Code GenerationOpen_source
Headroom logo

Headroom

Context compression for AI agents

Overview

About Headroom

Headroom is a context compression layer that sits between an AI coding agent and the model it calls. Agents burn tokens on material nobody reads: a ten thousand line log dump, a JSON tool response with forty redundant fields, the full text of a file when three functions mattered. Headroom compresses that content before it reaches the LLM and caches the originals locally, so the agent can pull the untouched version back on demand when it turns out to need it. The project publishes a worked example on its own repository: a 10,144 token log reduced to 1,260 tokens with the FATAL line preserved byte for byte.

The compression runs on your machine. No prompt content, file content or tool output is sent anywhere to be compressed, which is the difference between this and a hosted optimisation service and is usually the deciding factor in a security review. Headroom is Apache-2.0, published to PyPI and npm as headroom-ai, and the repository has gone from creation in January 2026 to 75,499 stars and 5,863 forks by October 2026. A commercial Enterprise tier exists, adding automatic model routing, prompt-injection filtering and VPC rollout, but the project publishes no price for it and there is no pricing page on the site.

Pricing

No pricing page found

Free tier
  • Open source$0/mo
  • EnterpriseContact sales

Checked 2026-10-16

Details

GitHub Stars 77,191
Forks 5,986
Data from: GitHub • Website•Updated: Oct 21, 2026
devopsinfrastructureopen-sourcetoken-optimization