Skip to content

Studio: add Higgs, MOSS, and MiniMax audio models - #8794

Merged
mahiatlinux merged 82 commits into
unslothai:mainfrom
Etherll:more-vocie-models
Aug 29, 2026
Merged

mahiatlinux merged 82 commits into
unslothai:mainfrom
Etherll:more-vocie-models

Conversation

@Etherll

@Etherll Etherll commented Aug 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds native Studio Audio support for:

  • bosonai/higgs-tts-2-3b-base
  • OpenMOSS-Team/MOSS-TTS-Local-Transformer-v1.5
  • OpenMOSS-Team/MOSS-TTS-Nano-100M
  • multimodalart/higgs-audio-v3-tts-4b-transformers
  • MiniMaxAI/MiniMax-Music3

The speech models use their publisher-provided Transformers interfaces. MiniMax Music 3 uses its Diffusers pipeline with separate lyrics and music-description inputs.

Motivation

Studio's existing audio path only handled codec-backed TTS models. These five models expose architecture-specific generation APIs and could not be loaded or decoded through that path.

Changes

Backend

  • Adds NativeAudioBackend with separate load and generation adapters for the five architectures.
  • Detects curated Hub IDs and downloaded checkpoints from config.json without fetching weights during capability checks.
  • Routes native audio models before the MLX and standard Unsloth inference paths.
  • Preserves worker cancellation and WAV response handling.
  • Adds optional instructions and seed fields to the Studio and OpenAI-compatible audio APIs.
  • Selects Transformers 5.5 for Higgs TTS 2 and Higgs Audio v3.
  • Updates the existing Diffusers pin from f53d552 to 2da7040, which contains the upstream MiniMax Music 3 pipeline. No new dependency package is added.

Frontend

  • Adds all five models to the curated Audio catalog.
  • Applies trust_remote_code only to models that require publisher code.
  • Allows native PyTorch speech models to bypass the GGUF-only macOS policy.
  • Reports the NVIDIA CUDA requirement before loading MiniMax Music 3 on unsupported devices.
  • Shows separate Lyrics and Music description fields for MiniMax Music 3.

Tests

  • Adds hermetic adapter tests for every model without downloading weights.
  • Covers model detection, Transformers-version selection, API instruction and seed forwarding, catalog wiring, macOS policy, and native runtime classification.

How to test

python -m pytest -q studio/backend/tests/test_native_audio.py
python -m pytest -q studio/backend/tests/test_audio_token_detection.py
python -m pytest -q studio/backend/tests/test_openai_audio_speech_route.py
python -m pytest -q studio/backend/tests/test_transformers_version.py::TestCheckConfigNeeds550::test_higgs_tts_uses_transformers_550

cd studio/frontend
node --experimental-strip-types --test tests/audio-page-policy.test.ts tests/audio-catalog-decodable.test.ts tests/audio-recommended-mode-order.test.ts tests/audio-community-pick-routing.test.ts tests/
recommended-curated-row-metadata.test.ts tests/recommended-catalog-seeds.test.ts
node node_modules/typescript/bin/tsc -b --pretty false
node node_modules/typescript/bin/tsc -p tsconfig.test.json --pretty false
node --experimental-strip-types --no-warnings src/features/model-picker/components/model-selector/model-catalog.check.ts

Focused backend and frontend tests, Python compilation, Ruff, TypeScript builds, and catalog checks pass locally.

Screenshots

minimax-music3-ui

Notes for reviewers

  • Higgs and MOSS have CUDA, XPU, MPS, and CPU code paths. Live inference still needs testing on each platform.
  • MiniMax Music 3's official local pipeline requires NVIDIA CUDA. Studio rejects CPU, XPU, ROCm, and macOS loads with an actionable error.

@Etherll
Etherll requested a review from danielhanchen as a code owner August 14, 2026 08:10
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 14, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 14, 2026
@mahiatlinux

Copy link
Copy Markdown
Contributor

