vllm.entrypoints.openai.api_server
¶
Functions:
-
build_and_serve–Build FastAPI app, initialize state, and start serving.
-
build_and_serve_renderer–Build FastAPI app for a CPU-only render server, initialize state, and
-
build_async_engine_client_from_engine_args–Create EngineClient, either:
-
init_render_app_state–Initialise FastAPI app state for a CPU-only render server.
-
run_server–Run a single-worker API server.
-
run_server_worker–Run a single API server worker.
-
setup_server–Validate API server args and create the server socket.
build_and_serve(engine_client, listen_address, sock, args, peer_loads=None, **uvicorn_kwargs)
async
¶
Build FastAPI app, initialize state, and start serving.
Returns the shutdown task for the caller to await.
Source code in vllm/entrypoints/launchers/api_server/entry.py
build_and_serve_renderer(vllm_config, listen_address, sock, args, **uvicorn_kwargs)
async
¶
Build FastAPI app for a CPU-only render server, initialize state, and start serving.
Returns the shutdown task for the caller to await.
Source code in vllm/entrypoints/launchers/render/entry.py
build_async_engine_client_from_engine_args(engine_args, *, usage_context=UsageContext.OPENAI_API_SERVER, client_config=None)
async
¶
Create EngineClient, either: - in-process using the AsyncLLMEngine Directly - multiprocess using AsyncLLMEngine RPC
Returns the Client or None if the creation failed.
Source code in vllm/entrypoints/launchers/api_server/entry.py
init_render_app_state(vllm_config, state, args)
async
¶
Initialise FastAPI app state for a CPU-only render server.
Unlike init_app_state this function does not require an
EngineClient; it bootstraps the
preprocessing pipeline (renderer, input_processor)
directly from the VllmConfig.
Source code in vllm/entrypoints/launchers/render/app_state.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
run_server(args, **uvicorn_kwargs)
async
¶
Run a single-worker API server.
Source code in vllm/entrypoints/launchers/api_server/entry.py
run_server_worker(listen_address, sock, args, client_config=None, **uvicorn_kwargs)
async
¶
Run a single API server worker.
Source code in vllm/entrypoints/launchers/api_server/entry.py
setup_server(args, *, reuse_port)
¶
Validate API server args and create the server socket.