Skip to content

docs(headroom): clarify that single-turn requests are never compressed - #1007

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
litellm_docs_headroom_single_turn_noop
Open

docs(headroom): clarify that single-turn requests are never compressed#1007
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
litellm_docs_headroom_single_turn_noop

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

The Headroom quick start told people to test with a system message plus one user message, which can never compress anything. LiteLLM holds back the system rows, the last user row, and the last assistant row (get_protected_indices in litellm/compression/compress.py, applied by the Headroom guardrail's _protected_indices), so on that payload compressible is empty and the guardrail returns before ever calling /v1/compress. Anyone following the page verbatim sees Headroom do nothing and reasonably concludes the integration is broken.

Reproduced on a live proxy (guardrails: ["headroom-compression"], also attached to a virtual key): the doc's own curl returns 200 with zero requests reaching the Headroom service, while the same call with one earlier user/assistant turn sends 3 rows to /v1/compress.

Changes: the quick-start examples (chat completions and /v1/messages) now carry an earlier turn, a paragraph after them explains the protected rows and the single-turn no-op, and the "Why requests_compressed can be 0" section now starts with that check before the Headroom-container defaults.

Also corrected two claims about x-litellm-applied-guardrails. That header is written from the guardrails the request opted into (_process_guardrail_metadata in litellm/proxy/utils.py), so it is present even when Headroom was skipped; it confirms opt-in, not that any message was rewritten. guardrail_information on the spend log row is the signal for the latter.

Link to Devin session: https://app.devin.ai/sessions/835118e39ed94d4cbeafc573bfd2d078

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview Aug 24, 2026 11:01pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants