AI News
All projects
Library

Headroom compresses tool outputs and logs before they reach an LLM

A library, proxy and MCP server that shrinks the tool outputs, logs, files and chat history an AI agent sends to a model.

headroom by headroomlabs-ai · 80,951 GitHub stars when we found it · added

According to the README, Headroom compresses what an AI agent reads before it reaches the LLM, including tool outputs, logs, RAG chunks, files and conversation history. Compression runs on the user's machine. The tool comes in three forms: a Python and TypeScript library with a compress() function, a proxy started with headroom proxy, and an MCP server. A wrap command can route Claude Code, Codex and other agents through the proxy without code changes. The README says Cursor needs manual setup.

Savings depend on the content. The README's benchmark table reports 21% fewer tokens for code search, 57% for SRE incident debugging, 42% for codebase exploration and 30% for GitHub issue triage. It says prose compresses very little. Its accuracy table shows GSM8K unchanged at 0.870. The author says a TruthfulQA gain of +0.030 falls inside the confidence interval, so it is not a detectable difference. The library needs no API key or model download, but the optional ML extras pull in PyTorch.

The package is released under Apache licence and needs Python 3.11 or newer. The README lists its limits. Cortex Code gets library mode only, and Linux Copilot keychain reuse is implemented but not yet validated on a real desktop. The author advises running headroom savings on your own traffic, because the benchmark figures come from seeded, synthetic scenarios.

In the author's words

Headroom (`headroom-ai` on PyPI and npm) compresses everything your AI agent reads — tool outputs, logs, RAG chunks, files, and conversation history — before it reaches the LLM.

From the README or the author's post. We checked that the sentence is there, not that it is true.

When to reach for it

If a coding agent or RAG pipeline spends most of its budget on repetitive JSON or log output, it is worth trying compression at the proxy and measuring with headroom savings first, since the README says prose and dense output barely shrink.

Works with

Claude CodeCodexCursorLangChainLiteLLM

See it

AI wrote this entry from the project's own README or its author's post. What the project does, and that AI built it where the entry says so, are the author's statements, quoted here. Nobody at IKANGAI ran or tested it. How this list is made