Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Python agentaianthropicclaude-codecompressioncontext-engineeringcontext-windowcursorfastapilangchainllmmcpopenaiprompt-engineeringproxypythonragtoken-optimizationtokenstypescript
Merge branch 'main' into feat/track-embedded-installs
Garm66f12b4f68b6
diff --cc headroom/proxy/server.pyindex 1190ba1bf,cfdc225bb..42b31ad44--- a/headroom/proxy/server.py+++ b/headroom/proxy/server.py@@@ -1188,19 -1346,13 +1346,28 @@@ def create_app(config: ProxyConfig | Noallow_headers=["*"],)+ # X-Headroom-Stack: SDK adapters (TS openai/anthropic/etc.) tag their- # requests so telemetry can segment by integration surface.++ # requests so telemetry can segment by integration surface. Registered++ # before extension middleware so any extension-level auth/guards run++ # outermost and we don't count requests they reject.+ @app.middleware("http")+ async def _record_headroom_stack(request, call_next):+ if request.url.path.startswith("/v1/"):+ stack = request.headers.get("x-headroom-stack")+ if stack:+ try:+ proxy.metrics.record_stack(stack)+ except Exception:+ logger.debug("record_stack failed", exc_info=True)+ return await call_next(request)++ # Third-party proxy extensions (Enterprise, custom plugins). Discovered via+ # the `headroom.proxy_extension` entry-point group. An extension that raises+ # from its install() is a deliberate fail-closed signal and aborts startup.+ from headroom.proxy.extensions import install_all as _install_extensions++ _install_extensions(app, config)+# Health & Metrics@app.get("/livez")async def livez():