Add Claude Opus 4.6 (rebased from #20508)#20510
Conversation
Add Claude Opus 4.6 entries for Anthropic, Bedrock Converse, and Vertex AI. Align pricing and capability metadata with Anthropic docs, including long-context rates, above-200k prompt-caching rates, prefill removal, and tool-use system prompt token counts. Register the Bedrock Converse model ID in constants and add targeted tests to validate model map values and converse registration.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@ishaan-jaff I'm working on #20508 right now, just a few secs! |
Greptile OverviewGreptile SummaryThis PR adds Claude Opus 4.6 model metadata across providers (Anthropic, Bedrock Converse, Vertex AI, Azure AI) in A new test suite ( Confidence Score: 2/5
|
| Filename | Overview |
|---|---|
| litellm/constants.py | Adds anthropic.claude-opus-4-6-v1:0 to BEDROCK_CONVERSE_MODELS registration list. |
| litellm/model_prices_and_context_window_backup.json | Adds pricing/capabilities for Claude Opus 4.6 across providers; appears consistent with main JSON but needs alignment with tests on supports_assistant_prefill and tool_use_system_prompt_tokens for claude-opus-4-6 entries. |
| model_prices_and_context_window.json | Adds Claude Opus 4.6 model configs (Anthropic, Bedrock Converse, Vertex AI, Azure AI) plus 200k+ token pricing tiers; conflicts with new test expectations for supports_assistant_prefill and tool_use_system_prompt_tokens on claude-opus-4-6 keys. |
| tests/test_litellm/test_claude_opus_4_6_config.py | Adds tests for Opus 4.6 model entries, but currently asserts supports_assistant_prefill is false and tool_use_system_prompt_tokens equals 346 for all models; this contradicts the JSON values for the claude-opus-4-6 keys and will fail. |
Sequence Diagram
sequenceDiagram
participant Dev as Developer/CI
participant Tests as test_claude_opus_4_6_config.py
participant JSON as model_prices_and_context_window.json
participant Const as litellm/constants.py
participant LiteLLM as litellm module
Dev->>Tests: run pytest
Tests->>JSON: open + json.load()
Tests->>JSON: assert Opus 4.6 entries exist
Tests->>JSON: assert pricing/capability fields match expectations
Tests->>LiteLLM: import litellm
LiteLLM->>Const: load BEDROCK_CONVERSE_MODELS
Tests->>LiteLLM: assert Opus 4.6 bedrock model registered
Tests-->>Dev: pass/fail based on JSON vs expected assertions
| assert info["supports_assistant_prefill"] is False | ||
| assert info["supports_function_calling"] is True | ||
| assert info["supports_prompt_caching"] is True | ||
| assert info["supports_reasoning"] is True | ||
| assert info["supports_tool_choice"] is True | ||
| assert info["supports_vision"] is True | ||
| if "tool_use_system_prompt_tokens" in info: | ||
| assert info["tool_use_system_prompt_tokens"] == 346 |
There was a problem hiding this comment.
Incorrect capability assertions
model_prices_and_context_window.json sets supports_assistant_prefill: true and tool_use_system_prompt_tokens: 159 for claude-opus-4-6 / claude-opus-4-6-20260205 (see model_prices_and_context_window.json:7529-7538), but this test unconditionally asserts supports_assistant_prefill is False and (when present) tool_use_system_prompt_tokens == 346. As written, the test will fail for those two entries.
This needs to either (a) assert the correct values per model key, or (b) change the JSON entries to match the intended capabilities (but then ensure other code paths expect that).
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_litellm/test_claude_opus_4_6_config.py
Line: 56:63
Comment:
**Incorrect capability assertions**
`model_prices_and_context_window.json` sets `supports_assistant_prefill: true` and `tool_use_system_prompt_tokens: 159` for `claude-opus-4-6` / `claude-opus-4-6-20260205` (see `model_prices_and_context_window.json:7529-7538`), but this test unconditionally asserts `supports_assistant_prefill is False` and (when present) `tool_use_system_prompt_tokens == 346`. As written, the test will fail for those two entries.
This needs to either (a) assert the correct values per model key, or (b) change the JSON entries to match the intended capabilities (but then ensure other code paths expect that).
How can I resolve this? If you propose a fix, please make it concise.Co-Authored-By: Warp <agent@warp.dev>
This PR is a rebased version of #20508 by @PeterDaveHello.
Changes
Closes #20508
Co-Authored-By: Peter Dave Hello PeterDaveHello@users.noreply.github.com
Co-Authored-By: Warp agent@warp.dev