mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
(feat)team-specific models
This commit is contained in:
parent
afd0d7cb41
commit
5ac5f6c53c
2 changed files with 18 additions and 0 deletions
|
@ -1285,6 +1285,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["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