mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
(round 4 fixes) - Team model alias setting (#8474)
* update team info endpoint * clean up model alias * fix model alias * fix model alias card * clean up naming on docs * fix model alias card * fix _model_in_team_aliases * team alias - fix litellm.model_alias_map * fix _update_model_if_team_alias_exists * fix test_aview_spend_per_user * Test model alias functionality with teams: * complete e2e test * test_update_model_if_team_alias_exists
This commit is contained in:
parent
f1dd0f62b5
commit
81109893ec
4 changed files with 168 additions and 15 deletions
|
@ -790,21 +790,6 @@ async def _user_api_key_auth_builder( # noqa: PLR0915
|
|||
raise Exception(
|
||||
"Key is blocked. Update via `/key/unblock` if you're admin."
|
||||
)
|
||||
|
||||
# Check 1. If token can call model
|
||||
_model_alias_map = {}
|
||||
model: Optional[str] = None
|
||||
if (
|
||||
hasattr(valid_token, "team_model_aliases")
|
||||
and valid_token.team_model_aliases is not None
|
||||
):
|
||||
_model_alias_map = {
|
||||
**valid_token.aliases,
|
||||
**valid_token.team_model_aliases,
|
||||
}
|
||||
else:
|
||||
_model_alias_map = {**valid_token.aliases}
|
||||
litellm.model_alias_map = _model_alias_map
|
||||
config = valid_token.config
|
||||
|
||||
if config != {}:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue