Skip to content

Studio: split Audio into Speak, Music and Transcribe workspaces - #12600

Merged
danielhanchen merged 33 commits into
unslothai:mainfrom
Etherll:feat/studio-audio-workspace
Oct 4, 2026
Merged

danielhanchen merged 33 commits into
unslothai:mainfrom
Etherll:feat/studio-audio-workspace

Conversation

@Etherll

@Etherll Etherll commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Studio's single Audio page becomes three pages, Speak, Music and Transcribe, each showing only the models, history and drafts for its task. The same branch fixes three problems found when all 73 offered audio.cpp models were tried on main: runtime errors were hidden behind "An internal error occurred", Studio offered four model families the installed runtime cannot load, and unsupported task names were unreadable.

This is PR 1 of a 7-PR series that turns the Audio page into audio.cpp-backed pages. It is meant to keep current behaviour, apart from the per-page scoping and the error fixes below.

Changes

Frontend split

  • audio-page.tsx (3,638 lines) is now a thin host. Hook bodies were moved by line range into hooks/ (use-audio-model-slot, use-stt-sidecar, use-transcription, use-audio-gallery, use-speech-generation, use-audio-handoff). Pages live in pages/ (speak-page, music-page, transcribe-page, shared tts-workspace).
  • New features/audio/workflows.ts and a Zustand store (stores/audio-workspace-store.ts) holding workflow, requestedWorkflow and navExpanded. The open page is not remembered across reloads, as on main.
  • The instruction fields (voice design, Higgs scene, MOSS style and language, music description) moved to components/instructions-fields.tsx; instructionsFieldKind picks the one a page shows. Their behaviour is unchanged.

Per-page behaviour

  • The model picker lists only models for that page's task.
  • History is filtered per page. Clear all clears only that page (DELETE /audio/gallery?workflow=).
  • Drafts are saved per page and survive page switches and reloads. Speak keeps the old storage key.
  • Per-workflow guided tour.

Navigation and handoffs

  • MediaWorkflowList is generalised from Images (Images is unchanged). When Audio is pinned, its pages show inline in the sidebar. The More flyout has an Audio submenu. Nav defaults are unchanged (Audio stays unpinned).
  • ?workflow= and ?task= deep links (text-to-audio opens Music). Both clear the URL after use.
  • A Library clip opens on its own workflow, Settings > Voice opens Speak, and the chat model picker passes the workflow.

Generate UX

  • When Generate is disabled, the reason shows inline with a fix as an action, e.g. "The loaded model makes speech. Choose a music model or open Speak".
  • Mod+Enter generates from anywhere on the page.
  • Elapsed time shows beside the phase while generating.
  • A failed run's reason stays under Generate with "Choose a different model".
  • The new clip's player takes focus and "New clip ready." is announced through aria-live.

Backend

  • audio_workflows is added to cached and local model inventory rows (helpers in audio_workflows.py), and the picker filters on it.
  • Gallery clips record their workflow. Older clips infer it from audio_type.
  • Fixes the 'clon' break in _family_from_spec_tasks. The new tests fail on the base and pass here.

Audio runtime error fixes

  1. Runtime errors now reach the UI. On main, CosyVoice3, VibeVoice 1.5B/7B, Vevo2, IndexTTS2/2.5, MiDashengLM, Maya1, FireRedTTS3-Instruct, HeartMuLa, ControlFoley and FireRedAudio all returned {"detail":"An internal error occurred"}. The runtime's reason is now passed through /audio/generate, /v1/audio/speech and transcription, sanitized (no paths or tokens, one line, at most 300 characters). CosyVoice3 without a reference clip now shows "The audio runtime could not generate audio: CosyVoice3 requires reference audio" as a toast and under Generate. Load-failure "Last output" text is sanitized the same way.
  2. Studio offered CrisperWhisper 2.0, Index-Echo, Audio-Flamingo and KugelAudio, which the installed runtime rejects with "unsupported model family hint". A spec-fallback family is now offered only if the runtime ships model_specs/<family>.json. The pinned prebuilt tag v0.9.0-unsloth.1 ships no model_specs directory, so for that tag Studio checks a generated list of its 101 spec families (audio_cpp_spec_families.py). Anything else is refused with " needs a newer audio runtime than the one installed."
  3. Unsupported task tokens get readable names. Smart-Turn now reads "Turn detection models are not supported in Studio yet." instead of "turn models are not supported".

Known gaps

  • Biome's useExhaustiveDependencies flags refs and setters that are now passed into hooks as parameters. The dependency lists are unchanged from the original page.
  • Non-turbo Chatterbox loading only as clon, and qwen3_tts wanting English rather than en, are left for PR 2.

