No project description provided
Project description
llmbroker
Route LLM calls over a pool of free LLMs with automatic round-robin and cooldown.
No LangChain, no heavy deps.
import llmbroker
llms = llmbroker.Broker("llms.toml")
print(llms.ask("Summarize this receipt").text)
llms.toml is a plain list of [[llms]] entries (base_url, model, api_key_ref).
Grab the freetier preset from this repo to start with a
maintained list of free LLM endpoints.
Why llmbroker:
- Round-robin with automatic failover — 429/503 cools an endpoint and tries the next; the caller never sees a rate-limit error unless every endpoint fails.
- No heavy deps — stdlib-only core; optional backends (
sqlite,redis,postgres) are submodules you import only when you need them. - Dead-simple to start — a TOML file and env vars, one constructor line, done.
- Fully customisable — swap registry, secrets, and telemetry backends independently: any DB, any secrets manager (AWS, Vault, …), any storage.
- Cluster-ready — add
shared_state=llmbroker.redis.SharedState(...)to sync cooldown state across instances; omit for single-process. - Sync and async —
llmbroker.Brokerfor scripts;llmbroker.AsyncBrokerfor FastAPI, agents, and async workers.
Documentation
Developers
Do not forget to run . ./activate.sh.
For work it need uv installed.
Use pre-commit hooks for code quality:
pre-commit install
Allure test report
Scripts
Install invoke preferably with uv tool:
uv tool install invoke
For a list of available scripts run:
invoke --list
For more information about a script run:
invoke <script> --help
Coverage report
Created with cookiecutter using template
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llmbroker-0.0.6.tar.gz.
File metadata
- Download URL: llmbroker-0.0.6.tar.gz
- Upload date:
- Size: 125.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f18edcc2623fe09b66d8ae07dca1bfcc71794288011082112b39ff8d7251df39
|
|
| MD5 |
96f2931a11b01b94b14db22555ac9db1
|
|
| BLAKE2b-256 |
20a9c841b79cfd2b12dd15651c7cfde56e743c4db8540c245fd4ced917cf4acb
|
File details
Details for the file llmbroker-0.0.6-py3-none-any.whl.
File metadata
- Download URL: llmbroker-0.0.6-py3-none-any.whl
- Upload date:
- Size: 24.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26557c3b3de4e549ec42e4930d924a6fe9bfeac9dc2336de2651878c1a91e5ba
|
|
| MD5 |
8666e6041c635e78f5e9851c78e87889
|
|
| BLAKE2b-256 |
85ae75a487859d880a2516da2af15cb4ec43085e7c4fb6a14d1b91ee264228d4
|