@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / a75a5b54c7
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 8, 16:30 UTC

[bug-fix] supported_tasks is breaking backward compatibility at init_app_state (#34027)

Signed-off-by: Kourosh Hakhamaneshi <kourosh@anyscale.com> Signed-off-by: kourosh hakhamaneshi <31483498+kouroshHakha@users.noreply.github.com> Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com>

kourosh hakhamaneshi committed Feb 8, 2026 at 17:46 UTC a75a5b54c7f76bc2e15d3025d61e63cc91c7b0d7
1 file changed +26 -2
vllm/entrypoints/openai/api_server.py
+26 -2
@@ -8,6 +8,7 @@ import os
8 import signal
9 import socket
10 import tempfile
11 +import warnings
12 from argparse import Namespace
13 from collections.abc import AsyncIterator
14 from contextlib import asynccontextmanager
@@ -62,6 +63,8 @@ prometheus_multiproc_dir: tempfile.TemporaryDirectory
63 # Cannot use __name__ (https://github.com/vllm-project/vllm/pull/4765)
64 logger = init_logger("vllm.entrypoints.openai.api_server")
65
66 +_FALLBACK_SUPPORTED_TASKS: tuple[SupportedTask, ...] = ("generate",)
67 +
68
69 @asynccontextmanager
70 async def build_async_engine_client(
@@ -152,7 +155,19 @@ async def build_async_engine_client_from_engine_args(
155 async_llm.shutdown()
156
157
155 -def build_app(args: Namespace, supported_tasks: tuple["SupportedTask", ...]) -> FastAPI:
158 +def build_app(
159 + args: Namespace, supported_tasks: tuple["SupportedTask", ...] | None = None
160 +) -> FastAPI:
161 + if supported_tasks is None:
162 + warnings.warn(
163 + "The 'supported_tasks' parameter was not provided to "
164 + "build_app and will be required in a future version. "
165 + "Defaulting to ('generate',).",
166 + DeprecationWarning,
167 + stacklevel=2,
168 + )
169 + supported_tasks = _FALLBACK_SUPPORTED_TASKS
170 +
171 if args.disable_fastapi_docs:
172 app = FastAPI(
173 openapi_url=None, docs_url=None, redoc_url=None, lifespan=lifespan
@@ -263,9 +278,18 @@ async def init_app_state(
278 engine_client: EngineClient,
279 state: State,
280 args: Namespace,
266 - supported_tasks: tuple["SupportedTask", ...],
281 + supported_tasks: tuple["SupportedTask", ...] | None = None,
282 ) -> None:
283 vllm_config = engine_client.vllm_config
284 + if supported_tasks is None:
285 + warnings.warn(
286 + "The 'supported_tasks' parameter was not provided to "
287 + "init_app_state and will be required in a future version. "
288 + "Please pass 'supported_tasks' explicitly.",
289 + DeprecationWarning,
290 + stacklevel=2,
291 + )
292 + supported_tasks = _FALLBACK_SUPPORTED_TASKS
293
294 if args.served_model_name is not None:
295 served_model_names = args.served_model_name