From 58f67b04d5e09a7124a7b896b0f57c290393ae5e Mon Sep 17 00:00:00 2001 From: Yassin Kortam Date: Mon, 8 Jun 2026 17:26:14 -0700 Subject: [PATCH] fix(identity): drop module-level fastapi import from store store.py lives outside proxy/ but is re-exported by litellm/identity/__init__, so importing the identity package pulled fastapi at module load and broke SDK-only installs that omit the proxy extras. Use http.HTTPStatus for the 401 code instead; the value is unchanged (Greptile review finding). --- litellm/identity/store.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/litellm/identity/store.py b/litellm/identity/store.py index d16d1e56d20..4d9e6e2f8a3 100644 --- a/litellm/identity/store.py +++ b/litellm/identity/store.py @@ -7,10 +7,9 @@ carrier. from __future__ import annotations +from http import HTTPStatus from typing import TYPE_CHECKING, Optional -from fastapi import status - from litellm.identity.principal import classify_principal_kind from litellm.integrations.otel.model.spans import SpanRole from litellm.integrations.otel.runtime import traced @@ -144,7 +143,7 @@ async def load_identity( ), type=ProxyErrorTypes.token_not_found_in_db, param="key", - code=status.HTTP_401_UNAUTHORIZED, + code=HTTPStatus.UNAUTHORIZED, ) await cache.set(hashed_token, uak)