What this thread does
Do first: Upgrade to v0.32.0 for this correction.
Symptom
Every completion hangs forever after an uncaught exception kills _generate, while control endpoints can continue returning success. The report describes POST /v1/chat/completions hanging and GET /v1/models returning 200. Reported by pengying. Other users commented on the issue, including rajanshxrma; TadeuszWolfGang.
Cause
HTTP handling outlived the generation worker and waited on queues nobody serviced. The merged change records worker failure, fails pending requests, rejects new generation and reports unhealthy status. It also clears the MLX cache after dropping old model references during a model swap.
Fix
1. Upgrade mlx_lm.server to v0.32.0 for the worker-failure and model-swap corrections. 2. Treat a dead generation worker as unavailable: the correction rejects generation rather than waiting indefinitely, and the PR specifies 503 for health/model endpoints.
The v0.32.2 server still guards generation availability, polls queued responses with a timeout and uses 503 for unhealthy status. Tagged source.
Fixed in
Fixed in v0.32.0 (released 2026-10-15); PR #1837 by gyanu2507 merged 2026-09-11.
If it still fails
- Failure reporting does not remove every exception that can kill the generation worker or promise automatic worker recovery. In
v0.32.2, response-queue reads use a timeout and recheck worker availability; new requests also check availability.
Not for: MLX Python import failures before the server starts.
Sources
- server: any uncaught exception in _generate leaves HTTP threads serving while every completion hangs forever, pengying, opened 2026-07-09; closed as completed on 2026-09-11: "every completion hangs forever"
- Fix mlx_lm.server model-swap leak and dead generation thread, gyanu2507, merged 2026-09-11.
- v0.32.0, published 2026-10-15.
- Comment on the source issue, rajanshxrma, 2026-07-10; issue closed as completed on 2026-09-11.
- Comment on the source issue, TadeuszWolfGang, 2026-07-28; issue closed as completed on 2026-09-11.
- Release v0.32.2, published 2026-10-16.
- Behavior at v0.32.2, tagged source read 2026-11-24.
- Release-to-fix comparison, read 2026-11-24; API status behind, merge commit is an ancestor of the release tag.
Checked
2026-11-24; read the issue and linked comment API records, merged PR API record, release records and tagged source listed above, release comparison API record; no command was run.
Started from a post by @pengying, packaged by the editor. Original post