Skip to content

Commit 76cbebe

Browse files
committed
fix(request): loop through model_names
1 parent 55ae3da commit 76cbebe

File tree

1 file changed

+16
-20
lines changed
  • src/vllm_router/services/request_service

1 file changed

+16
-20
lines changed

src/vllm_router/services/request_service/request.py

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -585,22 +585,16 @@ async def route_general_transcriptions(
585585

586586
endpoints = service_discovery.get_endpoint_info()
587587

588-
logger.debug("==== Total endpoints ====")
589-
logger.debug(endpoints)
590-
logger.debug("==== Total endpoints ====")
591-
592-
# filter the endpoints url by model name and label for transcriptions
593-
transcription_endpoints = [
594-
ep
595-
for ep in endpoints
596-
if model == ep.model_name
597-
and ep.model_label == "transcription"
598-
and not ep.sleep # Added ep.sleep == False
599-
]
600-
601-
logger.debug("====List of transcription endpoints====")
602-
logger.debug(transcription_endpoints)
603-
logger.debug("====List of transcription endpoints====")
588+
# filter the endpoints url by model name and model label for transcriptions
589+
transcription_endpoints = []
590+
for ep in endpoints:
591+
for model_name in ep.model_names:
592+
if (
593+
model == model_name
594+
and ep.model_label == "transcription"
595+
and not ep.sleep
596+
):
597+
transcription_endpoints.append(ep)
604598

605599
if not transcription_endpoints:
606600
logger.error("No transcription backend available for model %s", model)
@@ -640,10 +634,6 @@ async def route_general_transcriptions(
640634

641635
logger.info("Proxying transcription request for model %s to %s", model, chosen_url)
642636

643-
logger.debug("==== data payload keys ====")
644-
logger.debug(list(data.keys()))
645-
logger.debug("==== data payload keys ====")
646-
647637
try:
648638
client = request.app.state.aiohttp_client_wrapper()
649639

@@ -707,3 +697,9 @@ async def route_general_transcriptions(
707697
status_code=503,
708698
content={"error": f"Failed to connect to backend: {str(client_error)}"},
709699
)
700+
except Exception as e:
701+
logger.error(e)
702+
return JSONResponse(
703+
status_code=500,
704+
content={"error": "Internal server error"},
705+
)

0 commit comments

Comments
 (0)