Skip to content

Commit 9a2cb02

Browse files
allozaurServeurpersoCom
authored andcommitted
fix: Fetching props for only loaded models in ROUTER mode
1 parent 47f85e3 commit 9a2cb02

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tools/server/webui/src/lib/stores/models.svelte.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,21 @@ class ModelsStore {
279279
* Fetch props for a specific model from /props endpoint
280280
* Uses caching to avoid redundant requests
281281
*
282+
* In ROUTER mode, this will only fetch props if the model is loaded,
283+
* since unloaded models return 400 from /props endpoint.
284+
*
282285
* @param modelId - Model identifier to fetch props for
283-
* @returns Props data or null if fetch failed
286+
* @returns Props data or null if fetch failed or model not loaded
284287
*/
285288
async fetchModelProps(modelId: string): Promise<ApiLlamaCppServerProps | null> {
286289
// Return cached props if available
287290
const cached = this.modelPropsCache.get(modelId);
288291
if (cached) return cached;
289292

293+
if (serverStore.isRouterMode && !this.isModelLoaded(modelId)) {
294+
return null;
295+
}
296+
290297
// Avoid duplicate fetches
291298
if (this.modelPropsFetching.has(modelId)) return null;
292299

0 commit comments

Comments
 (0)