Skip to content

The open-source AI voice studio. Clone, dictate, create.

fix(cuda): route the 0.6 CUDA download gate through the platform token; stamp platform in libs manifests

jamiepine8a2db24c23a0
diff --git a/.gitignore b/.gitignore
index 853c5060..1b00eb85 100644
Binary files a/.gitignore and b/.gitignore differ
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dbd940e6..5b8acc11 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,9 @@
### API
- **OpenAI-compatible text-to-speech API.** `POST /v1/audio/speech` and `GET /v1/models` accept OpenAI's request shape, so the official `openai` SDKs, Open WebUI, Home Assistant and any other OpenAI TTS client become a local, offline TTS by changing only the base URL. `voice` is a Voicebox profile (name or id, falling back to the per-client binding and default voice like `/speak`); `model` is a Voicebox engine or model variant, with `tts-1`, `tts-1-hd` and `gpt-4o-mini-tts` accepted as aliases for the profile's configured engine; `response_format` supports `wav`, `mp3`, `flac`, `opus`, `pcm` and (with ffmpeg) `aac`; `speed` is a pitch-preserving time stretch; `instructions` feeds the engine's instruct prompt. Errors use OpenAI's `{"error": {...}}` body, and the endpoint is documented on the MCP Server page. — @neuron-tech-ai ([#1170](https://github.com/jamiepine/voicebox/pull/1170), from [#656](https://github.com/jamiepine/voicebox/pull/656); fixes [#10](https://github.com/jamiepine/voicebox/issues/10))
+### Linux
+
+- **Installing the CUDA or ROCm backend on Linux downloads a native Linux binary.** The GPU server release assets are now platform-qualified (`voicebox-server-{cuda,rocm}-<platform>.tar.gz`, `{cuda,rocm}-libs-<platform>-<version>.tar.gz`) and a `build-gpu-linux` release job builds the Linux CUDA and ROCm bundles alongside the Windows ones, so Linux no longer fetches a Windows `.exe` and silently falls back to CPU. The ROCm download is offered on Linux hosts with an AMD ROCm driver (`/dev/kfd`), and the CUDA download gate from 0.6 now refuses only platforms without a published asset (macOS, Linux arm64). — @1337hero, @smendola ([#851](https://github.com/jamiepine/voicebox/pull/851), [#561](https://github.com/jamiepine/voicebox/pull/561); fixes [#767](https://github.com/jamiepine/voicebox/issues/767))
## [0.6.0] - 2026-10-04
diff --git a/backend/services/cuda.py b/backend/services/cuda.py
index 41453389..9e6b4264 100644
--- a/backend/services/cuda.py
+++ b/backend/services/cuda.py
@@ -32,7 +32,11 @@ GITHUB_RELEASES_URL = "https://github.com/jamiepine/voicebox/releases/download"
PROGRESS_KEY = "cuda-backend"
-CUDA_DOWNLOAD_UNSUPPORTED_REASON = "Downloadable CUDA backend releases are currently only published for Windows."
+CUDA_DOWNLOAD_UNSUPPORTED_REASON = (
+ "Downloadable CUDA backend releases are only published for "
+ + " and ".join(SUPPORTED_GPU_ASSET_PLATFORMS)
+ + "."
+)
# The current expected CUDA libs version. Bump this when we change the
# CUDA toolkit version or torch's CUDA dependency changes (e.g. cu126 -> cu128).
@@ -68,7 +72,7 @@ def get_cuda_exe_name() -> str:
def is_cuda_download_supported() -> bool:
"""Return whether this platform has a matching CUDA release asset."""
- return sys.platform == "win32"
+ return server_asset_platform() in SUPPORTED_GPU_ASSET_PLATFORMS
def get_cuda_download_unsupported_reason() -> str | None:
@@ -314,11 +318,6 @@ async def _download_cuda_binary_locked(version: Optional[str] = None):
base_url = f"{GITHUB_RELEASES_URL}/{version}"
plat = server_asset_platform()
- if plat not in SUPPORTED_GPU_ASSET_PLATFORMS:
- raise RuntimeError(
- f"CUDA backend not available for platform '{plat}'. "
- f"Supported platforms: {', '.join(SUPPORTED_GPU_ASSET_PLATFORMS)}"
- )
server_archive = f"voicebox-server-cuda-{plat}.tar.gz"
libs_archive = f"cuda-libs-{plat}-{CUDA_LIBS_VERSION}.tar.gz"
diff --git a/backend/tests/test_cuda_download.py b/backend/tests/test_cuda_download.py
index 77115f06..d6e12fdb 100644
--- a/backend/tests/test_cuda_download.py
+++ b/backend/tests/test_cuda_download.py
@@ -1,25 +1,57 @@
+"""
+Platform gate for the downloadable CUDA backend.
+
+CUDA server assets are published for linux-x86_64 and windows-x86_64 only.
+Any other platform must be refused before a release download starts.
+"""
+
import sys as py_sys
import types
+from unittest.mock import patch
import pytest
from backend.services import cuda
-def test_cuda_status_reports_unsupported_linux_download(monkeypatch, tmp_path):
- monkeypatch.setattr(cuda.sys, "platform", "linux")
+def _platform(system: str, machine: str):
+ return (
+ patch("backend.utils.platform_detect.platform.system", return_value=system),
+ patch("backend.utils.platform_detect.platform.machine", return_value=machine),
+ )
+
+
+ "system,machine",
+ [("Darwin", "arm64"), ("Linux", "aarch64")],
+)
+def test_cuda_status_reports_unsupported_platform(monkeypatch, tmp_path, system, machine):
monkeypatch.setattr(cuda, "get_data_dir", lambda: tmp_path)
- status = cuda.get_cuda_status()
+ with _platform(system, machine)[0], _platform(system, machine)[1]:
+ status = cuda.get_cuda_status()
assert status["available"] is False
assert status["download_supported"] is False
assert status["unsupported_reason"] == cuda.CUDA_DOWNLOAD_UNSUPPORTED_REASON
+ "system,machine",
+ [("Linux", "x86_64"), ("Windows", "AMD64")],
+)
+def test_cuda_status_reports_supported_platform(monkeypatch, tmp_path, system, machine):
+ monkeypatch.setattr(cuda, "get_data_dir", lambda: tmp_path)
+
+ with _platform(system, machine)[0], _platform(system, machine)[1]:
+ status = cuda.get_cuda_status()
+
+ assert status["download_supported"] is True
+ assert status["unsupported_reason"] is None
+
+
@pytest.mark.asyncio
-async def test_cuda_download_rejects_linux_before_network(monkeypatch, tmp_path):
- monkeypatch.setattr(cuda.sys, "platform", "linux")
+async def test_cuda_download_rejects_macos_before_network(monkeypatch, tmp_path):
monkeypatch.setattr(cuda, "get_data_dir", lambda: tmp_path)
class UnexpectedClient:
@@ -28,5 +60,47 @@ async def test_cuda_download_rejects_linux_before_network(monkeypatch, tmp_path)
monkeypatch.setitem(py_sys.modules, "httpx", types.SimpleNamespace(AsyncClient=UnexpectedClient))
- with pytest.raises(RuntimeError, match="currently only published for Windows"):
- await cuda._download_cuda_binary_locked("v0.5.0")
+ with _platform("Darwin", "arm64")[0], _platform("Darwin", "arm64")[1]:
+ with pytest.raises(RuntimeError, match="only published for"):
+ await cuda._download_cuda_binary_locked("v0.5.0")
+
+
+async def test_cuda_download_requests_linux_x86_64_assets(monkeypatch, tmp_path):
+ """On Linux x86_64 the download must fetch the Linux-qualified asset names."""
+ monkeypatch.setattr(cuda, "get_data_dir", lambda: tmp_path)
+ monkeypatch.setattr(cuda, "_needs_server_download", lambda version: True)
+ monkeypatch.setattr(cuda, "_needs_cuda_libs_download", lambda: False)
+
+ requested: list[str] = []
+
+ class StopDownload(Exception):
+ pass
+
+ class FakeClient:
+ def __init__(self, *args, **kwargs):
+ pass
+
+ async def __aenter__(self):
+ return self
+
+ async def __aexit__(self, *exc):
+ return False
+
+ async def head(self, url, *args, **kwargs):
+ return types.SimpleNamespace(headers={"content-length": "0"})
+
+ async def fake_download(client, url, sha256_url, **kwargs):
+ requested.append(url)
+ requested.append(sha256_url)
+ raise StopDownload()
+
+ monkeypatch.setattr(cuda, "_download_and_extract_archive", fake_download)
+ monkeypatch.setitem(py_sys.modules, "httpx", types.SimpleNamespace(AsyncClient=FakeClient))
+
+ with _platform("Linux", "x86_64")[0], _platform("Linux", "x86_64")[1]:
+ with pytest.raises(StopDownload):
+ await cuda._download_cuda_binary_locked("v0.7.0")
+
+ asset = f"{cuda.GITHUB_RELEASES_URL}/v0.7.0/voicebox-server-cuda-linux-x86_64.tar.gz"
+ assert requested == [asset, f"{asset}.sha256"]
diff --git a/scripts/package_cuda.py b/scripts/package_cuda.py
index 62e97224..647651d4 100644
--- a/scripts/package_cuda.py
+++ b/scripts/package_cuda.py
@@ -178,6 +178,7 @@ def package(
# Write cuda-libs.json manifest
manifest = {
"version": cuda_libs_version,
+ "platform": plat,
"torch_compat": torch_compat,
"archive": cuda_libs_archive.name,
"sha256": cuda_sha,
diff --git a/scripts/package_rocm.py b/scripts/package_rocm.py
index ff7a5fcc..b5605c23 100644
--- a/scripts/package_rocm.py
+++ b/scripts/package_rocm.py
@@ -185,6 +185,7 @@ def package(
# Write rocm-libs.json manifest.
manifest = {
"version": rocm_libs_version,
+ "platform": plat,
"torch_compat": torch_compat,
"archive": rocm_libs_archive.name,
"sha256": rocm_sha,