Reviewed the native audio paths against the current Studio runtime, the model repositories, and the live UI flows. The PR solves a real gap: main had no native loaders for Higgs TTS 2/3, MOSS Local/Nano, or MiniMax Music 3. The five curated checkpoints are active, and the fixed MOSS Nano path now completes real CUDA generation.

Findings fixed

  • Multi-GPU llama.cpp child mapping treated visible ordinals as physical IDs. A reordered or ambiguous parent mask could apply a tensor split to the wrong cards. The child now emits a physical map only for the unambiguous single-GPU case and fails closed otherwise in llama_cpp.py:7426.
  • Higgs TTS 2 downloaded only its main checkpoint, then tried to fetch bosonai/higgs-audio-v2-tokenizer during load. Offline staged loads failed. The tokenizer is now a planned companion in native_audio.py:65.
  • The Higgs TTS 2 audio tokenizer stayed on CPU while generation tensors moved to CUDA/XPU/MPS. It now moves with the model in native_audio.py:784.
  • Remote-code audio models were staged before the trust prompt. Declining consent could still download untrusted repositories. Consent and its approved fingerprint now precede and survive staging, deferred loads, and queued loads in audio-page.tsx:1135.
  • Native audio LoRA rows were shown as loadable even though the backend does not apply native audio adapters. Adapter-only rows are now hidden unless exported as merged checkpoints in audio-picker-policy.ts:46.
  • MiniMax component loading ignored the selected local snapshot and reopened the display repository ID. Components now load from the selected source in native_audio.py:881.
  • MOSS used attention backends that produced invalid output on supported runtime paths. CUDA now uses a safe SDPA configuration and non-CUDA uses eager attention in native_audio.py:799.
  • The fallback prompt estimate undercounted CJK and emoji with len(text) / 3, allowing context overflow when no in-process tokenizer was reachable. It now uses a conservative UTF-8 byte bound in inference.py:510.
  • A model preflight could finish after generation started and replace the active model mid-request. A completed load also re-enabled controls before status caught up. Picks now queue behind generation, status refresh completes before load teardown, and queued picks replay after generation in audio-page.tsx:813.
  • The PR pinned a GitHub source archive after Diffusers 0.40.0 had shipped the required MiniMax integrations. The exact released wheel is now used in diffusers-pin.txt:16.
  • MOSS Local/Nano accepted raw prompt delimiters, so client text could close <user_inst> or open audio/role segments. Both codec profiles and all raw fields are neutralized in chat_template_helpers.py:190 and native_audio.py:1042.
  • External /v1/audio/speech requests accepted instructions in the schema but silently dropped it. The provider body now forwards the field in inference.py:16448.
  • MiniMax’s untouched UI sent 2,048 frames instead of its 750-frame, 30-second default, and the shared ceiling blocked the supported 9,000-frame range. Studio now exposes seconds at 25 fps with a 30-second default and 360-second maximum in audio-page-policy.ts:41. Encoder overflow is returned as HTTP 400 instead of HTTP 500 in inference.py:16240.
  • Higgs TTS 2 supports a scene description, but Studio exposed and sent instructions only for MOSS Local and MiniMax. The scene field and payload are now wired in audio-page.tsx:2440.
  • MOSS Nano under Transformers 5.5 generated all-NaN logits because meta loading left its nonpersistent rotary frequencies invalid. It also saved through a TorchCodec ABI path that is absent or incompatible on supported installs. The loader rebuilds the publisher’s RoPE frequencies, and its remote module alone uses the existing soundfile WAV path in native_audio.py:325.
  • Seed was accepted but ignored by Higgs and MOSS. Their RNG is now request-scoped and restored after generation in native_audio.py:356. MiniMax keeps its per-request generator.

