StackMap
Subscribe

9router vs headroom

Self-hosted gateway pointing any AI coding CLI (Claude Code, Codex, Cursor, Cline) at 40+ providers, with subscription→cheap→free auto-fallback and tool_result compression for 20-40% token savings. — versus — Context compression layer for agents: squeezes tool outputs, logs, files and RAG chunks 20-95% before the LLM — reversible, local-first; library, proxy, one-command agent wrap, or MCP.

The curated verdict

Same wire, same goal — cut coding-agent token spend at a local proxy. 9router is a multi-provider routing gateway with tool_result compression as a feature; Headroom is compression-first with content-aware routers, reversibility and no routing opinions.

9routerheadroom
Stars23k61k
Forks3.8k4.5k
LanguageJavaScriptPython
LicenseMITApache-2.0
Last activityyesterdaytoday
Topicsgateway, codingcoding, gateway
Curated connections82

9router — the curator's take

The 'never hit a rate limit again' gateway: run it on localhost, point Claude Code / Codex / Cursor / Cline / Copilot at its OpenAI-compatible endpoint, and it round-robins your accounts and cascades Subscription → cheap ($0.2-0.6/1M) → free (Kiro, OpenCode) providers so a job never dies mid-flight, while RTK compresses tool_result payloads (git diff, grep, ls) to shave 20-40% of tokens. Best when you juggle several provider subscriptions/keys and keep exhausting quota. NOT for you if you want one stable premium model (free-tier fallbacks vary in quality/availability), if routing traffic through third-party free providers raises data-privacy concerns, or if you want savings from smarter code retrieval rather than payload compression. Overlaps heavily with lynkr — pick 9router for free/multi-account fallback breadth, lynkr for tool-stripping, semantic caching and local-model routing.

headroom — the curator's take

The dedicated answer to context bloat: content-aware compressors route JSON, logs and code differently (60-95% on JSON, 15-20% on real coding sessions), originals stay cached so the model can retrieve what compression dropped — the reversibility is what makes aggressive ratios safe. Adoption cost is near zero: `headroom wrap claude` and you're running, or use it as proxy/library/MCP. Prompt-cache-aware alignment avoids torching your cache hit rate. NOT free lunch: a lossy-in-context layer between agent and model is another thing to debug when the model 'misses' something — budget for retrieval round-trips — and the 20% coding figure is the honest number, not the 95% headline.