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: add fix for migration issue and and stable linux debain (#19843)
Harshit Jain54a83e75cc0a
diff --git a/litellm-proxy-extras/litellm_proxy_extras/migrations/20251119131227_add_prompt_versioning/migration.sql b/litellm-proxy-extras/litellm_proxy_extras/migrations/20251119131227_add_prompt_versioning/migration.sqlindex a9d9528bd24..43eb2401422 100644--- a/litellm-proxy-extras/litellm_proxy_extras/migrations/20251119131227_add_prompt_versioning/migration.sql+++ b/litellm-proxy-extras/litellm_proxy_extras/migrations/20251119131227_add_prompt_versioning/migration.sql@@ -1,12 +1,12 @@-- DropIndex-DROP INDEX "LiteLLM_PromptTable_prompt_id_key";+DROP INDEX IF EXISTS "LiteLLM_PromptTable_prompt_id_key";-- AlterTable-ALTER TABLE "LiteLLM_PromptTable" ADD COLUMN "version" INTEGER NOT NULL DEFAULT 1;+ALTER TABLE "LiteLLM_PromptTable"+ADD COLUMN "version" INTEGER NOT NULL DEFAULT 1;-- CreateIndex-CREATE INDEX "LiteLLM_PromptTable_prompt_id_idx" ON "LiteLLM_PromptTable"("prompt_id");+CREATE INDEX "LiteLLM_PromptTable_prompt_id_idx" ON "LiteLLM_PromptTable" ("prompt_id");-- CreateIndex-CREATE UNIQUE INDEX "LiteLLM_PromptTable_prompt_id_version_key" ON "LiteLLM_PromptTable"("prompt_id", "version");-+CREATE UNIQUE INDEX "LiteLLM_PromptTable_prompt_id_version_key" ON "LiteLLM_PromptTable" ("prompt_id", "version");\ No newline at end of filediff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.pyindex 183c25ed463..4c8f31e9306 100644--- a/litellm/proxy/proxy_server.py+++ b/litellm/proxy/proxy_server.py@@ -5098,7 +5098,20 @@ class ProxyStartupEvent:except Exception as e:raise e- await prisma_client.connect()+ try:+ await prisma_client.connect()+ except Exception as e:+ if "P3018" in str(e) or "P3009" in str(e):+ verbose_proxy_logger.debug(+ "CRITICAL: DATABASE MIGRATION FAILED"+ )+ verbose_proxy_logger.debug(+ "Your database is in a 'dirty' state."+ )+ verbose_proxy_logger.debug(+ "FIX: Run 'prisma migrate resolve --applied <migration_name>'"+ )+ raise e## Start RDS IAM token refresh background task if enabled ### This proactively refreshes IAM tokens before they expire,diff --git a/litellm/proxy/schema.prisma b/litellm/proxy/schema.prismaindex d7aa6e9f0d0..d46c2db763c 100644--- a/litellm/proxy/schema.prisma+++ b/litellm/proxy/schema.prisma@@ -5,6 +5,7 @@ datasource client {generator client {provider = "prisma-client-py"+ binaryTargets = ["native", "debian-openssl-1.1.x", "debian-openssl-3.0.x", "linux-musl", "linux-musl-openssl-3.0.x"]}// Budget / Rate Limits for an org