From c23414c657d1aed1f8452ca0ef18998b68d08aa3 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 16 Apr 2026 21:58:03 +0530 Subject: [PATCH] Remove max support for opus 4.7 --- docs/my-website/blog/claude_opus_4_7/index.md | 17 +++++------ litellm/llms/anthropic/chat/transformation.py | 8 ++--- ...odel_prices_and_context_window_backup.json | 30 +++++++------------ model_prices_and_context_window.json | 30 +++++++------------ 4 files changed, 31 insertions(+), 54 deletions(-) diff --git a/docs/my-website/blog/claude_opus_4_7/index.md b/docs/my-website/blog/claude_opus_4_7/index.md index 17c45e58de4..851a0556c4c 100644 --- a/docs/my-website/blog/claude_opus_4_7/index.md +++ b/docs/my-website/blog/claude_opus_4_7/index.md @@ -221,7 +221,7 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \ ### Adaptive Thinking :::note -When using `reasoning_effort` with Claude Opus 4.7, all values (`low`, `medium`, `high`, `xhigh`, `max`) are mapped to `thinking: {type: "adaptive"}`. To use explicit thinking budgets with `type: "enabled"`, pass the native `thinking` parameter directly. +When using `reasoning_effort` with Claude Opus 4.7, all values (`low`, `medium`, `high`, `xhigh`) are mapped to `thinking: {type: "adaptive"}`. To use explicit thinking budgets with `type: "enabled"`, pass the native `thinking` parameter directly. ::: @@ -274,9 +274,9 @@ curl --location 'http://0.0.0.0:4000/v1/messages' \ ### Effort Levels -Claude Opus 4.7 supports five effort levels: `low`, `medium`, `high` (default), `xhigh`, and `max`. These give you finer-grained control over how much reasoning the model applies to a task. Pass the effort level via the `output_config` parameter. +Claude Opus 4.7 supports four effort levels: `low`, `medium`, `high` (default), and `xhigh`. These give you finer-grained control over how much reasoning the model applies to a task. Pass the effort level via the `output_config` parameter. -`xhigh` is a new effort level introduced with Opus 4.7 that sits between `high` and `max`. `max` is available on Claude Opus 4.6 and 4.7 only. +`xhigh` is a new effort level introduced with Opus 4.7 that sits above `high`. The `max` effort level is Claude Opus 4.6 only and is not available on 4.7. @@ -294,7 +294,7 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \ } ], "output_config": { - "effort": "max" + "effort": "xhigh" } }' ``` @@ -312,7 +312,7 @@ client = openai.OpenAI( response = client.chat.completions.create( model="claude-opus-4-7", messages=[{"role": "user", "content": "Explain quantum computing"}], - extra_body={"output_config": {"effort": "max"}} + extra_body={"output_config": {"effort": "xhigh"}} ) ``` @@ -324,7 +324,7 @@ from litellm import completion response = completion( model="anthropic/claude-opus-4-7", messages=[{"role": "user", "content": "Explain quantum computing"}], - output_config={"effort": "max"}, + output_config={"effort": "xhigh"}, ) ``` @@ -347,7 +347,7 @@ curl --location 'http://0.0.0.0:4000/v1/messages' \ } ], "output_config": { - "effort": "max" + "effort": "xhigh" } }' ``` @@ -362,6 +362,5 @@ curl --location 'http://0.0.0.0:4000/v1/messages' \ | `low` | Short, fast responses — simple lookups, formatting, classification | | `medium` | Balanced tradeoff for everyday Q&A and light reasoning | | `high` (default) | Complex reasoning, code generation, analysis | -| `xhigh` | Harder reasoning than `high` when `max` is overkill — tough debugging, non-trivial planning | -| `max` | Hardest problems — multi-step math, deep research, agentic planning (Opus 4.6 and 4.7 only) | +| `xhigh` | Hardest problems — multi-step math, deep research, agentic planning | diff --git a/litellm/llms/anthropic/chat/transformation.py b/litellm/llms/anthropic/chat/transformation.py index 09391058d67..9b6a560d54b 100644 --- a/litellm/llms/anthropic/chat/transformation.py +++ b/litellm/llms/anthropic/chat/transformation.py @@ -1506,13 +1506,11 @@ class AnthropicConfig(AnthropicModelInfo, BaseConfig): f"Invalid effort value: {effort}. Must be one of: " f"'high', 'medium', 'low', 'xhigh', 'max'" ) - # ``max`` is Claude Opus 4.6 and 4.7 only (not Sonnet 4.6, not Opus 4.5). + # ``max`` is Claude Opus 4.6 only (not Sonnet 4.6, not Opus 4.5/4.7). # Keep this hardcoded so the error message is specific and stable. - if effort == "max" and not ( - self._is_opus_4_6_model(model) or self._is_opus_4_7_model(model) - ): + if effort == "max" and not self._is_opus_4_6_model(model): raise ValueError( - f"effort='max' is only supported by Claude Opus 4.6 and 4.7. " + f"effort='max' is only supported by Claude Opus 4.6. " f"Got model: {model}" ) # ``xhigh`` is data-driven via ``supports_xhigh_reasoning_effort`` so diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 37f347bbb44..6e5dacc3adb 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -1146,8 +1146,7 @@ "supports_vision": true, "supports_xhigh_reasoning_effort": true, "tool_use_system_prompt_tokens": 346, - "supports_native_structured_output": true, - "supports_max_reasoning_effort": true + "supports_native_structured_output": true }, "global.anthropic.claude-opus-4-7": { "cache_creation_input_token_cost": 6.25e-06, @@ -1175,8 +1174,7 @@ "supports_vision": true, "supports_xhigh_reasoning_effort": true, "tool_use_system_prompt_tokens": 346, - "supports_native_structured_output": true, - "supports_max_reasoning_effort": true + "supports_native_structured_output": true }, "us.anthropic.claude-opus-4-7": { "cache_creation_input_token_cost": 6.875e-06, @@ -1204,8 +1202,7 @@ "supports_vision": true, "supports_xhigh_reasoning_effort": true, "tool_use_system_prompt_tokens": 346, - "supports_native_structured_output": true, - "supports_max_reasoning_effort": true + "supports_native_structured_output": true }, "eu.anthropic.claude-opus-4-7": { "cache_creation_input_token_cost": 6.875e-06, @@ -1233,8 +1230,7 @@ "supports_vision": true, "supports_xhigh_reasoning_effort": true, "tool_use_system_prompt_tokens": 346, - "supports_native_structured_output": true, - "supports_max_reasoning_effort": true + "supports_native_structured_output": true }, "au.anthropic.claude-opus-4-7": { "cache_creation_input_token_cost": 6.875e-06, @@ -1262,8 +1258,7 @@ "supports_vision": true, "supports_xhigh_reasoning_effort": true, "tool_use_system_prompt_tokens": 346, - "supports_native_structured_output": true, - "supports_max_reasoning_effort": true + "supports_native_structured_output": true }, "anthropic.claude-sonnet-4-6": { "cache_creation_input_token_cost": 3.75e-06, @@ -1944,8 +1939,7 @@ "supports_tool_choice": true, "supports_vision": true, "supports_xhigh_reasoning_effort": true, - "tool_use_system_prompt_tokens": 159, - "supports_max_reasoning_effort": true + "tool_use_system_prompt_tokens": 159 }, "azure_ai/claude-opus-4-1": { "cache_creation_input_token_cost": 1.875e-05, @@ -9129,8 +9123,7 @@ "provider_specific_entry": { "us": 1.1, "fast": 6.0 - }, - "supports_max_reasoning_effort": true + } }, "claude-opus-4-7-20260416": { "cache_creation_input_token_cost": 6.25e-06, @@ -9162,8 +9155,7 @@ "provider_specific_entry": { "us": 1.1, "fast": 6.0 - }, - "supports_max_reasoning_effort": true + } }, "claude-sonnet-4-20250514": { "deprecation_date": "2026-05-14", @@ -31190,8 +31182,7 @@ "supports_tool_choice": true, "supports_vision": true, "supports_xhigh_reasoning_effort": true, - "tool_use_system_prompt_tokens": 346, - "supports_max_reasoning_effort": true + "tool_use_system_prompt_tokens": 346 }, "vertex_ai/claude-opus-4-7@default": { "cache_creation_input_token_cost": 6.25e-06, @@ -31218,8 +31209,7 @@ "supports_tool_choice": true, "supports_vision": true, "supports_xhigh_reasoning_effort": true, - "tool_use_system_prompt_tokens": 346, - "supports_max_reasoning_effort": true + "tool_use_system_prompt_tokens": 346 }, "vertex_ai/claude-sonnet-4-5": { "cache_creation_input_token_cost": 3.75e-06, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index 37f347bbb44..6e5dacc3adb 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -1146,8 +1146,7 @@ "supports_vision": true, "supports_xhigh_reasoning_effort": true, "tool_use_system_prompt_tokens": 346, - "supports_native_structured_output": true, - "supports_max_reasoning_effort": true + "supports_native_structured_output": true }, "global.anthropic.claude-opus-4-7": { "cache_creation_input_token_cost": 6.25e-06, @@ -1175,8 +1174,7 @@ "supports_vision": true, "supports_xhigh_reasoning_effort": true, "tool_use_system_prompt_tokens": 346, - "supports_native_structured_output": true, - "supports_max_reasoning_effort": true + "supports_native_structured_output": true }, "us.anthropic.claude-opus-4-7": { "cache_creation_input_token_cost": 6.875e-06, @@ -1204,8 +1202,7 @@ "supports_vision": true, "supports_xhigh_reasoning_effort": true, "tool_use_system_prompt_tokens": 346, - "supports_native_structured_output": true, - "supports_max_reasoning_effort": true + "supports_native_structured_output": true }, "eu.anthropic.claude-opus-4-7": { "cache_creation_input_token_cost": 6.875e-06, @@ -1233,8 +1230,7 @@ "supports_vision": true, "supports_xhigh_reasoning_effort": true, "tool_use_system_prompt_tokens": 346, - "supports_native_structured_output": true, - "supports_max_reasoning_effort": true + "supports_native_structured_output": true }, "au.anthropic.claude-opus-4-7": { "cache_creation_input_token_cost": 6.875e-06, @@ -1262,8 +1258,7 @@ "supports_vision": true, "supports_xhigh_reasoning_effort": true, "tool_use_system_prompt_tokens": 346, - "supports_native_structured_output": true, - "supports_max_reasoning_effort": true + "supports_native_structured_output": true }, "anthropic.claude-sonnet-4-6": { "cache_creation_input_token_cost": 3.75e-06, @@ -1944,8 +1939,7 @@ "supports_tool_choice": true, "supports_vision": true, "supports_xhigh_reasoning_effort": true, - "tool_use_system_prompt_tokens": 159, - "supports_max_reasoning_effort": true + "tool_use_system_prompt_tokens": 159 }, "azure_ai/claude-opus-4-1": { "cache_creation_input_token_cost": 1.875e-05, @@ -9129,8 +9123,7 @@ "provider_specific_entry": { "us": 1.1, "fast": 6.0 - }, - "supports_max_reasoning_effort": true + } }, "claude-opus-4-7-20260416": { "cache_creation_input_token_cost": 6.25e-06, @@ -9162,8 +9155,7 @@ "provider_specific_entry": { "us": 1.1, "fast": 6.0 - }, - "supports_max_reasoning_effort": true + } }, "claude-sonnet-4-20250514": { "deprecation_date": "2026-05-14", @@ -31190,8 +31182,7 @@ "supports_tool_choice": true, "supports_vision": true, "supports_xhigh_reasoning_effort": true, - "tool_use_system_prompt_tokens": 346, - "supports_max_reasoning_effort": true + "tool_use_system_prompt_tokens": 346 }, "vertex_ai/claude-opus-4-7@default": { "cache_creation_input_token_cost": 6.25e-06, @@ -31218,8 +31209,7 @@ "supports_tool_choice": true, "supports_vision": true, "supports_xhigh_reasoning_effort": true, - "tool_use_system_prompt_tokens": 346, - "supports_max_reasoning_effort": true + "tool_use_system_prompt_tokens": 346 }, "vertex_ai/claude-sonnet-4-5": { "cache_creation_input_token_cost": 3.75e-06,