Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ One model. Two of its keys decide whether the service can run at all; the third
| `serveArgs` | The full argument list handed to `llama-server`, composed by the Set Model action |
| `uiPassword` | The password for the proxy's basic auth; the username is always `admin` |
| `modelSelection` | What the Set Model form last submitted, so it can be prefilled next time — read by nothing else |
| `modelSettings` | Context size, GPU layers and extra flags last used for each model — read only by Set Model |

Nothing else writes the file, and neither `serveArgs` nor `uiPassword` is defaulted — both are absent until you run their action, and each absence raises a task.

`modelSelection` holds the chosen `selection` plus, when Custom was chosen, a `custom` object carrying that variant's fields; picking a preset clears `custom`. The daemon never reads it, so it cannot disagree with `serveArgs` about what is actually running — at worst it prefills a form with a stale answer.
`modelSelection` holds the chosen `selection` plus a `custom` object with the last Custom submission's fields; picking another entry leaves `custom` in place so Custom stays prefilled. `modelSettings` is a list of `{hfRepo, hfFile, ctx, ngl, extraArgs}`, one per model, replaced on each submit of that model. Entries are matched to the list by the weights they resolve to — the same cached file, or the same quant tag before download — so a Custom model keeps its settings once it shows up as a downloaded entry. Stores from before `modelSettings` fall back to `modelSelection.custom`. The daemon reads neither, so they cannot disagree with `serveArgs` about what is actually running — at worst they prefill a form with a stale answer.

**No configuration file reaches the application.** Two environment variables are set, both redirecting caches onto the volume so downloaded weights survive a container rebuild:

Expand Down Expand Up @@ -127,12 +128,13 @@ Three actions, all user-facing.

Chooses what the server runs — either a curated preset or a model of your own.

- **What it changes:** `serveArgs` and `modelSelection` in `store.json`, replacing each entirely.
- **What it changes:** `serveArgs` and `modelSelection` in `store.json`, replacing each entirely, and the chosen model's entry in `modelSettings`.
- **Cost:** seconds to write, then a restart — and, if the model is not already cached, a download that can take a long time.
- **Repeat safety:** safe to re-run. Switching back to a previously used model is fast, because the old one is still cached.
- **The form reopens on your current selection**, read back from `modelSelection`, so changing one setting does not mean re-entering the rest. With nothing chosen yet it falls back to the hardware-filtered default.
- **Every entry has its own context size, GPU layers and extra flags**, prefilled with what that model last ran with (`modelSettings`), or with the preset's context and full GPU offload the first time. Switching to another model and back keeps them.
- **The form reopens on the running model**, which stays selectable: change its settings and submit to restart with them. Submitting it unchanged writes the same `serveArgs` and does not restart. With nothing chosen yet the form falls back to the hardware-filtered default.
- **Presets are filtered to your hardware.** The form reads the accelerator's memory — VRAM on NVIDIA and ROCm, system memory otherwise — and disables any preset that would not fit, defaulting to the smallest that does. The field's help text lists every preset with the memory it needs. The estimate is the quantized weights plus roughly a quarter for the context cache.
- **Models already downloaded to the volume appear in the same list**, so a model you fetched before can be reselected without retyping its repo or re-downloading it. A downloaded file that is a preset's quant stays under that preset, while other quants of the same repo get their own entries. A downloaded entry is passed to `llama-server` as `-hf <org>/<repo> -hff <file>` so the exact cached quant is reused. Those entries run at a fixed 8192-token context with full GPU offload; use Custom for anything else.
- **Models already downloaded to the volume appear in the same list**, so a model you fetched before can be reselected without retyping its repo or re-downloading it. A downloaded file that is a preset's quant stays under that preset, while other quants of the same repo get their own entries. A downloaded entry is passed to `llama-server` as `-hf <org>/<repo> -hff <file>` so the exact cached quant is reused; a first-time downloaded entry defaults to an 8192-token context. When the entry is the running model, its repo and file arguments are kept as they were written.
- **Custom** takes a HuggingFace GGUF repo, optionally a specific file, a context size, a GPU-layer count, and extra server flags. Those extra flags are split on whitespace, so a quoted value with spaces will not survive.

### Set UI Password
Expand Down Expand Up @@ -169,8 +171,8 @@ Because they are conditional, clearing either value later raises its task again

One check, on the daemon.

| Check | Method | Grace Period |
| ------------------------- | ---------------------- | ------------ |
| Check | Method | Grace Period |
| ------------------------- | ---------------------------------------- | ------------ |
| `primary` "llama.cpp API" | HTTP GET `/health` on port 8080 succeeds | 1 hour |

