AI product Open source · Apache-2.0
Headroom is an open-source context-compression tool for AI agents and LLM applications, provided as a Python library, TypeScript SDK, local proxy, CLI wrapper, and MCP server. It compresses tool outputs, logs, files, RAG chunks, source code, JSON, and conversation history before they reach an LLM; compression runs locally and the project states that prompt and file content are not sent elsewhere for compression.
Its ContentRouter selects SmartCrusher for JSON, CodeCompressor for source code, and Kompress-v2-base for prose. CacheAligner identifies volatile content that could invalidate a provider KV-cache prefix without rewriting prompts, while CCR caches originals locally so an agent can retrieve the full content on demand. The proxy can be used without code changes, and the MCP server exposes compression, retrieval, and statistics tools. Headroom also provides cross-agent memory, failure learning that writes corrections to agent instruction files, and optional output-token shaping.
The project supports Python 3.10+, a TypeScript SDK, Docker distribution, and integrations with OpenAI-compatible and Anthropic clients, coding agents, and several application frameworks. Its repository is licensed under Apache 2.0. The repository reports that compression savings depend on the input, with repetitive JSON and logs benefiting more than prose or already-dense content.
1 use taken from transcripts — each links to the moment in the video.
An open-source context compression layer that shrinks the inputs AI agents send to an LLM by compressing tool outputs, logs, files, and history.
1 in the library.