llm-host/llmhost
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
..
backends Refuse a request for a model that isn't loaded; show the slug in /models 2026-11-03 00:38:35 -08:00
web Refuse a request for a model that isn't loaded; show the slug in /models 2026-11-03 00:38:35 -08:00
__init__.py Initial llm-host: hardware-aware local LLM server with dashboard 2026-11-02 03:51:06 -08:00
__main__.py Initial llm-host: hardware-aware local LLM server with dashboard 2026-11-02 03:51:06 -08:00
catalog.json Add Ornith 1.5 9B for 16 GB Macs and 16 GB GPUs 2026-11-02 05:32:35 -08:00
cli.py Refuse a request for a model that isn't loaded; show the slug in /models 2026-11-03 00:38:35 -08:00
hfcache.py MLX: cap KV caches and recover from crashes; add llmhost watch 2026-11-02 07:45:12 -08:00
hw.py Initial llm-host: hardware-aware local LLM server with dashboard 2026-11-02 03:51:06 -08:00
opencode.py Refuse a request for a model that isn't loaded; show the slug in /models 2026-11-03 00:38:35 -08:00
paths.py Initial llm-host: hardware-aware local LLM server with dashboard 2026-11-02 03:51:06 -08:00
plan.py MLX: cap KV caches and recover from crashes; add llmhost watch 2026-11-02 07:45:12 -08:00
service.py Initial llm-host: hardware-aware local LLM server with dashboard 2026-11-02 03:51:06 -08:00