From b23bbb7670598c3ff13ce7b3d09c8d3bf02c2ff9 Mon Sep 17 00:00:00 2001 From: Lin Junrong Date: Wed, 12 Aug 2026 14:42:38 +0800 Subject: [PATCH] fix: drop the unreachable duplicate baseten branch in validate_environment validate_environment's provider chain tests custom_llm_provider == "baseten" twice, at lines 6171 and 6235. The elif at 6235 can never be reached because 6171 already matched, so those five lines are dead. The two blocks are byte-identical, so removing the second one changes nothing: validate_environment(model="baseten/deployment-x") without BASETEN_API_KEY -> {'keys_in_environment': False, 'missing_keys': ['BASETEN_API_KEY']} with BASETEN_API_KEY -> {'keys_in_environment': True, 'missing_keys': []} Identical before and after. baseten is the only provider duplicated inside this chain -- the other 42 appear exactly once. --- litellm/utils.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/litellm/utils.py b/litellm/utils.py index 79372f00284..dd3bfb51058 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -6232,11 +6232,6 @@ def validate_environment( keys_in_environment = True else: missing_keys.append("CEREBRAS_API_KEY") - elif custom_llm_provider == "baseten": - if "BASETEN_API_KEY" in os.environ: - keys_in_environment = True - else: - missing_keys.append("BASETEN_API_KEY") elif custom_llm_provider == "xai": if "XAI_API_KEY" in os.environ: keys_in_environment = True