Skip to content

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]

feat: fix linting errors

Krrish Dholakia9145e8db77f5
diff --git a/litellm/proxy/management_endpoints/internal_user_endpoints.py b/litellm/proxy/management_endpoints/internal_user_endpoints.py
index fd627a4f5b7..a638f4c7438 100644
--- a/litellm/proxy/management_endpoints/internal_user_endpoints.py
+++ b/litellm/proxy/management_endpoints/internal_user_endpoints.py
@@ -15,7 +15,7 @@ import asyncio
import traceback
import uuid
from datetime import datetime, timedelta, timezone
-from typing import Any, List, Optional, Union
+from typing import Any, List, Optional, Union, cast
import fastapi
from fastapi import APIRouter, Depends, Header, HTTPException, Request, status
@@ -743,7 +743,7 @@ async def user_update(
**existing_user_row.model_dump(exclude_none=True)
)
- existing_metadata = existing_user_row.metadata if existing_user_row else {}
+ existing_metadata = cast(Dict, getattr(existing_user_row, "metadata", {}) or {})
non_default_values = prepare_metadata_fields(
data=data,
diff --git a/litellm/proxy/management_endpoints/model_management_endpoints.py b/litellm/proxy/management_endpoints/model_management_endpoints.py
index 861869c145b..cf4696fff19 100644
--- a/litellm/proxy/management_endpoints/model_management_endpoints.py
+++ b/litellm/proxy/management_endpoints/model_management_endpoints.py
@@ -350,7 +350,14 @@ async def delete_model(
model_info: ModelInfoDelete,
user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
):
- global llm_router, llm_model_list, general_settings, user_config_file_path, proxy_config
+ from litellm.proxy.proxy_server import (
+ general_settings,
+ llm_model_list,
+ llm_router,
+ proxy_config,
+ user_config_file_path,
+ )
+
try:
"""
[BETA] - This is a beta endpoint, format might change based on user feedback. - https://github.com/BerriAI/litellm/issues/964