Lightweight library for building LLM-based control flow.
Project description
Welcome to Gears
Gears is a lightweight tool for writing control flow with LLMs with full control over your prompts. It allows you to build complex chains of actions and conditions, and execute them in a single call.
Why Gears?
Gears is so minimal; it is simply a wrapper around an LLM API call that:
- Allows you to specify your prompts as Jinja templates and inputs as Pydantic models
- Automatically handles LLM API failures with exponential backoff
- Allows you to specify control flow, based on LLM responses, in a simple, declarative way
But the real selling point is that we are committed to not growing the codebase beyond what is necessary to support the above features. (We are not venture-backed and do not intend to be.)
Installation
Gears is available on PyPI, and can be installed with pip:
pip install gearsllm
Dependencies
Gears has the following dependencies:
python>=3.9
pydantic
jinja2
tenacity
openai
ToDos
- Add pre-commit hooks with black & isort
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
Built Distribution
File details
Details for the file gearsllm-0.1.28.tar.gz
.
File metadata
- Download URL: gearsllm-0.1.28.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.9.16 Darwin/23.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e9621e729a20d9b7a861c7e9c8d08d6a100caaf3f7bfc9f96c1cb6e47281c1e |
|
MD5 | 6e869dc6646437462e27f7cdb75f05e2 |
|
BLAKE2b-256 | 191208ef29888413bc2b66bb1c323da23d7caf25e674046b1b4226b46cf7d34c |
File details
Details for the file gearsllm-0.1.28-py3-none-any.whl
.
File metadata
- Download URL: gearsllm-0.1.28-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.9.16 Darwin/23.2.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2916464ea0c3496433ec7e42e83c06a32bd58a475f2e012b559bc0b189e2ce7 |
|
MD5 | 916534655066e215324c1fa5a0e9f7c3 |
|
BLAKE2b-256 | f37619c6f2074568ef3a5af60cf224dbcbd4ede6d6cf8f76d8e5e8fa6a5ddf34 |