Skip to main content

Building blocks for rapid development of GenAI applications

Project description

Ragbits

Building blocks for rapid development of GenAI applications

Documentation | Contact

PyPI - License PyPI - Version PyPI - Python Version


What's Included?

  • Core - Fundamental tools for working with prompts and LLMs.
  • Document Search - Handles vector search to retrieve relevant documents.
  • CLI - The ragbits shell command, enabling tools such as GUI prompt management.
  • Guardrails - Ensures response safety and relevance.
  • Evaluation - Unified evaluation framework for Ragbits components.
  • Flow Controls - Manages multi-stage chat flows for performing advanced actions (coming soon).
  • Structured Querying - Queries structured data sources in a predictable manner (coming soon).
  • Caching - Adds a caching layer to reduce costs and response times (coming soon).

Installation

To use the complete Ragbits stack, install the ragbits package:

pip install ragbits

Alternatively, you can use individual components of the stack by installing their respective packages: ragbits-core, ragbits-document-search, ragbits-cli.

Quickstart

First, create a prompt and a model for the data used in the prompt:

from pydantic import BaseModel
from ragbits.core.prompt import Prompt

class Dog(BaseModel):
    breed: str
    age: int
    temperament: str

class DogNamePrompt(Prompt[Dog, str]):
    system_prompt = """
    You are a dog name generator. You come up with funny names for dogs given the dog details.
    """

    user_prompt = """
    The dog is a {breed} breed, {age} years old, and has a {temperament} temperament.
    """

Next, create an instance of the LLM and the prompt:

from ragbits.core.llms.litellm import LiteLLM

llm = LiteLLM("gpt-4o")
example_dog = Dog(breed="Golden Retriever", age=3, temperament="friendly")
prompt = DogNamePrompt(example_dog)

Finally, generate a response from the LLM using the prompt:

response = await llm.generate(prompt)
print(f"Generated dog name: {response}")

How Ragbits documentation is organized

  • Quickstart - Get started with Ragbits in a few minutes
  • How-to guides - Learn how to use Ragbits in your projects
  • CLI - Learn how to run Ragbits in your terminal
  • API reference - Explore the underlying API of Ragbits

License

Ragbits is licensed under the MIT License.

Contributing

We welcome contributions! Please read CONTRIBUTING.md for more information.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ragbits-0.8.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ragbits-0.8.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file ragbits-0.8.0.tar.gz.

File metadata

  • Download URL: ragbits-0.8.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for ragbits-0.8.0.tar.gz
Algorithm Hash digest
SHA256 9f9854549bc1300950ff09642f41446bf2dad2c879e3b9e609e4acb4dffb77ae
MD5 e3841318b3be8ed6733ddb48ea822b52
BLAKE2b-256 0024b10201debbd99b36a82b490bd3dad797660acf9eb50d2cf4676567916a22

See more details on using hashes here.

File details

Details for the file ragbits-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: ragbits-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for ragbits-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7dc511503408ec6e22dd1ae76d16a9175181ec7769314fb81f048cef80b920c0
MD5 28164204affa80627ff5e610a82ffe7f
BLAKE2b-256 f684f8a481c208edcde34813720c4096eb418cc649d33496833cd172d0e5e4fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page