Token Buffet — CLI LLM Proxy Router
Expose your flat-rate CLI subscriptions (Claude, Codex, Grok, agy) as a local OpenAI/Ollama/Anthropic-compatible API. Route requests by semantic tier (fast/medium/reasoning), smart load balance by quota, and power your downstream tools without paying per token.
Learn the Concept
For an overview of the LLM Wiki pattern and how this fits in, watch:
(Note: The video uses Claude Code as the example, but explains the LLM Wiki concepts and patterns well. Token Buffet applies the same pattern to any CLI-based LLM subscription — Claude, Codex, Grok, agy — and powers Obsidian vaults, community plugins, and agent frameworks.)
This shows how to turn your subscriptions into a local knowledge-synthesis engine for tools like Obsidian, chatbot clients, and AI agents.
Features
- Small runtime: The proxy, router, and dashboard use Python's standard HTTP server. Extractor capture needs its optional pseudo-terminal dependencies, and the Responses endpoint needs the OpenAI SDK.
- Semantic Routing: Translates generic model requests (
fast,medium,reasoning) into specific provider models based on remaining usage quotas. - Smart Load Balancing: Reads exported CLI quota files and routes requests to the provider with the most remaining quota.
- True Parallelism: Spawns sandbox directories to bypass SQLite locking limits in native CLIs.
Quick Start
Token Buffet always works in the folder you run it from. Make one folder for it:
mkdir TokenBuffet && cd TokenBuffet
pip install token-buffet # Python 3.12+; installs everything it needs
tbuffet init # scaffold, register the provider CLIs found on PATH, check app integrations
tbuffet demo init # optional: copy the demos, add them to their apps, list which can run
tbuffet start # proxies + router (8090) + dashboard (8080); Ctrl+C stops this session's process trees
tbuffet start --background # explicitly leave services running in the background
tbuffet status | stop | restart | doctor
Log in to each vendor CLI (claude, codex, grok, agy) once. init doesn't check logins; a provider that isn't signed in reports its error at tbuffet start.
Demos (pre-configured)
tbuffet demo init copies ready-to-use demos into demo/. Each one already points at the router, so after tbuffet start:
- Obsidian LLM Wiki (needs Obsidian installed): run
tbuffet open obsidian conference-notes(ordaily-notes), then choose Trust author and enable plugins. See the demo README. - Chatbots and Claudia: see
demo/README.md.
Providers and your own apps
tbuffet add-provider claude --validate # register a built-in provider + login/quota check
tbuffet add-provider mine --from config.json # import a config authored with the register-provider skill
tbuffet list-providers | remove-provider NAME
tbuffet add-app obsidian my-vault --path "/path/to/vault" --vault-type daily-notes
tbuffet list-apps | reconfigure-app TYPE NAME
Directory Structure
src/tokenbuffet/: proxy, router, dashboard and launchersrc/tokenbuffet/extractors/: provider usage and model capture/parse enginesrc/tokenbuffet/default_templates/: whattbuffet initcopies into your folder:config/integrations/(built-in app types, andproviders/with the built-in provider configs)scripts/demo/and the demo registrations inregistered_apps/are copied bytbuffet demo init
In your Token Buffet folder:
integrations/providers/: built-in provider configs (what Token Buffet supports)registered_providers/: the providers registered on this machinedata/: runtime state (providers_status/,provider_homes/,temp/)logs/: proxy, router and extractor logs
From a repository checkout
Install editable with pip install -e ., then run tbuffet init and tbuffet start from the repository root.
tbuffet start launches every provider proxy, the router (port 8090) and the dashboard (port 8080); tbuffet stop stops them. tbuffet dashboard starts the dashboard alone.
The router listens on port 8090, and the dashboard is at http://127.0.0.1:8080/. See the documentation index for the bridge guides.
Metadata
Release files for token-buffet 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| token_buffet-0.2.0.tar.gz | 3.2 MB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| token_buffet-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.1 MB
Release files / token_buffet-0.2.0.tar.gz
| Download URL | token_buffet-0.2.0.tar.gz |
|---|---|
| Size | 3.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
93fcaafe86ce5285f879998e8e2094e404a35ee8e01444e47e64429587ef64bb
|
|
BLAKE2b-256 checksum How to use checksums |
2a04c4021863b26bb89c416e44b28fee0ac7e66be1fbf6e8baa384d63f6f486d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logRelease files / token_buffet-0.2.0-py3-none-any.whl
| Download URL | token_buffet-0.2.0-py3-none-any.whl |
|---|---|
| Size | 3.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a2ade8f68343ad7b4c43f0fdba791984b5d4c80bd6a934be6169e8f0dbb93a5
|
|
BLAKE2b-256 checksum How to use checksums |
a05d23356c7e81ec8e8ce1bf09b713da78bcf0137fc2c0fb03a7df4580487986
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logSecurity for token-buffet 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for token_buffet-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.