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
fix(cli): stop advertising unwired compression tuning env vars in banner (#1634)
gglucassd5bf98df3152
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 62840aeca..8d812c1ff 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -27,6 +27,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0`<headroom_proactive_expansion>` XML tags, giving downstream consumers(LLMs, loggers, attribution parsers) a machine-readable provenanceboundary and preventing misattribution in multi-agent threads.+- **cli:** the startup banner no longer advertises+ `HEADROOM_COMPRESSION_STABLE_AFTER_TURN` and+ `HEADROOM_STALE_READ_COMPRESS_AFTER_TURNS` as tuning knobs. Both were read+ only to render the `Performance Tuning` banner section and were never wired+ into the compression path, so setting them changed the banner but had no+ effect on behavior. The banner now surfaces only the embedding sidecar,+ which is a real, consumed setting.- **memory/embedder:** cap CPU thread oversubscription in the localtorch/sentence-transformers embedder. Concurrent encodes previously eachfanned out to ~`os.cpu_count()` BLAS/OpenMP threads, so under load the memorydiff --git a/headroom/cli/proxy.py b/headroom/cli/proxy.pyindex 229693374..1d479d106 100644--- a/headroom/cli/proxy.py+++ b/headroom/cli/proxy.py@@ -1327,31 +1327,16 @@ Memory (Multi-Provider):context_tool_line = f" Context Tool: {_selected_context_tool()}"# Performance tuning section — only shown when at least one tuning var is active.- _stable_turn = _get_env_int_optional("HEADROOM_COMPRESSION_STABLE_AFTER_TURN") or 0- _stale_turns = _get_env_int_optional("HEADROOM_STALE_READ_COMPRESS_AFTER_TURNS") or 0_embed_socket = os.environ.get("HEADROOM_EMBEDDING_SERVER_SOCKET") or (embedding_server and (embedding_server_socket or f"/tmp/headroom-embed-{port}.sock"))_tuning_lines: list[str] = []- if _stable_turn:- _tuning_lines.append(- f" Prefix stability: conservative for first {_stable_turn} turns"- f" (HEADROOM_COMPRESSION_STABLE_AFTER_TURN={_stable_turn})"- )- if _stale_turns:- _tuning_lines.append(- f" Stale read compression: reads older than {_stale_turns} turns eligible"- f" (HEADROOM_STALE_READ_COMPRESS_AFTER_TURNS={_stale_turns})"- )if _embed_socket:_tuning_lines.append(f" Embedding sidecar: {_embed_socket}")if _tuning_lines:tuning_section = "\nPerformance Tuning:\n" + "\n".join(_tuning_lines)else:- tuning_section = (- "\nPerformance Tuning: (all defaults — set HEADROOM_COMPRESSION_STABLE_AFTER_TURN"- " / HEADROOM_STALE_READ_COMPRESS_AFTER_TURNS to tune)"- )+ tuning_section = ""click.echo(f"""╔═══════════════════════════════════════════════════════════════════════╗