llm-host/llmhost/backends
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
..
__init__.py Initial llm-host: hardware-aware local LLM server with dashboard 2026-11-02 03:51:06 -08:00
mlx.py MLX: count prompt tokens while prefill runs, not when the request ends 2026-11-02 13:50:10 -08:00
vllm.py Link lib -> lib64 in the merged CUDA tree for nvcc.profile 2026-11-02 03:52:56 -08:00