diff --git a/litellm/proxy/auth/handle_jwt.py b/litellm/proxy/auth/handle_jwt.py index bfccace9f85..046755305a9 100644 --- a/litellm/proxy/auth/handle_jwt.py +++ b/litellm/proxy/auth/handle_jwt.py @@ -2061,8 +2061,9 @@ class JWTAuthManager: raise HTTPException( status_code=403, detail=( - f"No team has access to the requested model: {requested_model}. " - f"Checked teams={user_team_ids}. Check `/models` to see all available models." + f"No team you are a member of has access to the requested " + f"model: {requested_model}. Check `/models` to see the models " + f"available to you." ), ) raise HTTPException( diff --git a/tests/test_litellm/proxy/auth/test_handle_jwt.py b/tests/test_litellm/proxy/auth/test_handle_jwt.py index 3573850a0f9..23c616ad5c4 100644 --- a/tests/test_litellm/proxy/auth/test_handle_jwt.py +++ b/tests/test_litellm/proxy/auth/test_handle_jwt.py @@ -5020,6 +5020,7 @@ async def test_resolve_db_team_fallback_distinguishes_no_membership_vs_model_den assert model_denied.value.status_code == 403 assert "requested model" in model_denied.value.detail assert "gpt-4" in model_denied.value.detail + assert "only_team" not in model_denied.value.detail assert no_member.value.status_code == 403 assert "not a member of any team" in no_member.value.detail