Commit graph

41 commits

Author SHA1 Message Date
neil
c8b70afdbf Split the internet upgrades: API-only tunnel, OIDC, authenticator codes, expose-dashboard
install-newt now sets up the tunnel for the API only; the dashboard stays on the LAN.
Dashboard sign-in is its own step: install-oidc (the OIDC flow, split out) or install-otp,
which pairs authenticator apps with a QR code in the terminal (stdlib QR encoder, TOTP per
RFC 6238) so a code also opens the dashboard, with replay and lockout rules.
expose-dashboard walks through publishing the dashboard, only after install-newt, and
warns while it's protected by the API key alone; with codes it offers to switch the key off
for the dashboard. Each install-* has a remove-*.

Also opencode-install.sh: a standalone script, fetched from the repo, that installs opencode
if needed, saves the API key to a 0600 file and adds the provider to opencode.json for new
and existing configs. /v1/models reports whether the model reasons, for that script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 15:56:54 -08:00
neil
e6ff4ce909 Connect dialog: a complete opencode.json, and a one-line key command
The snippet was only the provider entry, which an empty or missing opencode.json can't take,
and without a "model" opencode starts on its own hosted default and asks for that service's
key. It is now a whole config (schema, provider, model), as `llmhost opencode-config` prints,
with instructions for merging into an existing file.

The key-saving command was two lines; pasted together, the first line's `read` swallowed the
second as the key and no file was written. It's one line now, and writes only a non-empty key.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 15:10:49 -08:00
neil
04ff14c58f Dashboard: Connect dialog with the API key and opencode setup
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>
2026-11-05 23:03:56 -08:00
neil
6fd82448c5 Dashboard: an API key button that shows the key with a copy button
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>
2026-11-05 22:51:21 -08:00
neil
e814a2359d install-newt: optional internet access via a Pangolin tunnel, with OIDC sign-in on the dashboard
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>
2026-11-05 21:44:09 -08:00
neil
d07a92e5b5 Scrub real machine hostname from README and test fixtures 2026-11-05 01:29:45 -08:00
Neil Bantoc
c8f04f49b7 Requests table: durations in h/m/s, and the seconds each phase took
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>
2026-11-04 00:23:33 -08:00
Neil Bantoc
e24c0b7712 Reasoning effort is the dashboard's to set, not the client's
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>
2026-11-03 15:01:26 -08:00
Neil Bantoc
e48517b1cf Setup: keep the dashboard's reasoning setting across an update
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>
2026-11-03 15:01:12 -08:00
neil
8879db44a0 Proxy in front of vLLM too; dashboard reset/clear; opencode effort variants
- 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>
2026-11-03 13:03:52 -08:00
Neil Bantoc
1121c3f908 README: what to pick up on an NVIDIA box
All of this branch was written on Apple Silicon. Write down which parts are
unverified on vLLM (the second --served-model-name, which would stop the server
starting if vLLM rejects it), which are deliberately not wired there and why
(the reasoning chooser and the per-request table both depend on the MLX proxy,
and there is no proxy in front of vLLM), and which should just work but have
never run on that hardware.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-03 02:58:04 -08:00
Neil Bantoc
9af7f1e545 opencode: offer one model, not a menu where four of five fail
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>
2026-11-03 02:26:34 -08:00
Neil Bantoc
51c2880a2e Add tests/: four suites, a runner, and a sandbox that can't escape
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>
2026-11-03 02:23:15 -08:00
Neil Bantoc
ba7bd76af6 README: document the reasoning chooser
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-03 02:15:53 -08:00
Neil Bantoc
623d093b81 Dashboard: a reasoning chooser, offering only what the model accepts
Reasoning effort isn't a backend flag -- vLLM's --reasoning-parser only parses
the output. It's a chat-template kwarg read per request, and the models differ:
Qwen3.8 27B's template takes enable_thinking plus reasoning_effort in
('low','medium','xhigh') and raises on anything else, while Ornith 1.5 9B takes
only enable_thinking. Note 'xhigh', not OpenAI's 'high'.

So the chooser is built from what the loaded model's own template actually reads
(hfcache.template_controls), with the level names from the catalog, which is the
part that can't be inferred -- a level the template doesn't know would make it
raise, so an undeclared or unreadable one is never offered or sent.

