Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: open audio models on their Audio page (#12816)

Etherld2290598ff18
diff --git a/studio/frontend/src/features/audio/hooks/use-audio-handoff.ts b/studio/frontend/src/features/audio/hooks/use-audio-handoff.ts
index b72bcf829c2..2d95d20ffd8 100644
--- a/studio/frontend/src/features/audio/hooks/use-audio-handoff.ts
+++ b/studio/frontend/src/features/audio/hooks/use-audio-handoff.ts
@@ -37,6 +37,7 @@ export function useAudioHandoff({
workflow?: string;
audioType?: string;
loadId?: string;
+ gguf?: boolean;
item?: string;
};
const handledRouteModel = useRef<string | null>(null);
@@ -53,7 +54,7 @@ export function useAudioHandoff({
void navigateSelf({ to: "/audio", search: {}, replace: true });
return;
}
- const key = `${wanted}|${routeSearch.quant ?? ""}|${routeSearch.ggufQuant ?? ""}|${routeSearch.task ?? ""}|${routeSearch.audioType ?? ""}|${routeSearch.loadId ?? ""}|${routeSearch.workflow ?? ""}`;
+ const key = `${wanted}|${routeSearch.quant ?? ""}|${routeSearch.ggufQuant ?? ""}|${routeSearch.task ?? ""}|${routeSearch.audioType ?? ""}|${routeSearch.loadId ?? ""}|${routeSearch.gguf ? "gguf" : ""}|${routeSearch.workflow ?? ""}`;
if (handledRouteModel.current === key) return;
if (busyRef.current !== null) return;
// Open the named page first: a staged or failed load otherwise left the user on another page.
@@ -79,6 +80,7 @@ export function useAudioHandoff({
ggufVariant: routeSearch.ggufQuant ?? undefined,
loadId: routeSearch.loadId ?? undefined,
audioType: routeSearch.audioType ?? undefined,
+ isGguf: routeSearch.gguf ?? undefined,
// Chat-to-Audio routing drops the inventory flag, so stage the exact forwarded GGUF.
isDownloaded: routeSearch.loadId
? true
@@ -98,6 +100,7 @@ export function useAudioHandoff({
routeSearch.workflow,
routeSearch.audioType,
routeSearch.loadId,
+ routeSearch.gguf,
handleModelSelect,
navigateSelf,
transitionWorkflow,
diff --git a/studio/frontend/src/features/audio/route-search.ts b/studio/frontend/src/features/audio/route-search.ts
index f58aad80f70..5f09e2e05ca 100644
--- a/studio/frontend/src/features/audio/route-search.ts
+++ b/studio/frontend/src/features/audio/route-search.ts
@@ -37,6 +37,8 @@ export interface AudioRouteSearch {
task?: string;
audioType?: string;
loadId?: string;
+ /** The pick is a GGUF: an id without a GGUF suffix otherwise reads as a Transformers checkpoint. */
+ gguf?: boolean;
item?: string;
workflow?: AudioWorkflowId;
}
@@ -60,6 +62,7 @@ export function validateAudioSearch(
...(typeof search.loadId === "string" && search.loadId.trim()
? { loadId: search.loadId }
: {}),
+ ...(search.gguf === true || search.gguf === "true" ? { gguf: true } : {}),
...(typeof search.item === "string" ? { item: search.item } : {}),
...(isAudioWorkflowId(search.workflow)
? { workflow: search.workflow }
@@ -82,6 +85,8 @@ export function audioWorkflowForPick(pick: {
task?: string | null;
audioType?: string | null;
}): AudioWorkflowId | null {
+ // Only a separation row's audio-to-audio pick is routed here.
+ if (pick.task === "audio-to-audio") return "separate";
const workflow = audioWorkflowForTask(pick.task);
if (workflow !== null && workflow !== "speak") {
return workflow;
@@ -98,3 +103,35 @@ export function audioWorkflowForPick(pick: {
}
return workflow === "speak" && isCloneOnlyFamilyId(pick.id) ? "clone" : workflow;
}
+
+/** The /audio search for a model picked elsewhere (the chat picker, the Hub), opening the page
+ * that runs it. */
+export function audioPickSearch(
+ id: string,
+ pick: {
+ ggufFilename?: string | null;
+ ggufVariant?: string | null;
+ task?: string | null;
+ audioType?: string | null;
+ loadId?: string | null;
+ isGguf?: boolean | null;
+ },
+): AudioRouteSearch {
+ return {
+ model: id,
+ // `quant` is used verbatim as the gguf filename, so a label like "Q4_K_M" rides ggufQuant; both
+ // go along, since the dictation sidecar picks its quant by label alone.
+ quant: pick.ggufFilename ?? undefined,
+ ggufQuant: pick.ggufVariant ?? undefined,
+ task: pick.task ?? undefined,
+ audioType: pick.audioType ?? undefined,
+ loadId: pick.loadId ?? undefined,
+ gguf: pick.isGguf ? true : undefined,
+ workflow:
+ audioWorkflowForPick({
+ id,
+ task: pick.task,
+ audioType: pick.audioType,
+ }) ?? undefined,
+ };
+}
diff --git a/studio/frontend/src/features/audio/workflows.ts b/studio/frontend/src/features/audio/workflows.ts
index a33b3ac874f..10bc440a535 100644
--- a/studio/frontend/src/features/audio/workflows.ts
+++ b/studio/frontend/src/features/audio/workflows.ts
@@ -13,7 +13,7 @@ import {
VoiceIdIcon,
} from "@hugeicons/core-free-icons";
import type { IconSvgElement } from "@hugeicons/react";
-import { AUDIO_CPP_MUSIC_AUDIO_TYPE } from "./audio-cpp-catalog";
+import { AUDIO_CPP_MUSIC_AUDIO_TYPE } from "./audio-cpp-catalog.ts";
export type AudioWorkflowId =
| "speak"
diff --git a/studio/frontend/src/features/hub/catalog/model-inspector.tsx b/studio/frontend/src/features/hub/catalog/model-inspector.tsx
index dbcd3d6ed2c..fe67d3bdf5c 100644
--- a/studio/frontend/src/features/hub/catalog/model-inspector.tsx
+++ b/studio/frontend/src/features/hub/catalog/model-inspector.tsx
@@ -47,6 +47,7 @@ import { useCopyFeedback } from "../hooks/use-copy-feedback";
import { useDatasetSize } from "../hooks/use-dataset-size";
import {
type HubModelRunSelection,
+ hubModelRunsOnAudioPage,
isHubModelRunEligible,
} from "../lib/model-run-selection";
import { studioPageForTask } from "../lib/unsloth-support";
@@ -405,7 +406,7 @@ export type ModelInspectorActions = {
onSearchHub?: (query: string) => void;
onRun?: (
selection: HubModelRunSelection,
- mediaPage: ReturnType<typeof studioPageForTask>,
+ mediaPage: ReturnType<typeof studioPageForTask> | "audio",
) => void;
runConfigPending?: boolean;
};
@@ -554,10 +555,11 @@ export const ModelInspector = memo(function ModelInspector({
: "N/A";
// Media models use a separate runtime, so the llama.cpp memory estimate does
// not describe their load.
- const mediaPage = studioPageForTask(
- taskForMediaPick(model.pipelineTag, model.task) ?? undefined,
- );
- const runsOnMediaRuntime = mediaPage !== undefined;
+ const mediaTask = taskForMediaPick(model.pipelineTag, model.task);
+ const mediaPage = studioPageForTask(mediaTask ?? undefined);
+ const audioPage =
+ mediaPage === undefined && hubModelRunsOnAudioPage(model, mediaTask);
+ const runsOnMediaRuntime = mediaPage !== undefined || audioPage;
const runEligible = isHubModelRunEligible({
model,
isDataset,
@@ -567,7 +569,8 @@ export const ModelInspector = memo(function ModelInspector({
});
const runAction =
runEligible && onRun
- ? (selection: HubModelRunSelection) => onRun(selection, mediaPage)
+ ? (selection: HubModelRunSelection) =>
+ onRun(selection, audioPage ? "audio" : mediaPage)
: undefined;
const languages = parseLanguageTags(model.tags);
diff --git a/studio/frontend/src/features/hub/hooks/use-selected-model-view.ts b/studio/frontend/src/features/hub/hooks/use-selected-model-view.ts
index c0a38d12732..1713b6bb689 100644
--- a/studio/frontend/src/features/hub/hooks/use-selected-model-view.ts
+++ b/studio/frontend/src/features/hub/hooks/use-selected-model-view.ts
@@ -184,6 +184,7 @@ export function useSelectedModelView({
// only record of the modality when the Hub metadata has no pipeline tag or only the
// generic text-generation one.
task: selectedCachedRow?.task ?? selectedLocalRow?.task ?? null,
+ audioType: selectedCachedRow?.audioType ?? selectedLocalRow?.audioType ?? null,
libraryName: selectedDiscoverRow.result.libraryName,
gated: selectedDiscoverRow.result.gated,
private: selectedDiscoverRow.result.private,
@@ -258,6 +259,7 @@ export function useSelectedModelView({
license: detectLicense(mergedTags),
pipelineTag: mergedPipelineTag,
task: selectedCachedRow.task ?? null,
+ audioType: selectedCachedRow.audioType ?? null,
libraryName: mergedLibraryName,
gated: selectedHfResult?.gated,
private: selectedHfResult?.private,
@@ -339,6 +341,7 @@ export function useSelectedModelView({
license: detectLicense(mergedTags),
pipelineTag: mergedPipelineTag,
task: selectedLocalRow.task ?? null,
+ audioType: selectedLocalRow.audioType ?? null,
libraryName: mergedLibraryName,
gated: selectedHfResult?.gated,
private: selectedHfResult?.private,
@@ -392,6 +395,7 @@ export function useSelectedModelView({
license: detectLicense(mergedTags),
pipelineTag: mergedPipelineTag,
task: selectedLocalRow.task ?? null,
+ audioType: selectedLocalRow.audioType ?? null,
libraryName: mergedLibraryName,
gated: localHubMetadata?.gated,
private: localHubMetadata?.private,
diff --git a/studio/frontend/src/features/hub/hub-page.tsx b/studio/frontend/src/features/hub/hub-page.tsx
index 96c654e59a0..fb9cd2df260 100644
--- a/studio/frontend/src/features/hub/hub-page.tsx
+++ b/studio/frontend/src/features/hub/hub-page.tsx
@@ -13,6 +13,7 @@ import {
resolveInferenceCheckpointId,
useChatRuntimeStore,
} from "@/features/chat";
+import { audioPickSearch } from "@/features/audio/route-search";
import { useHubInfiniteScroll } from "@/features/hub";
import { useOnlineStatus } from "@/features/hub/hooks/use-online-status";
import {
@@ -23,6 +24,7 @@ import {
loadScopedGpu,
requestModelConfigHandoff,
} from "@/features/model-picker";
+import { taskForMediaPick } from "@/features/model-picker/components/model-selector/audio-picker-policy";
import { type NpuModel, type NpuPickerSource, useNpuStatus } from "@/features/npu";
import { loadOpenAIAutoSwitchSettings } from "@/features/settings";
import { GuidedTour, useGuidedTourController } from "@/features/tour";
@@ -101,6 +103,7 @@ import { residentModelIdMatches } from "./lib/model-identity";
import {
createHubModelConfigHandoff,
type HubModelRunSelection,
+ hubAudioTask,
} from "./lib/model-run-selection";
import {
type ModelTypeFilter,
@@ -1510,7 +1513,7 @@ export function ModelsPage() {
const handleRun = useCallback(
async (
selection: HubModelRunSelection,
- mediaPage: ReturnType<typeof studioPageForTask>,
+ mediaPage: ReturnType<typeof studioPageForTask> | "audio",
) => {
if (!selectedModel) return;
if (mediaPage) {
@@ -1524,7 +1527,22 @@ export function ModelsPage() {
}
void navigate({
to: `/${mediaPage}`,
- search: diffusionRouteSearch(selectedModel.hubRepoId, selection),
+ search:
+ mediaPage === "audio"
+ ? audioPickSearch(selectedModel.hubRepoId, {
+ ...selection,
+ task: hubAudioTask(
+ selectedModel,
+ taskForMediaPick(
+ selectedModel.pipelineTag,
+ selectedModel.task,
+ ),
+ ),
+ audioType: selectedModel.audioType,
+ isGguf: selectedModel.isGguf,
+ loadId: selectedModel.loadId,
+ })
+ : diffusionRouteSearch(selectedModel.hubRepoId, selection),
});
return;
}
diff --git a/studio/frontend/src/features/hub/lib/model-run-selection.ts b/studio/frontend/src/features/hub/lib/model-run-selection.ts
index 1a80bb59db5..0e0f6779c62 100644
--- a/studio/frontend/src/features/hub/lib/model-run-selection.ts
+++ b/studio/frontend/src/features/hub/lib/model-run-selection.ts
@@ -1,7 +1,17 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+import { AUDIO_CPP_REPO } from "@/features/audio/audio-cpp-catalog";
+import { audioWorkflowForPick } from "@/features/audio/route-search";
import type { ModelConfigHandoffRequest } from "@/features/model-picker";
+import {
+ audioPickIsRoutable,
+ curatedAudioInventoryTask,
+} from "@/features/model-picker/components/model-selector/audio-picker-policy";
+import {
+ AUDIO_CATALOG,
+ artifactForRepoId,
+} from "@/features/model-picker/components/model-selector/model-catalog";
import type { SelectedModelView } from "../types";
import { EMBEDDING_TAGS } from "./hf-model-meta.ts";
import { routableToMediaPage } from "./local-path.ts";
@@ -107,6 +117,51 @@ function createHandoffMeta(
return meta;
}
+/** The task the Audio handoff runs on: offline, a cached curated audio GGUF carries only the
+ * backend's generic text-generation task, which the picker maps back from the catalog too. */
+export function hubAudioTask(
+ model: SelectedModelView,
+ task: string | null,
+): string | null {
+ const artifact = model.hubRepoId
+ ? artifactForRepoId(model.hubRepoId, AUDIO_CATALOG)
+ : null;
+ return curatedAudioInventoryTask({
+ inventoryTask: task,
+ isExactCatalogArtifact: artifact !== null,
+ catalogScope: artifact?.group.scope,
+ catalogTask: artifact?.group.task,
+ });
+}
+
+/** Whether Run opens this model on the Audio page rather than in chat, which refuses audio models.
+ * Judged on the gate the chat picker routes by, so both surfaces send the same models there. */
+export function hubModelRunsOnAudioPage(
+ model: SelectedModelView,
+ task: string | null,
+): boolean {
+ // A filesystem row has no Hub id for the Audio handoff, so it keeps its chat Run.
+ const id = model.hubRepoId;
+ if (!id || !routableToMediaPage(model.kind, model.localSource)) return false;
+ // The shared GGUF audio repo holds many models; the Audio page lists them one by one.
+ if (id.toLowerCase() === AUDIO_CPP_REPO.toLowerCase()) return false;
+ task = hubAudioTask(model, task);
+ const audioType = model.audioType ?? null;
+ if (audioWorkflowForPick({ id, task, audioType }) === null) return false;
+ return audioPickIsRoutable({
+ id,
+ task,
+ isGguf: model.isGguf,
+ isCurated: artifactForRepoId(id, AUDIO_CATALOG) !== null,
+ // An on-device GGUF is tagged text-to-audio only by the audio runtime's header classifier.
+ taskFromGgufArch: model.isGguf && model.task === "text-to-audio",
+ baseModel: model.baseModel,
+ tags: model.tags,
+ libraryName: model.libraryName,
+ audioType,
+ });
+}
+
export function isHubModelRunEligible({
model,
isDataset,
diff --git a/studio/frontend/src/features/hub/types.ts b/studio/frontend/src/features/hub/types.ts
index e04c5a2f5eb..b52ecd40c6b 100644
--- a/studio/frontend/src/features/hub/types.ts
+++ b/studio/frontend/src/features/hub/types.ts
@@ -74,6 +74,8 @@ export interface SelectedModelView {
/** The backend's inferred pipeline task for an on-device row. A cached GGUF repo carries
* this and NOT `pipelineTag`, so deciding a GGUF row's modality needs both. */
task?: string | null;
+ /** The on-device row's audio type; separation is told apart from other audio-to-audio by it. */
+ audioType?: string | null;
libraryName?: string;
gated?: false | "auto" | "manual";
private?: boolean;
diff --git a/studio/frontend/src/features/loaded-models/loaded-models-indicator.tsx b/studio/frontend/src/features/loaded-models/loaded-models-indicator.tsx
index ef37c3bef0e..152ec7f5cac 100644
--- a/studio/frontend/src/features/loaded-models/loaded-models-indicator.tsx
+++ b/studio/frontend/src/features/loaded-models/loaded-models-indicator.tsx
@@ -12,6 +12,7 @@ import {
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip";
+import { useAudioWorkspaceStore } from "@/features/audio/stores/audio-workspace-store";
import { hasAuthToken, mustChangePassword } from "@/features/auth";
import { useSettingsDialogStore } from "@/features/settings";
import { usePersistedToggle } from "@/hooks/use-persisted-toggle";
@@ -34,9 +35,9 @@ import { HugeiconsIcon } from "@hugeicons/react";
import { useNavigate, useRouterState } from "@tanstack/react-router";
import { useCallback, useEffect, useRef } from "react";
import {
- LOADED_MODEL_KIND_LABELS,
type LoadedModelEntry,
type LoadedModelKind,
+ loadedModelKindLabel,
loadedModelTarget,
shortModelLabel,
} from "./loaded-models-sources";
@@ -72,7 +73,7 @@ function canShowIndicator(pathname: string): boolean {
}
function rowSubtitle(entry: LoadedModelEntry): string {
- const kind = LOADED_MODEL_KIND_LABELS[entry.kind];
+ const kind = loadedModelKindLabel(entry);
return entry.detail ? `${kind} · ${entry.detail}` : kind;
}
@@ -88,7 +89,7 @@ function LoadedModelRow({
onOpen: () => void;
}) {
const label = shortModelLabel(entry.name);
- const target = loadedModelTarget(entry.source);
+ const target = loadedModelTarget(entry.source, entry.workflows);
return (
<div className="flex items-center gap-2 rounded-[14px] px-1.5 py-1 transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(4%*var(--contrast-wash-gain,1)),transparent)]">
{/* Only the label half is the link: the eject button cannot nest inside it. */}
@@ -184,7 +185,11 @@ export function LoadedModelsIndicator({
const navigate = useNavigate();
const openEntry = useCallback(
(entry: LoadedModelEntry) => {
- const target = loadedModelTarget(entry.source);
+ const target = loadedModelTarget(
+ entry.source,
+ entry.workflows,
+ useAudioWorkspaceStore.getState().workflow,
+ );
if (target.open === "settings") {
// Read on click, not at render: the settings barrel reaches back here
// through the General tab, so the binding is only safe once both
@@ -193,9 +198,8 @@ export function LoadedModelsIndicator({
useSettingsDialogStore.getState().openDialog(target.tab);
return;
}
- // No search params: this only takes the user to the page, it does not
- // start a new thread or reload anything.
- void navigate({ to: target.to });
+ // Navigation only (Audio carries its workflow): no new thread, no reload.
+ void navigate({ to: target.to, search: target.search });
},
[navigate],
);
diff --git a/studio/frontend/src/features/loaded-models/loaded-models-sources.ts b/studio/frontend/src/features/loaded-models/loaded-models-sources.ts
index 382ab0b966d..ae491e04336 100644
--- a/studio/frontend/src/features/loaded-models/loaded-models-sources.ts
+++ b/studio/frontend/src/features/loaded-models/loaded-models-sources.ts
@@ -7,10 +7,16 @@
// come from each feature's own module because the indexes re-export their pages.
import {
+ AUDIO_CPP_AUDIO_TYPES,
audioCppDictationModelFor,
audioCppDisplayName,
isAudioCppFolderId,
} from "../audio/audio-cpp-catalog.ts";
+import {
+ type AudioWorkflowId,
+ audioWorkflowForAudioType,
+ isAudioWorkflowId,
+} from "../audio/workflows.ts";
import type { InferenceStatusResponse } from "@/features/chat/types/api";
import type { DiffusionStatus } from "@/features/images/api";
import type { VideoStatus } from "@/features/video/api";
@@ -33,6 +39,8 @@ export type LoadedModelEntry = {
name: string;
/** One short line: quantisation, family, device. */
detail: string;
+ /** Only on a `tts` row: the Audio page workflows that run the model, first one first. */
+ workflows?: AudioWorkflowId[];
/** Only on `source: "stt"`: its unload takes an engine, not a model id. */
sttEngine?: SttEngine;
/** Cached by the chat runtime but not active, so no status flags describe it. */
@@ -70,14 +78,37 @@ const STT_ENGINE_LABELS: Record<SttEngine, string> = {
* runtime holding the weights rather than the kind: a Whisper checkpoint in the
* chat slot belongs to Chat, while the dictation sidecars belong to Voice.
*
- * Dictation has no page of its own yet, so it opens the settings tab that
- * drives it. Point it at the Audio page once that lands.
+ * An audio model in the chat slot opens the Audio page on its workflow, since
+ * Chat refuses it. The dictation sidecars are shared with chat dictation, so
+ * they open the settings tab that drives them.
*/
export type LoadedModelTarget =
- | { open: "route"; to: "/chat" | "/images" | "/video"; label: string }
+ | {
+ open: "route";
+ to: "/chat" | "/images" | "/video" | "/audio";
+ search?: { workflow: AudioWorkflowId };
+ label: string;
+ }
| { open: "settings"; tab: "voice"; label: string };
-export function loadedModelTarget(source: LoadedModelSource): LoadedModelTarget {
+export function loadedModelTarget(
+ source: LoadedModelSource,
+ workflows?: readonly AudioWorkflowId[],
+ currentAudioWorkflow?: AudioWorkflowId,
+): LoadedModelTarget {
+ if (source === "chat" && workflows?.length) {
+ // An Audio page already on a workflow this model runs stays there: switching it would
+ // also stop a generation running on that workflow.
+ if (currentAudioWorkflow && workflows.includes(currentAudioWorkflow)) {
+ return { open: "route", to: "/audio", label: "Audio" };
+ }
+ return {
+ open: "route",
+ to: "/audio",
+ search: { workflow: workflows[0] },
+ label: "Audio",
+ };
+ }
switch (source) {
case "image":
return { open: "route", to: "/images", label: "Images" };
@@ -98,6 +129,22 @@ export const LOADED_MODEL_KIND_LABELS: Record<LoadedModelKind, string> = {
stt: "Dictation",
};
+const AUDIO_WORKFLOW_KIND_LABELS: Partial<Record<AudioWorkflowId, string>> = {
+ music: "Music",
+ separate: "Separation",
+ convert: "Voice conversion",
+};
+
+export function loadedModelKindLabel(
+ entry: Pick<LoadedModelEntry, "kind" | "workflows">,
+): string {
+ const workflow = entry.workflows?.[0];
+ return (
+ (workflow && AUDIO_WORKFLOW_KIND_LABELS[workflow]) ??
+ LOADED_MODEL_KIND_LABELS[entry.kind]
+ );
+}
+
/**
* Join the known parts, so no row shows a stray separator, and drop repeats:
* the llama.cpp and whisper.cpp dictation sidecars report their engine name as
@@ -147,15 +194,29 @@ export function describeInferenceStatus(
audioType !== "whisper" &&
audioType !== "audio_vlm";
const isStt = Boolean(status.is_audio) && audioType === "whisper";
- const runtime = status.is_gguf
- ? "GGUF"
- : status.is_mlx
- ? "MLX"
- : "Transformers";
+ const audioWorkflows = (status.audio_workflows ?? []).filter(
+ isAudioWorkflowId,
+ );
+ // The GGUF audio runtime reports is_gguf false, but it serves GGUFs too.
+ const runtime =
+ status.is_gguf || AUDIO_CPP_AUDIO_TYPES.has(audioType ?? "")
+ ? "GGUF"
+ : status.is_mlx
+ ? "MLX"
+ : "Transformers";
entries.push({
id: `chat:${active}`,
kind: isTts ? "tts" : isStt ? "stt" : "text",
source: "chat",
+ // An older backend sends no workflows: the audio type still tells Music from Speak.
+ ...(isTts
+ ? {
+ workflows:
+ audioWorkflows.length > 0
+ ? audioWorkflows
+ : [audioWorkflowForAudioType(audioType)],
+ }
+ : {}),
name: active,
detail: joinDetail(
runtime,
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/audio-picker-policy.ts b/studio/frontend/src/features/model-picker/components/model-selector/audio-picker-policy.ts
index edfd174fd81..beb437618f2 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/audio-picker-policy.ts
+++ b/studio/frontend/src/features/model-picker/components/model-selector/audio-picker-policy.ts
@@ -1,7 +1,10 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
-import { AUDIO_CPP_AUDIO_TYPES } from "../../../audio/audio-cpp-catalog.ts";
+import {
+ AUDIO_CPP_AUDIO_TYPES,
+ AUDIO_CPP_SEP_AUDIO_TYPE,
+} from "../../../audio/audio-cpp-catalog.ts";
import type { FormatFilter } from "./recommended-fit";
import type { ModelSelectorChangeMeta } from "./types";
@@ -84,13 +87,12 @@ export function communityAudioRowIsRunnable({
const evidence = [id, baseModel ?? "", ...(tags ?? [])].map((value) =>
value.toLowerCase(),
);
- const audioRuntimeGguf =
+ if (
isGguf &&
- (AUDIO_CPP_AUDIO_TYPES.has(audioType ?? "") ||
- [...evidence, (libraryName ?? "").toLowerCase()].some((value) =>
- AUDIO_RUNTIME_EVIDENCE.test(value),
- ));
- if (audioRuntimeGguf) return true;
+ isAudioRuntimeGgufEvidence({ id, baseModel, tags, libraryName, audioType })
+ ) {
+ return true;
+ }
if (isStt) {
if (isGguf) return false;
if (libraryName && libraryName.toLowerCase() !== "transformers")
@@ -116,6 +118,27 @@ export function communityAudioRowIsRunnable({
return !(isGguf && /(?:^|[-_./])csm(?:$|[-_./])/.test(family));
}
+function isAudioRuntimeGgufEvidence({
+ id,
+ baseModel,
+ tags,
+ libraryName,
+ audioType,
+}: {
+ id: string;
+ baseModel?: string | null;
+ tags?: readonly string[] | null;
+ libraryName?: string | null;
+ audioType?: string | null;
+}): boolean {
+ return (
+ AUDIO_CPP_AUDIO_TYPES.has(audioType ?? "") ||
+ [id, baseModel ?? "", ...(tags ?? []), libraryName ?? ""].some((value) =>
+ AUDIO_RUNTIME_EVIDENCE.test(value.toLowerCase()),
+ )
+ );
+}
+
/** A GGUF llama.cpp cannot decode, however it was found: CSM is Transformers-only, so it
* never loads in llama-server. Beside communityAudioRowIsRunnable's list to stay in step. */
export function speechGgufIsUndecodable({
@@ -194,6 +217,17 @@ export function audioPickIsRoutable({
return ["snac", "bicodec", "dac"].includes(codec) || AUDIO_CPP_AUDIO_TYPES.has(codec);
}
if (isCurated) return true;
+ // Hub music / audio-to-audio tags also cover MusicGen, Stable Audio, codecs, enhancers: Audio runs none.
+ if (task === "audio-to-audio") return audioType === AUDIO_CPP_SEP_AUDIO_TYPE;
+ if (task === "text-to-audio") {
+ if (NATIVE_AUDIO_TYPES.has(audioType ?? "")) return true;
+ return (
+ isGguf &&
+ (taskFromGgufArch ||
+ isLocalCheckpoint ||
+ isAudioRuntimeGgufEvidence({ id, baseModel, tags, libraryName, audioType }))
+ );
+ }
// A checkpoint from outputs/ has no Hub identity to judge, and the family-name heuristic would
// reject it on its directory name. Its task came from the backend reading the checkpoint,
// the stronger signal, and the Audio page lists it off that same tag.
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx b/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx
index 1c19789be46..0add7d4d708 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx
+++ b/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx
@@ -157,7 +157,7 @@ import {
useState,
useSyncExternalStore,
} from "react";
-import { audioWorkflowForPick } from "../../../audio/route-search.ts";
+import { audioPickSearch } from "../../../audio/route-search.ts";
import { useChatPickerInventory } from "../../inventory/use-chat-picker-inventory";
import {
type CommunityModelPolicy,
@@ -2655,10 +2655,13 @@ const DIFFUSION_TASKS: ReadonlySet<string> = new Set([
...VIDEO_GEN_TASKS,
]);
-// Speech pipeline tasks: owned by the Audio page. TTS picks load there; ASR picks map to the dictation sidecar.
+// Audio pipeline tasks: owned by the Audio page. TTS, music and separation picks load there; ASR picks map
+// to the dictation sidecar.
export const AUDIO_GEN_TASKS = [
"text-to-speech",
"automatic-speech-recognition",
+ "text-to-audio",
+ "audio-to-audio",
] as const;
// Diffusion GGUF archs the Images backend cannot assemble yet. The backend tags them with this
@@ -4119,6 +4122,7 @@ export function HubModelPicker({
tags?: string[];
libraryName?: string | null;
audioType?: string | null;
+ taskFromGgufArch?: boolean;
}
>();
for (const r of [
@@ -4153,15 +4157,18 @@ export function HubModelPicker({
});
}
for (const c of cachedGguf) {
+ // Only the audio runtime's header classifier tags a GGUF text-to-audio, so it is runnable.
+ const taskFromGgufArch = c.task === "text-to-audio" ? true : undefined;
const existing = map.get(c.repo_id);
if (existing) {
map.set(c.repo_id, {
...existing,
audioType: existing.audioType ?? c.audio_type,
+ taskFromGgufArch,
});
continue;
}
- map.set(c.repo_id, { audioType: c.audio_type });
+ map.set(c.repo_id, { audioType: c.audio_type, taskFromGgufArch });
}
return map;
}, [
@@ -4612,7 +4619,7 @@ export function HubModelPicker({
) {
// Loading it here would evict the chat model for a repo neither surface can run.
toast.error(
- `${id} is not a speech model Unsloth can run yet. The Audio page lists the families it supports.`,
+ `${id} is not an audio model Unsloth can run yet. The Audio page lists the families it supports.`,
{ duration: 7000 },
);
return;
@@ -4620,27 +4627,10 @@ export function HubModelPicker({
if (page) {
void navigateToPage({
to: `/${page}`,
- // `quant` is used verbatim as the gguf filename, so a label like "Q4_K_M" rides ggufQuant
- // instead; dropping it made every non-curated GGUF repo arrive as a bare repo id.
+ // pickedTask, not meta.pipelineTag: a cached row carries no tag to forward.
search:
page === "audio"
- ? {
- model: id,
- quant: meta.ggufFilename ?? undefined,
- ggufQuant: meta.ggufFilename
- ? undefined
- : (meta.ggufVariant ?? undefined),
- // pickedTask, not meta.pipelineTag: a cached row carries no tag to forward.
- task: pickedTask ?? undefined,
- audioType: meta.audioType ?? undefined,
- loadId: meta.loadId ?? undefined,
- workflow:
- audioWorkflowForPick({
- id,
- task: pickedTask,
- audioType: meta.audioType,
- }) ?? undefined,
- }
+ ? audioPickSearch(id, { ...meta, task: pickedTask })
: diffusionRouteSearch(id, meta),
});
return;
diff --git a/studio/frontend/tests/audio-handoff-intent.test.ts b/studio/frontend/tests/audio-handoff-intent.test.ts
index 2ce7d1442f6..71af5412c60 100644
--- a/studio/frontend/tests/audio-handoff-intent.test.ts
+++ b/studio/frontend/tests/audio-handoff-intent.test.ts
@@ -7,8 +7,12 @@ import test from "node:test";
import { readSrc, registerBundlerResolver } from "./helpers/kit.ts";
registerBundlerResolver();
-const { audioRouteIntent, audioWorkflowForPick, validateAudioSearch } =
- await import("../src/features/audio/route-search.ts");
+const {
+ audioPickSearch,
+ audioRouteIntent,
+ audioWorkflowForPick,
+ validateAudioSearch,
+} = await import("../src/features/audio/route-search.ts");
test("every task Audio runs survives validation, including text-to-audio", () => {
for (const task of [
@@ -112,7 +116,10 @@ test("a chat pick opens on the workflow its model runs in", () => {
);
assert.equal(audioWorkflowForPick({ id: "x/y", task: null }), null);
const clone = (folder: string) =>
- audioWorkflowForPick({ id: `audio-cpp/audio.cpp-gguf/${folder}`, task: "text-to-speech" });
+ audioWorkflowForPick({
+ id: `audio-cpp/audio.cpp-gguf/${folder}`,
+ task: "text-to-speech",
+ });
assert.equal(clone("Qwen3-TTS-12Hz-0.6B-Base-GGUF"), "clone");
assert.equal(clone("VoxCPM2-GGUF"), "speak");
});
@@ -122,17 +129,58 @@ test("the route validates through the shared helper", () => {
assert.match(route, /validateSearch: validateAudioSearch,/);
});
-test("the chat picker forwards the workflow and still routes no text-to-audio rows", () => {
+test("the chat picker routes music and separation rows to Audio with their workflow", () => {
const pickers = readSrc(
"features/model-picker/components/model-selector/pickers.tsx",
);
assert.match(
pickers,
- /workflow:\s*audioWorkflowForPick\(\{\s*id,\s*task: pickedTask,\s*audioType: meta\.audioType,\s*\}\) \?\? undefined,/,
+ /audioPickSearch\(id, \{ \.\.\.meta, task: pickedTask \}\)/,
);
const tasks = pickers.match(/export const AUDIO_GEN_TASKS = \[([^\]]*)\]/);
assert.ok(tasks);
- assert.doesNotMatch(tasks[1], /text-to-audio/);
+ assert.match(tasks[1], /"text-to-audio"/);
+ assert.match(tasks[1], /"audio-to-audio"/);
+});
+
+test("a pick's Audio search names its file, quant label, load and workflow", () => {
+ assert.deepEqual(
+ audioPickSearch("audio-cpp/audio.cpp-gguf/ACE-Step1.5-GGUF", {
+ ggufFilename: "ace-step-q8_0.gguf",
+ ggufVariant: "Q8_0",
+ task: "text-to-audio",
+ loadId: "/cache/snap",
+ isGguf: true,
+ }),
+ {
+ model: "audio-cpp/audio.cpp-gguf/ACE-Step1.5-GGUF",
+ quant: "ace-step-q8_0.gguf",
+ ggufQuant: "Q8_0",
+ task: "text-to-audio",
+ audioType: undefined,
+ loadId: "/cache/snap",
+ gguf: true,
+ workflow: "music",
+ },
+ );
+ // Without a filename the quant label rides ggufQuant, never `quant`.
+ const labelOnly = audioPickSearch("x/Kokoro-82M-GGUF", {
+ ggufVariant: "Q4_K_M",
+ task: "text-to-speech",
+ });
+ assert.equal(labelOnly.quant, undefined);
+ assert.equal(labelOnly.ggufQuant, "Q4_K_M");
+ assert.equal(labelOnly.workflow, "speak");
+});
+
+test("a routed audio-to-audio pick opens Separate", () => {
+ assert.equal(
+ audioWorkflowForPick({
+ id: "someone/BSRoformer-GGUF",
+ task: "audio-to-audio",
+ }),
+ "separate",
+ );
});
test("a chat picker handoff opens its page before the load, not only after it succeeds", () => {
@@ -177,3 +225,34 @@ test("a chat pick of an uncatalogued clone-only family opens Clone", () => {
"speak",
);
});
+
+test("a GGUF pick keeps its format through the Audio route", async () => {
+ const { audioPickSearch, validateAudioSearch } = await import(
+ "../src/features/audio/route-search.ts"
+ );
+ const search = audioPickSearch("someone/parakeet-audiocpp", {
+ task: "automatic-speech-recognition",
+ isGguf: true,
+ ggufVariant: "Q8_0",
+ });
+ assert.equal(search.gguf, true);
+ assert.equal(validateAudioSearch({ ...search }).gguf, true);
+ assert.equal(validateAudioSearch({ gguf: "true" }).gguf, true);
+ assert.equal(validateAudioSearch({ gguf: "1" }).gguf, undefined);
+ assert.equal(
+ audioPickSearch("org/whisper-small", {
+ task: "automatic-speech-recognition",
+ }).gguf,
+ undefined,
+ );
+ const { readFile } = await import("node:fs/promises");
+ const handoff = await readFile(
+ new URL(
+ "../src/features/audio/hooks/use-audio-handoff.ts",
+ import.meta.url,
+ ),
+ "utf8",
+ );
+ // Without it the slot picks the STT engine from the repo name alone.
+ assert.match(handoff, /isGguf: routeSearch\.gguf/);
+});
diff --git a/studio/frontend/tests/audio-picker-policy.test.ts b/studio/frontend/tests/audio-picker-policy.test.ts
index 806a6801476..ab9d802b5d0 100644
--- a/studio/frontend/tests/audio-picker-policy.test.ts
+++ b/studio/frontend/tests/audio-picker-policy.test.ts
@@ -365,16 +365,12 @@ test("Chat-to-Audio handoff preserves the live Hub task", () => {
// pickedTask, not meta.pipelineTag: a cached row carries no tag, so ASR would read as TTS.
assert.match(
pickerSource,
- /page === "audio"[\s\S]*task:\s*pickedTask \?\? undefined/,
+ /page === "audio"[\s\S]*audioPickSearch\(id, \{ \.\.\.meta, task: pickedTask \}\)/,
);
assert.match(
pickerSource,
/page === "audio" &&\s*!audioPickIsRoutable\(\{[\s\S]*isCurated: artifactForRepoId\(id, AUDIO_CATALOG\) !== null/,
);
- assert.match(
- pickerSource,
- /page === "audio"[\s\S]*ggufQuant:\s*meta\.ggufFilename[\s\S]*meta\.ggufVariant/,
- );
assert.match(
pickerSource,
/const alreadyListed = new Set\([\s\S]*visibleCachedGguf[\s\S]*visibleCachedModels/,
@@ -777,3 +773,40 @@ test("the audio page asks the GGUF-aware TTS predicate for trained rows", () =>
/isTtsAudioType\(\s*lora\.audio_type,\s*lora\.export_type === "gguf",?\s*\)/,
);
});
+
+test("music and audio-to-audio picks route only when the Audio page runs them", () => {
+ const pick = (overrides: Partial<Parameters<typeof audioPickIsRoutable>[0]>) =>
+ audioPickIsRoutable({
+ id: "someone/model",
+ task: "text-to-audio",
+ isGguf: false,
+ isCurated: false,
+ ...overrides,
+ });
+ // The Hub's music tag covers runtimes Studio does not have.
+ assert.equal(pick({ id: "facebook/musicgen-small" }), false);
+ assert.equal(pick({ id: "stabilityai/stable-audio-open-1.0" }), false);
+ assert.equal(pick({ id: "calcuis/ace-gguf", isGguf: true, tags: ["gguf"] }), false);
+ assert.equal(
+ pick({ id: "thepatch/stable-audio-3-medium-GGUF", isGguf: true, tags: ["gguf", "sa3.cpp"] }),
+ false,
+ );
+ // A GGUF published for the audio runtime, or one whose header it classified, does run.
+ assert.equal(
+ pick({ id: "ngquocvinh/YuE2-3B-GGUF", isGguf: true, tags: ["gguf", "audio.cpp"] }),
+ true,
+ );
+ assert.equal(pick({ id: "someone/ACE-GGUF", isGguf: true, taskFromGgufArch: true }), true);
+ assert.equal(pick({ id: "MiniMaxAI/MiniMax-Music3", audioType: "minimax_music3" }), true);
+ assert.equal(pick({ isCurated: true }), true);
+ // Separation is the one audio-to-audio kind with a page.
+ assert.equal(
+ pick({ id: "chenmozhijin/BSRoformer-GGUF", task: "audio-to-audio", isGguf: true, audioType: "audiocpp_sep" }),
+ true,
+ );
+ assert.equal(pick({ id: "nvidia/bigvgan_v2_22khz_80band_256x", task: "audio-to-audio" }), false);
+ assert.equal(
+ pick({ id: "someone/codec-GGUF", task: "audio-to-audio", isGguf: true, taskFromGgufArch: true }),
+ false,
+ );
+});
diff --git a/studio/frontend/tests/hub-media-run-gate.test.ts b/studio/frontend/tests/hub-media-run-gate.test.ts
index 1ef8fb60389..d60bc5f2e0b 100644
--- a/studio/frontend/tests/hub-media-run-gate.test.ts
+++ b/studio/frontend/tests/hub-media-run-gate.test.ts
@@ -10,7 +10,7 @@ import { registerBundlerResolver } from "./helpers/kit.ts";
registerBundlerResolver();
-const { isHubModelRunEligible } = await import(
+const { hubModelRunsOnAudioPage, isHubModelRunEligible } = await import(
"../src/features/hub/lib/model-run-selection.ts"
);
const { taskForMediaPick } = await import(
@@ -99,3 +99,147 @@ test("chat tasks are not eligible through the media route", () => {
false,
);
});
+
+test("an audio model the Audio page runs opens there, the rest keep their chat Run", () => {
+ const audio = (overrides: Partial<SelectedModelView>): SelectedModelView => ({
+ ...mediaModel(undefined, "cache"),
+ runtimeCanChat: true,
+ ...overrides,
+ });
+ const opensAudio = (model: SelectedModelView) =>
+ hubModelRunsOnAudioPage(
+ model,
+ taskForMediaPick(model.pipelineTag, model.task),
+ );
+ // A cached audio runtime GGUF carries its header task and no Hub tag.
+ assert.equal(
+ opensAudio(
+ audio({
+ id: "x/ACE-GGUF",
+ hubRepoId: "x/ACE-GGUF",
+ isGguf: true,
+ task: "text-to-audio",
+ }),
+ ),
+ true,
+ );
+ assert.equal(
+ opensAudio(
+ audio({
+ hubRepoId: "unsloth/orpheus-3b-0.1-ft",
+ pipelineTag: "text-to-speech",
+ }),
+ ),
+ true,
+ );
+ assert.equal(
+ opensAudio(
+ audio({
+ hubRepoId: "openai/whisper-small",
+ pipelineTag: "automatic-speech-recognition",
+ }),
+ ),
+ true,
+ );
+ // Tagged audio, but nothing here decodes it: Run stays where it was.
+ assert.equal(
+ opensAudio(
+ audio({
+ hubRepoId: "facebook/musicgen-small",
+ pipelineTag: "text-to-audio",
+ }),
+ ),
+ false,
+ );
+ assert.equal(
+ opensAudio(
+ audio({ hubRepoId: "suno/bark", pipelineTag: "text-to-speech" }),
+ ),
+ false,
+ );
+ assert.equal(
+ opensAudio(
+ audio({ hubRepoId: "unsloth/Qwen3-8B", pipelineTag: "text-generation" }),
+ ),
+ false,
+ );
+ // The shared GGUF audio repo is many models, not one Run target.
+ assert.equal(
+ opensAudio(
+ audio({
+ id: "audio-cpp/audio.cpp-gguf",
+ hubRepoId: "audio-cpp/audio.cpp-gguf",
+ isGguf: true,
+ pipelineTag: "text-to-speech",
+ task: "audio-to-audio",
+ tags: ["gguf", "audio.cpp"],
+ }),
+ ),
+ false,
+ );
+ // A filesystem row has no Hub id to hand Audio, so it keeps its chat Run.
+ assert.equal(
+ opensAudio({
+ ...mediaModel("text-to-speech", "local", "models_dir"),
+ hubRepoId: "unsloth/orpheus-3b-0.1-ft",
+ }),
+ false,
+ );
+});
+
+test("a cached separation GGUF opens Separate: its audio type reaches the gate", () => {
+ const model: SelectedModelView = {
+ ...mediaModel(undefined, "cache"),
+ id: "x/HTDemucs-GGUF",
+ hubRepoId: "x/HTDemucs-GGUF",
+ isGguf: true,
+ runtimeCanChat: true,
+ task: "audio-to-audio",
+ audioType: "audiocpp_sep",
+ };
+ const task = taskForMediaPick(model.pipelineTag, model.task);
+ assert.equal(hubModelRunsOnAudioPage(model, task), true);
+ // Any other audio-to-audio row (enhancers, codecs) still keeps its chat Run.
+ assert.equal(
+ hubModelRunsOnAudioPage({ ...model, audioType: null }, task),
+ false,
+ );
+});
+
+test("the Hub forwards the row's audio type into the Audio handoff", async () => {
+ const { readFile } = await import("node:fs/promises");
+ const src = await readFile(
+ new URL("../src/features/hub/hub-page.tsx", import.meta.url),
+ "utf8",
+ );
+ assert.match(
+ src,
+ /audioPickSearch\([\s\S]{0,400}audioType: selectedModel\.audioType/,
+ );
+});
+
+test("an offline cached curated audio GGUF still opens Audio from its catalog task", async () => {
+ const { hubAudioTask } = await import(
+ "../src/features/hub/lib/model-run-selection.ts"
+ );
+ const model: SelectedModelView = {
+ ...mediaModel(undefined, "cache"),
+ id: "unsloth/orpheus-3b-0.1-ft-GGUF",
+ hubRepoId: "unsloth/orpheus-3b-0.1-ft-GGUF",
+ isGguf: true,
+ runtimeCanChat: true,
+ // No Hub tag offline: the backend reports the generic task for a cached GGUF.
+ task: "text-generation",
+ };
+ const task = taskForMediaPick(model.pipelineTag, model.task);
+ assert.equal(hubAudioTask(model, task), "text-to-speech");
+ assert.equal(hubModelRunsOnAudioPage(model, task), true);
+ // A chat GGUF with the same generic task keeps its chat Run.
+ const chat = {
+ ...model,
+ id: "unsloth/Qwen3-8B-GGUF",
+ hubRepoId: "unsloth/Qwen3-8B-GGUF",
+ };
+ assert.equal(hubAudioTask(chat, task), "text-generation");
+ assert.equal(hubModelRunsOnAudioPage(chat, task), false);
+});
diff --git a/studio/frontend/tests/hub-runtime-boundary.test.ts b/studio/frontend/tests/hub-runtime-boundary.test.ts
index 76946f0a026..0f55d7b2f52 100644
--- a/studio/frontend/tests/hub-runtime-boundary.test.ts
+++ b/studio/frontend/tests/hub-runtime-boundary.test.ts
@@ -197,7 +197,7 @@ test("the Hub routes Run to its owning workflow without owning runtime actions",
assert.match(hubPage, /to: "\/chat", search: \{ new: requestId \}/);
assert.match(
modelInspector,
- /const mediaPage = studioPageForTask\([\s\S]*?taskForMediaPick\(model\.pipelineTag, model\.task\)/,
+ /const mediaTask = taskForMediaPick\(model\.pipelineTag, model\.task\);\s*const mediaPage = studioPageForTask\(mediaTask \?\? undefined\);/,
);
assert.match(
hubPage,
@@ -205,7 +205,7 @@ test("the Hub routes Run to its owning workflow without owning runtime actions",
);
assert.match(
hubPage,
- /to: `\/\$\{mediaPage\}`,[\s\S]*?diffusionRouteSearch\(selectedModel\.hubRepoId, selection\)/,
+ /to: `\/\$\{mediaPage\}`,[\s\S]*?mediaPage === "audio"[\s\S]*?audioPickSearch\(selectedModel\.hubRepoId,[\s\S]*?diffusionRouteSearch\(selectedModel\.hubRepoId, selection\)/,
);
assert.match(
hubPage,
@@ -260,7 +260,7 @@ test("the Hub routes Run to its owning workflow without owning runtime actions",
assert.match(modelInspector, /const runEligible = isHubModelRunEligible\(/);
assert.match(
modelInspector,
- /\? \(selection: HubModelRunSelection\) => onRun\(selection, mediaPage\)/,
+ /\? \(selection: HubModelRunSelection\) =>\s*onRun\(selection, audioPage \? "audio" : mediaPage\)/,
);
assert.match(
ggufCard,
diff --git a/studio/frontend/tests/loaded-models-sources.test.ts b/studio/frontend/tests/loaded-models-sources.test.ts
index 8e6c8182575..7a3858a5385 100644
--- a/studio/frontend/tests/loaded-models-sources.test.ts
+++ b/studio/frontend/tests/loaded-models-sources.test.ts
@@ -13,6 +13,7 @@ import {
describeInferenceStatus,
describeSttStatus,
describeVideoStatus,
+ loadedModelKindLabel,
loadedModelTarget,
mergeLoadedModels,
withPendingLoads,
@@ -616,3 +617,90 @@ test("a video row without a quant backend is unchanged", () => {
} as never);
assert.equal(row.detail, "wan2.2-t2v-a14b · FP8 · cuda");
});
+
+// Chat refuses a speech-only model, so its row opens the Audio page on the workflow that runs it.
+test("an audio model in the chat slot opens its Audio workflow, named for what it does", () => {
+ const row = (overrides: Record<string, unknown>) => {
+ const [entry] = describeInferenceStatus(
+ inferenceStatus({ active_model: "m/x", is_audio: true, ...overrides }),
+ );
+ return {
+ target: loadedModelTarget(entry.source, entry.workflows),
+ label: loadedModelKindLabel(entry),
+ };
+ };
+ const audio = (workflow: string) => ({
+ open: "route",
+ to: "/audio",
+ search: { workflow },
+ label: "Audio",
+ });
+ assert.deepEqual(row({ audio_type: "snac", audio_workflows: ["speak"] }), {
+ target: audio("speak"),
+ label: "Speech",
+ });
+ assert.deepEqual(
+ row({ audio_type: "audiocpp_music", audio_workflows: ["music"] }),
+ { target: audio("music"), label: "Music" },
+ );
+ assert.deepEqual(
+ row({ audio_type: "audiocpp_sep", audio_workflows: ["separate"] }),
+ {
+ target: audio("separate"),
+ label: "Separation",
+ },
+ );
+ assert.deepEqual(
+ row({ audio_type: "audiocpp_tts", audio_workflows: ["convert"] }),
+ { target: audio("convert"), label: "Voice conversion" },
+ );
+ // An older backend sends no workflows; the audio type still tells Music from Speak.
+ assert.deepEqual(
+ row({ audio_type: "minimax_music3" }).target,
+ audio("music"),
+ );
+ assert.deepEqual(row({ audio_type: "csm" }).target, audio("speak"));
+ // The first workflow names the row and is where the Audio page opens.
+ assert.deepEqual(
+ row({ audio_type: "audiocpp_tts", audio_workflows: ["speak", "edit"] }),
+ { target: audio("speak"), label: "Speech" },
+ );
+ // The GGUF audio runtime reports is_gguf false; its rows still read GGUF.
+ const [sep] = describeInferenceStatus(
+ inferenceStatus({
+ active_model: "audio-cpp/audio.cpp-gguf/HTDemucs-GGUF",
+ is_audio: true,
+ is_gguf: false,
+ audio_type: "audiocpp_sep",
+ gguf_variant: "Q8_0",
+ }),
+ );
+ assert.equal(sep.detail, "GGUF · Q8_0");
+ // Whisper in the chat slot is still Chat's.
+ assert.equal(row({ audio_type: "whisper" }).target.label, "Chat");
+});
+
+// Switching the Audio page's workflow stops a generation running on it, and the card only navigates.
+test("an Audio page already on a workflow the model runs is left there", () => {
+ const [row] = describeInferenceStatus(
+ inferenceStatus({
+ active_model: "audio-cpp/audio.cpp-gguf/DotTTS-Edit-GGUF",
+ is_audio: true,
+ audio_type: "audiocpp_tts",
+ audio_workflows: ["speak", "edit"],
+ }),
+ );
+ assert.deepEqual(row.workflows, ["speak", "edit"]);
+ assert.deepEqual(loadedModelTarget(row.source, row.workflows, "edit"), {
+ open: "route",
+ to: "/audio",
+ label: "Audio",
+ });
+ // A workflow the model does not run still opens its first one.
+ assert.deepEqual(loadedModelTarget(row.source, row.workflows, "music"), {
+ open: "route",
+ to: "/audio",
+ search: { workflow: "speak" },
+ label: "Audio",
+ });
+});
diff --git a/studio/frontend/tests/model-picker-partial-downloads.test.ts b/studio/frontend/tests/model-picker-partial-downloads.test.ts
index 47749e4a4bc..1f834518182 100644
--- a/studio/frontend/tests/model-picker-partial-downloads.test.ts
+++ b/studio/frontend/tests/model-picker-partial-downloads.test.ts
@@ -456,7 +456,11 @@ test("a partial pick carries no load identity", () => {
"a routed loadId is still read as downloaded",
);
// And the route still forwards whatever the pick gives it.
- assert.ok(PICKERS.includes("loadId: meta.loadId ?? undefined,"));
+ assert.ok(PICKERS.includes("audioPickSearch(id, { ...meta, task: pickedTask })"));
+ assert.match(
+ read("../src/features/audio/route-search.ts"),
+ /loadId: pick\.loadId \?\? undefined,/,
+ );
});
test("configure carries the same rule, because Run replays its metadata", () => {