Merge pull request #25901 from BerriAI/litellm_feat-add-reload-flag-proxy

feat(proxy): add --reload flag for uvicorn hot reload (dev only)
This commit is contained in:
ryan-crabbe-berri 2026-04-20 08:48:21 -07:00 • committed by GitHub
commit ea12bae9a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,