#675·voicebox

MLX thread error: "There is no Stream(gpu) in current thread" on HTTP REST and MCP transcribe

Author: lidi1011Created May 18, 2026Updated Sep 13, 2026

Environment

  • macOS 26.5, Apple Silicon (M4)
  • Voicebox v0.5.0 (app + server)

Bug summary

Voicebox HTTP REST API (POST /speak) and MCP voicebox.transcribe both fail with MLX thread-context errors. The MCP voicebox.speak tool works fine — the issue is specific to HTTP handlers using MLX in async/FastMCP context.

Steps to reproduce

1. HTTP REST /speak

curl -s http://127.0.0.1:17493/speak \
  -X POST \
  -H "Content-Type: application/json" \
  -H "X-Voicebox-Client-Id: test" \
  -d "{\"text\":\"hello\",\"profile\":\"<cloned_voice>\"}"

→ SSE stream shows status: "generating" for ~30s then status: "failed" with:

There is no Stream(gpu, 1) in current thread.

2. MCP voicebox.transcribe

Call via any MCP client with an audio file:

voicebox.transcribe(audio_path="/path/to/audio.wav", language="zh")

→ Same error:

There is no Stream(gpu, 4) in current thread.

Expected behavior

Both the HTTP speak endpoint and MCP transcribe should work on Apple Silicon with MLX backend, same as the MCP speak tool does.

Additional context

  • This breaks any non-MCP integration (custom TTS providers, shell scripting, etc.)
  • The MCP voicebox.speak works, suggesting the problem is in how FastMCP HTTP handlers set up the MLX thread context vs the MCP tool execution path