mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-27 01:22:18 +00:00
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 <kerry@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
9413b82477
commit
3afcd176b3
1 changed files with 0 additions and 40 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue