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 mypy error: add type annotation for SentenceTransformer return
chopratejasbe0ca4c752ca
diff --git a/headroom/relevance/embedding.py b/headroom/relevance/embedding.pyindex 151ca524e..22953ec5c 100644--- a/headroom/relevance/embedding.py+++ b/headroom/relevance/embedding.py@@ -144,7 +144,10 @@ class EmbeddingScorer(RelevanceScorer):# Use centralized registry for shared model instancesfrom headroom.models.ml_models import MLModelRegistry- return MLModelRegistry.get_sentence_transformer(self.model_name, self.device)+ model: SentenceTransformer = MLModelRegistry.get_sentence_transformer(+ self.model_name, self.device+ )+ return modeldef _encode(self, texts: list[str]):"""Encode texts to embeddings.