[BUG] Frontend progress SSE stream uses wrong ID — never receives loading updates #16

Closed
opened 2026-05-08 23:46:32 +00:00 by Mark · 0 comments
Owner

Summary

The frontend loading progress stream in src/hooks/useModelContainers.ts constructs a synthetic processId (derived from backend+repo+containerId) and uses it to subscribe to the SSE progress endpoint. However, the backend progress router at GET /api/models/{model_id}/progress expects the database model ID (the 7-character hex ID), not this derived process ID. As a result, the SSE connection never receives progress events.

Affected File

src/hooks/useModelContainers.ts lines 87-101

Root Cause

// Constructs a fake processId instead of using the model database ID
const processId = `${model.backend}-${model.hfRepo.replace(/\//g, \"-\").replace(/:/g, \"-\")}-${model.containerId || \"\"}`;

// This connects to /api/models/{processId}/progress
// But the backend expects /api/models/{model.id}/progress
const cleanup = createProgressStream(processId, ...)

The backend stream_model_progress() looks up the model by model_id in the database, which is a short hex string like "a1b2c3d". The constructed processId looks like "vllm-meta-llama-Llama-3-8B-Instruct-" which will never match.

Expected Behavior

Pass model.id (the database ID) instead of the constructed processId:

const cleanup = createProgressStream(model.id, ...)
## Summary The frontend loading progress stream in `src/hooks/useModelContainers.ts` constructs a synthetic `processId` (derived from backend+repo+containerId) and uses it to subscribe to the SSE progress endpoint. However, the backend progress router at `GET /api/models/{model_id}/progress` expects the **database model ID** (the 7-character hex ID), not this derived process ID. As a result, the SSE connection never receives progress events. ## Affected File `src/hooks/useModelContainers.ts` lines 87-101 ## Root Cause ```typescript // Constructs a fake processId instead of using the model database ID const processId = `${model.backend}-${model.hfRepo.replace(/\//g, \"-\").replace(/:/g, \"-\")}-${model.containerId || \"\"}`; // This connects to /api/models/{processId}/progress // But the backend expects /api/models/{model.id}/progress const cleanup = createProgressStream(processId, ...) ``` The backend `stream_model_progress()` looks up the model by `model_id` in the database, which is a short hex string like `"a1b2c3d"`. The constructed processId looks like `"vllm-meta-llama-Llama-3-8B-Instruct-"` which will never match. ## Expected Behavior Pass `model.id` (the database ID) instead of the constructed processId: ```typescript const cleanup = createProgressStream(model.id, ...) ```
Mark 2026-05-26 20:15:09 +00:00
Sign in to join this conversation.
No description provided.