diff --git a/vllm_omni/config/endpoint_policy.py b/vllm_omni/config/endpoint_policy.py index 06731603e..af53b8691 100644 --- a/vllm_omni/config/endpoint_policy.py +++ b/vllm_omni/config/endpoint_policy.py @@ -8,7 +8,14 @@ from typing import NamedTuple from fastapi import FastAPI, Request from fastapi.responses import JSONResponse -from vllm.entrypoints.serve import create_error_response + +# vLLM < 0.28 keeps create_error_response under serve.utils (it is not +# re-exported from vllm.entrypoints.serve); 0.28+ moved it under +# serve.exception_handling and re-exports it from the package root. +try: + from vllm.entrypoints.serve import create_error_response +except ImportError: + from vllm.entrypoints.serve.utils.error_response import create_error_response class RouteTarget(NamedTuple): diff --git a/vllm_omni/entrypoints/openai/api_server.py b/vllm_omni/entrypoints/openai/api_server.py index cee98a3ac..1e55d4476 100755 --- a/vllm_omni/entrypoints/openai/api_server.py +++ b/vllm_omni/entrypoints/openai/api_server.py @@ -64,7 +64,14 @@ from vllm.entrypoints.pooling.embed.serving import ServingEmbedding as OpenAISer from vllm.entrypoints.pooling.pooling.serving import ServingPooling from vllm.entrypoints.pooling.scoring.serving import ServingScores from vllm.entrypoints.scale_out.token_in_token_out.serving import ServingTokens -from vllm.entrypoints.serve import create_error_response + +# vLLM < 0.28 keeps create_error_response under serve.utils (it is not +# re-exported from vllm.entrypoints.serve); 0.28+ moved it under +# serve.exception_handling and re-exports it from the package root. +try: + from vllm.entrypoints.serve import create_error_response +except ImportError: + from vllm.entrypoints.serve.utils.error_response import create_error_response # vLLM moved `base` from openai.basic.api_router to serve.instrumentator.basic. # Keep a fallback for older/newer upstream layouts during rebase windows.