Testing

Frontend:

cd studio/frontend
npm test                      # 10034 pass, 0 fail
npm run typecheck             # clean
npm run i18n:check:strict     # clean, no new strings
npm run build                 # OK
npm run bundle:check          # within budget

The 19 frontend tests that read audio-page.tsx source now read the split files. Their assertions are unchanged. Two slice end markers changed because the next declaration moved to a different hook.

Backend:

cd studio/backend
python -m pytest tests/test_audio_cpp_models.py tests/test_audio_workflows.py \
  tests/test_audio_gallery.py tests/test_audio_cpp_runtime_status.py \
  tests/test_cache_inventory.py tests/test_gallery_flags.py \
  tests/test_inference_status_route.py tests/test_inference_status_loaded_gguf.py \
  tests/test_gguf_load_cache_reuse.py tests/test_audio_runtime_errors.py \
  tests/test_audio_cpp_server_http.py   # 461 passed

tests/studio contracts pass. One sidebar-pin contract fails the same way on the base and is fixed upstream by #12597. Upstream's updated file passes against this branch.

Runtime smoke on a sandbox install of this branch (CUDA, one GPU), with no page errors:

  • Kokoro-82M generate on Speak, Stable-Audio-3-Small-Music generate on Music, Moonshine transcription of jfk.wav on Transcribe.
  • CosyVoice3 without reference audio shows the runtime's reason. Loading CrisperWhisper2.0-GGUF returns 400 with the "needs a newer audio runtime" message.
  • More > Audio > Music, the pinned Audio list, and deep links.
  • Stacked layout, dark theme with UI size 20, UI size 12, and reduced motion.

An independent reviewer checked screenshots of the new pages. The 8 findings in scope for this PR were fixed and re-shot. The rest are existing behaviour or planned for later PRs (clip card and waveform, upload card, example chips, recommended models).

Screenshots

Before (merge base) on the left, this PR on the right, from two separate installs on the same host.

/audio: the single Audio page becomes the Speak page.

Default Audio page

/audio?workflow=music: main ignores the parameter; this PR opens the Music page with lyrics and a description.

Music page

/audio?workflow=transcribe: opens the Transcribe page.

Transcribe page

CosyVoice3 loaded, Generate with no reference clip: the runtime's reason now shows under Generate. On main the same request returns HTTP 500 with "An internal error occurred" (the toast had already faded when the left shot was taken).

CosyVoice3 runtime error

Map each audio.cpp family's existing task to the Audio workflow it serves
(speak, music, transcribe) and report it as audio_workflows on inference
status and cached-model rows. Gallery clips record their workflow, older
clips infer it from audio_type, and DELETE /audio/gallery can scope a clear
to one workflow.

Fix the spec-task fallback stopping at a 'clon' token, so a clone+music or
clone+asr spec is no longer refused as clone-only. Only offer a fallback
family the installed runtime knows (its model_specs, or the pinned tag's
spec list), and name unsupported task tokens in plain words.

Pass the audio runtime's own error text, sanitized, to /audio/generate,
/v1/audio/speech and transcription instead of a generic internal error.
The 3,600-line Audio page becomes a thin host over hooks (model slot, STT
sidecar, transcription, gallery, generation, handoff) and per-workflow
pages, with the moved code unchanged. A Zustand workspace store holds the
current workflow; only the page commits it, the sidebar and deep links ask.

- Sidebar: Images' workflow list is generalised; a pinned Audio row lists
  its workflows inline, and the More flyout gets an Audio submenu. Nav
  defaults are unchanged.
- Handoffs: ?workflow= and ?task= (text-to-audio opens Music), Library
  clips open on their own page, the chat picker passes the workflow.
- Each page lists only models for its task, keeps its own history and
  drafts, and tours its own controls. Clear all clears only that page.
- Today's model-specific fields move into a tool-panel registry unchanged.
- Generate says why it is off and offers the fix, runs from Mod+Enter,
  shows elapsed time, keeps a failed run's reason, and focuses the new clip.

The source-shape tests that read audio-page.tsx now read the split files,
with their assertions unchanged.
@Etherll
Etherll requested a review from danielhanchen as a code owner October 3, 2026 06:41
danielhanchen and others added 9 commits October 3, 2026 06:57
…model memory

