[Bugfix] Remove the duplicate api registration in vllm-omni (#880)

Signed-off-by: Chenguang ZHENG <645327136@qq.com>
This commit is contained in:
Chenguang Zheng authored and GitHub committed 2026-01-21 07:00:31 +00:00
1 parent 25b08b3371
commit 72a8553310
1 file changed
+8
@@ -631,6 +631,14 @@ def Omnispeech(request: Request) -> OmniOpenAIServingSpeech | None:
return request.app.state.openai_serving_speech
# Remove the original /v1/chat/completions route before registering our own
# This prevents duplicate route registration warnings in FastAPI logs.
for route in router.routes[:]:
if hasattr(route, "path") and route.path == "/v1/chat/completions":
router.routes.remove(route)
break
@router.post(
"/v1/chat/completions",
dependencies=[Depends(validate_json_request)],