Compare commits

..

4 Commits

Author SHA1 Message Date
Z User
48a6166a57 fix: model select uses relativePath + mmproj select in ConfigTab + Perf NaN fix + version 0.6.0
## 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/<path> 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.
2026-10-28 20:18:51 +00:00
35730871bf Merge pull request 'fix: version display in UI + simplify subdir to just <repo> (includes all from PR #14)' (#15) from fix/versioning-and-subdir into master
Reviewed-on: #15
2026-10-28 19:38:28 +00:00
6593f78ded Merge pull request 'feat: mmproj support, model subdirs, auto-categorize, perf overview, comfy total size, wake dashboard fix' (#14) from feat/multi-fixes into master
Reviewed-on: #14
2026-10-28 19:37:10 +00:00
Z User
b96d773065 fix: version display in UI + simplify subdir to just <repo>
## What

1. **Version display** — user reported 'ни одно изменение с дашбордом не увидел'.
   Added DASHBOARD_VERSION constant (0.5.0) shown in the footer as 'v0.5.0'.
   Also returned in /api/debug so user can verify the update took effect via
   `curl http://gpu-node:8090/api/debug | jq .version`.

2. **Simplify subdir** — user said '<user>___<repo> не нужно, просто <repo>'.
   Changed download subdir from 'user___repo' to just 'repo'. So
   huggingface.co/user/Qwen3-VL/resolve/main/model.gguf → subdir='Qwen3-VL'
   (was 'user___Qwen3-VL').

3. **Includes all changes from PR #14** (mmproj, subdirs, auto-categorize,
   perf overview, comfy total size, wake dashboard fix) — this branch
   merges feat/multi-fixes + adds versioning + simplifies subdir.

## After merge

```sh
git pull && sh build.sh
docker compose up -d --force-recreate dashboard model-worker
```

Check the footer — should show 'v0.5.0'. If it doesn't, the update didn't
take effect.
2026-10-28 19:34:07 +00:00
4 changed files with 165 additions and 25 deletions

View File

@@ -120,6 +120,7 @@ export async function GET() {
ok: envError === null,
error: envError,
},
version: "0.6.0",
timestamp: new Date().toISOString(),
});
}

View File

