mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
uvicorn allow setting num workers (#7681)
This commit is contained in:
parent
5c870c0c51
commit
9ac18caf24
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue