Backend engineers running RAG pipelines with large documents
leanctx routes retrieved passages through LLMLingua-2, trimming each document by roughly 40% before injection into the LLM request. On prose-heavy traffic (retrieved docs, PDFs, meeting transcripts), blended savings reach 36.7%. Code in tool results stays verbatim; only the document text compresses. The N=503 benchmark showed ~$78 saved per 1,000 requests at Sonnet input pricing on a 45.8% prose corpus.
Skip if:
Your retrieved documents are already short or pre-summarized. If average retrieved context is under 500 tokens per request, the compression overhead and the 1.2 GB model download are unlikely to pay off.

