mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
Merge branch 'main' into litellm_fix_team_model_access_checks
This commit is contained in:
commit
f85d5afd58
213 changed files with 7650 additions and 1600 deletions
|
@ -1116,6 +1116,14 @@ async def can_user_call_model(
|
|||
if user_object is None:
|
||||
return True
|
||||
|
||||
if SpecialModelNames.no_default_models.value in user_object.models:
|
||||
raise ProxyException(
|
||||
message=f"User not allowed to access model. No default model access, only team models allowed. Tried to access {model}",
|
||||
type=ProxyErrorTypes.key_model_access_denied,
|
||||
param="model",
|
||||
code=status.HTTP_401_UNAUTHORIZED,
|
||||
)
|
||||
|
||||
return await _can_object_call_model(
|
||||
model=model,
|
||||
llm_router=llm_router,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue