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]

Fix proxy_cli.py: avoid overriding DATABASE_URL when it’s already provided. (#11076)

Martin Liud4eec9558bc5
diff --git a/litellm/proxy/proxy_cli.py b/litellm/proxy/proxy_cli.py
index 4c022991f11..0a9ff2f064b 100644
--- a/litellm/proxy/proxy_cli.py
+++ b/litellm/proxy/proxy_cli.py
@@ -659,7 +659,7 @@ def run_server( # noqa: PLR0915
**key_management_settings
)
database_url = general_settings.get("database_url", None)
- if database_url is None:
+ if database_url is None and os.getenv("DATABASE_URL") is None:
# Check if all required variables are provided
database_host = os.getenv("DATABASE_HOST")
database_username = os.getenv("DATABASE_USERNAME")