Skip to main content

No project description provided

Project description

Build Status Coverage

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-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-0.0.11.tar.gz (107.0 kB view details)

Uploaded Source

Built Distribution

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

llmbroker-0.0.11-py3-none-any.whl (38.1 kB view details)

Uploaded Python 3

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

Hashes for llmbroker-0.0.11.tar.gz
Algorithm Hash digest
SHA256 30f3020e2e4ffc73b713e3b9d91535722a14bb471935fe8a68d7bf33af0790bf
MD5 bb5ad27f140609263847649312112500
BLAKE2b-256 9a67eb0bba55d0f6be5b233fd396765c0e33756a9cdbb58673d4a4ade0f3fb64

See more details on using hashes here.

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

Hashes for llmbroker-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 0445e51ea33e8a8e43317a0857a0383d01a7a206062fe147ee96ca4d7f6a2225
MD5 d81c04a976664d59d1768fea6c364925
BLAKE2b-256 8a050b9025f77ac0c219fafa2579a5dac7856f00eb73114ccaf1e3fe29107083

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