whereismyai
LLMBrake
LLMBrake is a TypeScript library that sets per-customer monthly dollar cost caps and switches models for AI applications.
LLMBrake is a small TypeScript library that wraps OpenAI-compatible chat completion calls to track costs per customer. It computes call costs in USD from provider token usage and maintains a monthly spend total in UTC calendar months. When a customer approaches their budget limit, it automatically switches to a cheaper model, and it throws a budget exceeded error once the limit is reached. The library operates directly inside your application using your own API keys without acting as a proxy or reading prompt content. It supports streaming responses, custom price tables, and pluggable storage backends like Redis or memory. An optional hosted layer adds shared counters and a management dashboard.
LLMBrake at a glance
- Best for: Software engineer
- Runs on: Node, API, self-hosted
- Pricing: Library is free and open source under the MIT license; LLMBrake Cloud is an optional paid layer.
- Released: November 2026
- Category: AI coding tool
- Website: github.com/llmbrake/llmbrake
Key features
- Tracks monthly customer spending in USD
- Switches to cheaper models near budget limits
- Blocks requests when budgets are exhausted
- Supports streaming responses with token usage
- Works with OpenAI-compatible endpoints
- Offers pluggable storage for multi-server setups
- Runs inside your application with direct provider calls
Use it for
- Enforcing monthly spending limits per AI app customer
- Downgrading expensive model requests near budget caps
- Preventing unexpected API bills from runaway usage
- Tracking token costs without proxying network traffic
Alternatives to LLMBrake
- LiteLLM — One OpenAI-format API for 100+ LLM providers
- FreeLLMAPI — Accesses hundreds of free LLM models and billions of tokens through one API key.
- LangChain4j — Integrates LLMs and vector stores directly into Java applications.
- Freebuff — Access multiple coding AI models for free without subscriptions.
- SmallCode — Runs fully local with budget-managed context and a forgiving parser for small models.
- MTPLX — It runs local models twice as fast via native MTP speculative decoding.
- Octopus — Connects multiple LLM providers with automatic failover and protocol conversion.
- Tokscale — Track and compare token usage across multiple AI coding agents.
- oMLX — It uses paged SSD KV caching to reduce agent TTFT to under 5 seconds.
- llm-d — Deploys production-grade LLM serving on existing hardware clusters.
- Tallyhook Collector — Calculates exact AI coding agent costs locally and groups them for client invoicing.
- ScaledThought — Access open-weight models on an OpenAI-compatible API set up entirely by an AI agent.
All LLMBrake alternatives