Skip to content

Comments

Update anthropic_beta_headers_config.json to allow vertexai support 1m context#21864

Open
abehsu-mu wants to merge 2 commits intoBerriAI:mainfrom
abehsu-mu:fix/update_anthropic_beta_headers_config_for_vertexai_to_enalbe_1m_context
Open

Update anthropic_beta_headers_config.json to allow vertexai support 1m context#21864
abehsu-mu wants to merge 2 commits intoBerriAI:mainfrom
abehsu-mu:fix/update_anthropic_beta_headers_config_for_vertexai_to_enalbe_1m_context

Conversation

@abehsu-mu
Copy link

add context-1m-2025-08-07 for vertex_ai

Relevant issues

Fixes #21861

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

🐛 Bug Fix

Changes

 add context-1m-2025-08-07 for vertex_ai
@vercel
Copy link

vercel bot commented Feb 22, 2026

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

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Feb 22, 2026 2:11am

Request Review

@CLAassistant
Copy link

CLAassistant commented Feb 22, 2026

CLA assistant check
All committers have signed the CLA.

@abehsu-mu
Copy link
Author

@greptileai help me look at Confidence Score

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 22, 2026

Based on my review of your PR, here's what's affecting the confidence score:

Why the score might be lower than 4/5:

  1. Missing test coverage - The pre-submission checklist shows tests weren't added. The repository requires at least 1 test in the tests/litellm/ directory as a hard requirement. This is critical for verifying that:

  2. No verification evidence - While the fix looks correct (changing "context-1m-2025-08-07": null to "context-1m-2025-08-07": "context-1m-2025-08-07" for vertex_ai), there's no test output or demonstration that this resolves the issue.

What would raise the score to 4/5+:

Add a test similar to the existing anthropic beta header tests that verifies:

# Test that context-1m-2025-08-07 is correctly forwarded for vertex_ai
# and that it's filtered out for providers where it's null

You can likely find similar tests in tests/litellm/ that test the filter_and_transform_beta_headers functionality. Add a test case for vertex_ai with context-1m-2025-08-07.

The code change itself is correct and minimal - it's just missing the verification layer that gives maintainers confidence the fix works.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 22, 2026

Greptile Summary

Enables the context-1m-2025-08-07 Anthropic beta header for the vertex_ai provider by changing its mapping value from null (unsupported) to "context-1m-2025-08-07" (supported). This aligns vertex_ai with all other providers (anthropic, azure_ai, bedrock_converse, bedrock, databricks) that already support this header.

  • The context-1m-2025-08-07 beta header was previously blocked for vertex_ai due to a null value in the config, causing requests with this header to have it silently dropped
  • The fix is a single-value change in the JSON configuration, with no code logic changes required
  • Also adds a trailing newline to the file (minor formatting fix)
  • Note: The PR does not include tests in tests/litellm/ as required by the contribution checklist, though existing tests in tests/test_litellm/test_anthropic_beta_headers_filtering.py dynamically load the config and should validate this change

Confidence Score: 5/5

  • This PR is safe to merge — it's a minimal, correct JSON config change that enables an existing beta header for vertex_ai.
  • The change is a single value flip from null to a string in a JSON config file. It makes vertex_ai consistent with all other providers. No code logic is affected, and the change is clearly scoped. The existing test suite dynamically loads the config and validates header filtering behavior for all providers including vertex_ai.
  • No files require special attention.

Important Files Changed

Filename Overview
litellm/anthropic_beta_headers_config.json Enables context-1m-2025-08-07 beta header for vertex_ai provider (changed from null to "context-1m-2025-08-07"), making it consistent with all other providers. Also adds a trailing newline to the file.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Client sends request with\nanthropic-beta: context-1m-2025-08-07"] --> B["filter_and_transform_beta_headers()"]
    B --> C{"Look up header in\nprovider config"}
    C -->|"Before PR: vertex_ai = null"| D["Header dropped ❌"]
    C -->|"After PR: vertex_ai = 'context-1m-2025-08-07'"| E["Header forwarded ✅"]
    E --> F["Vertex AI API receives\ncontext-1m-2025-08-07 header"]
Loading

Last reviewed commit: 7cd40f1

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, no comments

Edit Code Review Agent Settings | Greptile

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