Skip to content

docs(headroom): document Headroom prompt compression integration - #420

Merged
krrish-berri-2 merged 3 commits into
mainfrom
claude/silly-solomon-f60a38
Jun 27, 2026
Merged

docs(headroom): document Headroom prompt compression integration#420
krrish-berri-2 merged 3 commits into
mainfrom
claude/silly-solomon-f60a38

Conversation

@krrish-berri-2

Copy link
Copy Markdown
Contributor

Summary

Adds a new doc for the Headroom integration introduced in BerriAI/litellm#31407. Headroom ships as a pre-call LiteLLM guardrail plugin but is prompt compression, not safety filtering, so the page is positioned under Cost Optimization rather than Guardrail Providers.

The doc covers:

  • Config in config.yaml and the underlying POST /v1/compress contract Headroom exposes.
  • Three enablement paths: default_on: true for always-on, virtual key with guardrails: ["headroom-compression"] for per-user rollout, and request-body opt-in (guardrails array on /v1/chat/completions, litellm_metadata.guardrails on /v1/messages).
  • A Claude Code section walking through the admin-to-developer flow, including the ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN setup and the x-headroom-bypass: true per-request escape hatch.
  • A "Validate Headroom ran" section with a screenshot of the request lifecycle row in the Logs UI.
  • A Dockerfile for deploying the Headroom proxy.

Sidebar changes add the page under Cost Optimization in both the proxy and integrations sidebars, and the existing SDK prompt_compression page links across to the proxy variant.

Test plan

  • npm run start renders /docs/proxy/headroom without MDX errors
  • Integrations sidebar shows Cost Optimization > Headroom
  • Proxy sidebar shows Cost Optimization > Headroom
  • Anchor link from Requirements to Deploy Headroom resolves
  • Screenshot at /img/headroom_logs.png renders inline

Adds a new page covering the Headroom integration that ships as a pre-call
LiteLLM guardrail plugin. Covers config, opt-in via key or request body,
Claude Code rollout flow, validation in the Logs UI, deploy via Dockerfile,
and the headroom service contract. Sidebars surface it under Cost
Optimization in both the proxy and integrations sidebars; the SDK
prompt_compression page links across to the proxy variant.
@vercel

vercel Bot commented Jun 27, 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, Comment Jun 27, 2026 3:55am

Request Review

@krrish-berri-2
krrish-berri-2 enabled auto-merge (squash) June 27, 2026 03:51
@krrish-berri-2
krrish-berri-2 merged commit b12cdc7 into main Jun 27, 2026
2 checks passed
@krrish-berri-2
krrish-berri-2 deleted the claude/silly-solomon-f60a38 branch June 27, 2026 03:55

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e7f89487f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/proxy/headroom.md

In the Admin UI, open any request in **Logs**, scroll to the **Guardrails & Policy Compliance** panel, and you will see `headroom-compression` listed under **Request Lifecycle** as a `pre-call` step with its latency, plus an entry under **Evaluation Details**.

![Headroom guardrail in the LiteLLM Logs UI](/img/headroom_logs.png)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Replace the failed-run validation screenshot

When users follow this validation section, the referenced image shows the request status as Failure, 0 Passed, and Pre-call guardrail: headroom-compression FAILED, so it demonstrates a failed compression attempt rather than a successful Headroom run. This can lead operators to treat a failed guardrail as the expected validation state; please use a screenshot from a successful run or update the text to explain failure diagnostics instead.

Useful? React with 👍 / 👎.

@krrish-berri-2
krrish-berri-2 restored the claude/silly-solomon-f60a38 branch June 27, 2026 04:04
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.

2 participants