mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-17 04:34:25 +00:00
fix(proxy): ignore no-default-models sentinel during model resolution
This commit is contained in:
parent
80d3b69d9c
commit
cb264f3f6f
2 changed files with 23 additions and 1 deletions
|
|
@ -11507,6 +11507,8 @@ def _add_team_models_to_all_models(
|
|||
team_models.setdefault(model_id, set()).add(team_object.team_id)
|
||||
else:
|
||||
for model_name in team_object.models:
|
||||
if model_name == SpecialModelNames.no_default_models.value:
|
||||
continue
|
||||
_models = llm_router.get_model_list(
|
||||
model_name=model_name, team_id=team_object.team_id
|
||||
)
|
||||
|
|
|
|||
|
|
@ -687,7 +687,6 @@ def test_restructure_always_happens(monkeypatch):
|
|||
assert should_restructure is True
|
||||
assert ui_path == packaged_ui_path
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_initialize_scheduled_jobs_credentials(monkeypatch):
|
||||
"""
|
||||
|
|
@ -1368,6 +1367,27 @@ def test_add_team_models_to_all_models():
|
|||
)
|
||||
assert result == {"gpt-4-model-2": {"team1"}}
|
||||
|
||||
def test_add_team_models_to_all_models_ignores_no_default_models():
|
||||
"""
|
||||
Regression test for #31438.
|
||||
"""
|
||||
from litellm.proxy._types import LiteLLM_TeamTable
|
||||
from litellm.proxy.proxy_server import _add_team_models_to_all_models
|
||||
|
||||
team = MagicMock(spec=LiteLLM_TeamTable)
|
||||
team.team_id = "team1"
|
||||
team.models = ["no-default-models"]
|
||||
|
||||
llm_router = MagicMock()
|
||||
|
||||
result = _add_team_models_to_all_models(
|
||||
team_db_objects_typed=[team],
|
||||
llm_router=llm_router,
|
||||
)
|
||||
|
||||
assert result == {}
|
||||
llm_router.get_model_list.assert_not_called()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_apply_search_filter_matches_team_public_model_name():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue