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.
llms = llmbroker.Broker("llms.toml")
print(llms.ask("Explain Python decorators in one sentence").text)
Put your LLMs in llms.toml — or grab a preset:
llmbroker preset freetier > llms.toml
The only setup is the API keys. Ask llmbroker which ones your pool needs — each with a note on where to get it:
llmbroker env llms.toml > .env
The same Broker scales straight to a server or cluster — add Redis or Postgres to share cooldown state across instances, the calling code stays the same.
Why llmbroker:
- Automatic failover — when one LLM is rate-limited or down, the next one in the pool answers instead; you get a reply, not an error, as long as any LLM is up.
- Chat, tools & agents — one-shot
ask, multi-turnchat, and function/tool calling for agentic workflows. - Async-first —
llmbroker.AsyncBrokerbuilt on asyncio for FastAPI, agents, and async workers;llmbroker.Brokerwraps the same engine in a blocking API for plain scripts. - Pluggable backends — swap registry, state store, and telemetry independently: DB, Redis etc.
- API keys configurable storage — environment variables, DB, AWS, Vault, your own store.
- Multi-user mode -- optionally separate secrets and LLMs list for each application user.
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.11.tar.gz.
File metadata
- Download URL: llmbroker-0.0.11.tar.gz
- Upload date:
- Size: 107.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30f3020e2e4ffc73b713e3b9d91535722a14bb471935fe8a68d7bf33af0790bf
|
|
| MD5 |
bb5ad27f140609263847649312112500
|
|
| BLAKE2b-256 |
9a67eb0bba55d0f6be5b233fd396765c0e33756a9cdbb58673d4a4ade0f3fb64
|
File details
Details for the file llmbroker-0.0.11-py3-none-any.whl.
File metadata
- Download URL: llmbroker-0.0.11-py3-none-any.whl
- Upload date:
- Size: 38.1 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 |
0445e51ea33e8a8e43317a0857a0383d01a7a206062fe147ee96ca4d7f6a2225
|
|
| MD5 |
d81c04a976664d59d1768fea6c364925
|
|
| BLAKE2b-256 |
8a050b9025f77ac0c219fafa2579a5dac7856f00eb73114ccaf1e3fe29107083
|