#29320 feat: LLMLingua-2 in-place prompt compaction integration
# PRD: LLMLingua-2 Prompt Compaction Integration
## Problem Statement
Teams running long-context LLM workloads through LiteLLM hit provider context limits and pay for input tokens on every request. LiteLLM's existing drop-and-retrieve compaction (BM25 message stubbing + server-side retrieval) solves a different problem and only covers Anthropic Messages. Operators need **in-place prompt compaction** via LLMLingua-2 on the request hot path — opt-in per tenant, observable, fail-open, and isolated from existing compression code — for both proxy and SDK callers.
## Solution
Add a self-contained **LLMLingua-2 compaction integration** that registers as a LiteLLM callback, compacts eligible messages in place before the LLM call, and exposes compaction status through metadata, spend logs, and response headers. Compaction is never on by default: a proxy master switch plus per-key/team/request **prompt compaction settings** gate every request. When compaction cannot run safely or within budget, the gateway **pass-through**s original messages and still completes the LLM request.
## User Stories
1. As a platform operator, I want to enable LLMLingua-2 compaction on my LiteLLM proxy via YA…