LLM Cost Control Kit

Everything you need to cut an LLM bill by 60–90% without changing what your product does: a cost-aware router you can drop in today, token accounting that survives an audit, and the caching and batching checklists that produce the savings the calculator promises.

What's inside

  • router.py — a provider-agnostic, cost-aware router: difficulty classification, cheap-model-first with confidence-gated escalation, per-request budget ceilings, and automatic fallback across Anthropic / OpenAI / Google.
  • meter.py — drop-in token accounting middleware: per-request, per-user and per-feature cost attribution written to a line-delimited log you can aggregate in one SQL query.
  • prompt-caching-playbook.md — what to put in the cached prefix, the ordering rule that makes caching actually hit, TTL economics, and the five mistakes that silently drop your hit rate to zero.
  • batching-playbook.md — which workloads are safe to move to the 50% batch tier, and a worked migration.
  • cost-model.csv — the spend model: traffic assumptions in, monthly and annual cost out, per model, with a caching and routing sensitivity grid. Opens in Excel or Google Sheets.
  • prices.csv — the full 30-model price table from the calculator, machine-readable, with source links.
  • cost-review-checklist.md — a 24-point pre-launch review so a cost bug doesn't ship to production.

One zip. No dependencies beyond your existing SDKs. MIT-licensed code — use it in commercial work.

Buy the kit — $19

Instant download — the link is on the Stripe confirmation page and in your emailed receipt. If a single routing change saves you one hour of frontier-model traffic, it has paid for itself.

The arithmetic this is based on

100,000 calls a month at 4,000 input / 800 output tokens, all sent to a frontier model, is about $1,400/month. Route the 80% of that traffic which is easy to a small model, cache the 3,000-token system prefix, and batch the non-interactive third: the same workload lands under $200. The kit is the code and the checklists that get you there — check the numbers yourself in the calculator.