Repository navigation
Studio: audio.cpp v0.9.2 support - #14073
danielhanchen merged 18 commits into
Conversation
- Send one name per renamed option (Chatterbox s3gen_cfg_rate, Seed-VC length_adjust, ACE-Step lm_cfg_scale): the legacy name unless the model's strict contract lists the v0.9.2 name. - Refuse audio GGUF downloads on a runtime older than v0.9.2; cached files keep loading. - Fetch model_specs/ at the release's source commit during install, all or nothing, with a one-time backfill for existing managed installs. Drop the hard-coded family list. - Follow the runtime's contract order: model_specs/ first on v0.9.2, the GGUF's embedded spec on older runtimes. - Offer Voxtral-4B-TTS, KugelAudio, OWSM, OWSM-CTC, CrisperWhisper, Hviske-v6 and VibeVoice-ASR-Streaming-7B; fix the voxtral and kitten name hints. - Rebuild republished GGUFs whose tensors did not change from the cached copy, fetching only the new header.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
- Check each companion (MioTTS's MioCodec) before downloading anything, not only the model's own files. - Refuse a Hub download job for an audio GGUF on a runtime older than v0.9.2 with the same message (HTTP 409). - Fetch model_specs/ with one short try per request, so a network that blocks GitHub no longer holds the install or backfill for minutes.
The Hub planner adds a model's companion files (MioTTS's MioCodec) to the same job, so check them as well as the model itself before it starts.
…untime swap - Refuse a Hub download job outside the shared audio repo (such as audio-cpp/MiniMax-Music3-GGUF) on a runtime older than v0.9.2 too. Only an old runtime looks the repo up, so other downloads are unaffected. - Forget every resolved audio model when the audio runtime is replaced, so a reload no longer reuses the old runtime's option names for five minutes. - Return the language OWSM detects instead of the choice it ignores. - Hold VibeVoice-ASR-Streaming-7B back from the Transcribe picker until the Hub's main branch carries it.
OWSM-CTC has no language detection and returns the "auto" it was sent, so fall back to the caller's choice instead. OWSM still reports what it heard.
…ld runtime - A scoped Hub job (scope_id plus files) skips the variant planner, so check the GGUFs it would fetch: the shared repo's files by their folder row, any other repo as a whole. Cached files and non-GGUF files pass. - Transcribe's timestamp aligner download gets the same old-runtime check as the model's own files.
… cache - Resolve each scoped GGUF at the variant it belongs to, so a request for an uncached Q4_K_M is refused even when the default Q8_0 is cached. - Look the files up in Unsloth Studio's active Hugging Face cache, not the one the library saw at import.
|
Review round done at
Verification:
The network catalog check still flags This PR has no layout or styling changes; the frontend diff is catalog rows only. |
…dget for the new picker rows
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6b289deac
ℹ️ 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".
| if found is not None: | ||
| checked.append(found) | ||
| for item in checked: | ||
| problem = stale_runtime_download_problem(item) |
There was a problem hiding this comment.
Honor the selected cache in the old-runtime gate
When download_dir targets a custom Models folder, download_model_response does not compute cache_paths.hub_cache until after this gate, so this default probe (and the scoped cached() probe below) reads the active cache rather than the worker's destination. On a v0.9.1 runtime, a model cached only in the requested custom folder is rejected even though the job would fetch nothing; conversely, an active-cache hit can authorize a fetch into an empty custom folder and defeat the protection. Compute the destination first and thread its Hub cache through all of these checks.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this: it needs an old runtime plus a per-request download_dir that differs from the active cache, with the model cached in only one of them; the worst case is the pre-PR behaviour (no gate) or a refused job that would have fetched nothing.
| model = resolve(row, None if names else variant, hf_token, network = network) | ||
| checked = [model] if model is not None else [] |
There was a problem hiding this comment.
Check every variant before full-snapshot downloads
For a non-scoped audio repo outside the folder-row form with no gguf_variant, names is None, so this resolves and checks only the default variant. The worker receives no variant and runs the full-snapshot path (hub/workers/hf_download.py), so if the default variant is cached but another GGUF is not, the gate passes and downloads the sibling; once cached, that sibling also passes the missing-files gate and can be selected on the old runtime. Full-snapshot jobs need to inspect every missing audio GGUF/variant rather than only the default.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this: the UI always sends the variant for non-scoped GGUF jobs (download-api-adapter.ts), so a variant-less full-snapshot job of a non-umbrella audio repo is API-only, and it falls back to the pre-PR behaviour rather than breaking anything.
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6b289deac
ℹ️ 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".
| blobs = dict( | ||
| zip( | ||
| entries, | ||
| pool.map(lambda item: _spec_bytes(repo, commit, *item), entries.items()), |
There was a problem hiding this comment.
Stop queued spec fetches after the first failure
When the tree request succeeds but requests to raw.githubusercontent.com time out, ThreadPoolExecutor.map eagerly queues every spec blob and the executor context waits for all queued work even after the first future raises. With roughly 122 specs, 8 workers, and the 10-second per-request timeout, this optional step can stall an install or in-app update for about ceil(122/8) * 10 seconds rather than one short failed try (and the in-app path has already unloaded audio models). Stop scheduling or cancel pending futures after the first blob failure.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Executor.map cancels the futures it has not started as soon as one result raises (the finally in result_iterator, present on 3.11 and 3.13), so only the up to 8 in-flight requests finish. Measured: 122 failing blobs at 0.5 s each return in 1.1 s, one wave, not 16.
|
@codex review |
|
@codex review |
…onymous [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 84aa51d2fc
ℹ️ 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".
| rebuilt = [ | ||
| path | ||
| for path, _size in missing | ||
| if AudioCppBackend._rebuild_header_only(model, path, hf_token, cache_dir, cancel_event) |
There was a problem hiding this comment.
Run header reuse in user-facing audio downloads
When a user selects a republished audio model while its older GGUF is cached, the normal Audio-page paths never reach this optimization: checked use-audio-model-slot.ts, which stages TTS downloads through hub/workers/hf_download.py (where _rebuild_header_only_ggufs explicitly restricts reuse to image/video), and use-stt-sidecar.ts, which sends ASR downloads through stt_download_worker.py. Only an API-triggered AudioCppBackend._download_missing reaches this call, so the primary Studio flows still transfer the full multi-GB GGUF instead of reusing its unchanged tensors; invoke the rebuild from those workers or route those downloads through this path.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing this here: it is a bandwidth optimisation, and the Audio-page worker paths still download the full file correctly, so nothing is wrong or lost; extending header reuse to those workers is a follow-up.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
# Conflicts: # studio/frontend/scripts/check-bundle-budget.ts
…ach limit Both sides raised the same eager-startup-JS budget: this branch for the DeepInfra connection (~75 B raw / ~30 B transfer) and upstream for the audio.cpp v0.9.2 picker rows (unslothai#14073, +253 B raw / +59 B transfer). Both rationales are kept and each limit takes the LARGER measurement so neither PR's headroom is silently given back: transfer 2_047_608 (from unslothai#14073) and raw 6_806_162 (from the DeepInfra raise).
The previous merge commit (d506d77) resolved this file by staging it with the <<<<<<< / ======= / >>>>>>> markers still in place, so both sides' budget blocks and both pairs of transferBytes/rawBytes lines were committed. The file was not valid TypeScript. This keeps one resolved block: both rationale comments (unslothai#14073 and DeepInfra) and the larger of each limit, transferBytes 2_047_608 and rawBytes 6_806_162, as the merge intended.
…eset the startup budget to the build (#14168) ## Summary Main is over the startup bundle budget, so `Frontend build + bundle sanity` fails on every PR based on it: ``` over the startup budget: transfer 2005.9 KB > 2003.5 KB, raw 6665.4 KB > 6659.1 KB (main at 2fee36f) ``` This PR takes two steps. It moves #14137's prompt upsampler client out of the startup chunks, which is real growth with a lazy home. It then resets both limits to the measured build. Main has gone over this budget repeatedly, and the root of that is a shortfall in how the limits were raised, which this corrects. ## Cause **#14137 (FLUX.3 prompt upsampling).** The Images page is lazy (`ImagesPage = lazy(...)` in `__root.tsx`), but `features/images/api.ts` is not. Startup modules import it for other calls (`loaded-models-api.ts`, `loaded-models-sources.ts`, `use-media-companion-bytes.ts`). #14137 put the four upsampler calls there, with value imports from `lib/prompt-enhance.ts`, so that module joined the startup chunks. Only `prompt-enhance-panel.tsx`, inside the lazy Images page, calls them. **The limits themselves.** Each raise since #14073 was sized from its own PR's delta and added to the previous limit. That previous limit already sat below the build, starting at #14073: - `475a02ac` measures 2,047,700 B transfer against the 2,047,608 B limit #14073 set. - By `2fee36ff` the gap is 6,500 B raw and 2,409 B transfer. The raises since (#14072, #14075, #14110, #14108, #14113) each added their delta, so the shortfall carried forward. CI agrees with my machine to the byte: the first run of this PR read 1999.7 KB transfer on both. ## Change - **New `features/images/prompt-upsampler-api.ts`:** holds `getPromptUpsamplerStatus`, `startPromptUpsamplerDownload`, `cancelPromptUpsamplerDownload` and `previewEnhancedPrompt`, moved unchanged, with the same `parseJson` error handling. - **`api.ts`:** now imports only the `PromptEnhancement` type from `lib/prompt-enhance` (erased at build). - **`prompt-enhance-panel.tsx`:** imports the calls from the new module. - **No behavior change** in the app. - **`check-bundle-budget.ts`:** both limits are reset to the measured build plus the usual margin (160 B raw, 189 B transfer), with an entry in the BUDGET comment block explaining why the reset is absolute rather than by delta. - `rawBytes`: 6,819,206 (main after #14113) -> 6,825,885. - `transferBytes`: 2,051,727 -> 2,054,261. ## Testing One machine and build, Node 24, exact byte totals from the budget script, 95 chunks throughout: | tree | raw B | transfer B | |---|---|---| | main `2fee36ff` | 6,825,378 | 2,053,999 | | main `2fee36ff` + the move | 6,821,006 | 2,052,708 | | main `78e5eefa4d` (adds #14113) + the move | 6,821,334 | 2,052,857 | | + #14183 | 6,821,410 | 2,052,614 | | + #14172 (one tooltip design) | 6,825,307 | 2,053,990 | | this PR (main `b227654927`, adds #14184, + the move) | 6,825,725 | 2,054,072 | - **The move saves:** 4,372 B raw and 1,291 B transfer. - **#14113 adds:** 328 B raw and 149 B transfer on this build. - **Landed while main was over, with no raise:** #14183 (+76 B raw, -243 B transfer), #14172 (+3,897 B raw, +1,376 B transfer, the shared tooltip is in the eager shell) and #14184 (+418 B raw, +82 B transfer). This is the treadmill the absolute reset stops: while main is red on this check, growth lands unaccounted. - **With the new limits:** `within budget (0.2 KB transfer, 0.2 KB raw to spare)`. - **`npm run typecheck`:** clean. - **`bundle-budget-cli.test.ts`, `bundle-budget-closure.test.ts`, `image-prompt-enhance.test.ts` and `loaded-models-platform-matrix.test.ts`:** 74 passed. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…14901) The generate path drops options the request will not carry (`ignored_options`, unslothai#14075) before `filled_options` folds the audio.cpp v0.9.2 renamed option names (unslothai#14073). The option panel shows a renamed option under its legacy name and a strict v0.9.2 contract lists only the canonical name, so valid values were dropped and the defaults sent instead: - Seed-VC with a strict v0.9.2 spec: `length_adjust` or `duration_scale` 1.5 reached the runtime as `duration_scale` 1.0. - Seed-VC with an older strict spec: `duration_scale` 1.5 was dropped and `length_adjust` 1.0 sent. - Chatterbox: `flow_guidance_scale` 1.0 was dropped and `s3gen_cfg_rate` 0.7 sent. `ignored_options` now judges a renamed option under its legacy name and widens strict keys with the legacy name, matching `filled_options`. Options the model does not take are still dropped and reported. Tests: `test_generation_keeps_a_renamed_option_under_either_name` in `test_audio_cpp_option_renames.py` drives a Convert generation through the backend with a fake server for both names on Seed-VC (old and new specs) and Chatterbox, and checks that an unknown option is still reported. 4 of its 5 cases fail on main and all pass here. Across the audio test files: 2312 passed vs 2308 on main; the 6 remaining failures (`test_native_audio.py`, `soundfile` missing locally) are the same on both sides. Not run against a live audio.cpp server.
Summary
The refreshed GGUFs in
audio-cpp/audio.cpp-gguffollow audio.cpp v0.9.2. That release renames several request options and checksmodel_specs/before a GGUF's embedded spec. It also loads families that Unsloth Studio was hiding as "needs a newer audio runtime". With this change Unsloth Studio sends option names that both v0.9.1 and v0.9.2 accept, works out which families the installed runtime loads from the runtime's own spec files instead of a hard-coded list, and offers the newly supported models.Changes
Renamed options. Chatterbox
s3gen_cfg_rate->flow_guidance_scale, Seed-VClength_adjust->duration_scale, and ACE-Steplm_cfg_scale->lm_guidance_scaleare kept in a fixedOPTION_RENAMEStable. The option panel shows each one once, under the legacy name. On the wire exactly one name is sent: the v0.9.2 name when the model's strict request contract lists it, otherwise the legacy name (v0.9.2 still reads it). A value given under either name (UI, API or MCP) is folded into that one option, so v0.9.2 no longer fails Chatterbox Convert with "conflicting option values", and the Seed-VC Length slider reaches refreshed GGUFs asduration_scale.Runtime family detection.
install_audio_cpp_prebuilt.pynow fetchesmodel_specs/*.jsonfrom the release manifest'ssource_commit(never the tag, because the fork's tags point at a packaging commit with an older tree) and puts the folder next to the server. Every file is checked against its git blob sha and must parse as a JSON object. The fetch is all or nothing: a failure leaves no folder and does not fail the install. The install record now storessource_commit. Existing managed installs get a one-time background backfill at startup (skipped whenUNSLOTH_DISABLE_UPDATE_CHECK=1). It takes the commit from the record, the release manifest, or the server version string, and it runs under the install lock.runtime_knows_familyreads that folder, andaudio_cpp_spec_families.py(the hard-coded family list for v0.9.0/v0.9.1) is deleted.Contract order. On v0.9.2 and newer, request keys, options and required inputs come from
model_specs/first and then the GGUF's embedded spec. On older prebuilt runtimes only the embedded spec counts, so a backfilled folder does not change what an old runtime is asked to do.Old-runtime download gate. On a prebuilt runtime older than v0.9.2, Unsloth Studio refuses to download audio GGUF files that are not already cached, for both TTS loads and the Transcribe download path. The error is " needs a newer audio runtime before its files can be downloaded. Update the audio runtime from the update banner, or run
unsloth studio update." A Hub download job is refused with HTTP 409 and the same message, for the shared repo's folders, their companions (MioTTS's MioCodec), audio repos outside it such asaudio-cpp/MiniMax-Music3-GGUF, and scoped jobs (scope_idplusfiles) that would fetch an uncached audio GGUF. Transcribe's timestamp aligner download is checked the same way. Only an old runtime looks a repo up for this, so other downloads are unaffected. Fully cached models, local files and custom builds (unknown version) are not affected.Runtime swap. Replacing the audio runtime from the update banner now drops every resolved audio model, so a reload right after the update uses the new runtime's spec files rather than a five-minute-old resolution.
New models. The pickers now offer Voxtral-4B-TTS-2603, KugelAudio-0-Open, OWSM, OWSM-CTC, CrisperWhisper 2.0 and Hviske-v6. Name hints are fixed so a Voxtral TTS file name is no longer guessed as the realtime ASR family
voxtral_realtime(its GGUF header namesvoxtral_tts), andkitten-tts2is no longer matched askitten_tts. Transcribe sendslanguage: "auto"to OWSM and OWSM-CTC (they take ISO 639-3 codes, and<en>fails) and reports the language OWSM detects (OWSM-CTC detects none, so the chosen language is kept), and sends nolanguageto models whose strict contract has no such option (Hviske-v6).Header-only rebuild. When a republished GGUF has the same tensors as the cached older copy, the backend fetches only the new header and rebuilds the file from the cached blob instead of downloading the whole file again (one metadata request, only when an older copy is cached). All 138 GGUFs the refresh rewrites were checked to be header-only. Any failure falls back to the normal download.
Testing
Live runs on Linux against the prebuilt runtimes, using the Unsloth Studio backend code paths directly (CUDA on a shared GPU, CPU for v0.9.1). Every server request was logged.
v0.9.2-unsloth.1(CUDA) put 122 spec files beside the server with no.model_specs-*leftovers, and the record hassource_commit. With the spec fetch pointed at an unreachable host, the install still succeeded, left no folder, and every family read as unknown.runtime_release_key()returned(0, 9, 2), andruntime_knows_familywas True forvoxtral_tts,kugelaudio,owsm,owsm_ctc,crisperwhisperandhviske_asr_v6, and False for a made-up family.languagefield and OWSM requests sent"auto"; all returned 200.spec-refresh-v0.9.2revision), Chatterbox Convert and Seed-VC Convert sent exactly one name per renamed pair (s3gen_cfg_rate,duration_scale), whichever name the value was entered under, and the server returned 200. On the Seed-VC V1 routes,length_adjust1.5 vs 1.0 gave 6.316 s vs 4.214 s output. The default V2 route ignores the option, as the v0.9.2 spec documents, so the Length control has no effect there. That behaviour predates this change.v0.9.1-unsloth.1(CPU), uncached Chatterbox-Turbo (TTS) and OWSM small (Transcribe) were refused with the new message, and no download was started (blob count unchanged). Cached OWSM base still loaded and transcribed, and it used the v0.9.1 keybeam_sizeinstead of v0.9.2'snum_beams. Cached Hviske-v6 and Voxtral TTS were reported as needing a newer runtime.model_specs/andsource_commitremoved: it recovered commitcf124a67cc55from the release manifest, wrote 112 specs with no leftovers, and a second call was a no-op.Unit tests (new:
test_audio_cpp_option_renames.py,test_audio_cpp_runtime_specs.py,test_audio_cpp_catalog_v092.py,test_audio_cpp_header_rebuild.py, plus install-time fetch cases intests/studio/install/test_install_audio_cpp_prebuilt_logic.py):studio/backend: everytests/test_audio_cpp_*.py,test_stt_audiocpp_details.pyandtest_gguf_header_delta.pytest passes in a full backend run (-n 16). The other failures in that run are environment-only (a local venv with a mismatched huggingface-hub) and reproduce identically on main.tests/studio/install/test_install_audio_cpp_prebuilt_logic.py: 186 passed.studio/frontend:npm run typecheckclean;node --experimental-strip-types --test tests/audio-cpp-catalog.test.ts tests/audio-picker-filter.test.ts tests/recommended-curated-row-metadata.test.ts tests/audio-convert-panels.test.ts tests/audio-run-api.test.ts: 100 passed;npm run catalog:checkpasses.ruff check(0.15.12) clean on the changed Python files.Notes
VibeVoice-ASR-Streaming-7B-GGUFexists only on thespec-refresh-v0.9.2branch ofaudio-cpp/audio.cpp-gguf. The pickers hold it back (listed inAUDIO_CPP_UNOFFERED_FOLDERS) until the main branch is refreshed; the backend still loads it by id. The nightly network catalog check flags that entry until then.voiceandvoice_idcontrols, and OWSM always detects the language. Both are left for follow-ups.UI before / after
Audio page, "Select audio model" picker on the Recommended tab, searched for each newly offered row (Transcribe for ASR, Text to Speech for TTS). Base 4c5fb40 (left) vs this branch at e6b289d (right), two separate installs. Hviske-v5.3-GGUF is the control row and shows on both sides.