From f796036af031f5b340432e8f2f0fb447fafd4aee Mon Sep 17 00:00:00 2001 From: Ryan Crabbe Date: Thu, 16 Apr 2026 13:52:39 -0700 Subject: [PATCH] feat(proxy): add --reload flag for uvicorn hot reload (dev only) Opt-in CLI flag, off by default, no env var. Only affects the uvicorn run path; gunicorn/hypercorn paths and prod (which doesn't pass the flag) are unaffected. --- litellm/proxy/proxy_cli.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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", ) +@click.option( + "--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,