From a34f098fe5406b8bb9d2ec7b7a91c27131a55ee5 Mon Sep 17 00:00:00 2001 From: Abhimanyu Kapur <38531241+akapur99@users.noreply.github.com> Date: Fri, 10 Jul 2026 21:16:17 -0700 Subject: [PATCH] docs(anthropic): clarify the Opus 4.5 branch in adaptive-effort translation Add an inline comment explaining that the effort-capable non-adaptive branch in _translate_adaptive_effort_for_non_adaptive_model exists for models like Claude Opus 4.5 that accept output_config.effort but reject adaptive thinking, and why effort-only requests pass through while adaptive requests with an unsupported effort level fall through to the legacy translation. --- .../experimental_pass_through/messages/transformation.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py b/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py index 39713e0f003..01412d3c8b2 100644 --- a/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py +++ b/litellm/llms/anthropic/experimental_pass_through/messages/transformation.py @@ -329,6 +329,11 @@ class AnthropicMessagesConfig(BaseAnthropicMessagesConfig): if effort is None and not adaptive_thinking: return + # Models that natively accept `output_config.effort` but are not adaptive (Claude Opus 4.5). + # Keep the native effort and only drop the adaptive `thinking` block, which these models + # reject. Effort-only requests pass through so provider subclasses (bedrock/vertex) keep + # owning level clamping; an adaptive request only stays here when its effort level is one + # the model supports, otherwise it falls through to the legacy budget translation below. if AnthropicConfig._model_supports_effort_param(model, custom_llm_provider) and ( not adaptive_thinking or AnthropicConfig._validate_effort_for_model(model, effort, custom_llm_provider) is None