Skip to content

vllm.entrypoints.launchers.launcher

Classes:

  • NoSignalServer –

    Uvicorn server that never installs its own SIGINT/SIGTERM handlers.

Functions:

  • serve_http –

    Start a FastAPI app using Uvicorn, with support for custom Uvicorn config

  • setup_server –

    Validate API server args and create the server socket.

  • terminate_if_errored –

    See discussions here on shutting down a uvicorn server

  • watchdog_loop –

    Watchdog task that runs in the background, checking

NoSignalServer

Bases: Server

Uvicorn server that never installs its own SIGINT/SIGTERM handlers.

Callers register their own handlers on the event loop for graceful shutdown; uvicorn's would race with and override them (see #49668).

With peer_loads (several API workers on one shared socket: a shared array with one slot per worker, and this worker's index), each worker publishes its number of open connections, and a pending connection is accepted by the least loaded worker. The event loop's own server would accept every queued connection in whichever worker wakes first.

serve_http(app, sock, enable_ssl_refresh=False, peer_loads=None, **uvicorn_kwargs) async

Start a FastAPI app using Uvicorn, with support for custom Uvicorn config options. Supports http header limits via h11_max_incomplete_event_size and h11_max_header_count.

setup_server(args, *, reuse_port)

Validate API server args and create the server socket.

terminate_if_errored(server, engine)

See discussions here on shutting down a uvicorn server https://github.com/encode/uvicorn/discussions/1103 In this case we cannot await the server shutdown here because handler must first return to close the connection for this request.

watchdog_loop(server, engine) async

Watchdog task that runs in the background, checking

for error state in the engine. Needed to trigger shutdown

if an exception arises is StreamingResponse() generator.