Files
Z User 71f90aa569 feat: mmproj support, model subdirs, auto-categorize, perf overview, comfy total size, wake dashboard fix
## Summary

8 fixes in one PR — all from user feedback:

1. **Perf tab shows nothing** — added /api/props endpoint, Overview view
   with avg TPS / ctx usage / multimodal / sampling defaults
2. **Comfy models list — no total size** — added total size to header
3. **gpuctl wake doesn't start dashboard** — added belt-and-suspenders
   check + explicit docker compose up -d dashboard fallback
4. **mmproj support (multimodal)** — new mmprojPath config field,
   --mmproj arg, Set mmproj button in Models tab
5. **Subdirectory support in llama_models** — listModels() recurses one
   level deep, ModelFile has relativePath/subdir/kind fields
6. **Auto-categorize models** — detectModelKind() tags files as
   base/mmproj/mtp/draft by filename, shown as colored badges
7. **Comfy download progress** — reduced queue refresh from 5s to 2s
8. **Auto-create repo subdir on download** — HF/GitHub URLs
   automatically create user___repo/ subdirectory

## Details

### Perf tab (1)
- New /api/props endpoint proxies llama.cpp /props
- New Overview view shows: avg TPS, total slots, ctx usage, multimodal,
  predicted/prompt token counts, model name, total ctx, sampling defaults
- Slots view now shows 'No slots' instead of 'No active slots' (idle
  slots are still listed by /slots)
- Default view changed from slots to overview
- Added 'Click Live to start polling' placeholder when not active
- Error display if fetch fails

### Comfy total size (2)
- ComfyTab header now shows total size: 'N file(s) · X.XX GB total'

### gpuctl wake dashboard fix (3)
- wake_mode() now checks if dashboard container is running after the
  --profile wake up -d call, and if not, runs a plain
  'docker compose up -d dashboard' as fallback

### mmproj support (4)
- DashboardConfig.mmprojPath (relative path like 'Qwen3-VL/mmproj-F16.gguf')
- DEFAULT_CONFIG.mmprojPath = ''
- buildLlamaExtraArgs: --mmproj /models/<path> when set
- parseLlamaExtraArgs: parses --mmproj, strips /models/ prefix
- mergeConfig: includes mmprojPath
- ModelsTab: 'Set mmproj' button for files with kind='mmproj'
- Active mmproj shown with badge in model list

### Subdirectory support (5)
- ModelFile: added relativePath, subdir, kind fields
- listModels() now walks top-level entries; if a subdirectory is found,
  lists .gguf files inside it (one level deep — HF repos are flat)
- Sort: by subdir (groups files in same repo together), then by size desc
- deleteModel() accepts relative paths like 'Qwen3-VL/model.gguf'
- Path traversal protection: resolved path must stay under
  LLAMA_MODELS_DIR

### Auto-categorize models (6)
- detectModelKind(filename) checks lowercase filename:
  - 'mmproj' in name → 'mmproj'
  - 'mtp' in name → 'mtp'
  - 'draft' in name → 'draft'
  - otherwise → 'base'
- Models tab shows colored Kind badge per file
- Action buttons are context-aware:
  - base: 'Use' (sets config.model)
  - mmproj: 'Set mmproj' (sets config.mmprojPath)
  - mtp/draft: 'Set draft' (sets config.draftModel)

### Comfy download progress (7)
- Queue refresh interval reduced from 5000ms to 2000ms for more
  responsive progress display

### Auto-create repo subdir on download (8)
- startModelDownload() now detects HF and GitHub URLs and extracts
  user/repo to create a subdirectory:
  - huggingface.co/<user>/<repo>/resolve/<branch>/<file>
    → subdir = '<user>___<repo>'
  - github.com/<user>/<repo>/releases/download/<tag>/<file>
    → subdir = '<user>___<repo>'
  - Other URLs: no subdir (flat layout)
- The subdirectory is created on the fly before starting curl
- File is saved as <LLAMA_MODELS_DIR>/<subdir>/<filename>
- Job.filename shows the full relative path (e.g. 'user___repo/model.gguf')

## Verification

- npm run build — OK, 27 routes (1 new /api/props)
- bash dashboard/validate-build.sh — all 8 COPY sources ✓

## After deploy

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

Test:
- Download a HF model → it lands in user___repo/ subdir
- Models tab shows files grouped by subdir with kind badges
- Click 'Set mmproj' on an mmproj file → --mmproj added to launch args
- Start Llama → check Perf tab → Overview shows TPS / ctx / multimodal
- gpuctl sleep → gpuctl wake → dashboard should come back up
2026-10-28 19:10:58 +00:00
..

GPU-Node Dashboard

A small Next.js web dashboard for managing the llama.cpp instance running on the GPU node. Replaces the need to manually edit .env and call gpuctl over SSH.

Features

  • Status overview — live view of all containers (llama, ssh, comfyui, etc.) for the current node instance, with health check + auto-refresh.
  • Models list — scans gpu/llama_models/*.gguf and shows sizes / modified time; click "Use" to switch the active model in the launch config.
  • Launch config — structured form for --ctx-size, --parallel, --n-gpu-layers, --threads, --batch-size, --context-overflow, speculative decoding (--spec-type, --model-draft, --spec-draft-n-max), and a free-form extra args textarea for anything else.
  • Presets — save named configurations and reload them with one click.
  • Start / Restart / Stop / Remove llama container via docker compose.
  • Live logs — streaming docker logs -f with color-coded output.
  • GPU status — runs nvidia-smi via docker exec on the llama container (or falls back to docker compose run --rm gpu-test nvidia-smi ...).
  • Auto-writes .env — every "Apply / Start" persists the current LLAMA_MODEL and LLAMA_EXTRA_ARGS back to .env, so the existing workflow keeps working.

How it integrates

The dashboard runs as a new dashboard service in compose.yaml. It mounts:

  • /var/run/docker.sock → can run docker compose and docker ps commands
  • The host project path (read/write so it can edit .env and save presets)

On every "Start / Apply" action, the dashboard:

  1. Persists the structured config to gpu/dashboard-config.json.
  2. Writes LLAMA_MODEL and LLAMA_EXTRA_ARGS to .env (preserving other vars).
  3. Runs docker compose --profile llama up -d --force-recreate llama with the same env vars inlined — identical to gpuctl start llama <model> <args>.

The dashboard is exposed via Tailscale serve on port 8090.

Local development

cd dashboard
npm install
npm run dev

You will need to set the same env vars the container would set:

export HOST_PROJECT_PATH=/path/to/GPU-Node   # absolute path on host
export PROJECT_DIR=/path/to/GPU-Node         # path mounted inside the dev shell
export NODE_INSTANCE=gpu-node

You also need docker and docker compose available on your $PATH, and the current user must be in a group that can access /var/run/docker.sock.

Building the image

docker build -t gpu-node-dashboard ./dashboard

Or via the project's build.sh after this PR merges — that script will be extended to build the dashboard image as well.

Tech stack

  • Next.js 16 (standalone output, App Router)
  • React 19 + TypeScript 5
  • Tailwind CSS 4 + shadcn-style components
  • Radix UI primitives (select, tabs, switch, label)
  • lucide-react icons