Skip to content

Conversation

@irfansofyana
Copy link

@irfansofyana irfansofyana commented Nov 27, 2025

Title

Fix issue where anthropic_beta header was being sent to all Bedrock models via the /v1/messages endpoint, causing "unknown variant: anthropic_beta" errors on non-Claude models like Qwen and Nova.

Changes:

  • Use BedrockLLM.get_bedrock_invoke_provider() for robust model detection
  • Only add anthropic_beta to request when provider is "anthropic"
  • Add comprehensive tests for Claude and non-Claude models
  • Update documentation explaining the filtering behavior

This ensures Claude Code works seamlessly with non-Claude Bedrock models while preserving full anthropic_beta support for Claude models.

Relevant issues

Fixes #17133

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

🐛 Bug Fix

Changes

  • Use BedrockLLM.get_bedrock_invoke_provider() for robust model detection
  • Only add anthropic_beta to request when provider is "anthropic"
  • Add comprehensive tests for Claude and non-Claude models
  • Update documentation explaining the filtering behavior

@vercel
Copy link

vercel bot commented Nov 27, 2025

@irfansofyana is attempting to deploy a commit to the CLERKIEAI Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Nov 27, 2025

CLA assistant check
All committers have signed the CLA.

Fix issue where anthropic_beta header was being sent to all Bedrock models
via the /v1/messages endpoint, causing "unknown variant: anthropic_beta"
errors on non-Claude models like Qwen and Nova.

Changes:
- Use BedrockLLM.get_bedrock_invoke_provider() for robust model detection
- Only add anthropic_beta to request when provider is "anthropic"
- Add comprehensive tests for Claude and non-Claude models
- Update documentation explaining the filtering behavior

This ensures Claude Code works seamlessly with non-Claude Bedrock models
while preserving full anthropic_beta support for Claude models.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@irfansofyana irfansofyana force-pushed the fix/anthropic-beta-header-non-claude-models branch from 085d559 to 67fe547 Compare December 4, 2025 05:21
@vercel
Copy link

vercel bot commented Dec 4, 2025

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

Project Deployment Preview Comments Updated (UTC)
litellm Ready Ready Preview Comment Dec 4, 2025 5:23am

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.

[Bug]: Claude Code with Qwen Models unknown variant anthropic_beta,

2 participants