The API key button is Connect again. Besides the key, it walks through adding this server to
opencode: type the API's address (remembered in the browser; prefilled on a LAN visit) and it
fills in a command that saves the key to a 0600 file without it touching shell history, and
the provider block from the same builder as `llmhost opencode-config`. GET /api/connect
replaces /api/key, behind the same sign-in.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Behind the same sign-in as the rest of the dashboard (GET /api/key, no-store), so whoever
can open the dashboard can hand the key to a client without a shell on the server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A plain install is unchanged: LAN-only, dashboard behind the API key. `llmhost install-newt`
is the upgrade path. It installs a pinned, sha256-checked newt as a third user service and
switches the dashboard to an OIDC authorization-code + PKCE sign-in limited to allowed groups
or users. The API still takes the key. Secrets live in 0600 files, never in config.json, a
service file or argv. `llmhost remove-newt` undoes it; setup/update keep it; `logs --newt`
shows the tunnel (and `logs -f` now follows the service it was asked for).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Duration, TTFT and the two new columns use one formatter that grows units only
as the value reaches them: 142 ms, 7.52 s, 31.2 s, then 1m 20s, then
1h 02m 06s. Sub-minute values keep their old precision, which is where almost
every request lives; a long generation no longer reads as "80.4 s".
Prompt sec and Generated sec show the two phases the rates were already
computed over, so a row now says where its time went: an 8011-token prompt as
19.3 s of prefill at 415 tok/s, then 6.74 s generating 141 tokens at 20.9. The
seconds come from the same split as the rates beside them -- a test asserts
tok/s == tokens / seconds for both phases, so the two can't drift apart.
A request that didn't stream has no first-token mark and so no split: its
prompt seconds read "—" and its whole duration is charged to generation, which
the column subtitle now says rather than leaving to be inferred.
run_phases/run_row move out of the snapshot closure to module level, so the
suite exercises the real row-building instead of a copy of it that had to be
kept in step by hand.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
One model is loaded at a time under one setting, and that setting belongs next
to the model it applies to -- the same reason the client can't switch models.
So the proxy now takes a client's reasoning settings off the request before
applying the dashboard's: a top-level reasoning_effort, and enable_thinking or
reasoning_effort inside chat_template_kwargs. Other template kwargs, which
llm-host has no opinion about, still pass through.
This reverses the precedence the proxy had (a client's own kwargs won, mirroring
mlx_lm's own rule), which was the wrong model for a single-model server: clients
offer a generic menu -- opencode's low/medium/high -- and a level the template
doesn't define makes it raise, so every request failed with nothing on the
user's screen to explain it.
- opencode: the provider block disables all three of opencode's effort levels
instead of curating them. A chooser there would be a menu that does nothing.
- Deletes the nearest-effort mapping (EFFORT_SCALE, nearest_effort,
plan.effort_levels, the effort_levels= parameter through both backends): it
existed only to rescue a client-supplied level, and none survives now.
- plan.REASONING_KEYS names the knobs this server drives, with a test asserting
it stays exactly equal to what reasoning_kwargs can emit -- so a new template
knob can't be added without also taking it away from clients.
- Two strings that still described a menu of models, from before the block held
a single entry.
Verified against the live MLX server: with the dashboard on xhigh, five request
shapes (nothing, enable_thinking: false, effort low top-level, effort low in
kwargs, and the off-scale "turbo" that used to 404) all answer identically, and
the reply tracks the dashboard alone as it moves off / low / xhigh.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
cmd_setup rebuilds config.json from the plan, and the reasoning setting isn't
part of the plan -- the dashboard writes it into the same file. So every
`llmhost update` (setup --yes under the hood) silently put every model back to
"Model default", losing a setting the user had chosen in the UI.
Carry it over, minus models that no longer fit. The helper exists so the reason
is on the record rather than implied by a dict literal; its tests cover the
empty and no-longer-fits cases that must not write the key at all.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
- Move the MLX proxy into backends/proxy.py and run it on both backends:
public port 1134 is the proxy, the model server listens on 127.0.0.1:1135.
On vLLM this brings the reasoning chooser, the "default" alias and the
per-request table. Effort levels the model lacks map to the nearest it has
(high -> xhigh on qwen3.8); vLLM's own key is sent upstream; streamed runs
are counted from the usage chunk (MTP packs several tokens per chunk).
- Dashboard: restore METRIC_RE (vLLM page stuck on "loading"); Statistics
header with Reset, Requests header with Clear; drop the TTFT chart; rename
token columns; Peak KV shows "-" when no samples cover a run.
- opencode: config snippet's model points at <provider>/default, and
reasoning models get variants built from the levels the template accepts.
- README: proxy on both platforms; NVIDIA checklist split into verified / open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only one model is loaded at a time, so listing every model that fits gave a
picker with one working entry and four that now answer 404 -- and the entry that
worked changed id on every `llmhost switch`, invalidating any client's saved
default.
Replace the list with a single entry, `default`, which is a name the API itself
answers to: vLLM takes it as a second --served-model-name and still reports the
real slug, being first in the list; the MLX proxy accepts it as an alias. So
`llmhost/default` survives a switch. The local entry is labelled with whatever is
loaded, refreshed by both switch paths; a remote block is pasted once and never
refreshed, so it names no model rather than make a claim that goes stale.
Existing configs point at a specific model, which this provider no longer has and
opencode would reject, so configure() and sync() migrate `<prov>/<model>` to
`<prov>/default`. Other providers' defaults are untouched, and an older remote
block that still lists many models keeps working, including as the fallback when
the local provider is removed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
These grew one bug at a time in a scratch directory and were about to be thrown
away, having caught four real regressions between them. Move them in as they
are -- plain scripts, stdlib only, no test dependency -- behind a shared harness
and `python3 tests/run.py`.
The harness exists mostly for its guard. A suite testing the purge path once
sandboxed LLMHOST_CONFIG but not LLMHOST_HOME and deleted a live install's data
directory; BIN_DIR and SHIM have no env override at all, coming straight off
Path.home(). So the harness repoints those into the sandbox and then asserts
that every path llmhost could write or delete is inside it, aborting the run if
not -- verified by pointing it at a real path and watching it refuse.
The model plan the opencode suite needs is now a fixture rather than a file read
out of someone's home directory; it carries no key (the key lives in its own
file) and its machine-specific fields are pinned.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>