Skip to content

Commit 72a8553

Browse files
authored
[Bugfix] Remove the duplicate api registration in vllm-omni (vllm-project#880)
Signed-off-by: Chenguang ZHENG <645327136@qq.com>
1 parent 25b08b3 commit 72a8553

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

vllm_omni/entrypoints/openai/api_server.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,14 @@ def Omnispeech(request: Request) -> OmniOpenAIServingSpeech | None:
631631
return request.app.state.openai_serving_speech
632632

633633

634+
# Remove the original /v1/chat/completions route before registering our own
635+
# This prevents duplicate route registration warnings in FastAPI logs.
636+
for route in router.routes[:]:
637+
if hasattr(route, "path") and route.path == "/v1/chat/completions":
638+
router.routes.remove(route)
639+
break
640+
641+
634642
@router.post(
635643
"/v1/chat/completions",
636644
dependencies=[Depends(validate_json_request)],

0 commit comments

Comments
 (0)