Skip to main content

LLM Interaction Framework

Project description

Logo

Flexible LLM library for code and agents

PyPI - Python Version PyPI - Version GitHub License GitHub Actions Workflow Status


Rigging is a lightweight LLM framework to make using language models in production code as simple and effective as possible. Here are the highlights:

  • Structured Pydantic models can be used interchangeably with unstructured text output.
  • LiteLLM as the default generator giving you instant access to a huge array of models.
  • Define prompts as python functions with type hints and docstrings.
  • Simple tool use, even for models which don't support them at the API.
  • Store different models and configs as simple connection strings just like databases.
  • Integrated tracing support with Logfire.
  • Chat templating, forking, continuations, generation parameter overloads, stripping segments, etc.
  • Async batching and fast iterations for large scale generation.
  • Metadata, callbacks, and data format conversions.
  • Modern python with type hints, async support, pydantic validation, serialization, etc.
import rigging as rg

@rg.prompt(generator_id="gpt-4")
async def get_authors(count: int = 3) -> list[str]:
    """Provide famous authors."""

print(await get_authors())

# ['William Shakespeare', 'J.K. Rowling', 'Jane Austen']

Rigging is built by dreadnode where we use it daily.

Installation

We publish every version to Pypi:

pip install rigging

If you want to build from source:

cd rigging/
poetry install

Supported LLMs

Rigging will run just about any language model:

API Keys

Pass the api_key in an generator id or use standard environment variables.

rg.get_generator("gpt-4-turbo,api_key=...")
export OPENAI_API_KEY=...
export MISTRAL_API_KEY=...
export ANTHROPIC_API_KEY=...
...

Check out the docs for more.

Getting Started

Check out the guide in the docs

  1. Get a generator using a connection string.
  2. Build a chat or completion pipeline
  3. Run the pipeline and get the output.
import rigging as rg
import asyncio

async def main():
    # 1 - Get a generator
    generator = rg.get_generator("claude-3-sonnet-20240229")

    # 2 - Build a chat pipeline
    pipeline = generator.chat(
        [
            {"role": "system", "content": "Talk like a pirate."},
            {"role": "user", "content": "Say hello!"},
        ]
    )

    # 3 - Run the pipeline
    chat = await pipeline.run()
    print(chat.conversation)

# Run the main function
asyncio.run(main())

# [system]: Talk like a pirate.
# [user]: Say hello!
# [assistant]: Ahoy, matey! Here be the salty sea dog ready to trade greetings wit' ye. Arrr!

Want more?

Examples

Documentation

docs.dreadnode.io has everything you need.

Star History

Star History Chart

Project details


Download files

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

Source Distribution

rigging-3.3.5.tar.gz (112.8 kB view details)

Uploaded Source

Built Distribution

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

rigging-3.3.5-py3-none-any.whl (130.7 kB view details)

Uploaded Python 3

File details

Details for the file rigging-3.3.5.tar.gz.

File metadata

  • Download URL: rigging-3.3.5.tar.gz
  • Upload date:
  • Size: 112.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.9

File hashes

Hashes for rigging-3.3.5.tar.gz
Algorithm Hash digest
SHA256 3f24ef62155f1049f0d485cf24649b4ded70a2771e49410da71b6c3d0fd626b4
MD5 c80bb440ac2dc334445dd5dc25cd612a
BLAKE2b-256 5cb24deaacda6b4237d9c5f8324b3458929e98b51158ed3eb3e6574a3ee31fa6

See more details on using hashes here.

Provenance

The following attestation bundles were made for rigging-3.3.5.tar.gz:

Publisher: publish.yml on dreadnode/rigging

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rigging-3.3.5-py3-none-any.whl.

File metadata

  • Download URL: rigging-3.3.5-py3-none-any.whl
  • Upload date:
  • Size: 130.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.9

File hashes

Hashes for rigging-3.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e3cba9dca540488b71ded5e491ecdea1037b76e6e0501145079885aafc7a2bbf
MD5 ad9c5793097020dce8e8946dca6ca49f
BLAKE2b-256 978235c80126ba849b0c06529e2184e6e7c7a6bf6b0887ff95f041a7d7758554

See more details on using hashes here.

Provenance

The following attestation bundles were made for rigging-3.3.5-py3-none-any.whl:

Publisher: publish.yml on dreadnode/rigging

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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