vllm.entrypoints.openai.api_server ¶
parser module-attribute ¶
parser = FlexibleArgumentParser(
description="vLLM OpenAI-Compatible RESTful API server."
)
build_app ¶
build_app(
args: Namespace,
supported_tasks: tuple[SupportedTask, ...],
) -> FastAPI
Source code in vllm/entrypoints/openai/api_server.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
build_async_engine_client async ¶
build_async_engine_client(
args: Namespace,
*,
usage_context: UsageContext = OPENAI_API_SERVER,
disable_frontend_multiprocessing: bool | None = None,
client_config: dict[str, Any] | None = None,
) -> AsyncIterator[EngineClient]
Source code in vllm/entrypoints/openai/api_server.py
build_async_engine_client_from_engine_args async ¶
build_async_engine_client_from_engine_args(
engine_args: AsyncEngineArgs,
*,
usage_context: UsageContext = OPENAI_API_SERVER,
disable_frontend_multiprocessing: bool = False,
client_config: dict[str, Any] | None = None,
) -> AsyncIterator[EngineClient]
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/openai/api_server.py
create_server_socket ¶
Source code in vllm/entrypoints/openai/api_server.py
create_server_unix_socket ¶
init_app_state async ¶
init_app_state(
engine_client: EngineClient,
state: State,
args: Namespace,
supported_tasks: tuple[SupportedTask, ...],
) -> None
Source code in vllm/entrypoints/openai/api_server.py
run_server async ¶
Run a single-worker API server.
Source code in vllm/entrypoints/openai/api_server.py
run_server_worker async ¶
Run a single API server worker.
Source code in vllm/entrypoints/openai/api_server.py
setup_server ¶
Validate API server args, set up signal handler, create socket ready to serve.