Skip to content

[LLM translation] Refactor Anthropic Configurations and Add Support for anthropic_beta Headers #13590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 14, 2025

Conversation

jugaldb
Copy link
Collaborator

@jugaldb jugaldb commented Aug 13, 2025

[LLM translation] Refactor Anthropic Configurations and Add Support for anthropic_beta Headers

Relevant issues

Fixes #13552

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
  • I have added a screenshot of my new test passing locally
  • 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

Type

🆕 New Feature

Changes

…` Headers

- Renamed `AmazonAnthropicClaude3Config` and `AmazonAnthropicClaude3MessagesConfig` to `AmazonAnthropicClaudeConfig` and `AmazonAnthropicClaudeMessagesConfig` respectively for consistency.
- Implemented `get_anthropic_beta_from_headers` function to extract and handle `anthropic-beta` headers across various transformations.
- Updated request transformations in `AmazonConverseConfig` and `AmazonInvokeConfig` to include `anthropic_beta` parameters based on user headers.
- Added tests to ensure proper handling of `anthropic_beta` headers in different scenarios.
@jugaldb jugaldb changed the title [LLM translation] Refactor Anthropic Configurations and Add Support for anthropic_beta Headers [Draft] [LLM translation] Refactor Anthropic Configurations and Add Support for anthropic_beta Headers Aug 13, 2025
Copy link

vercel bot commented Aug 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Project Deployment Preview Comments Updated (UTC)
litellm Ready Preview Comment Aug 13, 2025 8:42pm

- Updated test cases to use the renamed `AmazonAnthropicClaudeConfig` instead of `AmazonAnthropicClaude3Config` for consistency with recent changes.
- Adjusted imports and assertions in test files to reflect the new configuration class name.
- Renamed `AmazonAnthropicClaude3MessagesConfig` to `AmazonAnthropicClaudeMessagesConfig` in the test file to align with recent refactoring.
- Adjusted the instantiation of the configuration class in the test to reflect the new naming convention.
- Added `forward_client_headers_to_llm_api` setting in the Bedrock documentation to facilitate client-side header forwarding.
- Updated `completion` function to use merged headers instead of original `extra_headers`.
- Improved request handling in `BedrockConverseLLM` and `AmazonInvokeConfig` to ensure proper header management for `anthropic-beta` parameters.
- Refactored request transformation logic to return the transformed request for better clarity and functionality.
@jugaldb jugaldb changed the title [Draft] [LLM translation] Refactor Anthropic Configurations and Add Support for anthropic_beta Headers [LLM translation] Refactor Anthropic Configurations and Add Support for anthropic_beta Headers Aug 13, 2025
@krrishdholakia krrishdholakia merged commit f360e0e into main Aug 14, 2025
39 of 46 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.

[Feature]: anthropic_beta support for bedrock
2 participants