From 13714586b63a026df9dbdac6b793fef1366b0461 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 3 May 2026 04:02:29 +0000 Subject: [PATCH] fix(constants): make ANTHROPIC_MIN_THINKING_BUDGET_TOKENS a plain constant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The documentation CI test (tests/documentation_tests/test_env_keys.py) asserts every os.getenv() key in the source has a matching entry in the litellm-docs config_settings.md table. ANTHROPIC_MIN_THINKING_BUDGET_TOKENS tracks Anthropic's published wire-protocol minimum (1024) — it's not a user-tunable, so making it env-overridable was wrong anyway. Drop the os.getenv() wrapper; the value is now a plain literal. Co-authored-by: Mateo Wang --- litellm/constants.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/litellm/constants.py b/litellm/constants.py index 177fb024d69..7bf94971a39 100644 --- a/litellm/constants.py +++ b/litellm/constants.py @@ -402,13 +402,12 @@ BEDROCK_MIN_THINKING_BUDGET_TOKENS = int( # Anthropic's Messages API rejects ``thinking.budget_tokens < 1024`` with a # 400. ``reasoning_effort='minimal'`` historically mapped to 128 (the global # default) which always 400'd against direct Anthropic, Azure AI Anthropic, -# Vertex AI Anthropic, and Bedrock Invoke. Use the provider minimum so -# ``minimal`` is a usable tier on all Anthropic-backed routes; Bedrock -# Converse already clamped to 1024 server-side, so this just unifies the -# behavior. -ANTHROPIC_MIN_THINKING_BUDGET_TOKENS = int( - os.getenv("ANTHROPIC_MIN_THINKING_BUDGET_TOKENS", 1024) -) +# Vertex AI Anthropic, and Bedrock Invoke. Floor at the provider minimum so +# ``minimal`` is a usable tier on every Anthropic-backed route; Bedrock +# Converse already clamps server-side, this just unifies the behavior. +# Constant — not env-overridable — because it tracks Anthropic's published +# wire-protocol minimum, not a tunable. +ANTHROPIC_MIN_THINKING_BUDGET_TOKENS = 1024 REPLICATE_POLLING_DELAY_SECONDS = float( os.getenv("REPLICATE_POLLING_DELAY_SECONDS", 0.5) )