WorkflowBinding, the status audio_workflows field and lastModelByWorkflow had
no reader. The tool panel registry rendered one instruction field through a
generic framework whose request and validation hooks were never called; the
page now renders that field directly from instructionsFieldKind.
The selected clip is a card with its model and age, a waveform player and
the clip menu, which gains Send to. A run in progress shows a pending card
with its phase, elapsed time and Stop. History rows add the model and age.
An unlisted generated clip now stays on the page that made it instead of
showing on the other TTS page and blocking its history. Switching between
Speak and Music passes the same busy gate as a mode switch, so a load in
flight no longer pulls the page back when it finishes.
Etherll added a commit to Etherll/unsloth that referenced this pull request Oct 3, 2026
Brings in unslothai#12600's pre-commit fixes, comment trims and the move of the
instruction fields to components/instructions-fields.tsx.

unslothai#12600 dropped the tool panel registry, WorkflowBinding, the status
audio_workflows field and lastModelByWorkflow because nothing read them.
The Clone page reads all of them, so they come back here with their first
consumer. The registry renders the instruction fields from their new path,
which leaves instructionsFieldKind without a caller; it goes, and the
tool panel tests keep the copy assertions its test made.
npm run typecheck failed on the test's row helper, which lacked created_at.
danielhanchen and others added 4 commits October 3, 2026 08:49
Search results skipped the page's row filter, so a search on Speak offered
music models and Music offered speech models.
Load model into moves to the top of the rail, next to the model it applies to.
modelLoadNote phrases the note shown before a run that loads a model first.
Auto-selecting the other page's first clip, and the next gallery refresh,
both dropped the unsaved fallback, which is the only copy of that clip.
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 3, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 3, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 3, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 3, 2026
Etherll added a commit to Etherll/unsloth that referenced this pull request Oct 3, 2026
Keeps the backend half (local audio.cpp folders report their workflows).
The picker already applies the page filter to LM Studio, models-dir and
custom-folder rows through unslothai#12600's guard, so the second helper is not
kept.
Etherll added a commit to Etherll/unsloth that referenced this pull request Oct 3, 2026
Brings in unslothai#12600's main merge, the load device next to the model and the history row truncation. Speak and Clone keep their own inputs slot where the rail now puts the text field.
Etherll added a commit to Etherll/unsloth that referenced this pull request Oct 3, 2026
…/studio-audio-clone

The picker uses localRowAllowed and hubRowAllowed for every row list, in place of unslothai#12600's inline guards.
Etherll added a commit to Etherll/unsloth that referenced this pull request Oct 3, 2026
Brings in unslothai#12600's Send to and unsaved-clip fixes and its comment trims.
Etherll added a commit to Etherll/unsloth that referenced this pull request Oct 3, 2026
Trained checkpoints split between Speak and Music as in unslothai#12600; Clone lists none.
Etherll added a commit to Etherll/unsloth that referenced this pull request Oct 3, 2026
…-clone

Takes the branch's own resolution of unslothai#12600 everywhere; keeps Send to -> Clone.
Etherll added a commit to Etherll/unsloth that referenced this pull request Oct 3, 2026
Brings in unslothai#12602's head, which includes unslothai#12600's latest (title-menu workflow switcher,
ClipCard, pending card) and the Clone slimming.

Conflicts: kept both sides' worker/orchestrator fields (stats and status_patch); the Music
dispatch and music-only guard sit before Clone's simplified reference check; music tests
use unslothai#12602's slimmer helpers. The result area uses ClipCard and the pending card, with the
variation chips above it and Edit/Extend in the shared clip menu (inline send buttons
dropped). Music keeps its rail props, recommended models and error reset.

Music still needs what the Clone slimming dropped as unused there: group_id on gallery
items and run responses, wav_info, and a stereo copy of an edit source. Edits no longer
check the removed trim field, and showRunResult accepts the music workflow.
@danielhanchen danielhanchen added >3000# affects UI# new-feature# refactor# security# Moves a security boundary: sandbox, allowlist, permission or network guard labels Oct 3, 2026
@Etherll

Etherll commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

…arge UI sizes

Picking a History clip on the other page cleared this page's unsaved clip,
which can be the only copy, so it is kept now. Send to checks again after the
clip downloads, since a run started meanwhile was stopped by the switch and
the clip dropped. The header's Library link drops its label before it would
truncate at large UI sizes.
Etherll added a commit to Etherll/unsloth that referenced this pull request Oct 4, 2026
Brings in unslothai#12600's clip retention across page switches and the header fit at large UI sizes.
@Etherll

Etherll commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@danielhanchen
danielhanchen merged commit c754470 into unslothai:main Oct 4, 2026
@unslothai unslothai deleted a comment from shimmyshimmer Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects UI# new-feature# refactor# security# Moves a security boundary: sandbox, allowlist, permission or network guard >3000#

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants