Skip to main content

No project description provided

Project description

Build Status Coverage

llmbroker

Turn a crowd of free, rate-limited LLMs into one reliable model — no premium subscription, no single point of failure. No LangChain, no heavy deps.

pip install llmbroker
llmbroker preset freetier > llms.toml   # ready-made pool of free models
llmbroker env llms.toml > .env          # which API keys to get, and where
llms = llmbroker.Broker("llms.toml")
reply = llms.ask("Explain decorators in one sentence")
print(reply.text)   # groq rate-limited? gemini answers instead

Fill in whichever keys are easy — models without keys just stay inactive.

Automatic failover llms.ask(...) — next model answers when one is down
Chat, tools & agents llms.chat(messages, tools=...), run_tool_loop(...)
Async-first AsyncBroker — same engine, for FastAPI / agents / workers
Scale out Broker("postgresql://…") — sqlite / Postgres / MongoDB, calling code unchanged
Self-regulating pool reply.record_quality(0.3) — weak models sink per task kind
Pluggable secrets env vars, DB, AWS, Vault, or your own backend
Multi-user mode per-user API keys on top of one shared pool

Documentation

Development

Do not forget to run . ./activate.sh. It needs uv installed.

Use pre-commit hooks for code quality:

pre-commit install

Install invoke preferably with uv tool:

uv tool install invoke

For a list of available scripts run invoke --list; for details on one, invoke <script> --help.

The bundled freetier preset drifts as providers change their free tiers; refresh it with invoke catalog-refresh, which prints the maintenance runbook (presets/freetier-refresh-prompt.md).

Reports:

Created with cookiecutter using template

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

llmbroker-1.2.0.tar.gz (249.9 kB view details)

Uploaded Source

Built Distribution

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

llmbroker-1.2.0-py3-none-any.whl (63.7 kB view details)

Uploaded Python 3

File details

Details for the file llmbroker-1.2.0.tar.gz.

File metadata

  • Download URL: llmbroker-1.2.0.tar.gz
  • Upload date:
  • Size: 249.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for llmbroker-1.2.0.tar.gz
Algorithm Hash digest
SHA256 847515a7b7a679ba97affd16fa0621a3ecfb15684ffc8ec0a6c33099f39b3431
MD5 701e0e1e783b1f2f1af3f2d50d09384c
BLAKE2b-256 04af66a228970744eec5536c40b53fd7fdc3c30703de193ee1f77ac3aa2f528b

See more details on using hashes here.

File details

Details for the file llmbroker-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: llmbroker-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 63.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for llmbroker-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a8cb6053408579353a343fdb5351c1a17456f74e7f76dbbfe9985571c818f98
MD5 dec289ca84c025377c61fd04b39f6fc9
BLAKE2b-256 20d3993a2f3fb92e72bd6db1f90c8fb71e074bf665d46d3002d427f336b5873b

See more details on using hashes here.

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