Skip to content

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

fix(tts): bundle VoiceDesign backend in the frozen build, resolve legacy designed profiles, add tests

jamiepineeb88a1362aa6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 221d6fdf..7b765d31 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@
## [Unreleased]
+### Features
+
+- **Design a voice from a written description.** The profile form gains a third source, "Describe a voice", next to clone-from-audio and built-in voice: write the voice you want ("a warm, gravelly older man with a slow Scottish lilt") and the profile is created as a `designed` voice backed by the new `qwen_voice_design` engine (Qwen3-TTS-12Hz-1.7B-VoiceDesign, 10 languages, local, Apache-2.0 weights). Designed profiles work everywhere a profile does: `/generate`, `/speak`, MCP `voicebox_speak`, stories, and dictation TTS. A per-generation instruct layers onto the description instead of replacing it. — @Lvigentini ([#1012](https://github.com/jamiepine/voicebox/pull/1012))
+
## [0.6.0] - 2026-10-04
**The stability release.** 0.5 made Voicebox a dictation and agent-voice studio; 0.6 makes it hold up. Sixty-plus contributor pull requests landed since 0.5 and most of them fix something that used to go wrong in daily use: MLX crashed with `There is no Stream(gpu, 1) in current thread` when a model was loaded on one thread and used on another, memory grew with every generation and never came back on unload, a fully-cached model retried HuggingFace five times per file before it would load offline, the Docker image could not write its own data volume, dictation refused to arm without an LLM it was never going to call, and the backend test suite would not even collect. All of that is fixed. The headline features ride on top: native AMD ROCm on Windows and in Docker, five new interface languages, and Chatterbox multilingual running on Apple Silicon through MLX.
diff --git a/backend/build_binary.py b/backend/build_binary.py
index 0a7cf879..95f8fae5 100644
--- a/backend/build_binary.py
+++ b/backend/build_binary.py
@@ -121,6 +121,8 @@ def build_server(cuda=False, rocm=False):
"--hidden-import",
"backend.backends.qwen_custom_voice_backend",
"--hidden-import",
+ "backend.backends.qwen_voice_design_backend",
+ "--hidden-import",
"backend.utils.audio",
"--hidden-import",
"backend.utils.cache",
diff --git a/backend/routes/generations.py b/backend/routes/generations.py
index 639a2902..1edac8f1 100644
--- a/backend/routes/generations.py
+++ b/backend/routes/generations.py
@@ -50,7 +50,16 @@ def _get_or_create_import_profile(db: Session) -> DBVoiceProfile:
def _resolve_generation_engine(data: models.GenerationRequest, profile) -> str:
- return data.engine or getattr(profile, "default_engine", None) or getattr(profile, "preset_engine", None) or "qwen"
+ if data.engine:
+ return data.engine
+ stored = getattr(profile, "default_engine", None) or getattr(profile, "preset_engine", None)
+ if stored:
+ return stored
+ # Designed profiles created before the design engine existed carry no
+ # default_engine; "qwen" would be rejected by validate_profile_engine.
+ if getattr(profile, "voice_type", None) == "designed":
+ return profiles.DEFAULT_DESIGN_ENGINE
+ return "qwen"
@router.post("/generate", response_model=models.GenerationResponse)
diff --git a/backend/tests/test_designed_profiles.py b/backend/tests/test_designed_profiles.py
new file mode 100644
index 00000000..9e1cadd9
--- /dev/null
+++ b/backend/tests/test_designed_profiles.py
@@ -0,0 +1,139 @@
+"""Designed voice profiles: creation, engine validation, voice prompt, and the
+VoiceDesign backend's instruct layering. None of this loads the model."""
+
+import shutil
+import tempfile
+from pathlib import Path
+from types import SimpleNamespace
+
+import pytest
+from sqlalchemy import create_engine
+from sqlalchemy.orm import sessionmaker
+
+from backend import models
+from backend.backends import TTS_ENGINES, get_tts_model_configs
+from backend.backends.qwen_voice_design_backend import QwenVoiceDesignBackend
+from backend.database import Base
+from backend.models import VoiceProfileCreate
+from backend.routes.generations import _resolve_generation_engine
+from backend.services.profiles import (
+ DEFAULT_DESIGN_ENGINE,
+ create_profile,
+ create_voice_prompt_for_profile,
+ validate_profile_engine,
+)
+
+DESIGN = "A warm, gravelly older man with a slow Scottish lilt."
+
+
+def test_db():
+ temp_dir = tempfile.mkdtemp()
+ engine = create_engine(f"sqlite:///{Path(temp_dir) / 'test.db'}")
+ Base.metadata.create_all(bind=engine)
+ db = sessionmaker(autocommit=False, autoflush=False, bind=engine)()
+ yield db
+ db.close()
+ engine.dispose()
+ shutil.rmtree(temp_dir)
+
+
+def mock_profiles_dir(monkeypatch, tmp_path):
+ from backend import config
+
+ monkeypatch.setattr(config, "get_profiles_dir", lambda: tmp_path)
+ return tmp_path
+
+
+def test_engine_is_registered():
+ assert "qwen_voice_design" in TTS_ENGINES
+ configs = [c for c in get_tts_model_configs() if c.engine == "qwen_voice_design"]
+ assert [c.model_name for c in configs] == ["qwen-voice-design-1.7B"]
+ assert configs[0].hf_repo_id == "Qwen/Qwen3-TTS-12Hz-1.7B-VoiceDesign"
+
+
+def test_generation_request_accepts_engine():
+ req = models.GenerationRequest(profile_id="p", text="hi", engine="qwen_voice_design")
+ assert req.engine == "qwen_voice_design"
+
+
+async def test_designed_profile_gets_design_engine_by_default(test_db, mock_profiles_dir):
+ profile = await create_profile(
+ VoiceProfileCreate(name="Designed", language="en", voice_type="designed", design_prompt=DESIGN),
+ test_db,
+ )
+ assert profile.voice_type == "designed"
+ assert profile.default_engine == DEFAULT_DESIGN_ENGINE
+ assert profile.design_prompt == DESIGN
+
+ voice_prompt = await create_voice_prompt_for_profile(profile.id, test_db, engine=DEFAULT_DESIGN_ENGINE)
+ assert voice_prompt == {"voice_type": "designed", "design_prompt": DESIGN}
+
+
+async def test_designed_profile_rejects_cloning_engine(test_db, mock_profiles_dir):
+ with pytest.raises(ValueError, match="cannot use default engine"):
+ await create_profile(
+ VoiceProfileCreate(
+ name="Bad", language="en", voice_type="designed", design_prompt=DESIGN, default_engine="qwen"
+ ),
+ test_db,
+ )
+
+ profile = await create_profile(
+ VoiceProfileCreate(name="Designed", language="en", voice_type="designed", design_prompt=DESIGN),
+ test_db,
+ )
+ with pytest.raises(ValueError, match="does not support designed"):
+ validate_profile_engine(profile, "chatterbox")
+ validate_profile_engine(profile, "qwen_voice_design")
+
+
+async def test_cloned_profile_rejects_design_engine(test_db, mock_profiles_dir):
+ profile = await create_profile(VoiceProfileCreate(name="Cloned", language="en"), test_db)
+ assert profile.voice_type == "cloned"
+ assert profile.default_engine is None
+ with pytest.raises(ValueError, match="does not support cloned"):
+ validate_profile_engine(profile, "qwen_voice_design")
+
+
+def test_legacy_designed_profile_without_default_engine_resolves_to_design_engine():
+ request = models.GenerationRequest(profile_id="p", text="hi")
+ legacy = SimpleNamespace(voice_type="designed", default_engine=None, preset_engine=None)
+ assert _resolve_generation_engine(request, legacy) == DEFAULT_DESIGN_ENGINE
+
+ cloned = SimpleNamespace(voice_type="cloned", default_engine=None, preset_engine=None)
+ assert _resolve_generation_engine(request, cloned) == "qwen"
+
+ pinned = SimpleNamespace(voice_type="designed", default_engine="qwen_voice_design", preset_engine=None)
+ assert _resolve_generation_engine(request, pinned) == "qwen_voice_design"
+
+
+async def test_backend_layers_instruct_on_design_prompt(monkeypatch):
+ backend = QwenVoiceDesignBackend()
+ calls = []
+
+ class FakeModel:
+ def generate_voice_design(self, text, instruct, language):
+ calls.append((text, instruct, language))
+ import numpy as np
+
+ return [np.zeros(24000, dtype=np.float32)], 24000
+
+ async def fake_load(model_size=None):
+ backend.model = FakeModel()
+
+ monkeypatch.setattr(backend, "load_model_async", fake_load)
+ vp = {"voice_type": "designed", "design_prompt": DESIGN}
+
+ audio, sr = await backend.generate("Hello.", vp, language="en", seed=1)
+ assert sr == 24000 and len(audio) == 24000
+ assert calls[-1] == ("Hello.", DESIGN, "English")
+
+ await backend.generate("Hello.", vp, language="fr", instruct="Whisper it.")
+ assert calls[-1][1] == f"{DESIGN.rstrip('. ')}. Whisper it."
+ assert calls[-1][2] == "French"
diff --git a/backend/voicebox-server.spec b/backend/voicebox-server.spec
index a40d99cb..ab0b03b7 100644
--- a/backend/voicebox-server.spec
+++ b/backend/voicebox-server.spec
@@ -5,7 +5,7 @@ from PyInstaller.utils.hooks import copy_metadata
datas = []
binaries = []
-hiddenimports = ['backend', 'backend.main', 'backend.config', 'backend.database', 'backend.models', 'backend.services.profiles', 'backend.services.history', 'backend.services.tts', 'backend.services.transcribe', 'backend.utils.platform_detect', 'backend.backends', 'backend.backends.pytorch_backend', 'backend.backends.qwen_custom_voice_backend', 'backend.utils.audio', 'backend.utils.cache', 'backend.utils.progress', 'backend.utils.hf_progress', 'backend.services.cuda', 'backend.services.effects', 'backend.utils.effects', 'backend.services.versions', 'pedalboard', 'chatterbox', 'chatterbox.tts_turbo', 'chatterbox.mtl_tts', 'backend.backends.chatterbox_backend', 'backend.backends.chatterbox_turbo_backend', 'backend.backends.luxtts_backend', 'zipvoice', 'zipvoice.luxvoice', 'torch', 'transformers', 'fastapi', 'uvicorn', 'sqlalchemy', 'soundfile', 'qwen_tts', 'qwen_tts.inference', 'qwen_tts.inference.qwen3_tts_model', 'qwen_tts.inference.qwen3_tts_tokenizer', 'qwen_tts.core', 'qwen_tts.cli', 'requests', 'pkg_resources.extern', 'backend.backends.hume_backend', 'tada', 'tada.modules', 'tada.modules.tada', 'tada.modules.encoder', 'tada.modules.decoder', 'tada.modules.aligner', 'tada.modules.acoustic_spkr_verf', 'tada.nn', 'tada.nn.vibevoice', 'tada.utils', 'tada.utils.gray_code', 'tada.utils.text', 'backend.utils.dac_shim', 'torchaudio', 'backend.backends.kokoro_backend', 'en_core_web_sm', 'loguru', 'backend.mcp_server', 'backend.mcp_server.server', 'backend.mcp_server.tools', 'backend.mcp_server.context', 'backend.mcp_server.resolve', 'backend.mcp_server.events', 'sse_starlette', 'backend.backends.mlx_backend', 'mlx', 'mlx.core', 'mlx.nn', 'mlx_audio', 'mlx_audio.tts', 'mlx_audio.stt', 'mlx_lm', 'backend.backends.qwen_llm_backend', 'backend.backends.chatterbox_mlx_backend']
+hiddenimports = ['backend', 'backend.main', 'backend.config', 'backend.database', 'backend.models', 'backend.services.profiles', 'backend.services.history', 'backend.services.tts', 'backend.services.transcribe', 'backend.utils.platform_detect', 'backend.backends', 'backend.backends.pytorch_backend', 'backend.backends.qwen_custom_voice_backend', 'backend.backends.qwen_voice_design_backend', 'backend.utils.audio', 'backend.utils.cache', 'backend.utils.progress', 'backend.utils.hf_progress', 'backend.services.cuda', 'backend.services.effects', 'backend.utils.effects', 'backend.services.versions', 'pedalboard', 'chatterbox', 'chatterbox.tts_turbo', 'chatterbox.mtl_tts', 'backend.backends.chatterbox_backend', 'backend.backends.chatterbox_turbo_backend', 'backend.backends.luxtts_backend', 'zipvoice', 'zipvoice.luxvoice', 'torch', 'transformers', 'fastapi', 'uvicorn', 'sqlalchemy', 'soundfile', 'qwen_tts', 'qwen_tts.inference', 'qwen_tts.inference.qwen3_tts_model', 'qwen_tts.inference.qwen3_tts_tokenizer', 'qwen_tts.core', 'qwen_tts.cli', 'requests', 'pkg_resources.extern', 'backend.backends.hume_backend', 'tada', 'tada.modules', 'tada.modules.tada', 'tada.modules.encoder', 'tada.modules.decoder', 'tada.modules.aligner', 'tada.modules.acoustic_spkr_verf', 'tada.nn', 'tada.nn.vibevoice', 'tada.utils', 'tada.utils.gray_code', 'tada.utils.text', 'backend.utils.dac_shim', 'torchaudio', 'backend.backends.kokoro_backend', 'en_core_web_sm', 'loguru', 'backend.mcp_server', 'backend.mcp_server.server', 'backend.mcp_server.tools', 'backend.mcp_server.context', 'backend.mcp_server.resolve', 'backend.mcp_server.events', 'sse_starlette', 'backend.backends.mlx_backend', 'mlx', 'mlx.core', 'mlx.nn', 'mlx_audio', 'mlx_audio.tts', 'mlx_audio.stt', 'mlx_lm', 'backend.backends.qwen_llm_backend', 'backend.backends.chatterbox_mlx_backend']
datas += copy_metadata('qwen-tts')
datas += copy_metadata('requests')
datas += copy_metadata('transformers')