Skip to content

Commit ff7d11c

Browse files
allozaurServeurpersoCom
authored andcommitted
fix: Fetching props for only loaded models in ROUTER mode
1 parent fa4a17f commit ff7d11c

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
@@ -295,14 +295,21 @@ class ModelsStore {
295295
* Fetch props for a specific model from /props endpoint
296296
* Uses caching to avoid redundant requests
297297
*
298+
* In ROUTER mode, this will only fetch props if the model is loaded,
299+
* since unloaded models return 400 from /props endpoint.
300+
*
298301
* @param modelId - Model identifier to fetch props for
299-
* @returns Props data or null if fetch failed
302+
* @returns Props data or null if fetch failed or model not loaded
300303
*/
301304
async fetchModelProps(modelId: string): Promise<ApiLlamaCppServerProps | null> {
302305
// Return cached props if available
303306
const cached = this.modelPropsCache.get(modelId);
304307
if (cached) return cached;
305308

309+
if (serverStore.isRouterMode && !this.isModelLoaded(modelId)) {
310+
return null;
311+
}
312+
306313
// Avoid duplicate fetches
307314
if (this.modelPropsFetching.has(modelId)) return null;
308315

0 commit comments

Comments
 (0)