22nd of 48 in Gateways and observability

headroom

Compresses tool outputs, logs and history before they reach the LLM

Stars
79.4k
License
Apache-2.0
Last commit
Nov 2026
Last release
Nov 2026
Language
Python
Stars, last 29 weeks+77,875
20 Apr 2026: 1,478 stars27 Apr 2026: 1,600 stars4 May 2026: 1,681 stars11 May 2026: 1,744 stars18 May 2026: 1,875 stars25 May 2026: 2,032 stars1 Jun 2026: 4,374 stars8 Jun 2026: 18,790 stars15 Jun 2026: 28,378 stars22 Jun 2026: 46,388 stars29 Jun 2026: 52,954 stars6 Jul 2026: 56,162 stars13 Jul 2026: 57,982 stars20 Jul 2026: 59,816 stars27 Jul 2026: 61,887 stars3 Aug 2026: 63,594 stars10 Aug 2026: 65,061 stars17 Aug 2026: 65,979 stars24 Aug 2026: 66,819 stars31 Aug 2026: 67,657 stars7 Sept 2026: 69,791 stars14 Sept 2026: 71,700 stars21 Sept 2026: 72,979 stars28 Sept 2026: 73,671 stars5 Oct 2026: 74,177 stars12 Oct 2026: 74,959 stars19 Oct 2026: 76,272 stars26 Oct 2026: 77,917 stars2 Nov 2026: 78,691 stars9 Nov 2026: 79,353 stars

1,478 on 20 Apr 202679,353 on 9 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

Headroom is a Python library, local proxy and CLI that shrinks agent context before it is sent to an LLM provider. It routes JSON, source code and text to separate compressors and keeps originals locally so the model can retrieve them. `headroom wrap` configures coding agents such as Claude Code, Codex, Aider and Cline to go through the proxy.

Who it is for: Developers cutting LLM input token costs in apps or coding agents

Ranked among open-source alternatives to OpenRouter (#2 of 10).

Strengths

  • Seeded, offline benchmark: 21–57% fewer input tokens across four agent scenarios
  • One-command `headroom wrap` for many coding agents, reversible with `headroom unwrap`
  • Compression runs locally; reported 0.21 ms p50 on a 10K-token JSON result
  • Originals cached locally and retrievable by the model via `headroom_retrieve`

Weaknesses

  • Little savings on prose or already-dense output; gains depend on repetitive payloads
  • Cursor and ZCode need manual base-URL setup; Cortex Code is library-only
  • Third-party OpenAI-compatible providers need an extra flag or the key goes to OpenAI
  • Output token reduction is off by default and reported as an estimate

What it needs

  • no GPU
  • Docker + Compose
  • Needs Python 3.13 (for uv tool install), Serena (installed by headroom wrap), Kompress-v2-base model from Hugging Face
  • Models: OpenAI, Anthropic, Bedrock, Gemini, OpenAI-compatible providers
  • port 8787

What changed

  1. v0.44.0 ↗ (opens in a new tab)BreakingSecurity fix

    “packaging: keep PyTorch extras out of all (#4067)”

    GHSA-MC2F-VG4V-2FH4. “asgi: stop buffering when the client disconnects (GHSA-mc2f-vg4v-2fh4) (#4701) (c6d7081)”

  2. v0.43.0 ↗ (opens in a new tab)BreakingSecurity fix

    “mcp: port MCP servers to SDK 2.x (#4603)”

    GHSA-8G49-PG6G-XGRF. “mcp: confine headroomread to the workspace (GHSA-8g49-pg6g-xgrf) (#4525) (8ab2e91)”

From the release notes. No flag means the note does not say so, not that the upgrade is safe.

Quick answers

Is headroom open source?

Yes. Its code is on GitHub under the Apache-2.0 license.

Can you run headroom with Docker?

Yes. Its repository has a Docker setup: a Dockerfile, a Compose file or a published image.

Does headroom need a GPU?

No, it runs without one.

Head to head

Also in Gateways and observability

See all 48
Also in Gateways and observability
RankProjectScore
1OmniRouteLLM gateway routing one OpenAI-compatible endpoint across 372 providers86.5k starsMIT96 out of 100
3new-apiGateway that unifies LLM providers behind OpenAI, Anthropic and Gemini APIs51.8k stars+2,216 (+4.5%) in 30 daysAGPL-3.0known advisory in latest version91 out of 100
#4MLflowTracing, evaluation and prompt registry for LLM apps, plus ML tracking Live demo ↗ (opens in a new tab)28.8k stars+450 (+1.6%) in 30 daysApache-2.090 out of 100
#5LiteLLMOpenAI-format gateway and Python SDK for calling 100+ LLM providers63.1k stars+2,260 (+3.7%) in 30 dayscustom license87 out of 100
#6freellmapiOpenAI-compatible gateway pooling free-tier LLM providers with automatic failover50.6k stars+17,147 (+51%) in 30 daysMIT86 out of 100