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
feat(schema): add additional indexes to LiteLLM_SpendLogs for improved query performance (#11675)
Cole McIntosh2a7f113fde0a
diff --git a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma b/litellm-proxy-extras/litellm_proxy_extras/schema.prismaindex 8088edf29ed..ac8834018d3 100644--- a/litellm-proxy-extras/litellm_proxy_extras/schema.prisma+++ b/litellm-proxy-extras/litellm_proxy_extras/schema.prisma@@ -266,6 +266,9 @@ model LiteLLM_SpendLogs {@@index([startTime])@@index([end_user])@@index([session_id])+ @@index([model_group, cache_hit, startTime, api_base])+ @@index([model_group, cache_hit, api_key, startTime])+ @@index([model_group, cache_hit, end_user, startTime])}// View spend, model, api_key per requestdiff --git a/litellm/proxy/schema.prisma b/litellm/proxy/schema.prismaindex dc16a0ceaf0..78266fe4388 100644--- a/litellm/proxy/schema.prisma+++ b/litellm/proxy/schema.prisma@@ -265,6 +265,9 @@ model LiteLLM_SpendLogs {@@index([startTime])@@index([end_user])@@index([session_id])+ @@index([model_group, cache_hit, startTime, api_base])+ @@index([model_group, cache_hit, api_key, startTime])+ @@index([model_group, cache_hit, end_user, startTime])}// View spend, model, api_key per requestdiff --git a/schema.prisma b/schema.prismaindex 032b9e0b58d..0b5cecd69d4 100644--- a/schema.prisma+++ b/schema.prisma@@ -265,6 +265,9 @@ model LiteLLM_SpendLogs {@@index([startTime])@@index([end_user])@@index([session_id])+ @@index([model_group, cache_hit, startTime, api_base])+ @@index([model_group, cache_hit, api_key, startTime])+ @@index([model_group, cache_hit, end_user, startTime])}// View spend, model, api_key per request