From 48a6166a570cbfe9eb323b4b55c40de60b906898 Mon Sep 17 00:00:00 2001 From: Z User Date: Wed, 28 Oct 2026 20:18:51 +0000 Subject: [PATCH] fix: model select uses relativePath + mmproj select in ConfigTab + Perf NaN fix + version 0.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problems fixed ### 1. Model select didn't use subdirectories ConfigTab's model Select used m.name (just 'model.gguf') instead of m.relativePath ('Qwen3-VL/model.gguf'). When the user selected a model from a subdir, the config stored just the filename — llama.cpp would look for /models/model.gguf instead of /models/Qwen3-VL/model.gguf. **Fix:** Select uses m.relativePath everywhere (model + draft + mmproj). Also filters by kind: only base models in model Select, only mtp/draft in draft Select, only mmproj in mmproj Select. Shows subdir/ prefix in the dropdown. ### 2. mmproj select missing from ConfigTab User asked: 'mmproj нужна настройка еще на самой странице конфигов' **Fix:** Added a new 'Multimodal projector (mmproj)' section in ConfigTab with a Select dropdown. Lists files with kind='mmproj' (or all files as fallback if no mmproj files detected). Shows the resulting --mmproj /models/ line when set. ### 3. Perf tab shows NaN and '?' everywhere - 'Ctx usage: NaN / 50176' — slots[].n_past was undefined → NaN in reduce - 'Default sampling: temp: ? ...' — /props didn't return default_generation_settings (or named differently) - 'Total ctx: —' — /props didn't return n_context - 'slot #0 ctx: /50176' — n_past was undefined **Fix:** - NaN-safe: all slot field access uses typeof checks or ?? '?' - Try multiple key names: default_generation_settings || generation_settings, total_slots || n_slots, n_context || n_ctx_total, has_multimodal || mmproj_path || is_multimodal - Added '▶ Raw /props + /slots JSON' collapsible section at the bottom of Overview — shows the raw JSON from both endpoints so the user (and I) can see what llama.cpp actually returns. This is critical for debugging — llama.cpp changes field names across versions. ### 4. Version bump to 0.6.0 Updated DASHBOARD_VERSION to '0.6.0' so the user can verify the update took effect (footer shows v0.6.0, /api/debug returns version: '0.6.0'). ## After merge ```sh git pull && sh build.sh docker compose up -d --force-recreate dashboard model-worker ``` Check footer — should show v0.6.0. If it shows v0.5.0, the container didn't rebuild (try docker compose build dashboard && docker compose up -d --force-recreate dashboard). For Perf tab debugging: open the '▶ Raw /props + /slots JSON' section and share the output — that'll show exactly what llama.cpp returns. --- dashboard/src/app/api/debug/route.ts | 2 +- dashboard/src/app/page.tsx | 156 ++++++++++++++++++++++++--- dashboard/src/lib/version.ts | 2 +- 3 files changed, 141 insertions(+), 19 deletions(-) diff --git a/dashboard/src/app/api/debug/route.ts b/dashboard/src/app/api/debug/route.ts index 3a71dda..c27527d 100644 --- a/dashboard/src/app/api/debug/route.ts +++ b/dashboard/src/app/api/debug/route.ts @@ -120,7 +120,7 @@ export async function GET() { ok: envError === null, error: envError, }, - version: "0.5.0", + version: "0.6.0", timestamp: new Date().toISOString(), }); } diff --git a/dashboard/src/app/page.tsx b/dashboard/src/app/page.tsx index b1e9cc9..f95ed06 100644 --- a/dashboard/src/app/page.tsx +++ b/dashboard/src/app/page.tsx @@ -1804,8 +1804,13 @@ function ConfigTab({ No .gguf files found ) : ( - models.map((m) => ( - + models.filter((m) => m.kind === "base").map((m) => ( + + {m.subdir && ( + + {m.subdir}/ + + )} {m.name} {m.sizeHuman} @@ -1913,11 +1918,18 @@ function ConfigTab({ — None — - {models.map((m) => ( - - {m.name} - - ))} + {models + .filter((m) => m.kind === "mtp" || m.kind === "draft") + .map((m) => ( + + {m.subdir && ( + + {m.subdir}/ + + )} + {m.name} + + ))} @@ -1936,6 +1948,67 @@ function ConfigTab({ + {/* Multimodal (mmproj) — vision projector for VL models */} +
+
+ + + Multimodal projector (mmproj) + +

