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: fix linting error
Krrish Dholakiadee5182fc841
diff --git a/litellm/proxy/management_endpoints/common_daily_activity.py b/litellm/proxy/management_endpoints/common_daily_activity.pyindex d5de85311b7..94cff2489d8 100644--- a/litellm/proxy/management_endpoints/common_daily_activity.py+++ b/litellm/proxy/management_endpoints/common_daily_activity.py@@ -101,6 +101,19 @@ def update_breakdown_metrics(return breakdown+async def get_api_key_metadata(+ prisma_client: PrismaClient,+ api_keys: set[str],+) -> Dict[str, Dict[str, Any]]:+ """Update api key metadata for a single record."""+ key_records = await prisma_client.db.litellm_verificationtoken.find_many(+ where={"token": {"in": list(api_keys)}}+ )+ return {+ k.token: {"key_alias": k.key_alias, "team_id": k.team_id} for k in key_records+ }++async def get_daily_activity(prisma_client: Optional[PrismaClient],table_name: str,@@ -177,15 +190,7 @@ async def get_daily_activity(model_metadata: Dict[str, Dict[str, Any]] = {}provider_metadata: Dict[str, Dict[str, Any]] = {}if api_keys:- key_records = await prisma_client.db.litellm_verificationtoken.find_many(- where={"token": {"in": list(api_keys)}}- )- api_key_metadata.update(- {- k.token: {"key_alias": k.key_alias, "team_id": k.team_id}- for k in key_records- }- )+ api_key_metadata = await get_api_key_metadata(prisma_client, api_keys)# Process resultsresults = []diff --git a/litellm/proxy/management_endpoints/internal_user_endpoints.py b/litellm/proxy/management_endpoints/internal_user_endpoints.pyindex e2f1077095f..42a5dd7e813 100644--- a/litellm/proxy/management_endpoints/internal_user_endpoints.py+++ b/litellm/proxy/management_endpoints/internal_user_endpoints.py@@ -36,8 +36,6 @@ from litellm.proxy.management_helpers.utils import management_endpoint_wrapperfrom litellm.proxy.utils import handle_exception_on_proxyfrom litellm.types.proxy.management_endpoints.common_daily_activity import (BreakdownMetrics,- DailySpendData,- DailySpendMetadata,KeyMetadata,KeyMetricWithMetadata,LiteLLM_DailyUserSpend,