Headroom
Open-source library that compresses tool outputs, logs, and JSON before they reach an LLM, cutting token costs 60-95% without changing the answers.
🔗 Visit HeadroomDescription
Imagine your AI coding assistant has to read a huge log file just to find one error message — most of what it reads is noise, but it still gets billed (in time and money) for every word. Headroom acts like a smart summarizer that sits between your tools and the AI: it squeezes out the boring, repetitive parts of logs, JSON responses, and file dumps before they ever reach the model, while keeping a copy of the original nearby in case the AI needs to double-check a detail later.
Headroom is an open-source (Apache 2.0) context-compression layer for LLM-based agents and coding assistants, built as a Rust core with Python and TypeScript SDKs. It runs as a library, a transparent proxy, or an MCP server, and plugs into Claude Code, Cursor, Copilot, Cline, Continue, and 100+ LLM providers via LiteLLM. Under the hood it routes content through specialized compressors: SmartCrusher for JSON, an AST-aware CodeCompressor for Python/JS/TS/Go/Rust/Java/C/C++/Perl, a ModernBERT-based text classifier, plus dedicated compressors for logs, search results, git diffs, and HTML. Compression is reversible (CCR) — nothing is thrown away, the LLM can pull the original back via a retrieve call if it actually needs it. Reported savings: 60-95% on JSON, 15-20% on general coding-agent workloads, up to 92% on code-search/debugging tasks, all while claiming unchanged answer quality.
💬 Our review
The short version: if your coding agent or LLM pipeline is burning tokens on repetitive tool output — logs, JSON, file reads — Headroom is a free, open-source way to cut that bill by half or more without touching your prompts.
The pitch is credible because the mechanism is simple and inspectable: content-aware compressors per data type, plus a reversible-retrieval safety net so nothing is silently dropped. That's a meaningfully different approach from just truncating context or relying on a provider's built-in prompt caching (Anthropic's cache discount, for instance, only helps with stable prefixes, not with genuinely noisy tool output). The trade-off is setup effort — getting the biggest wins requires routing traffic through the proxy or wiring the SDK in, and the payoff varies a lot by workload (don't expect 90%+ savings on hand-written code, that's a JSON/log-heavy-workload number). It's also young enough that provider-specific quirks (cache mechanics, content-type misdetection) can eat into the theoretical gains. For a team already spending real money on agentic coding tools, it's a low-risk experiment: free, Apache-licensed, and it doesn't require abandoning whatever LLM you're already using.
💰 Pricing
📊 Global score
🤖 AI-enriched data
Apache 2.0, aucune restriction commerciale. Auto-hébergeable en librairie, proxy ou serveur MCP ; aucune offre payante distincte.
Pros
60-95% de réduction de tokens sur du JSON, données mesurées
Compression réversible (CCR) — rien n'est perdu, récupérable à la demande
Local-first : les données ne quittent jamais la machine
Compatible 100+ fournisseurs LLM via LiteLLM, s'intègre à Claude Code/Cursor/Copilot
Apache 2.0, gratuit, pas de vendor lock-in
Cons
Gains très variables selon le type de contenu (15-20% sur du code contre 95% sur du JSON)
Configuration nécessaire pour un gain réel (le mode proxy demande un minimum de mise en place)
SDK TypeScript encore limité au mode librairie (pas de proxy)
Jeune projet — les subtilités propres à chaque fournisseur (cache Anthropic, etc.) demandent un peu d'apprentissage