Commit graph

15 commits

Author SHA1 Message Date
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