voicebox icon indicating copy to clipboard operation
voicebox copied to clipboard

just setup-python doesn't install mlx-audio/mlx-lm — MLX backend fails on fresh Apple Silicon dev setup

Open edmiidz opened this issue 5 months ago • 2 comments

Summary

just setup-python does not install mlx-audio (or mlx-lm), so a freshly set-up dev environment on Apple Silicon fails all STT/TTS that go through the MLX backend with:

ModuleNotFoundError: No module named 'mlx_audio'

The release CI (.github/workflows/release.yml) installs these packages, but the justfile — the documented dev setup path (just setup) — does not. So the bundled app works while a from-source dev checkout silently can't transcribe or generate on the MLX path.

Environment

  • Repo at cabef1b (v0.5.0), built from source via just setup
  • macOS 26.5.1, Darwin 25.5.0, arm64 (Apple Silicon)
  • Python 3.12.13 (Homebrew), mlx==0.31.2

Reproduction

just setup           # or: just setup-python
just dev-backend
curl -X POST http://127.0.0.1:17493/transcribe -F "[email protected]" -F "model=turbo"

The transcribe call returns 202 repeatedly, and the server log shows:

ERROR: Marked whisper-turbo as error: No module named 'mlx_audio'

backend/backends/mlx_backend.py imports from mlx_audio.stt import load (line ~307) and from mlx_audio.tts import load (line ~97), but nothing in just setup-python installs mlx-audio.

Root cause

requirements-mlx.txt deliberately does not list mlx-audio (its comment explains the transformers version conflict and says to install it --no-deps afterward). release.yml does exactly that:

# .github/workflows/release.yml
pip install -r backend/requirements-mlx.txt
pip install --no-deps mlx-lm==0.31.1
pip install --no-deps mlx-audio==0.4.1

But the justfile MLX block stops at requirements-mlx.txt:

# justfile (Apple Silicon block in setup-python)
if [ "$(uname -m)" = "arm64" ] && [ "$(uname)" = "Darwin" ]; then
    echo "Detected Apple Silicon — installing MLX dependencies..."
    {{ pip }} install -r {{ backend_dir }}/requirements-mlx.txt
fi

So mlx-lm and mlx-audio are never installed for dev.

Suggested fix

Add the same two --no-deps installs to the Apple-Silicon branch of setup-python in the justfile (both the [unix] and [windows] recipes), mirroring release.yml:

{{ pip }} install -r {{ backend_dir }}/requirements-mlx.txt
{{ pip }} install --no-deps mlx-lm==0.31.1
{{ pip }} install --no-deps mlx-audio==0.4.1

Workaround

backend/venv/bin/pip install --no-deps mlx-lm==0.31.1 mlx-audio==0.4.1

Filed after a from-source build on Apple Silicon. Related: #699 (also MLX-on-Apple-Silicon, same package versions).

edmiidz avatar Jun 30 '26 20:06 edmiidz

Confirmed on M4 — `just setup-python` installs `requirements-mlx.txt` (mlx + miniaudio) and stops, never running the `pip install --no-deps mlx-lm==0.31.1` / `mlx-audio==0.4.1` steps that `.github/workflows/release.yml` already does for packaged builds. No error, no log line — `get_backend_type()` just silently falls back to `"pytorch"`.

Heads up if you try the obvious fix (`pip install mlx-lm` by hand, no `--no-deps`): it drags in `transformers>=5.0.0`, which breaks Qwen CustomVoice loading with a `check_model_inputs()` TypeError — see #699 comment for details. `--no-deps` avoids that entirely, which is presumably why the release workflow does it that way.

Opened #886 with the missing justfile step (mirrors release.yml) plus a couple of related MLX fixes found along the way. Verified on real M4 hardware.

AlexStephenLytton avatar Jul 12 '26 18:07 AlexStephenLytton

This is fixed by #892 (thanks @flowbrix): just setup-python now installs mlx-lm and mlx-audio on Apple Silicon, so the MLX backend works on a fresh dev setup. It is part of Voicebox 0.6.0. The 0.6.0 build is cut and is waiting on an Apple Developer account issue that blocks notarizing the macOS release; it will be published as soon as that clears. Closing as fixed; if you still see this on 0.6.0 once it is out, please reopen with details.

capy-ai-staging avatar Oct 07 '26 04:10 capy-ai-staging