Fine-tune LLMs from one YAML. Layer streaming trains an 8B model on a 4 GB laptop GPU.
Python cliconsumer-gpudpofine-tuningggufhuggingfacellmllmopslocal-ailocal-llmloralow-vrammachine-learningollamapeftpythonpytorchqlorasfttransformers
fix(tts): refuse incompatible Spark/Oute live-codec installs (#265) (#1113)
AmixDigitald2b0d153d942
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex fd3aaad1..b29eba09 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -123,7 +123,7 @@ src/soup_cli/experiment/ - SQLite experiment trackingeval/ - Eval platform (custom tasks, LLM judge, human eval, leaderboard)migrate/ - Config migration (LLaMA-Factory, Axolotl, Unsloth)- recipes/ - Ready-made configs for popular models (174 recipes)+ recipes/ - Ready-made configs for popular models (173 recipes)autopilot/ - Zero-config decision engine (v0.25.0)registry/ - Model Registry (hashing, store, diff, attach) (v0.26.0 + v0.33.0)cans/ - Shareable .can artifact format + run/publish orchestrator (v0.26.0 + v0.33.0)diff --git a/changelog.d/0.75.1/1113.fixed.md b/changelog.d/0.75.1/1113.fixed.mdnew file mode 100644index 00000000..549710e3--- /dev/null+++ b/changelog.d/0.75.1/1113.fixed.md@@ -0,0 +1 @@+- Spark-TTS and OuteTTS raw-audio live-codec configs now fail closed at config parse with the real upstream compatibility reason; the unrunnable Spark recipe is removed, while Oute keeps the pre-encoded `chatml` recipe path (#265 by @Amix29 in #1113).diff --git a/docs/commands.md b/docs/commands.mdindex d8639b1a..9d2a84f7 100644--- a/docs/commands.md+++ b/docs/commands.md@@ -179,7 +179,7 @@ soup migrate --from llamafactory config.yaml Import config from LLaMA-Factorysoup migrate --from axolotl config.yml Import config from Axolotlsoup migrate --from unsloth notebook.ipynb Import config from Unsloth notebooksoup migrate --from llamafactory c.yaml --dry-run Preview without writing-soup recipes list List all 174 ready-made recipes+soup recipes list List all 173 ready-made recipessoup recipes show llama3.1-8b-sft Print recipe YAMLsoup recipes use llama3.1-8b-sft Copy recipe to soup.yamlsoup recipes search "reasoning" Search by keyword/task/size@@ -367,7 +367,7 @@ soup train # task='distill' + distill_mode=token|sequence Token logit-KL or sesoup train # task=classifier|reranker|cross_encoder + lora LoRA-adapter classifier (frozen encoder) — LIVE (v0.71.12)soup train # use_mod | expand_layers Mixture-of-Depths / LLaMA Pro (Llama/Qwen/Mistral) — LIVE (v0.71.12)soup train # use_longlora LongLoRA S² is refused at config load: the override leaked future tokens and applied no S² grouping; use rope_scaling_type with plain LoRA (#1240)-soup train # task='tts' + tts_family + modality='audio_out' TTS codec-string SFT; pre-encoded + Orpheus/SNAC + Llasa/XCodec2 live; Sesame CSM refused (native trainer required) — LIVE (v0.71.20)+soup train # task='tts' + tts_family + modality='audio_out' TTS pre-encoded codec-token SFT + emotion templating; Orpheus/Llasa live-codec; Spark/Oute raw-audio refused (upstream pins); Sesame CSM refused — LIVE (v0.71.20)soup train # task in {sft,tts} + moe_expert_quant=nf4|int8_rowwise [+moe_lora] bnb per-expert quant of fused-MoE experts (CUDA); refused on other tasks, which never applied it (#798) — LIVE (v0.71.20)soup train # task in {sft,tts} + train_router_only=true [+moe_lora] Freeze MoE experts, train only the gating router; refused on other tasks (#798). moe_lora needs lora.dropout: 0.0 on fused-expert MoEs — LIVE (v0.71.20)soup train # quantization='bitnet_1.58' BitNet 1.58 training is not implemented; config load refuses itdiff --git a/docs/serving-and-export.md b/docs/serving-and-export.mdindex a69ea12d..30541425 100644--- a/docs/serving-and-export.md+++ b/docs/serving-and-export.md@@ -653,7 +653,7 @@ soup ui**Pages:**- **Dashboard** — view all experiment runs, loss charts, system info, multi-run comparison-- **New Training** — create configs from templates or 174 ready-made recipes, validate, start training with live SSE log streaming and progress bar+- **New Training** — create configs from templates or 173 ready-made recipes, validate, start training with live SSE log streaming and progress bar- **Data Explorer** — browse and inspect datasets (JSONL, JSON, CSV, Parquet)- **Model Chat** — chat with streaming responses, configurable temperature/top_p/max_tokens, system prompt, adapter selection, markdown rendering, chat export@@ -662,7 +662,7 @@ soup ui- **Enhanced Metrics** — 2x2 chart grid (loss, LR, grad_norm, throughput) + GPU memory chart, eval results table- **Multi-Run Compare** — overlay loss curves from up to 5 runs side-by-side- **Chat Upgrade** — SSE streaming via proxy, typing indicator, cancel button, markdown renderer (bold, italic, code blocks), chat export as JSON-- **Config Builder** — recipe dropdown (174 recipes), config schema API for dynamic form generation+- **Config Builder** — recipe dropdown (173 recipes), config schema API for dynamic form generationGradient norm is nullable: backends or steps that do not report it store andstream `null`, and the Web UI chart leaves a gap instead of drawing a falsediff --git a/docs/training.md b/docs/training.mdindex 1bf584e2..930a3727 100644--- a/docs/training.md+++ b/docs/training.md@@ -1829,13 +1829,18 @@ that pairing — then Soup resamples to 16 kHz and calls theTransformers-native `HKUSTAudio/xcodec2-hf` codec, andrenders the resulting ids as `<|s_ID|>` between Llasa's speech-generationboundary tokens. Audio remains duration/byte-capped and is read through an-`O_NOFOLLOW` fd. Spark and Oute remain dependency-gated pending their #265-slice. Sesame CSM fails earlier with an architecture-specific message because+`O_NOFOLLOW` fd. Spark and Oute raw-audio live encoding now fails closed:+Spark-TTS has no installable `sparktts` package and its official environment pins+Torch/Transformers below Soup's supported stack; current `outetts` pins+Transformers 4.52.3 and Oute preparation also needs transcript/word alignment.+For those two families, pre-encode in the upstream environment and train the+resulting codec-token chat with `data.format: chatml`. Sesame CSM fails earlier+with an architecture-specific message becauseits 32 parallel Mimi codebooks require a native multimodal trainer, not acodec-string adapter.-Four ready-made codec-string recipes ship: `orpheus-tts-sft`, `llasa-tts`,-`spark-tts`, `oute-tts` — copy with `soup recipes use <name>`. Cross-validators+Three ready-made codec-string recipes ship: `orpheus-tts-sft`, `llasa-tts`,+`oute-tts` — copy with `soup recipes use <name>`. Cross-validatorsreject the `mlx` backend, `modality != audio_out`, and emotion tags outside theper-family allowlist.diff --git a/src/soup_cli/config/schema.py b/src/soup_cli/config/schema.pyindex 04460a27..1c7d5f40 100644--- a/src/soup_cli/config/schema.py+++ b/src/soup_cli/config/schema.py@@ -5422,6 +5422,10 @@ class SoupConfig(BaseModel):"model's native CSM/AutoProcessor training path until Soup has ""a dedicated CSM trainer.")+ if self.data.format == "audio" and tcfg.tts_family in {"spark", "oute"}:+ from soup_cli.utils.tts_codec import incompatible_live_codec_error++ raise ValueError(str(incompatible_live_codec_error(tcfg.tts_family)))if tcfg.tts_emotion is not None:try:validate_emotion_tag(tcfg.tts_emotion, family=tcfg.tts_family)diff --git a/src/soup_cli/recipes/catalog.py b/src/soup_cli/recipes/catalog.pyindex ffbee323..fbb54846 100644--- a/src/soup_cli/recipes/catalog.py+++ b/src/soup_cli/recipes/catalog.py@@ -48,7 +48,7 @@ def search_recipes(# ----------------------------------------------------------------------------# Recipe catalog (174 recipes)+# Recipe catalog (173 recipes)# ---------------------------------------------------------------------------RECIPES: Dict[str, RecipeMeta] = {@@ -3510,32 +3510,6 @@ training:batch_size: autotts_family: llasa-output: ./output-""",- ),- "spark-tts": RecipeMeta(- model="SparkAudio/Spark-TTS-0.5B",- task="tts",- size="0.5B",- tags=("tts", "spark", "audio_out", "v0.52.0"),- description="Spark-TTS — live (v0.71.20)",- yaml_str="""\-base: SparkAudio/Spark-TTS-0.5B-task: tts-modality: audio_out--data:- train: ./data/tts_train.jsonl- format: audio- audio_dir: ./data/audio- max_length: 2048--training:- epochs: 3- lr: 5e-5- batch_size: auto- tts_family: spark-output: ./output""",),@@ -3544,16 +3518,15 @@ output: ./outputtask="tts",size="0.5B",tags=("tts", "oute", "audio_out", "emotion", "v0.52.0"),- description="Oute-TTS with emotion conditioning — live (v0.71.20)",+ description="OuteTTS v0.3 pre-encoded SFT; raw-audio live codec refused by upstream pin",yaml_str="""\base: OuteAI/OuteTTS-0.3-500Mtask: ttsmodality: audio_outdata:- train: ./data/tts_train.jsonl- format: audio- audio_dir: ./data/audio+ train: ./data/tts_pre_encoded.jsonl+ format: chatmlmax_length: 2048training:diff --git a/src/soup_cli/trainer/tts.py b/src/soup_cli/trainer/tts.pyindex c07416fd..85dd91cb 100644--- a/src/soup_cli/trainer/tts.py+++ b/src/soup_cli/trainer/tts.py@@ -112,6 +112,10 @@ class TTSTrainerWrapper(SFTTrainerWrapper):from soup_cli.utils.tts_codec import csm_live_codec_errorraise csm_live_codec_error()+ if family in {"spark", "oute"}:+ from soup_cli.utils.tts_codec import incompatible_live_codec_error++ raise incompatible_live_codec_error(family)if family == "llasa":try:__import__("torchaudio")diff --git a/src/soup_cli/utils/tts.py b/src/soup_cli/utils/tts.pyindex 7abd8bb8..3ddfbf08 100644--- a/src/soup_cli/utils/tts.py+++ b/src/soup_cli/utils/tts.py@@ -220,8 +220,6 @@ def validate_tts_compat(*, task: str, modality: str, backend: str) -> None:TTS_CODEC_PACKAGES: Mapping[str, str] = MappingProxyType({"orpheus": "snac","llasa": "torchaudio",- "spark": "sparktts",- "oute": "outetts",})# Per-family emotion control templating. Emotion-conditioned familiesdiff --git a/src/soup_cli/utils/tts_codec.py b/src/soup_cli/utils/tts_codec.pyindex 8d8e9360..b4b0f867 100644--- a/src/soup_cli/utils/tts_codec.py+++ b/src/soup_cli/utils/tts_codec.py@@ -20,10 +20,11 @@ per-family encoder) is family-agnostic. It now has codec-string encoders for:* **Llasa / XCodec2** — 16 kHz XCodec2 ids are rendered as Llasa speechtokens between its native speech-generation boundary tokens.-Spark and Oute remain separate #265 work. Sesame CSM is deliberately refused-on this codec-string path: current CSM training uses 32 Mimi codebooks plus-text as parallel multimodal frames, which cannot be represented faithfully by-replacing a text assistant turn.+Spark and Oute raw-audio live encoding is deliberately refused on this path+because their current upstream stacks are incompatible with Soup. Sesame CSM+is also refused: current CSM training uses 32 Mimi codebooks plus text as+parallel multimodal frames, which cannot be represented faithfully by replacing+a text assistant turn.Security / robustness:- Heavy imports (numpy / soundfile / torch / snac / transformers) are lazy — module import@@ -43,7 +44,7 @@ import osimport statfrom typing import Any, Callable, Optional-from soup_cli.utils.tts import tts_codec_package, validate_tts_family+from soup_cli.utils.tts import validate_tts_family# SNAC checkpoint for the Orpheus family (24 kHz, 3 codebooks).SNAC_MODEL_ID = "hubertsiuzdak/snac_24khz"@@ -380,15 +381,46 @@ def csm_live_codec_error() -> RuntimeError:)+def incompatible_live_codec_error(family: str) -> RuntimeError:+ """Explain upstream packaging/objective blockers for #265 families."""+ canonical = validate_tts_family(family)+ if canonical == "spark":+ return RuntimeError(+ "TTS family 'spark' has no installable 'sparktts' PyPI package. "+ "The official Spark-TTS source pins torch==2.5.1, torchaudio==2.5.1 "+ "and transformers==4.46.2, which conflicts with Soup's supported "+ "training stack (#265). Refusing raw-audio live encoding instead of "+ "suggesting a nonexistent install or downgrading the environment. "+ "Pre-encode with the official Spark-TTS environment and train with "+ "data.format=chatml until a compatible native codec integration lands."+ )+ if canonical == "oute":+ return RuntimeError(+ "TTS family 'oute' live-codec preparation cannot safely depend on "+ "the current outetts package: its published metadata pins "+ "transformers==4.52.3 while Soup requires transformers>=5.16.1. "+ "Oute v0.3 training also needs transcript/word alignment plus audio "+ "codes, not a bare WAV-to-token substitution (#265). Refusing raw-audio "+ "live encoding rather than silently downgrading Transformers or "+ "training the wrong target. Use an upstream Oute environment to "+ "pre-encode training examples and train with data.format=chatml "+ "until a compatible native path lands."+ )+ return RuntimeError(+ f"TTS family {canonical!r} has no incompatible-live-codec contract"+ )++def tts_encoder_for_family(family: str, *, device: Optional[str] = None) -> Callable[[str], str]:"""Return the live audio→codec-string encoder for ``family``.Only the families in :data:`LIVE_CODEC_FAMILIES` have a codec-string- encoder. Orpheus uses SNAC and Llasa uses XCodec2. Spark/Oute remain #265- work; Sesame CSM is refused because its parallel Mimi-codebook objective- needs a dedicated multimodal trainer rather than this text-SFT adapter.+ encoder. Orpheus uses SNAC and Llasa uses XCodec2. Spark/Oute raw-audio+ encoding is refused for upstream-stack incompatibility; Sesame CSM is+ refused because its parallel Mimi-codebook objective needs a dedicated+ multimodal trainer rather than this text-SFT adapter."""canonical = validate_tts_family(family)if canonical == "orpheus":@@ -405,13 +437,9 @@ def tts_encoder_for_family(return _encodeif canonical == "sesame_csm":raise csm_live_codec_error()- pkg = tts_codec_package(canonical)- raise RuntimeError(- f"Live-codec encoding for TTS family '{canonical}' is not yet "- f"implemented (Orpheus/SNAC and Llasa/XCodec2 are live; the "- f"'{canonical}' encoder via {pkg!r} is tracked in #265). Pre-encode "- "your audio to codec tokens offline and train with data.format=chatml."- )+ if canonical in {"spark", "oute"}:+ raise incompatible_live_codec_error(canonical)+ raise AssertionError(f"unhandled TTS family after validation: {canonical!r}")# ---------------------------------------------------------------------------diff --git a/tests/fixtures/recipe_base_architectures.json b/tests/fixtures/recipe_base_architectures.jsonindex a311f58b..bbbc8f43 100644--- a/tests/fixtures/recipe_base_architectures.json+++ b/tests/fixtures/recipe_base_architectures.json@@ -194,9 +194,6 @@"model_type": "qwen3_5","routed_experts": 0},- "SparkAudio/Spark-TTS-0.5B": {- "unresolvable": "the repo has no config.json"- },"baichuan-inc/Baichuan2-13B-Chat": {"model_type": "baichuan","routed_experts": 0diff --git a/tests/fixtures/recipe_config_snapshots.json b/tests/fixtures/recipe_config_snapshots.jsonindex dffae9f3..5475e503 100644--- a/tests/fixtures/recipe_config_snapshots.json+++ b/tests/fixtures/recipe_config_snapshots.json@@ -1384,9 +1384,7 @@},"oute-tts": {"base": "OuteAI/OuteTTS-0.3-500M",- "data.audio_dir": "./data/audio",- "data.format": "audio",- "data.train": "./data/tts_train.jsonl",+ "data.train": "./data/tts_pre_encoded.jsonl","modality": "audio_out","task": "tts","training.lr": 5e-05,@@ -2166,16 +2164,6 @@"training.lr": 0.0001,"training.quantization": "none"},- "spark-tts": {- "base": "SparkAudio/Spark-TTS-0.5B",- "data.audio_dir": "./data/audio",- "data.format": "audio",- "data.train": "./data/tts_train.jsonl",- "modality": "audio_out",- "task": "tts",- "training.lr": 5e-05,- "training.tts_family": "spark"- },"voxtral-sft": {"base": "mistralai/Voxtral-Mini-3B-2507","data.audio_dir": "./data/audio",diff --git a/tests/recipe_count.py b/tests/recipe_count.pyindex c98e7494..515cf4f8 100644--- a/tests/recipe_count.py+++ b/tests/recipe_count.py@@ -9,7 +9,7 @@ the catalog, in ``tests/test_recipe_count_is_synced.py``.from __future__ import annotations-EXPECTED_RECIPE_COUNT = 174+EXPECTED_RECIPE_COUNT = 173def recipe_count_hint(actual: int) -> str:diff --git a/tests/test_issue1070_moe_target_modules.py b/tests/test_issue1070_moe_target_modules.pyindex d3584882..f8cbd6d7 100644--- a/tests/test_issue1070_moe_target_modules.py+++ b/tests/test_issue1070_moe_target_modules.py@@ -533,11 +533,11 @@ class TestTheRatchet:def test_the_record_has_the_measured_shape(self):"""If regeneration silently lost bases or experts, the tests above wouldpass while checking less. Pinned to the numbers the reviewer derived- independently: 114 bases, 23 MoE, 8 of them flagless, 13 model types."""+ independently: 113 bases, 23 MoE, 8 of them flagless, 13 model types."""moe = _moe_bases()flagless = [b for b in moe if b not in _flagged_bases()]- assert len(_record()) == 114+ assert len(_record()) == 113assert len(moe) == 23assert len(flagless) == 8, sorted(flagless)assert len({info["model_type"] for info in moe.values()}) == 13diff --git a/tests/test_issue265_spark_oute_contract.py b/tests/test_issue265_spark_oute_contract.pynew file mode 100644index 00000000..60b332be--- /dev/null+++ b/tests/test_issue265_spark_oute_contract.py@@ -0,0 +1,110 @@+"""#265 slice 2: fail closed on incompatible Spark/Oute live-codec installs."""++import pytest+++ "family,needle",+ [+ ("spark", "no installable 'sparktts' PyPI package"),+ ("oute", "transformers==4.52.3"),+ ],+)+def test_encoder_dispatch_names_the_real_upstream_blocker(family, needle):+ from soup_cli.utils.tts_codec import tts_encoder_for_family++ with pytest.raises(RuntimeError, match=needle):+ tts_encoder_for_family(family)++[email protected]("family", ["spark", "oute"])+def test_trainer_refuses_before_import_probe(family):+ from soup_cli.trainer.tts import TTSTrainerWrapper++ wrapper = object.__new__(TTSTrainerWrapper)+ with pytest.raises(RuntimeError, match="Refusing|refus|raw-audio"):+ wrapper._require_tts_codec(family)++[email protected]("family", ["spark", "oute"])+def test_raw_audio_is_refused_at_config_parse_time(family):+ from soup_cli.config.loader import load_config_from_string++ yaml = f"""base: test/model+task: tts+modality: audio_out+data:+ train: ./tts.jsonl+ format: audio+ audio_dir: ./audio+training:+ tts_family: {family}+"""+ with pytest.raises(ValueError, match="Spark|Oute|spark|oute"):+ load_config_from_string(yaml)+++def test_oute_recipe_uses_the_working_preencoded_path():+ from soup_cli.config.loader import load_config_from_string+ from soup_cli.recipes.catalog import RECIPES++ cfg = load_config_from_string(RECIPES["oute-tts"].yaml_str)+ assert cfg.training.tts_family == "oute"+ assert cfg.data.format == "chatml"+++def test_unrunnable_spark_recipe_is_not_advertised():+ from soup_cli.recipes.catalog import RECIPES++ assert "spark-tts" not in RECIPES+++def test_spark_message_does_not_recommend_nonexistent_pip_package():+ from soup_cli.utils.tts_codec import incompatible_live_codec_error++ message = str(incompatible_live_codec_error("spark"))+ assert "pip install sparktts" not in message+ assert "torch==2.5.1" in message+ assert "transformers==4.46.2" in message+ assert "data.format=chatml" in message+++def test_oute_message_does_not_recommend_resolver_breaking_install():+ from soup_cli.utils.tts_codec import incompatible_live_codec_error++ message = str(incompatible_live_codec_error("oute"))+ assert "pip install outetts" not in message+ assert "transcript/word alignment" in message+ assert "transformers>=5.16.1" in message+ assert "data.format=chatml" in message+++def test_incompatibility_helper_always_returns_runtime_error():+ from soup_cli.utils.tts_codec import incompatible_live_codec_error++ assert isinstance(incompatible_live_codec_error("orpheus"), RuntimeError)+++def test_tts_docs_list_only_runnable_codec_string_recipes():+ from pathlib import Path++ root = Path(__file__).resolve().parents[1]+ text = (root / "docs" / "training.md").read_text(encoding="utf-8")+ start = text.index("## TTS")+ end = text.index("## Classifier", start)+ section = text[start:end]++ assert "Three ready-made codec-string recipes ship" in section+ assert "spark-tts" not in section+ for recipe in ("orpheus-tts-sft", "llasa-tts", "oute-tts"):+ assert recipe in section+++def test_command_reference_keeps_emotion_templating():+ from pathlib import Path++ root = Path(__file__).resolve().parents[1]+ lines = (root / "docs" / "commands.md").read_text(encoding="utf-8").splitlines()+ row = next(line for line in lines if "task='tts'" in line)+ assert "emotion templating" in row+ assert "LIVE (v0.71.20)" in rowdiff --git a/tests/test_v0520.py b/tests/test_v0520.pyindex 81a40e9a..d5490bc6 100644--- a/tests/test_v0520.py+++ b/tests/test_v0520.py@@ -947,7 +947,6 @@ class TestV0520Recipes:NEW_RECIPES = ("orpheus-tts-sft","llasa-tts",- "spark-tts","oute-tts",)@@ -963,7 +962,6 @@ class TestV0520Recipes:"name,expected_family", [("orpheus-tts-sft", "orpheus"),("llasa-tts", "llasa"),- ("spark-tts", "spark"),("oute-tts", "oute"),],)@@ -1094,7 +1092,7 @@ class TestTddReviewGaps:from soup_cli.recipes.catalog import RECIPESnew = (- "orpheus-tts-sft", "llasa-tts", "spark-tts", "oute-tts",+ "orpheus-tts-sft", "llasa-tts", "oute-tts",)for name in new:base = RECIPES[name].modeldiff --git a/tests/test_v07120.py b/tests/test_v07120.pyindex 2d957b36..50b25fa9 100644--- a/tests/test_v07120.py+++ b/tests/test_v07120.py@@ -36,13 +36,13 @@ class TestTtsCodecPackage:def test_per_family_packages(self):from soup_cli.utils.tts import TTS_CODEC_PACKAGES, tts_codec_package- for fam in ("orpheus", "llasa", "spark", "oute"):+ for fam in ("orpheus", "llasa"):assert tts_codec_package(fam) == TTS_CODEC_PACKAGES[fam]assert tts_codec_package("orpheus") == "snac"assert tts_codec_package("llasa") == "torchaudio"- assert tts_codec_package("spark") == "sparktts"- with pytest.raises(RuntimeError, match="no Soup-compatible"):- tts_codec_package("sesame_csm")+ for fam in ("sesame_csm", "spark", "oute"):+ with pytest.raises(RuntimeError, match="no Soup-compatible"):+ tts_codec_package(fam)def test_case_insensitive(self):from soup_cli.utils.tts import tts_codec_package