+ Vision projector for VL models (Qwen3-VL, Llama 3.2 Vision, etc.). + Select the mmproj .gguf file that matches your base model. + Leave empty for text-only models. +

+
+
+ + + {config.mmprojPath && ( +
+ --mmproj /models/{config.mmprojPath} +
+ )} +
+
+
@@ -3923,7 +3996,9 @@ function OverviewView({

); } - const gen = props.default_generation_settings as + // Try multiple key names — llama.cpp has changed these across versions + const gen = (props.default_generation_settings || + props.generation_settings) as | { n_predict?: number; temperature?: number; @@ -3949,8 +4024,30 @@ function OverviewView({ ? activeSlots.reduce((s, x) => s + (x.timings?.predicted_per_second || 0), 0) / activeSlots.length : null; - const hasMultimodal = Boolean(props.has_multimodal); - const totalSlots = (props.total_slots as number) || slots.length; + const hasMultimodal = Boolean( + props.has_multimodal ?? props.mmproj_path ?? props.is_multimodal + ); + const totalSlots = + (props.total_slots as number) || + (props.n_slots as number) || + slots.length; + // Ctx usage — guard against NaN (slots may not have n_past/n_ctx when idle) + const ctxUsed = slots.reduce( + (s, x) => s + (typeof x.n_past === "number" ? x.n_past : 0), + 0 + ); + const ctxTotal = slots.reduce( + (s, x) => s + (typeof x.n_ctx === "number" ? x.n_ctx : 0), + 0 + ); + // n_context from props (might be n_context or n_ctx_total) + const totalCtx = + (props.n_context as number) || + (props.n_ctx_total as number) || + ctxTotal || + null; + + const [showRaw, setShowRaw] = React.useState(false); return (
@@ -3969,11 +4066,10 @@ function OverviewView({ 0 - ? `${slots.reduce((s, x) => s + x.n_past, 0)} / ${slots.reduce( - (s, x) => s + x.n_ctx, - 0 - )}` + ctxTotal > 0 + ? `${ctxUsed} / ${ctxTotal}` + : ctxUsed > 0 + ? `${ctxUsed}` : "—" } hint="tokens across all slots" @@ -4008,7 +4104,7 @@ function OverviewView({ />
@@ -4051,6 +4147,32 @@ function OverviewView({
)} + + {/* Raw JSON dump — for debugging when fields are missing */} +
+ + {showRaw && ( +
+
+
/props:
+
+                {JSON.stringify(props, null, 2)}
+              
+
+
+
/slots:
+
+                {JSON.stringify(slots, null, 2)}
+              
+
+
+ )} +
); } @@ -4077,7 +4199,7 @@ function SlotsView({ slots }: { slots: SlotInfo[] }) {
- ctx: {s.n_past}/{s.n_ctx} + ctx: {s.n_past ?? "?"}/{s.n_ctx ?? "?"}
diff --git a/dashboard/src/lib/version.ts b/dashboard/src/lib/version.ts index 0bf099b..8405e2e 100644 --- a/dashboard/src/lib/version.ts +++ b/dashboard/src/lib/version.ts @@ -4,7 +4,7 @@ * Displayed in the footer and available via /api/debug so the user can * verify the update actually took effect. */ -export const DASHBOARD_VERSION = "0.5.0"; +export const DASHBOARD_VERSION = "0.6.0"; /** * Build timestamp — set at build time by Next.js.