Rigging is a lightweight LLM interaction framework built on Pydantic XML. The goal is to make leveraging LLMs in production pipelines as simple and effictive as possible. Here are the highlights:
- Structured Pydantic models can be used interchangably with unstructured text output.
- LiteLLM as the default generator giving you instant access to a huge array of models.
- Add easy tool calling abilities to models which don't natively support it.
- Store different models and configs as simple connection strings just like databases.
- Chat templating, forking, continuations, generation parameter overloads, stripping segments, etc.
- Modern python with type hints, async support, pydantic validation, serialization, etc.
import rigging as rg
from rigging.model import CommaDelimitedAnswer as Answer
chat = rg.get_generator('gpt-4') \
.chat(f"Give me 3 famous authors between {Answer.xml_tags()} tags.") \
.until_parsed_as(Answer) \
.run()
answer = chat.last.parse(Answer)
print(answer.items)
# ['J. R. R. Tolkien', 'Stephen King', 'George Orwell']
Rigging is built and maintained by dreadnode where we use it daily for our work.
We publish every version to Pypi:
pip install rigging
If you want to build from source:
cd rigging/
poetry install
Head over to our documentation for more information.