Skip to content

Add Claude Opus 4.6 (rebased from #20508)#20510

Closed
ishaan-jaff wants to merge 2 commits intomainfrom
feat/add-claude-opus-4-6-rebased
Closed

Add Claude Opus 4.6 (rebased from #20508)#20510
ishaan-jaff wants to merge 2 commits intomainfrom
feat/add-claude-opus-4-6-rebased

Conversation

@ishaan-jaff
Copy link
Member

This PR is a rebased version of #20508 by @PeterDaveHello.

Changes

  • Adds Claude Opus 4.6 model configuration with:
    • Extended pricing tiers for 200k+ tokens
    • Support for prompt caching, computer use, vision, PDF input
    • 128k max output tokens

Closes #20508

Co-Authored-By: Peter Dave Hello PeterDaveHello@users.noreply.github.com
Co-Authored-By: Warp agent@warp.dev

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.
@vercel
Copy link

vercel bot commented Feb 5, 2026

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

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Feb 5, 2026 7:33pm

Request Review

@PeterDaveHello
Copy link
Contributor

@ishaan-jaff I'm working on #20508 right now, just a few secs!

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 5, 2026

Greptile Overview

Greptile Summary

This PR adds Claude Opus 4.6 model metadata across providers (Anthropic, Bedrock Converse, Vertex AI, Azure AI) in model_prices_and_context_window.json (and the backup copy), including 200k+ token pricing tier fields and capability flags, and registers the Bedrock Converse model ID in litellm/constants.py.

A new test suite (tests/test_litellm/test_claude_opus_4_6_config.py) validates the JSON entries and Bedrock registration. However, the test’s capability assertions currently don’t match the JSON values for the claude-opus-4-6 / claude-opus-4-6-20260205 entries (assistant prefill + tool system prompt token count), so CI will fail unless either the test or those JSON entries are updated to be consistent.

Confidence Score: 2/5

  • This PR is not safe to merge as-is due to a deterministic test/config mismatch that will fail CI.
  • The added test asserts supports_assistant_prefill and tool_use_system_prompt_tokens values that contradict the JSON model metadata for claude-opus-4-6 keys, causing a guaranteed failure until reconciled.
  • tests/test_litellm/test_claude_opus_4_6_config.py and model_prices_and_context_window.json (and backup copy)

Important Files Changed

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
Loading

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.

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +56 to +63
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
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