The proxy injects the setting into chat completions, with a key the client set
itself always winning, the same precedence mlx_lm gives its own
--chat-template-kwargs. Reading it from config per request (mtime-cached) means
the dashboard changes it with no restart, so the model stays loaded -- the
startup flag would have cost a full reload per change.

vLLM gets no control: llm-host runs it without a proxy, so there is nothing in
the path to inject the kwarg. The panel hides itself rather than pretend.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-03 02:15:12 -08:00
Neil Bantoc
944eda06cc Dashboard: KV cache on MLX, a completed-request table, honest GPU charts
Three gaps, all of them things the dashboard drew but never filled.

KV cache was never reported on MLX: /llmhost/metrics had no "kv" key at all,
so the tile and chart sat empty. mlx_lm has no endpoint for it, but it logs
"Prompt Cache: N sequences, X GB" (decimal GB, n_bytes/1e9) and that stream
already passes through _pump_output, so pick it out there and report a fraction
of --prompt-cache-bytes -- the same shape vLLM's kv already has, so the sampler
needs no backend special-casing. Peak is kept alongside the current value.

GPU temperature and power are root-only on macOS (powermetrics), so hw.live_stats
has always returned None for them on Apple. Two permanently blank charts is worse
than none: hide them and say why when the hardware doesn't report them.

Add a completed-request table above the server log: when each request finished,
its duration, time to first token, prompt and generated tokens, the rate for each
phase, and peak KV during the run. Rates are split at the first token -- prompt
tokens over TTFT, generated tokens over what's left -- since a single rate over
the whole duration blurs prefill into generation. The proxy keeps the last 50 runs;
peak KV is joined in by the sampler, which is the only side that samples KV on a
timer.

Also: close the upstream connection explicitly when a client hangs up mid-answer
rather than leaving it to GC, log that in one line, and collapse mlx_lm's
resulting BrokenPipeError traceback in the log view. Any other traceback is left
verbatim.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-03 01:28:09 -08:00
Neil Bantoc
2c0818ca2b Refuse a request for a model that isn't loaded; show the slug in /models
The MLX proxy rewrote every request's "model" to the preloaded one, so asking
for a model the server wasn't running returned another model's output wearing
the requested name -- silently. The rewrite itself has to stay (mlx_lm would
otherwise try to load a model matching the name), so validate first: a name
that is neither the served name nor its repo id gets 404 model_not_found,
naming what is loaded and how to switch. An unstated name still means "the
loaded one", and the key is still checked before the model.

opencode's /models hid the same trap twice over. Label models
`<title> · <slug> (<where>)` so the list is searchable by the id used
everywhere else -- titles alone had dropped the slug -- and mark the loaded
one `(Local, loaded)`, refreshed by both switch paths (CLI and dashboard)
through a new opencode.sync(), which only ever refreshes a block that is
already there.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-03 00:38:35 -08:00
Neil Bantoc
8c6615dbb4 opencode: clear the cached key, and let --purge keep the API key
opencode caches a provider's key in ~/.local/share/opencode/auth.json and that
copy wins over opencode.json: with a stale entry it fails auth without sending
a request at all and asks for the key interactively. Verified by A/B on a live
install -- correct entry works, wrong entry never reaches the server, absent
entry works and reads the key file.

llm-host mints a fresh key whenever the config dir is purged, so the cached
copy went stale on every reinstall. configure() now drops the entry for its own
provider, leaving the {file:...} reference authoritative; it tracks the key file
and cannot go stale. remove() takes the cached key with the provider. Other
providers' credentials are never touched, and an unreadable store is left alone
rather than repaired.

Add `uninstall --purge --keep-key` so the key survives a purge and a reinstall
reuses it -- clients elsewhere then keep working. Warn about the new key when
it doesn't. Factor the purge into purge() so it can be tested without touching
a real install.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-03 00:19:54 -08:00
Neil Bantoc
13a7def080 opencode: label models with the catalog title, not the slug
/models showed "qwen3.8-27b (Local)" where the catalog already has a name
meant for reading: "Qwen3.8 27B". The dict key stays the slug -- that is the
model id the API answers to -- so only the display name changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-02 23:52:31 -08:00
Neil Bantoc
504ea3018a opencode: name providers LLMHost (Local) / LLMHost (<host>), identify by key file
The local and remote setup paths already used distinct provider ids, so one
opencode config can point at a local server and any number of remote ones.
Name them after the machine they reach so they're tellable apart in /models.

