mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
feat(proxy_server.py): support retrieving models for a team, if user is a member - via /models?team_id
Allows user to see team models on UI when creating a key
This commit is contained in:
parent
621d193727
commit
26226d475f
4 changed files with 32 additions and 20 deletions
|
@ -85,7 +85,7 @@ def get_key_models(
|
|||
|
||||
|
||||
def get_team_models(
|
||||
user_api_key_dict: UserAPIKeyAuth,
|
||||
team_models: List[str],
|
||||
proxy_model_list: List[str],
|
||||
model_access_groups: Dict[str, List[str]],
|
||||
) -> List[str]:
|
||||
|
@ -96,10 +96,10 @@ def get_team_models(
|
|||
- If model_access_groups is provided, only return models that are in the access groups
|
||||
"""
|
||||
all_models = []
|
||||
if len(user_api_key_dict.team_models) > 0:
|
||||
all_models = user_api_key_dict.team_models
|
||||
if len(team_models) > 0:
|
||||
all_models = team_models
|
||||
if SpecialModelNames.all_team_models.value in all_models:
|
||||
all_models = user_api_key_dict.team_models
|
||||
all_models = team_models
|
||||
if SpecialModelNames.all_proxy_models.value in all_models:
|
||||
all_models = proxy_model_list
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue