Align Claude 4.6 alias and mapping behavior#21487
Open
PeterDaveHello wants to merge 1 commit intoBerriAI:mainfrom
Open
Align Claude 4.6 alias and mapping behavior#21487PeterDaveHello wants to merge 1 commit intoBerriAI:mainfrom
PeterDaveHello wants to merge 1 commit intoBerriAI:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Feb 18, 2026
Contributor
Greptile SummaryThis PR aligns Claude 4.6 alias handling across the Anthropic and Bedrock providers. Key changes:
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| litellm/llms/anthropic/chat/transformation.py | Splits _is_claude_opus_4_6 into separate Opus/Sonnet 4.6 helpers and updates reasoning/structured-output paths. Minor inconsistency: "opus_4.6" variant missing from the structured output substring set while "sonnet_4.6" is present. |
| litellm/constants.py | Adds regional aliases (global/us/eu/jp/apac/au) for Claude Opus 4.6 and Sonnet 4.6 to BEDROCK_CONVERSE_MODELS, plus versioned :0 entries. Consistent with existing patterns for other models. |
| litellm/model_prices_and_context_window_backup.json | Adds pricing/capability metadata for new Claude 4.6 Bedrock aliases (opus :0, jp, apac; sonnet v1:0, v1, jp, au). Entries are consistent with existing regional pricing patterns (10% markup for non-US regions). |
| model_prices_and_context_window.json | Identical changes to the backup JSON. Adds pricing/capability metadata for new Claude 4.6 Bedrock regional and versioned aliases. Both JSON files remain synchronized. |
| tests/litellm/llms/anthropic/test_anthropic_reasoning_effort.py | Adds tests for Opus 4.6 dotted alias, Sonnet 4.6 reasoning effort mapping (adaptive type), and param support verification. All mock-only, no network calls. |
| tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py | Extends structured output, effort validation, and reasoning effort tests to cover Sonnet 4.6 and dotted alias variants. Validates max effort is rejected for Sonnet 4.6 but accepted for Opus 4.6. |
| tests/test_litellm/test_claude_opus_4_6_config.py | Extends Bedrock registration tests to verify jp/apac/au aliases for Opus and Sonnet 4.6. Adds Sonnet 4.6 Australia region mapping test and alias cost mapping consistency checks. |
Flowchart
flowchart TD
A[Model string received] --> B{_is_claude_opus_4_6?}
B -->|Yes| C[Adaptive reasoning]
B -->|No| D{_is_claude_sonnet_4_6?}
D -->|Yes| C
D -->|No| E{supports_reasoning?}
E -->|Yes| F[Budget-based reasoning]
E -->|No| G[No reasoning params]
C --> H{effort == max?}
H -->|Yes, Opus 4.6| I[Allow max effort]
H -->|Yes, Sonnet 4.6| J[Raise ValueError]
H -->|No| K[Pass effort through]
A --> L{response_format?}
L --> M{Model in structured output set?}
M -->|Yes: opus-4.6, sonnet-4.6, opus_4_6, etc.| N[Native output_format]
M -->|No| O[Tool-based workaround]
Last reviewed commit: ae1d36e
ae1d36e to
ec161cc
Compare
Sameerlite
suggested changes
Feb 19, 2026
Add missing Bedrock Converse aliases for Claude Sonnet 4.6 and regional variants, and keep corresponding model-price entries in sync across both price maps. Refine Anthropic Claude 4.6 handling to keep structured-output alias coverage while avoiding redundant reasoning capability checks. Preserve output_config.effort=max as Opus 4.6 only, keep adaptive reasoning mapping for Sonnet 4.6 aliases, and remove the non-canonical Opus v1:0 model-cost alias per review feedback. Update focused Anthropic and Claude 4.6 config tests to match the final behavior.
ec161cc to
b4fedc2
Compare
Contributor
Author
|
@Sameerlite PR updated, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - [see details](https://docs.litellm.ai/docs/extras/contributing_code)
make test-unit@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🐛 Bug Fix
✅ Test
Changes
litellm/constants.pylitellm/model_prices_and_context_window_backup.jsonmodel_prices_and_context_window.jsonlitellm/llms/anthropic/chat/transformation.py:0, and regional aliases (global/us/eu/jp/apac/au):0, and regional aliases (global/us/eu/jp/apac/au)get_model_info(..., custom_llm_provider="bedrock_converse")resolves correctly for registered Claude 4.6 aliases.tests/litellm/llms/anthropic/test_anthropic_reasoning_effort.pytests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.pytests/test_litellm/test_claude_opus_4_6_config.pyValidation run
Executed: