Skip to content

Litellm anthropic doc beta header#21320

Merged
Sameerlite merged 3 commits intomainfrom
litellm_anthropic_doc_beta_header
Feb 16, 2026
Merged

Litellm anthropic doc beta header#21320
Sameerlite merged 3 commits intomainfrom
litellm_anthropic_doc_beta_header

Conversation

@Sameerlite
Copy link
Collaborator

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test

Changes

@vercel
Copy link

vercel bot commented Feb 16, 2026

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

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Feb 16, 2026 4:31pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 16, 2026

Greptile Summary

This PR adds a new blog post explaining how LiteLLM manages Anthropic beta headers across different providers (Bedrock, Azure AI, Vertex AI). The blog covers the config file structure, how to add new headers, dynamic reload options, and troubleshooting invalid beta flag errors.

  • The blog post references the existing anthropic_beta_headers_config.json and the sync_anthropic_beta_headers documentation page correctly in concept but has two accuracy issues:
    • The bedrock_converse example incorrectly shows advanced-tool-use-2025-11-20 mapped to "tool-search-tool-2025-10-19" when the actual config has it as null
    • A relative link to the docs section won't resolve properly from a Docusaurus blog post
  • No tests are included (the PR checklist items are unchecked), though this is documentation-only
  • The PR title "Litellm anthropic doc beta header" is vague and the description is empty — it would benefit from a clearer title and description explaining the motivation for this blog post

Confidence Score: 3/5

  • Documentation-only PR with no code changes; safe to merge after fixing inaccurate example and broken link
  • This is a docs-only blog post so there is no runtime risk, but it contains a factually incorrect config example that contradicts the actual config file, and a broken link. These should be fixed to avoid confusing users who follow the guide.
  • docs/my-website/blog/claude_code_beta_headers/index.md - contains incorrect bedrock_converse example and broken doc link

Important Files Changed

Filename Overview
docs/my-website/blog/claude_code_beta_headers/index.md New blog post documenting Anthropic beta header management in LiteLLM. Contains an inaccurate config example for bedrock_converse and a broken relative link to the docs section.

Sequence Diagram

sequenceDiagram
    participant CC as Claude Code
    participant LP as LiteLLM Proxy
    participant Config as Beta Headers Config
    participant Provider as Provider (Bedrock/Azure/Vertex)

    CC->>LP: Request with anthropic-beta headers
    LP->>Config: Load provider-specific mapping
    Config-->>LP: header→mapped_value or null
    Note over LP: Filter: remove unknown & null headers<br/>Transform: rename to provider-specific names
    LP->>Provider: Request with filtered/mapped headers
    Provider-->>LP: Response
    LP-->>CC: Response
Loading

Last reviewed commit: e67641c

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +79 to +82
"bedrock_converse": {
"advanced-tool-use-2025-11-20": "tool-search-tool-2025-10-19",
"new-feature-2026-03-01": null,
...
Copy link
Contributor

Choose a reason for hiding this comment

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

Incorrect header mapping for bedrock_converse

The example shows bedrock_converse mapping advanced-tool-use-2025-11-20 to "tool-search-tool-2025-10-19", but in the actual anthropic_beta_headers_config.json, bedrock_converse has this header set to null. Only bedrock (non-converse) maps it to "tool-search-tool-2025-10-19".

This is misleading because the example suggests bedrock_converse supports this header (via transformation), when in reality it filters it out entirely.

Suggested change
"bedrock_converse": {
"advanced-tool-use-2025-11-20": "tool-search-tool-2025-10-19",
"new-feature-2026-03-01": null,
...
"bedrock_converse": {
"advanced-tool-use-2025-11-20": null,
"new-feature-2026-03-01": null,

:::tip Zero-Downtime Updates
With dynamic reloading, you can fix invalid beta header errors **without restarting your service**! This is especially useful in production environments where downtime is costly.

See [Auto Sync Anthropic Beta Headers](../proxy/sync_anthropic_beta_headers.md) for complete documentation.
Copy link
Contributor

Choose a reason for hiding this comment

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

Broken relative link to docs page

This relative path ../proxy/sync_anthropic_beta_headers.md won't resolve correctly from a Docusaurus blog post. Blog posts are routed via their slug (e.g., /blog/claude_code_beta_headers), so ../proxy/ doesn't navigate into the docs section. This should use an absolute docs URL path instead.

Suggested change
See [Auto Sync Anthropic Beta Headers](../proxy/sync_anthropic_beta_headers.md) for complete documentation.
See [Auto Sync Anthropic Beta Headers](/docs/proxy/sync_anthropic_beta_headers) for complete documentation.

@Sameerlite Sameerlite merged commit 351e834 into main Feb 16, 2026
26 of 70 checks passed
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.

1 participant