mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-07 04:24:12 +00:00
fixed byok models for teams issue (#21408)
This commit is contained in:
@@ -1928,6 +1928,24 @@ def test_get_known_models_from_wildcard(
|
||||
assert all(model in wildcard_models for model in expected_models)
|
||||
|
||||
|
||||
def test_get_known_models_from_wildcard_without_litellm_params():
|
||||
"""
|
||||
Test wildcard expansion without litellm_params (BYOK case - team has openai/*
|
||||
but no deployment in router config).
|
||||
"""
|
||||
from litellm.proxy.auth.model_checks import get_known_models_from_wildcard
|
||||
|
||||
wildcard_models = get_known_models_from_wildcard(
|
||||
wildcard_model="openai/*", litellm_params=None
|
||||
)
|
||||
# Should return expanded OpenAI models (gpt-4o, gpt-4o-mini, etc.)
|
||||
assert len(wildcard_models) > 0
|
||||
assert all(m.startswith("openai/") for m in wildcard_models)
|
||||
# Check for common OpenAI models
|
||||
model_ids = [m.split("/", 1)[1] for m in wildcard_models]
|
||||
assert "gpt-4o" in model_ids or "gpt-3.5-turbo" in model_ids
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"data, user_api_key_dict, expected_model",
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user