Skip to main content

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:

Karpathy LLM Wiki Overview

(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.

Architecture

AI Subscriptions Hub Architecture

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 (or daily-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 launcher
  • src/tokenbuffet/extractors/: provider usage and model capture/parse engine
  • src/tokenbuffet/default_templates/: what tbuffet init copies into your folder:
    • config/
    • integrations/ (built-in app types, and providers/ with the built-in provider configs)
    • scripts/
    • demo/ and the demo registrations in registered_apps/ are copied by tbuffet demo init

In your Token Buffet folder:

  • integrations/providers/: built-in provider configs (what Token Buffet supports)
  • registered_providers/: the providers registered on this machine
  • data/: 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.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for token-buffet 0.2.4
File Size Uploaded Provenance
token_buffet-0.2.4.tar.gz 3.2 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for token-buffet 0.2.4
File Interpreter ABI Platform
token_buffet-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 7.1 MB

Release files / token_buffet-0.2.4.tar.gz

Download URL token_buffet-0.2.4.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
fc92579856e01d80a1d4e42427722413e0631540a30e5da359999be513dad25d
BLAKE2b-256 checksum
How to use checksums
fe538f9323e6e45d02e6ffefa84346fda9c005a953d09de7d5903ec122084909
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 24, 2026.

Transparency log

Release files / token_buffet-0.2.4-py3-none-any.whl

Download URL token_buffet-0.2.4-py3-none-any.whl
Size 3.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4ddb4bea62e1abc0bdd390069f549c86aaac8a87145c5217ad2ff1d560e1e54f
BLAKE2b-256 checksum
How to use checksums
b3947f2612387b7937a0c29b1c8af06ae511797685ddde0c2e66e02d4887cf12
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 24, 2026.

Transparency log

Security for token-buffet 0.2.4

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.

Select from 2 files

Attestation for token_buffet-0.2.4.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 24, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page