Decide which block is *this* machine's by the key-file reference it carries
rather than by its name, so:

  - a provider renamed by hand is still recognised and updated in place
    instead of a second one being added next to it;
  - a remote provider sitting under the `llmhost` id is no longer silently
    overwritten with a localhost baseURL (setup takes `llmhost-local` and
    says so) -- the one-shot .before-llmhost backup could not recover it;
  - uninstall removes only the local provider, never `llmhost-*` blocks for
    servers that are still running, and never providers it didn't create.

Add `llmhost opencode-remove` for the case the servers can't handle for each
other: uninstalling on a server can't reach the clients pointing at it. Wire
uninstall to it, repointing opencode's default model at a surviving llm-host
provider and dropping `model` only when none is left.

Also split config read/write out of configure() and report `unparsable`: a
syntactically broken opencode.json used to raise ValueError mid-setup.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-11-02 23:42:18 -08:00
neil
a250812d42 MLX: count prompt tokens while prefill runs, not when the request ends
The proxy only added a request's prompt tokens from the final usage chunk, so a
long prefill showed as a flat prompt rate and then one spike (prompt size over a
2 s sample), and requests the client abandoned mid-prefill were never counted.
mlx_lm.server already streams ": keepalive <done>/<total>" after each prefill
step; count those as they pass through, and top up from the usage chunk. Also
leave out prompt-cache hits (cached_tokens), which take no processing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 13:50:10 -08:00
neil
994659b5e2 Dashboard: time to first token tile and chart
vLLM: from the vllm:time_to_first_token_seconds histogram. MLX: the proxy
times streamed requests from arrival to the first generated token. Each
chart sample is the average over requests that got their first token in
that 2 s window; idle samples are gaps, and isolated samples now draw as
dots in every chart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 08:12:07 -08:00
neil
8611d92cf4 MLX: cap KV caches and recover from crashes; add llmhost watch
- mlx_lm.server kept up to 10 conversations' KV caches with no byte
  limit and prefilled 8 prompts at once, which ran a 16 GB Mac out of
  GPU memory. The plan now gives the live request half the free memory
  (at least 32k tokens), caps --prompt-cache-bytes to the rest, and on
  small machines prefills one prompt at a time.
- When its generation thread dies, mlx_lm.server keeps running but fails
  every request. The proxy now restarts it.
- llmhost watch: one live line with download progress (bytes, speed,
  time left), then loading, until the model answers. Setup and switch
  point at it instead of llmhost logs -f.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 07:45:12 -08:00
