Skip to content

[Bug Fix] Auth Check, Fix typing to ensure case where model is None is handled #10170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions litellm/proxy/auth/auth_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async def common_checks(
9. Check if request body is safe
10. [OPTIONAL] Organization checks - is user_object.organization_id is set, run these checks
"""
_model = request_body.get("model", None)
_model: Optional[str] = cast(Optional[str], request_body.get("model", None))

# 1. If team is blocked
if team_object is not None and team_object.blocked is True:
Expand All @@ -112,7 +112,7 @@ async def common_checks(
)

## 2.1 If user can call model (if personal key)
if team_object is None and user_object is not None:
if _model and team_object is None and user_object is not None:
await can_user_call_model(
model=_model,
llm_router=llm_router,
Expand Down
Loading