Skip to content

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.

Fix LLMLingua API: use context=[content] not original_prompt

chopratejas02fd2284e024
diff --git a/headroom/transforms/llmlingua_compressor.py b/headroom/transforms/llmlingua_compressor.py
index f7e0ec6b6..24a8ebe90 100644
--- a/headroom/transforms/llmlingua_compressor.py
+++ b/headroom/transforms/llmlingua_compressor.py
@@ -358,9 +358,9 @@ class LLMLinguaCompressor(Transform):
# Perform compression
try:
result = compressor.compress_prompt(
- original_prompt=content,
+ context=[content], # LLMLingua expects a list of context strings
rate=compression_rate,
- force_tokens=force_tokens if force_tokens else None,
+ force_tokens=force_tokens if force_tokens else [],
drop_consecutive=self.config.drop_consecutive,
)