headroomlabs-ai

headroom: Compress Context for AI Agents

Headroom compresses tool outputs, logs, files, and retrieval context before they reach an LLM, helping reduce token use while retaining important details. It offers local library, proxy, and MCP integrations for agent workflows.

PythonApache-2.0AILLMAI Agents
View on GitHub Compare
Stars
74.3k
Forks
5.7k
Stars, last 30 days
+4,302

Our take

Health score

74/100

How it is scored
Activity
90
Community
82
Issues
69
Pull requests
54

+4,302 stars in the last 30 days

  • Merges more pull requests than 95% of the projects we track
  • Releases more often than 93% of the projects we track
  • More contributors than 78% of the projects we track
  • Slower to merge pull requests than 86% of the projects we track

Project history

Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.

Selected snapshot

Stars

79,257

Forks

6,197

Change since Nov 9, 2026: +85 stars·+7 forks

Overview

Headroom is a local context-compression layer for AI applications and coding agents. It reduces the size of inputs such as tool results, logs, source code, and RAG chunks before they are sent to an LLM, aiming to lower token use without losing information needed for the task.

It can be integrated as a Python or TypeScript library, run as a proxy, or used through an MCP server. It is most relevant to developers with long agent sessions or repetitive, high-volume tool output; short conversations and already concise text may see little benefit.

Key Features

  • Routes JSON, source code, and prose to different compression methods.
  • Provides Python and TypeScript libraries, a local proxy, and MCP tools.
  • Wraps several coding agents so their traffic can pass through the proxy.
  • Stores originals locally for retrieval through its reversible compression flow.
  • Offers shared context and memory across supported agents.
  • Includes optional output-shaping controls and session-learning tools.
  • Reports token savings and includes benchmarking and evaluation commands.

Use Cases

  • Developers running coding agents can reduce repeated logs, file contents, and tool results in long sessions.
  • Teams using multiple agent clients can share context and memory across supported tools.
  • Application developers can compress LLM inputs inline through the Python or TypeScript SDKs.
  • Operators can route OpenAI-compatible traffic through a local proxy without changing application code.
  • MCP users can add compression and retrieval tools to compatible clients.

Getting Started

Install the Python package and its core integrations:

pip install "headroom-ai[all]"
headroom proxy --port 8787

For other install options, agent setup, and configuration, see the README and documentation.

Alternatives

  • mcp-gateway: MCP Gateway reduces context overhead by consolidating tools behind one endpoint, while Headroom compresses tool outputs and other context.
ProjectLanguageLicenseStarsStatus
headroomPythonApache-2.074.3kNot checked yet
mcp-gatewayRustOther78Active

Considerations

  • Savings depend on the content. Repetitive structured output may compress substantially, while prose and already-dense content may change little.
  • Compression is intended to preserve useful information, but the README presents benchmark results rather than a guarantee for every workload. Test against your own inputs.
  • The CLI is provided by the Python package; the npm package is a TypeScript SDK and does not include the CLI.
  • The project supports optional dependencies and integrations, so some capabilities require installing extra packages. The README lists Python 3.10+ as the requirement.
  • Anonymous usage telemetry is enabled by default and can be disabled with HEADROOM_BEACON=off, DO_NOT_TRACK=1, or --offline.
  • Compression runs locally, but requests still go to the LLM provider configured by the user.

Found this useful?

Share it with someone who would like headroom.

Comparisons