neil
0b2cdcf513 Port check: ignore TIME_WAIT on macOS too; uninstall waits for its ports
The TIME_WAIT fix only applied on Linux, so a reinstall on a Mac right
after uninstall still saw 1134 as busy (the old dashboard's connections
were closing) and moved the API to 1136. Now a port is busy only if
something accepts connections on it or a SO_REUSEADDR bind fails, on
both platforms. Uninstall also waits for the services to release their
ports before returning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 07:36:54 -08:00
neil
780bdf1fac Default the API to port 1134
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 07:25:05 -08:00
neil
c08a548fe0 Default the dashboard to port 11340
New installs use 11340 instead of 8080, which is often taken by other
dev servers. Existing installs keep their saved port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 07:24:03 -08:00
neil
0611efd154 Port check: ignore TIME_WAIT leftovers on Linux
Binding without SO_REUSEADDR fails while connections to a just-stopped
server linger in TIME_WAIT, so setup moved to the next port even though
nothing was listening. Servers bind with SO_REUSEADDR, so check the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 07:09:03 -08:00
neil
22e3019725 Uninstall: offer to delete downloaded models, with a command that works
The old hint pointed at `hf`, which lived in the venv uninstall had just
deleted. Uninstall now lists llm-host's catalog models in the cache with
their sizes and asks (default no); --models deletes without asking. It
runs `uv tool run --from huggingface_hub hf cache rm`, which also frees
blobs in the shared hub/blobs directory, and prints that exact command
when models are kept. Models outside the catalog are never touched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 05:51:52 -08:00
neil
458b0cfc32 Setup: show progress while stopping the running services
After confirming, setup stops the old services and waits up to 30s for
their ports to free, with no output. Show a spinner with elapsed seconds
immediately (a plain line when not on a terminal), ending in a check mark.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 05:48:05 -08:00
neil
b07af69afa Installer: add ~/.local/bin to PATH instead of only warning
Appends an export to the profile for the user's shell (zsh: .zshrc,
bash: .bash_profile on macOS / .bashrc on Linux, fish: config.fish),
once, and tells the user to open a new terminal at the end of setup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 05:44:35 -08:00
neil
7ad0642d2e Offer to install opencode and connect it to the local server
After setup, if opencode is missing, offer to install it with its
official installer; then add an `llmhost` provider pointing at
http://localhost:<api port>/v1 that reads llm-host's key file directly.
Other providers and the default model are kept, the original config is
backed up once, trailing commas are tolerated, and a config with
comments is left untouched (the block is printed instead). Re-runs and
`llmhost update` keep the provider's port and models in sync.
New: `llmhost opencode-setup`, and setup flags --opencode / --no-opencode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 05:37:35 -08:00
neil
3da3d8ed45 Add Ornith 1.5 9B for 16 GB Macs and 16 GB GPUs
Listed last so larger machines keep their current default. Builds: BF16,
NVFP4, AWQ and MLX 8/6/4-bit. Its KV cost (17.6 KiB/token) is estimated
from config.json (8 full-attention layers x 4 KV heads x 256 dims, fp8)
plus the ~10% margin the measured 35B/122B numbers showed over the same
formula; it hasn't been measured on hardware yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 05:32:35 -08:00
neil
7eb72d1d79 Never move a saved port on update
`llmhost update` stopped the services and checked the ports before the
old processes had released them (launchctl bootout returns early), so
the API hopped to the next free port and broke configured clients.
Setup now waits for our own ports to close, and treats saved ports as
pinned: if another program holds one it errors instead of moving. Only
a first install auto-picks a free port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 05:17:19 -08:00
neil
249c693e6d MLX proxy: count prompt tokens on streamed requests
Streamed responses only carry usage when the client asks for it, so the
prompt processing chart stayed at zero on Macs. The proxy now requests
the usage chunk itself and strips it from responses to clients that
didn't ask, forwarding the stream one whole event at a time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 05:03:49 -08:00
neil
c4b54b4abd Dashboard: add a prompt processing tok/s chart
Sits between generation tok/s and KV cache in a three-chart row
(stacks on narrow screens), with the same hover readout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 05:03:07 -08:00
neil
85912dd3b2 MLX: report ready only once the model answers; quieter logs
mlx_lm.server's /health is OK as soon as its thread starts, so the
dashboard showed Ready while the model was still downloading. The proxy
now sends a 1-token probe and answers /health with 503 until it succeeds.
Also drop health-check, dashboard-poll and per-file HF request lines from
the MLX log while keeping download progress bars.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 04:48:33 -08:00
neil
16f096714e Handle busy ports and stop orphaning mlx_lm.server
On a Mac with port 8000 already taken, the proxy failed to bind after
mlx_lm.server had started, leaving an orphan each time launchd retried.
- setup now stops our own services, then moves the API/dashboard to the
  next free ports (or errors if a port was given explicitly)
- the MLX service binds its port before starting mlx_lm.server, always
  stops the child on exit, and cleans up leftovers from earlier crashes
- drop the nonexistent huggingface_hub[cli] extra

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 04:45:36 -08:00
neil
d2ab08a5f5 MLX proxy: don't count health checks as requests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 04:41:26 -08:00
neil
9ccd5ffd70 Link lib -> lib64 in the merged CUDA tree for nvcc.profile
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 03:52:56 -08:00
neil
f0ea0bd7bb Fix nvcc self-test: copy nvcc into the merged CUDA tree
nvcc resolves its toolkit from its real path, so a symlink made it look
for lib64 inside a single pip wheel and fail to link cudart_static.
Also make `llmhost start` start the dashboard after `setup --no-start`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 03:52:33 -08:00
neil
5b9586ac80 Initial llm-host: hardware-aware local LLM server with dashboard
Detects the GPU (NVIDIA on Linux, Apple Silicon on macOS), picks the
catalog models and builds that fit, installs vLLM or MLX without sudo,
and runs the model server plus a web dashboard as user services.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
2026-11-02 03:51:06 -08:00