The dashboard sends two standard chat completion requests through the real LiteLLM Proxy. A custom async_pre_call_hook evaluates the compression policy before the upstream call.
- Count: estimate tokens in messages and tool definitions.
- Decide: skip requests below the configurable threshold.
- Compress: Headroom processes eligible tool content locally, without an extra LLM call.
- Protect: preserve system and user instructions, assistant messages, and tool-call IDs. Keep the original if compression fails or increases tokens.
- Compare: show both responses, token estimates, actual provider usage, timing, and exact fact checks.
Follow-ups keep separate, uncompressed client histories for the two branches. Add more context to simulate additional tool or file reads.
Demo scope: structured tool context, no database, one backend container. ML text compression and automatic context retrieval are not enabled. Compressed content may lose information; inspect the answers and test follow-up questions.
Cloudflare Static Assets → Worker → Container → LiteLLM + Headroom → upstream provider