mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
Merge pull request #1933 from BerriAI/litellm_team_specific_models
[FEAT] Proxy - set team specific models
This commit is contained in:
commit
1cb8d2d3a3
3 changed files with 74 additions and 16 deletions
|
@ -1303,6 +1303,20 @@ async def _read_request_body(request):
|
|||
return request_data
|
||||
|
||||
|
||||
def _is_valid_team_configs(team_id=None, team_config=None, request_data=None):
|
||||
if team_id is None or team_config is None or request_data is None:
|
||||
return
|
||||
# check if valid model called for team
|
||||
if "models" in team_config:
|
||||
valid_models = team_config.pop("models")
|
||||
model_in_request = request_data["model"]
|
||||
if model_in_request not in valid_models:
|
||||
raise Exception(
|
||||
f"Invalid model for team {team_id}: {model_in_request}. Valid models for team are: {valid_models}\n"
|
||||
)
|
||||
return
|
||||
|
||||
|
||||
# LiteLLM Admin UI - Non SSO Login
|
||||
html_form = """
|
||||
<!DOCTYPE html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue