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(proxy): add --reload flag for uvicorn hot reload (dev only)

Ryan Crabbef796036af031
diff --git a/litellm/proxy/proxy_cli.py b/litellm/proxy/proxy_cli.py
index c638e294268..f1e5938c1f4 100644
--- a/litellm/proxy/proxy_cli.py
+++ b/litellm/proxy/proxy_cli.py
@@ -577,6 +577,12 @@ class ProxyInitializationHelpers:
help="Exit with error if database migration fails on startup.",
envvar="ENFORCE_PRISMA_MIGRATION_CHECK",
)
+ "--reload",
+ is_flag=True,
+ default=False,
+ help="Enable uvicorn hot reload (dev only). Incompatible with --num_workers>1, --run_gunicorn, and --run_hypercorn.",
+)
def run_server( # noqa: PLR0915
host,
port,
@@ -618,6 +624,7 @@ def run_server( # noqa: PLR0915
keepalive_timeout,
max_requests_before_restart,
enforce_prisma_migration_check: bool,
+ reload: bool,
):
if setup:
from litellm.setup_wizard import run_setup_wizard
@@ -954,6 +961,9 @@ def run_server( # noqa: PLR0915
if loop_type:
uvicorn_args["loop"] = loop_type
+ if reload:
+ uvicorn_args["reload"] = True
+
uvicorn.run(
**uvicorn_args,
workers=num_workers,