From 76c81f97d7cf6ecd9fa66ac7e577123ea7f3d53e Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 10 Jan 2025 19:03:14 -0800 Subject: [PATCH] uvicorn allow setting num workers (#7681) --- litellm/proxy/proxy_cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/proxy_cli.py b/litellm/proxy/proxy_cli.py index 8f89bb557a..6cc94fd7b4 100644 --- a/litellm/proxy/proxy_cli.py +++ b/litellm/proxy/proxy_cli.py @@ -68,7 +68,7 @@ def is_port_in_use(port): @click.option( "--num_workers", default=1, - help="Number of gunicorn workers to spin up", + help="Number of uvicorn / gunicorn workers to spin up. By default, 1 uvicorn is used.", envvar="NUM_WORKERS", ) @click.option("--api_base", default=None, help="API base URL.") @@ -653,7 +653,7 @@ def run_server( # noqa: PLR0915 from litellm.proxy.proxy_server import app # noqa uvicorn_args = { - "app": app, + "app": "litellm.proxy.proxy_server:app", "host": host, "port": port, } @@ -674,6 +674,7 @@ def run_server( # noqa: PLR0915 uvicorn.run( **uvicorn_args, loop="uvloop", + workers=num_workers, ) elif run_gunicorn is True: # Gunicorn Application Class