@@ -53,6 +53,7 @@ import {
} from "@/components/ui/select";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { cn, formatBytes, timeAgo } from "@/lib/utils";
import { DASHBOARD_VERSION } from "@/lib/version";
// ---------------------------------------------------------------------------
// Types
@@ -1560,8 +1561,11 @@ export default function DashboardPage() {
<footer className="border-t border-border bg-card/30 mt-auto">
<div className="mx-auto max-w-7xl px-4 sm:px-6 py-3 flex items-center justify-between text-xs text-muted-foreground">
<div>
GPU-Node Dashboard ·{" "}
<div className="flex items-center gap-2">
<span className="font-mono font-medium text-foreground">
v{DASHBOARD_VERSION}
</span>
<span>·</span>
<a
href="https://github.com/ggml-org/llama.cpp"
target="_blank"
@@ -1800,8 +1804,13 @@ function ConfigTab({
No .gguf files found
</SelectItem>
) : (
models.map((m) => (
<SelectItem key={m.name} value={m.name}>
models.filter((m) => m.kind === "base").map((m) => (
<SelectItem key={m.relativePath} value={m.relativePath}>
{m.subdir && (
<span className="text-muted-foreground text-xs">
{m.subdir}/
</span>
)}
<span className="font-mono">{m.name}</span>
<span className="ml-2 text-muted-foreground text-xs">{m.sizeHuman}</span>
</SelectItem>
@@ -1909,11 +1918,18 @@ function ConfigTab({
</SelectTrigger>
<SelectContent>
<SelectItem value="__none__">— None —</SelectItem>
{models.map((m) => (
<SelectItem key={m.name} value={m.name}>
<span className="font-mono">{m.name}</span>
</SelectItem>
))}
{models
.filter((m) => m.kind === "mtp" || m.kind === "draft")
.map((m) => (
<SelectItem key={m.relativePath} value={m.relativePath}>
{m.subdir && (
<span className="text-muted-foreground text-xs">
{m.subdir}/
</span>
)}
<span className="font-mono">{m.name}</span>
</SelectItem>
))}
</SelectContent>
</Select>
</div>
@@ -1932,6 +1948,67 @@ function ConfigTab({
</div>
</div>
{/* Multimodal (mmproj) — vision projector for VL models */}
<div className="rounded-md border p-4 space-y-3 bg-muted/20">
<div>
<span className="text-sm font-medium flex items-center gap-2">
<Zap className="h-4 w-4 text-warning" />
Multimodal projector (mmproj)
</span>
<p className="text-xs text-muted-foreground mt-0.5">
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.
</p>
</div>
<div className="space-y-1.5">
<Label htmlFor="mmproj-select">mmproj file</Label>
<Select
value={config.mmprojPath || "__none__"}
onValueChange={(v) => update("mmprojPath", v === "__none__" ? "" : v)}
>
<SelectTrigger id="mmproj-select">
<SelectValue placeholder="None (text-only)" />
</SelectTrigger>
<SelectContent>
<SelectItem value="__none__">— None (text-only) —</SelectItem>
{models
.filter((m) => m.kind === "mmproj")
.map((m) => (
<SelectItem key={m.relativePath} value={m.relativePath}>
{m.subdir && (
<span className="text-muted-foreground text-xs">
{m.subdir}/
</span>
)}
<span className="font-mono">{m.name}</span>
<span className="ml-2 text-muted-foreground text-xs">{m.sizeHuman}</span>
</SelectItem>
))}
{/* Also show base models as fallback (some mmproj files
don't have 'mmproj' in the name) */}
{models.filter((m) => m.kind === "mmproj").length === 0 && (
models.map((m) => (
<SelectItem key={m.relativePath} value={m.relativePath}>
{m.subdir && (
<span className="text-muted-foreground text-xs">
{m.subdir}/
</span>
)}
<span className="font-mono">{m.name}</span>
</SelectItem>
))
)}
</SelectContent>
</Select>
{config.mmprojPath && (
<div className="text-[10px] text-muted-foreground font-mono">
--mmproj /models/{config.mmprojPath}
</div>
)}
</div>
</div>
<div className="grid gap-4 sm:grid-cols-2">
<div className="space-y-1.5">
<Label htmlFor="overflow">Context overflow</Label>
@@ -3919,7 +3996,9 @@ function OverviewView({
</p>
);
}
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;
@@ -3945,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 (
<div className="space-y-4">
@@ -3965,11 +4066,10 @@ function OverviewView({
<MetricCell
label="Ctx usage"
value={
slots.length > 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"
@@ -4004,7 +4104,7 @@ function OverviewView({
/>
<MetricCell
label="Total ctx"
value={typeof props.n_context === "number" ? `${props.n_context}` : "—"}
value={totalCtx != null ? `${totalCtx}` : "—"}
hint="n_ctx × parallel"
/>
</div>
@@ -4047,6 +4147,32 @@ function OverviewView({
</div>
</div>
)}
{/* Raw JSON dump — for debugging when fields are missing */}
<div>
<button
className="text-xs text-muted-foreground hover:text-foreground underline-offset-2 hover:underline"
onClick={() => setShowRaw((v) => !v)}
>
{showRaw ? "▼" : "▶"} Raw /props + /slots JSON
</button>
{showRaw && (
<div className="mt-2 space-y-2">
<div>
<div className="text-[10px] text-muted-foreground mb-1">/props:</div>
<pre className="text-[10px] font-mono whitespace-pre-wrap bg-zinc-950 dark:bg-black text-zinc-300 rounded-md border p-2 max-h-40 overflow-y-auto scrollbar-thin">
{JSON.stringify(props, null, 2)}
</pre>
</div>
<div>
<div className="text-[10px] text-muted-foreground mb-1">/slots:</div>
<pre className="text-[10px] font-mono whitespace-pre-wrap bg-zinc-950 dark:bg-black text-zinc-300 rounded-md border p-2 max-h-40 overflow-y-auto scrollbar-thin">
{JSON.stringify(slots, null, 2)}
</pre>
</div>
</div>
)}
</div>
</div>
);
}
@@ -4073,7 +4199,7 @@ function SlotsView({ slots }: { slots: SlotInfo[] }) {
</span>
</div>
<div className="text-xs text-muted-foreground font-mono">
ctx: {s.n_past}/{s.n_ctx}
ctx: {s.n_past ?? "?"}/{s.n_ctx ?? "?"}
</div>
</div>

View File

@@ -225,23 +225,21 @@ export async function startModelDownload(
const last = segments.pop() || "model.gguf";
filename = last;
// For HuggingFace URLs: /<user>/<repo>/resolve/main/<file>
// → subdir = "<user>___<repo>" (sanitized)
// → subdir = "<repo>" (just the repo name, not user___repo)
// For GitHub releases: /<user>/<repo>/releases/download/<tag>/<file>
// → subdir = "<user>___<repo>"
// → subdir = "<repo>"
const host = parsed.hostname.toLowerCase();
if (host === "huggingface.co" || host === "hf.co") {
// HF URL: /user/repo/resolve/branch/file
if (segments.length >= 2) {
const user = segments[0];
const repo = segments[1];
subdir = `${user}___${repo}`.replace(/[^\w.\-]/g, "_");
subdir = repo.replace(/[^\w.\-]/g, "_");
}
} else if (host === "github.com" && segments.includes("releases")) {
// GitHub: /user/repo/releases/download/tag/file
if (segments.length >= 2) {
const user = segments[0];
const repo = segments[1];
subdir = `${user}___${repo}`.replace(/[^\w.\-]/g, "_");
subdir = repo.replace(/[^\w.\-]/g, "_");
}
}
}

View File

@@ -0,0 +1,15 @@
/**
* Dashboard version — bump this on every PR merge.
*
* Displayed in the footer and available via /api/debug so the user can
* verify the update actually took effect.
*/
export const DASHBOARD_VERSION = "0.6.0";
/**
* Build timestamp — set at build time by Next.js.
* Falls back to "dev" when running in dev mode.
*/
export const BUILD_ID =
process.env.NEXT_PUBLIC_BUILD_ID ||
(process.env.NODE_ENV === "production" ? "prod" : "dev");