From 3afcd176b372d7262eb619ea65ffa227c2efbed8 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 26 Sep 2026 22:28:28 +0000 Subject: [PATCH] test: remove substring guard test_default_api_base (#43355) It asserted no provider name is a substring of any other provider's default api_base, so any new provider whose name sits inside an existing hostname (sail vs parasail) broke main without a bug in our code. The litellm_proxy default api_base fix it originally guarded is covered by the explicit api_base tests in the same file Co-authored-by: kerry Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- tests/local_testing/test_get_llm_provider.py | 40 -------------------- 1 file changed, 40 deletions(-) diff --git a/tests/local_testing/test_get_llm_provider.py b/tests/local_testing/test_get_llm_provider.py index 4ac7cecb97a..982e14660b7 100644 --- a/tests/local_testing/test_get_llm_provider.py +++ b/tests/local_testing/test_get_llm_provider.py @@ -133,46 +133,6 @@ def test_get_llm_provider_azure_o1(): assert model == "o1-mini" -def test_default_api_base(): - from litellm.litellm_core_utils.get_llm_provider_logic import ( - _get_openai_compatible_provider_info, - ) - from litellm.types.utils import LlmProviders - - # Patch environment variable to remove API base if it's set - with patch.dict(os.environ, {}, clear=True): - for provider in litellm.openai_compatible_providers: - # Get the API base for the given provider - if provider == "github_copilot": - continue - # Skip chatgpt as it requires OAuth authentication - if provider == "chatgpt": - continue - # Skip ragflow as it requires specific model format: ragflow/chat/{id}/{model} or ragflow/agent/{id}/{model} - if provider == "ragflow": - continue - _, _, _, api_base = _get_openai_compatible_provider_info( - model=f"{provider}/*", api_base=None, api_key=None, dynamic_api_key=None - ) - if api_base is None: - continue - - for other_provider in LlmProviders: - if other_provider.value != provider and provider != "{}_chat".format( - other_provider.value - ): - if provider == "codestral" and other_provider.value == "mistral": - continue - elif provider == "github" and other_provider.value == "azure": - continue - elif ( - provider in ("qwencloud", "qwen_ai_platform") - and other_provider.value == "dashscope" - ): - continue - assert other_provider.value not in api_base.replace("/openai", "") - - def test_hosted_vllm_default_api_key(): from litellm.litellm_core_utils.get_llm_provider_logic import ( _get_openai_compatible_provider_info,