Testing performed

  • Focused backend: 211 passed, 1 skipped across native audio, speech routes, cancellation, GPU mapping, Diffusers pinning, and codec delimiter coverage.
  • Focused frontend: 97 passed across audio policy, model selection, staging, consent, lifecycle, and race coverage.
  • Frontend TypeScript build and test typecheck passed.
  • Ruff checks and git diff --check passed for the changed backend files.
  • Real end-to-end model test on an RTX 3080 with Torch 2.11.0+cu130 and Transformers 5.5.0: loaded OpenMOSS-Team/MOSS-TTS-Nano-100M plus OpenMOSS-Team/MOSS-Audio-Tokenizer-Nano through NativeAudioBackend, generated with seed 8794, and produced a 983,084-byte stereo 48 kHz WAV with 245,760 frames (5.12 seconds). Load took 2.767 seconds and generation took 3.374 seconds. A second post-commit run was byte-identical, SHA256 7a3e0a94e5a6076252f5d87088e6b0c470dc256822c3b88cfea76d1c7a2d6192.
  • Full local suite was intentionally not run. Focused fork CI and Playwright before/after evidence are next.

@mahiatlinux

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-08-29T00:49:11.288205Z 5b68aff Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4e4cadf86a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mahiatlinux

Copy link
Copy Markdown
Contributor

@codex review

@mahiatlinux

Copy link
Copy Markdown
Contributor

Post-push review passes are complete. Three fresh local passes covered backend security and planning, model runtime paths, and frontend request/state contracts.

Additional findings fixed

  • MiniMax frame conversion could lose one frame at valid slider positions because decimal seconds underflowed before Math.floor. The conversion now preserves all 8,976 frame-aligned slider positions in audio-page-policy.ts:65.
  • Higgs companion preflight used hard-coded repositories while the publishers load checkpoint metadata. Higgs 2 now follows Transformers' audio_tokenizer_config.json precedence, Higgs 3 follows audio_tokenizer_id, and both security and download planning inspect the same target the runtime loads in native_audio.py:200.
  • Higgs 3 resolved a private codec with the HF token, then called the publisher's zero-argument loader and dropped the token. The approved codec is now loaded explicitly with auth, FP32, remote-code consent, device placement, eval mode, and frozen parameters in native_audio.py:923.
  • MiniMax lyrics accepted raw pipeline delimiters such as <|lyrics_end|> and <|audio_start|>. Lyrics are now neutralized before Diffusers assembles its control-token prompt in native_audio.py:1263.
  • Metadata larger than the 1 MB security inspection limit silently fell back to a default codec while Transformers still read the full file. Oversized companion metadata now fails closed in native_audio.py:110, maps to HTTP 400 in models.py:2527, and produces an actionable worker load error in worker.py:50.
  • Switching to Transcribe did not invalidate a MiniMax selection waiting on /api/system, or a TTS load queued during generation. The stale selection generation and every queued TTS load are now cleared, and replay requires Speak mode in audio-page.tsx:1027.
  • The new Lyrics, Music description, Scene description, Style instructions, and Language labels were visible text but not associated with their controls. Field now renders a real label tied to each input in audio-page.tsx:212.

Playwright evidence

The before side is the original PR head 8af9fb4d5. The after side is reviewed head 6563d3d29; final head 331ab43f2 adds backend-only pre-commit formatting.

MiniMax controls before and after

MiniMax generated WAV before and after

Higgs scene guidance before and after

Delayed TTS selection while Transcribe is active

The browser exercised the separately built Studio bundles and actual interactions. Verified facts:

  • MiniMax default request: 2,048 frames before, 750 after.
  • MiniMax 1.16-second request: 29 frames after.
  • Generated MiniMax and Higgs WAV players rendered on both sides.
  • Backend HTTP 400 text rendered as a visible toast on both sides.
  • Higgs scene guidance was absent before and sent as audio_instructions after.
  • Accessible label lookup moved from 0 to 1 for the reviewed MiniMax controls.
  • A delayed MiniMax selection issued one hidden /api/inference/load after switching to Transcribe before the fix and zero after it.

Focused verification after the post-push fixes: backend security/runtime tests passed, frontend typecheck passed, all 8,976 MiniMax frame positions passed, and the Playwright evidence contract passed. The final focused fork CI is running on the exact staged result.

@mahiatlinux

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 5b68aff01e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mahiatlinux mahiatlinux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mahiatlinux

Copy link
Copy Markdown
Contributor

All reviewed and fixed, LGTM. CI results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants