Skip to main content

BeyondLLM

Build - Rapid Experiment - Evaluate - Observability

Thumbnails

Python Versions Discord Twitter Try an example

Contributors Code of Conduct

Beyond LLM offers an all-in-one toolkit for experimentation, evaluation, and deployment of Retrieval-Augmented Generation (RAG) systems, simplifying the process with automated integration, customizable evaluation metrics, and support for various Large Language Models (LLMs) tailored to specific needs, ultimately aiming to reduce LLM hallucination risks and enhance reliability.

👉 Join our Discord community!

Try out a quick demo on Google Colab:

Open In Colab

Quick install

pip install beyondllm

Quickstart Guide- Chat with YouTube Video

In this quick start guide, we'll demonstrate how to create a Chat with YouTube video RAG application using Beyond LLM with less than 8 lines of code. This 8 lines of code includes:

  • Getting custom data source
  • Retrieving documents
  • Generating LLM responses
  • Evaluating embeddings
  • Evaluating LLM responses

Approach-1: Using Default LLM and Embeddings

Build customised RAG in less than 5 lines of code using Beyond LLM.

from beyondllm import source,retrieve,generator
import os
os.environ['GOOGLE_API_KEY'] = "Your Google API Key:"

data = source.fit("https://www.youtube.com/watch?v=oJJyTztI_6g",dtype="youtube",chunk_size=512,chunk_overlap=50)
retriever = retrieve.auto_retriever(data,type="normal",top_k=3)
pipeline = generator.Generate(question="what tool is video mentioning about?",retriever=retriever)

print(pipeline.call())

Approach-2: With Custom LLM and Embeddings

Beyond LLM support various Embeddings and LLMs that are two very important components in Retrieval Augmented Generation.

from beyondllm import source,retrieve,embeddings,llms,generator
import os
from getpass import getpass
os.environ['OPENAI_API_KEY'] = getpass("Your OpenAI API Key:")

data = source.fit("https://www.youtube.com/watch?v=oJJyTztI_6g",dtype="youtube",chunk_size=1024,chunk_overlap=0)
embed_model = embeddings.OpenAIEmbeddings()
retriever = retrieve.auto_retriever(data,embed_model,type="normal",top_k=4)
llm = llms.ChatOpenAIModel()
pipeline = generator.Generate(question="what tool is video mentioning about?",retriever=retriever,llm=llm)

print(pipeline.call()) #AI response
print(retriever.evaluate(llm=llm)) #evaluate embeddings
print(pipeline.get_rag_triad_evals()) #evaluate LLM response
Output
The tool mentioned in the context is called Jupiter, which is an AI Guru designed to simplify the learning of complex data science topics. Users can access Jupiter by logging into AI Planet, accessing any course for free, and then requesting explanations of topics from Jupiter in various styles, such as in the form of a movie plot. Jupiter aims to make AI education more accessible and interactive for everyone.

Hit_rate:1.0
MRR:1.0

Context relevancy Score: 8.0
Answer relevancy Score: 7.0
Groundness score: 7.666666666666667

Observability

Observability helps to keep track of the closed source models on the latency and the cost monitor tracking. BeyondLLM provides Observer that currently monitors the OpenAI LLM model performance.

from beyondllm import source,retrieve,generator, llms, embeddings
from beyondllm.observe import Observer
import os

os.environ['OPENAI_API_KEY'] = 'sk-****'

Observe = Observer()
Observe.run()

llm=llms.ChatOpenAIModel()
embed_model = embeddings.OpenAIEmbeddings()

data = source.fit("https://www.youtube.com/watch?v=oJJyTztI_6g",dtype="youtube",chunk_size=512,chunk_overlap=50)
retriever = retrieve.auto_retriever(data,embed_model,type="normal",top_k=4)

pipeline = generator.Generate(question="what tool is video mentioning about?",retriever=retriever, llm=llm)
pipeline = generator.Generate(question="What is the tool used for?",retriever=retriever, llm=llm)
pipeline = generator.Generate(question="How can i use the tool for my own use?",retriever=retriever, llm=llm)

Documentation

See the beyondllm.aiplanet.com for complete documentation.

Contribution guidelines

Beyond LLM thrives in the rapidly evolving landscape of open-source projects. We wholeheartedly welcome contributions in various capacities, be it through innovative features, enhanced infrastructure, or refined documentation.

See Contributing guide for more information on contributing to the BeyondLLM library.

Acknowledgements

and the entire OpenSource community.

License

The contents of this repository are licensed under the Apache License, version 2.0.

Get in Touch

You can schedule a 1:1 meeting with our Team to get started with GenAI Stack, OpenAGI, AI Planet Open Source LLMs(Buddhi, effi and Panda Coder) and Beyond LLM. Schedule the call here: https://calendly.com/jaintarun

Metadata

Release files for beyondllm 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beyondllm 0.2.3
File Size Uploaded
beyondllm-0.2.3.tar.gz 33.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beyondllm 0.2.3
File Interpreter ABI Platform
beyondllm-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 88.0 kB

Release files / beyondllm-0.2.3.tar.gz

Download URL beyondllm-0.2.3.tar.gz
Size 33.1 kB
Tags Source
SHA-256 checksum
How to use checksums
153f91c09e1dd98d055bff78c2989633bb9c22f58201a5562e4b8795852845c5
BLAKE2b-256 checksum
How to use checksums
4bfab6bc238dcee23dbab0a4176f5b67535023d7accf9fb4a6bbfecaa98c7483
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.11 Darwin/23.6.0

Release files / beyondllm-0.2.3-py3-none-any.whl

Download URL beyondllm-0.2.3-py3-none-any.whl
Size 54.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbdfeace0aed790c7a6c4ead12dd873af70288b6e514d6829634372f5d8abcbc
BLAKE2b-256 checksum
How to use checksums
15270583eb4ad0196b30ab8af5f6e4b3a9a2ac96ccd47482dc293a4fa0f09170
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.10.11 Darwin/23.6.0

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page