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.

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-turn chat, and function/tool calling for agentic workflows.
  • Async-firstllmbroker.AsyncBroker built on asyncio for FastAPI, agents, and async workers; llmbroker.Broker wraps 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

llmbroker

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


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.0.0.tar.gz (216.2 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.0.0-py3-none-any.whl (58.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for llmbroker-1.0.0.tar.gz
Algorithm Hash digest
SHA256 570996989d09fde14789b57dffefe2e916211f82581b7f251b7b715cb3a582cb
MD5 eacbabfef7947a6bd87bbd5123b4bdf6
BLAKE2b-256 958fa1f8dca89178e972621588a6dc9f311171c1ba5c0332b82b7739edcef9eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llmbroker-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 58.4 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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2fb262edca1e0a6d75699915c05c840054855c7753c5f500c5b54b1c6252fc88
MD5 f6e20439c37bcb31c89e4db4a89eab26
BLAKE2b-256 32c97d898664afae90472f8a52bb79e9e153857b4262d69a9330468eea86c51e

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