llm-host/llmhost/web
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
..
__init__.py Initial llm-host: hardware-aware local LLM server with dashboard 2026-11-02 03:51:06 -08:00
index.html Dashboard: KV cache on MLX, a completed-request table, honest GPU charts 2026-11-03 01:28:09 -08:00
server.py Dashboard: KV cache on MLX, a completed-request table, honest GPU charts 2026-11-03 01:28:09 -08:00