From b6d6e270b49e72a49c3f8a6496a8e965e8eb55c6 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Tue, 25 Feb 2025 14:51:57 -0800 Subject: [PATCH] can_team_access_model --- litellm/proxy/auth/handle_jwt.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/auth/handle_jwt.py b/litellm/proxy/auth/handle_jwt.py index 29f4b31f9c..248d553662 100644 --- a/litellm/proxy/auth/handle_jwt.py +++ b/litellm/proxy/auth/handle_jwt.py @@ -33,6 +33,7 @@ from litellm.proxy._types import ( ScopeMapping, Span, ) +from litellm.proxy.auth.auth_checks import can_team_access_model from litellm.proxy.utils import PrismaClient, ProxyLogging from .auth_checks import ( @@ -723,8 +724,12 @@ class JWTAuthManager: team_models = team_object.models if isinstance(team_models, list) and ( not requested_model - or requested_model in team_models - or "*" in team_models + or can_team_access_model( + model=requested_model, + team_object=team_object, + llm_router=None, + team_model_aliases=None, + ) ): is_allowed = allowed_routes_check( user_role=LitellmUserRoles.TEAM,