**The hour-long grace is for the model download**, which happens on the first start after a selection and is bounded only by size and bandwidth. The server opens its port before loading the model, but `/health` returns HTTP 503 until loading completes; an open port alone is not readiness. The probe runs inside `llama-cpp-sub`, bypassing the proxy's authentication. A failure after the grace period calls for checking download errors, available memory, and the daemon logs.
Expand All @@ -195,7 +197,7 @@ The `main` volume is backed up — `sdk.Backups.ofVolumes('main')` — with one
6. **Model presets are filtered by detected memory**, and the fit estimate is approximate — a preset that is enabled can still be tight at large context sizes.
7. **Extra server flags are split on whitespace**, so quoted arguments containing spaces do not survive.
8. **Models are excluded from backups.** After a restore, the selected model downloads again on first start.
9. **Downloaded models are listed by repo and file.** A cached file matching a curated preset's quant is not duplicated; other quants from the same repo remain separate entries. Downloaded entries do not expose context or GPU-layer settings — use Custom for those.
9. **Downloaded models are listed by repo and file.** A cached file matching a curated preset's quant is not duplicated; other quants from the same repo remain separate entries. Settings are remembered per model, so deleting a model with Delete Model Cache and downloading it again keeps them.
10. **Saved inference states are upstream-version-specific.** Custom `--slot-save-path` caches may need to be recreated after an update; the package does not convert them. This does not affect downloaded GGUF weights or `store.json`.

---
Expand Down
5 changes: 2 additions & 3 deletions instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Two tasks appear on the dashboard on a fresh install:

1. **Set UI Password** — generates your web UI login password. The username is always `admin`; copy the password it returns (you'll need it the first time you open the UI or connect a client). Run it again any time to rotate the password.
2. **Set Model** — choose what llama.cpp serves. The form shows curated presets, lists the memory each one needs, and disables ones too large for the detected memory. Models you have already downloaded are listed too, so you can switch back to one without re-entering or re-downloading it. If none of the presets fit, pick **Custom** and paste a HuggingFace repo such as `unsloth/Qwen2.5-7B-Instruct-GGUF:Q4_K_M`. On a GPU variant, leave `GPU layers` at 999 to offload everything; on the CPU-only `generic` variant the field is ignored.
2. **Set Model** — choose what llama.cpp serves. The form shows curated presets, lists the memory each one needs, and disables ones too large for the detected memory. Models you have already downloaded are listed too, so you can switch back to one without re-entering or re-downloading it. Every entry has its own context size, GPU layers and extra arguments, and remembers what you last used with that model. If none of the presets fit, pick **Custom** and paste a HuggingFace repo such as `unsloth/Qwen2.5-7B-Instruct-GGUF:Q4_K_M`. On a GPU variant, leave `GPU layers` at 999 to offload everything; on the CPU-only `generic` variant the field is ignored.

Complete both tasks, then start the service from the dashboard. The first launch downloads weights — expect several gigabytes and a few minutes (or longer over a slow link) before the API answers. The API health check stays pending until the model finishes loading, even if the chat UI opens earlier. Subsequent restarts are fast.

Expand Down Expand Up @@ -44,13 +44,12 @@ curl -s -u admin:<your-ui-password> <your-interface-url>/v1/chat/completions \

### Actions

- **Set Model** — switch to a different preset, a model you already downloaded, or a custom GGUF. The form opens with your current selection already filled in, so you can change one setting without re-entering the rest. The service restarts with the new weights; uncached models download on this restart.
- **Set Model** — switch to a different preset, a model you already downloaded, or a custom GGUF. The form opens on the model you are running, with its settings filled in, so you can change its context size or flags and submit; submitting without changes does not restart anything. Each model remembers its own settings, so switching away and back keeps them. The service restarts with the new weights; uncached models download on this restart.
- **Set UI Password** — generate a new web UI password (username stays `admin`). Use it for first-time setup or to rotate the password later; when rotating, it asks you to confirm, since saved logins stop working.
- **Delete Model Cache** — pick a downloaded model from the list, with its size, and remove it to reclaim disk space. The model you are currently running can't be deleted; switch to another one with Set Model first. A deleted model will be re-downloaded if you select it again.

## Limitations

- **One model at a time.** Switching models restarts the service.
- **Models are large.** A 70B Q4 file is ~40 GB; even small models are several gigabytes. Confirm free disk before selecting a preset.
- **Already-downloaded models are added to the list with fixed settings.** They run at an 8192-token context with full GPU offload; pick **Custom** if you need a different context size or extra flags.
- **Saved slot caches may not survive an upstream update.** If you use `--slot-save-path` in Custom's extra arguments and restoring an old slot fails, replay its prompt and save the slot again. Your downloaded model weights are unaffected.
Loading
Loading