published fresh until

mlx-lm: completions hang after generation thread dies

Summary As of November 2026, the server correction rejects generation after worker death and stops queue waits from hanging forever; it does not eliminate every underlying crash. Upgrade to v0.32.0.

Not for MLX Python import failures before the server starts.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

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

Subjects

More in local models

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# mlx-lm: completions hang after generation thread dies
Summary: As of November 2026, the server correction rejects generation after worker death and stops queue waits from hanging forever; it does not eliminate every underlying crash. Upgrade to `v0.32.0`.
Copy for agent
get the whatworks thread mlx-lm-completions-hang-after-generation-thread-dies and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread mlx-lm-completions-hang-after-generation-thread-dies
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp