Adds a small Next.js dashboard as a new Docker service () that replaces the need to manually edit and call over SSH every time you want to tweak llama launch parameters. Features: - Live status panel for all GPU-node containers (auto-refresh) - Models list with file sizes, click-to-select active model - Structured launch config form: * Model, ctx-size, parallel, batch-size, n-gpu-layers, threads * Context overflow (none / shift / evict) * Speculative decoding (spec-type, draft model, spec-draft-n-max) * Free-form extra args textarea for anything else - Named presets (save / load / delete) - Start / Restart / Stop / Remove llama actions - Live streaming logs viewer (docker logs -f) - GPU status (nvidia-smi via docker exec on llama) - Auto-writes LLAMA_MODEL and LLAMA_EXTRA_ARGS back to .env so the existing workflow keeps working, and persists full structured config to gpu/dashboard/config.json for reload on next visit Integration: - New service in compose.yaml (no profile, runs always) - Mounts /var/run/docker.sock + HOST_PROJECT_PATH - Tailscale serve exposes port 8090 -> dashboard:3000 - build.sh extended to build the dashboard image Tech: Next.js 16 standalone, React 19, TypeScript 5, Tailwind 4, shadcn-style components, Radix UI primitives.
76 lines
2.8 KiB
Markdown
76 lines
2.8 KiB
Markdown
# 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
|
|
|
|
```sh
|
|
cd dashboard
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
You will need to set the same env vars the container would set:
|
|
|
|
```sh
|
|
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
|
|
|
|
```sh
|
|
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
|