The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(proxy/_types.py): handle user_email=None
Krrish Dholakia2d1082f52012
diff --git a/litellm/proxy/_new_secret_config.yaml b/litellm/proxy/_new_secret_config.yamlindex afb1b7b3aa7..cd49647464b 100644--- a/litellm/proxy/_new_secret_config.yaml+++ b/litellm/proxy/_new_secret_config.yaml@@ -18,4 +18,9 @@ router_settings:general_settings:enable_jwt_auth: Truelitellm_jwtauth:- admin_jwt_scope: "ai.admin"\ No newline at end of file+ admin_jwt_scope: "ai.admin"+ # team_id_jwt_field: "client_id" # 👈 CAN BE ANY FIELD+ user_id_jwt_field: "sub" # 👈 CAN BE ANY FIELD+ org_id_jwt_field: "org_id" # 👈 CAN BE ANY FIELD+ end_user_id_jwt_field: "customer_id" # 👈 CAN BE ANY FIELD+ user_id_upsert: True\ No newline at end of filediff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.pyindex 255e37186df..220a0d5ddbe 100644--- a/litellm/proxy/_types.py+++ b/litellm/proxy/_types.py@@ -1631,7 +1631,7 @@ class LiteLLM_UserTable(LiteLLMPydanticObjectBase):class LiteLLM_UserTableFiltered(BaseModel): # done to avoid exposing sensitive datauser_id: str- user_email: str+ user_email: Optional[str] = Noneclass LiteLLM_UserTableWithKeyCount(LiteLLM_UserTable):diff --git a/litellm/proxy/management_endpoints/internal_user_endpoints.py b/litellm/proxy/management_endpoints/internal_user_endpoints.pyindex 43d8273dee5..e9be169cdcb 100644--- a/litellm/proxy/management_endpoints/internal_user_endpoints.py+++ b/litellm/proxy/management_endpoints/internal_user_endpoints.py@@ -1240,4 +1240,5 @@ async def ui_view_users(return [LiteLLM_UserTableFiltered(**user.model_dump()) for user in users]except Exception as e:+ verbose_proxy_logger.exception(f"Error searching users: {str(e)}")raise HTTPException(status_code=500, detail=f"Error searching users: {str(e)}")