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.12.tar.gz (145.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.12-py3-none-any.whl (51.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llmbroker-0.0.12.tar.gz
  • Upload date:
  • Size: 145.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.12.tar.gz
Algorithm Hash digest
SHA256 73d89e8c49a7f4fe0687b81bb712278a46c9af5c88ce59683a5dfbd0c86d3ba9
MD5 f84b0d83c52a21c0f3cf4a148917bc58
BLAKE2b-256 bb6f394ebe69e90fb42e5fc604967a841be0ee02fea3c9c0f9323d1e5f0523ef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llmbroker-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 51.9 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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 903083f51dca224c6069b6021ac0ff09b59c5eda00a63f47c1c4bc7c96a82c04
MD5 fe88cc91c5a95ba965af07287358e711
BLAKE2b-256 867bbea855c1a24cd2c6d7a6f9e62ff97da9e67a66fa34269cf5c8f644f6d35b

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