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: honor litellm availability overrides
JerrettDavisc7922d6de665
diff --git a/headroom/proxy/cost.py b/headroom/proxy/cost.pyindex d1bef3a1a..40e747d53 100644--- a/headroom/proxy/cost.py+++ b/headroom/proxy/cost.py@@ -27,10 +27,10 @@ def _get_litellm_module() -> Any | None:"""Import LiteLLM only when pricing data is actually requested."""global litellm- if litellm is not None:- return litellmif not LITELLM_AVAILABLE:return None+ if litellm is not None:+ return litellmtry:import litellm as imported_litellmdiff --git a/headroom/proxy/savings_tracker.py b/headroom/proxy/savings_tracker.pyindex 9910d006b..6ffe263cc 100644--- a/headroom/proxy/savings_tracker.py+++ b/headroom/proxy/savings_tracker.py@@ -37,10 +37,10 @@ def _get_litellm_module() -> Any | None:"""Import LiteLLM only when cost metadata is requested."""global litellm- if litellm is not None:- return litellmif not LITELLM_AVAILABLE:return None+ if litellm is not None:+ return litellmtry:import litellm as imported_litellm