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: fix the audio model selector's list, labels and search (#13517)

Etherl76b4e2fe98e6
diff --git a/studio/frontend/src/app/routes/hub.tsx b/studio/frontend/src/app/routes/hub.tsx
index 469816aed49..d353f1ee0a1 100644
--- a/studio/frontend/src/app/routes/hub.tsx
+++ b/studio/frontend/src/app/routes/hub.tsx
@@ -2,6 +2,8 @@
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
import type { CapabilityKey } from "@/features/hub";
+import { hubAudioTaskSearch } from "@/lib/hub-audio-task";
+import type { PipelineType } from "@huggingface/hub";
import { createRoute, lazyRouteComponent } from "@tanstack/react-router";
import { requireAuth } from "../auth-guards";
import { Route as rootRoute } from "./__root";
@@ -29,6 +31,7 @@ export interface ModelsSearch {
section?: "trending" | "latest" | "finetune";
kind?: "models" | "datasets";
capability?: CapabilityKey;
+ audioTask?: PipelineType[];
}
export const Route = createRoute({
@@ -70,6 +73,8 @@ export const Route = createRoute({
if (HUB_CAPABILITIES.includes(capability as CapabilityKey)) {
next.capability = capability as CapabilityKey;
}
+ const audioTask = hubAudioTaskSearch(search.audioTask, next.capability);
+ if (audioTask) next.audioTask = audioTask;
return next;
},
});
diff --git a/studio/frontend/src/features/audio/audio-page-policy.ts b/studio/frontend/src/features/audio/audio-page-policy.ts
index 37814c241e9..06161fb0e76 100644
--- a/studio/frontend/src/features/audio/audio-page-policy.ts
+++ b/studio/frontend/src/features/audio/audio-page-policy.ts
@@ -11,7 +11,9 @@ import {
AUDIO_CPP_TTS_AUDIO_TYPE,
type AudioCppRuntimeStatus,
audioCppDisplayName,
+ AUDIO_CPP_REPO,
audioCppModelFor,
+ isAudioCppFolderId,
} from "./audio-cpp-catalog.ts";
/** Why the installed audio runtime cannot run this recommended speech or music model, or null
@@ -381,6 +383,93 @@ export function canTransitionAudioMode(
);
}
+/** The main slot's loaded model as the picker rows name it. llama-server reports a custom-folder
+ * GGUF's file stem as active_model and its path as model_identifier, and that row uses the path;
+ * a Hub model keeps its repo id, since model_identifier can be a cache snapshot path. */
+export function audioLoadedSelection(
+ status:
+ | {
+ active_model?: string | null;
+ model_identifier?: string | null;
+ gguf_variant?: string | null;
+ }
+ | null
+ | undefined,
+ // The quant a GGUF file name carries (`ggufQuantLabel`); without one a file name stays as is.
+ quantLabel?: (filename: string) => string,
+): { id: string | null; variant: string | null } {
+ const active = status?.active_model ?? null;
+ const id = active
+ ? active.includes("/")
+ ? active
+ : (status?.model_identifier ?? active)
+ : null;
+ return { id, variant: id ? loadedQuantKey(status?.gguf_variant ?? null, quantLabel) : null };
+}
+
+/** llama status echoes the load selector, which is a file name for a pick from the quant list
+ * (`model-q4_k_m.gguf`); picker rows key that quant `Q4_K_M`, under any directory it sits in. */
+function loadedQuantKey(
+ variant: string | null,
+ quantLabel?: (filename: string) => string,
+): string | null {
+ if (!variant || !quantLabel || !/\.gguf$/i.test(variant.trim())) return variant;
+ const path = variant.trim().replace(/\\/g, "/");
+ const cut = path.lastIndexOf("/") + 1;
+ return `${path.slice(0, cut)}${quantLabel(path.slice(cut)).toUpperCase()}`;
+}
+
+/** A deleted model is gone once the settled inventory no longer lists it; a quant delete leaves
+ * the model listed. An audio.cpp folder is gone with its package repo, or, once the inventory
+ * lists folder rows, when its own row is missing. */
+export function rememberedModelIsGone(
+ id: string,
+ inventory: { settled: boolean; error: boolean; available: ReadonlySet<string> },
+): boolean {
+ if (!inventory.settled || inventory.error) return false;
+ if (inventory.available.has(id.toLowerCase())) return false;
+ if (!isAudioCppFolderId(id)) return true;
+ return (
+ !inventory.available.has(AUDIO_CPP_REPO.toLowerCase()) ||
+ [...inventory.available].some((listed) => isAudioCppFolderId(listed))
+ );
+}
+
+/** Whether a delete of `deletedRepoId` can have removed the remembered model: the same repo, or
+ * the audio.cpp package that holds the remembered folder. */
+export function deleteCoversRememberedModel(
+ deletedRepoId: string,
+ rememberedId: string,
+): boolean {
+ const deleted = deletedRepoId.toLowerCase();
+ const remembered = rememberedId.toLowerCase();
+ return remembered === deleted || remembered.startsWith(`${deleted}/`);
+}
+
+/** Delete markers a settled inventory listing newer than the delete has now been judged against.
+ * Each marker keeps the listing current when its delete was announced. */
+export function settledDeleteMarkers(
+ markers: ReadonlyMap<string, ReadonlySet<string>>,
+ inventory: { settled: boolean; error: boolean; available: ReadonlySet<string> },
+): string[] {
+ if (!inventory.settled || inventory.error) return [];
+ return [...markers]
+ .filter(([, listedAtDelete]) => listedAtDelete !== inventory.available)
+ .map(([repoId]) => repoId);
+}
+
+const HUB_REPO_ID_RE = /^[\w.-]+\/[\w.-]+$/;
+
+/** A remembered Hub repo the settled inventory no longer lists is not offered, even when it was
+ * deleted while nothing on this page was listening. Local folders and trained checkpoints are not
+ * listed by repo id, so they are always offered. Nothing is forgotten here. */
+export function rememberedModelUnavailable(
+ id: string,
+ inventory: { settled: boolean; error: boolean; available: ReadonlySet<string> },
+): boolean {
+ return HUB_REPO_ID_RE.test(id) && rememberedModelIsGone(id, inventory);
+}
+
/** A managed TTS completion owns auto-load only while the same staging generation is selected
* in Speak. Downloads continue globally after ownership changes, but their completion must
* not mutate the main slot. */
diff --git a/studio/frontend/src/features/audio/audio-page.tsx b/studio/frontend/src/features/audio/audio-page.tsx
index e950f0ddf72..7171369b375 100644
--- a/studio/frontend/src/features/audio/audio-page.tsx
+++ b/studio/frontend/src/features/audio/audio-page.tsx
@@ -16,8 +16,10 @@ import { buildAudioTourSteps } from "./tour";
import { useSidebar } from "@/components/ui/sidebar";
import { usePlatformStore } from "@/config/env";
import { type InferenceStatusResponse, getInferenceStatus } from "@/features/chat";
+import { useHubInventory } from "@/features/hub";
import { useInventoryVersion } from "@/features/hub/stores/inventory-events";
import { ModelSelector } from "@/features/model-picker/components/model-selector";
+import { ggufQuantLabel } from "@/features/model-picker/model-config/model-identity";
import { AUDIO_CATALOG } from "@/features/model-picker/components/model-selector/model-catalog";
import { PillTabs } from "@/features/model-picker/components/model-selector/pill-tabs";
import type { ModelOption } from "@/features/model-picker/components/model-selector/types";
@@ -26,7 +28,10 @@ import { usePersistedChoice } from "@/hooks/use-persisted-choice";
import { usePersistedToggle } from "@/hooks/use-persisted-toggle";
import { useScrollFades } from "@/hooks/use-scroll-fades";
import { isTauri } from "@/lib/api-base";
-import { subscribeModelLifecycle } from "@/lib/model-lifecycle-events";
+import {
+ subscribeModelDeleted,
+ subscribeModelLifecycle,
+} from "@/lib/model-lifecycle-events";
import { toast } from "@/lib/toast";
import { cn } from "@/lib/utils";
import { useIsMobileShell } from "@/hooks/use-mobile";
@@ -43,6 +48,11 @@ import {
type AudioGenerationPhase,
audioEjectAvailable,
audioGenerationPresentation,
+ audioLoadedSelection,
+ deleteCoversRememberedModel,
+ rememberedModelIsGone,
+ rememberedModelUnavailable,
+ settledDeleteMarkers,
} from "./audio-page-policy";
import { type AudioSourceSelection, clipReference } from "./audio-run-request";
import { AudioRuntimeUpdateNotice } from "./components/audio-runtime-update-notice";
@@ -978,9 +988,77 @@ export function AudioPage({
audioWorkflows: status?.audio_workflows,
music: musicGeneration,
});
- const lastPageModel = useAudioWorkspaceStore(
- (state) => state.lastModelByWorkflow[pageWorkflow] ?? null,
+ const rememberedModels = useAudioWorkspaceStore(
+ (state) => state.lastModelByWorkflow,
+ );
+ const forgetModel = useAudioWorkspaceStore((state) => state.forgetModel);
+ const modelInventory = useHubInventory({ kind: "models" });
+ // Deleted repos wait here, with the inventory listing current at the delete, until a newer
+ // settled listing shows whether the model is gone.
+ const deletedModelsRef = useRef(new Map<string, ReadonlySet<string>>());
+ const availableSetRef = useRef(modelInventory.availableSet);
+ availableSetRef.current = modelInventory.availableSet;
+ const [deletedModelsTick, setDeletedModelsTick] = useState(0);
+ useEffect(
+ () =>
+ subscribeModelDeleted((repoId) => {
+ deletedModelsRef.current.set(repoId.toLowerCase(), availableSetRef.current);
+ setDeletedModelsTick((tick) => tick + 1);
+ }),
+ [],
);
+ useEffect(() => {
+ const deleted = deletedModelsRef.current;
+ if (deleted.size === 0) return;
+ const inventory = {
+ settled: modelInventory.inventorySettled,
+ error: modelInventory.inventoryError,
+ available: modelInventory.availableSet,
+ };
+ for (const id of new Set(Object.values(rememberedModels))) {
+ if (
+ !id ||
+ ![...deleted.keys()].some((repoId) =>
+ deleteCoversRememberedModel(repoId, id),
+ )
+ ) {
+ continue;
+ }
+ if (rememberedModelIsGone(id, inventory)) forgetModel(id);
+ }
+ // A listing newer than the delete was just judged, so the marker is spent; kept, a package
+ // marker would forget a folder downloaded again later.
+ for (const repoId of settledDeleteMarkers(deleted, inventory)) {
+ deleted.delete(repoId);
+ }
+ }, [
+ deletedModelsTick,
+ rememberedModels,
+ modelInventory.inventorySettled,
+ modelInventory.inventoryError,
+ modelInventory.availableSet,
+ forgetModel,
+ ]);
+ const rememberedPageModel = rememberedModels[pageWorkflow] ?? null;
+ const lastPageModel =
+ rememberedPageModel &&
+ !rememberedModelUnavailable(rememberedPageModel, {
+ settled: modelInventory.inventorySettled,
+ error: modelInventory.inventoryError,
+ available: modelInventory.availableSet,
+ })
+ ? rememberedPageModel
+ : null;
+ // Where the loaded model runs, for the "open" action on pages it cannot run.
+ const loadedModelHome = workflowForLoadedModel({
+ current: "speak",
+ audioWorkflows: status?.audio_workflows,
+ music: musicGeneration,
+ });
+ const openLoadedModelHome = {
+ label: `open ${loadedModelHome === "speak" ? "Speak" : audioWorkflowTab(loadedModelHome).label}`,
+ onClick: () => transitionWorkflow(loadedModelHome),
+ };
const openSelector = useCallback(() => setSelectorOpen(true), []);
const chooseModelAction = { label: "Choose a model", onClick: openSelector };
const handlePickRecommended = useCallback(
@@ -1074,10 +1152,7 @@ export function AudioPage({
actions: [
{ label: "Choose a model that can edit", onClick: openSelector },
...recommendedEditActions,
- {
- label: "open Speak",
- onClick: () => transitionWorkflow("speak"),
- },
+ openLoadedModelHome,
],
}
: !pageModelLoaded && ttsWorkflow === "separate"
@@ -1105,10 +1180,7 @@ export function AudioPage({
actions: [
{ label: "Choose a model that can clone", onClick: openSelector },
...recommendedCloneActions,
- {
- label: "open Speak",
- onClick: () => transitionWorkflow("speak"),
- },
+ openLoadedModelHome,
],
}
: !pageModelLoaded && ttsWorkflow === "convert"
@@ -1161,10 +1233,7 @@ export function AudioPage({
actions: [
{ label: "Choose a music model", onClick: openSelector },
...recommendedMusicActions,
- {
- label: "open Speak",
- onClick: () => transitionWorkflow("speak"),
- },
+ openLoadedModelHome,
],
}
: ttsWorkflow === "separate"
@@ -1523,13 +1592,14 @@ export function AudioPage({
} satisfies ModelOption;
});
// Arriving on a page never loads: the picker shows the page's last model, unloaded, to re-pick.
+ const speakLoaded = audioLoadedSelection(status, ggufQuantLabel);
const showLastPageModel =
mode === "speak" && !pageModelLoaded && lastPageModel !== null;
const selectorValue =
mode === "speak"
? showLastPageModel
? lastPageModel
- : (status?.active_model ?? undefined)
+ : (speakLoaded.id ?? undefined)
: (transcribeRepo ?? undefined);
const capabilityLine =
@@ -1650,7 +1720,12 @@ export function AudioPage({
loadedModelIdOverride={
mode === "transcribe" && sttReady
? (selectedSttRepo ?? undefined)
- : undefined
+ : mode === "speak"
+ ? (speakLoaded.id ?? "")
+ : undefined
+ }
+ loadedGgufVariantOverride={
+ mode === "speak" ? speakLoaded.variant : undefined
}
loaded={
mode === "transcribe"
@@ -1676,6 +1751,8 @@ export function AudioPage({
className="!h-[calc(34px*var(--ui-space-scale,1))] max-w-full gap-1 overflow-hidden pl-3 pr-1 @[68rem]:gap-2 @[68rem]:pl-4 @[68rem]:pr-2"
triggerLabelClassName="text-ui-14 @[68rem]:text-ui-16"
task={HUB_TASKS_BY_MODE[mode]}
+ // Separate runs audio-to-audio models, which the speak picker's tasks leave out.
+ hubTask={pageWorkflow === "separate" ? "audio-to-audio" : undefined}
catalog={AUDIO_CATALOG}
// TTS/ASR come from the checkpoint's own tokenizer, not a curated recipe, so any publisher's
// audio repo loads here.
diff --git a/studio/frontend/src/features/audio/stores/audio-workspace-store.ts b/studio/frontend/src/features/audio/stores/audio-workspace-store.ts
index 82c1c5ca95e..cae0ef4cff8 100644
--- a/studio/frontend/src/features/audio/stores/audio-workspace-store.ts
+++ b/studio/frontend/src/features/audio/stores/audio-workspace-store.ts
@@ -21,6 +21,7 @@ interface AudioWorkspaceState {
clearRequestedWorkflow: () => void;
setNavExpanded: (expanded: boolean) => void;
rememberModel: (workflow: AudioWorkflowId, id: string) => void;
+ forgetModel: (id: string) => void;
}
export const useAudioWorkspaceStore = create<AudioWorkspaceState>()(
@@ -50,6 +51,19 @@ export const useAudioWorkspaceStore = create<AudioWorkspaceState>()(
},
},
),
+ forgetModel: (id) =>
+ set((state) => {
+ const key = id.toLowerCase();
+ const kept = Object.fromEntries(
+ Object.entries(state.lastModelByWorkflow).filter(
+ ([, model]) => model?.toLowerCase() !== key,
+ ),
+ );
+ return Object.keys(kept).length ===
+ Object.keys(state.lastModelByWorkflow).length
+ ? state
+ : { lastModelByWorkflow: kept };
+ }),
}),
{
name: AUDIO_WORKSPACE_STORAGE_KEY,
diff --git a/studio/frontend/src/features/hub/hooks/use-discover-search.ts b/studio/frontend/src/features/hub/hooks/use-discover-search.ts
index 277ec3c14ba..53300e6397e 100644
--- a/studio/frontend/src/features/hub/hooks/use-discover-search.ts
+++ b/studio/frontend/src/features/hub/hooks/use-discover-search.ts
@@ -16,6 +16,7 @@ import {
type HfModelSearchChannel,
type HfSortDirection,
type HfSortKey,
+ type HfTaskFilter,
useHubModelSearch,
} from "./use-hub-model-search";
import {
@@ -104,6 +105,7 @@ export function useDiscoverSearch({
channel,
ownerScope,
filters,
+ task,
}: {
debouncedQuery: string;
accessToken: string | undefined;
@@ -114,6 +116,7 @@ export function useDiscoverSearch({
channel: HfModelSearchChannel | null;
ownerScope: "unsloth" | "all";
filters?: ModelSearchFilters;
+ task?: HfTaskFilter;
}): DiscoverSearch {
const { phase, failure } = useHubAvailability();
const hub = useHubName();
@@ -138,6 +141,7 @@ export function useDiscoverSearch({
keepUnsupportedTags: true,
channel,
filters,
+ task,
});
const datasetSearch = useHubDatasetSearch(debouncedQuery, {
accessToken,
diff --git a/studio/frontend/src/features/hub/hub-page.tsx b/studio/frontend/src/features/hub/hub-page.tsx
index a6843a870b8..ba6fd647f31 100644
--- a/studio/frontend/src/features/hub/hub-page.tsx
+++ b/studio/frontend/src/features/hub/hub-page.tsx
@@ -1,7 +1,9 @@
// 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 type { PipelineType } from "@huggingface/hub";
import { useAppShellReadySignal } from "@/components/app-readiness";
+import { matchesHubAudioTask } from "@/lib/hub-audio-task";
import { useHfEndpoint, useHubSource } from "@/lib/hf-endpoint";
import { usePlatformStore } from "@/config/env";
import {
@@ -646,6 +648,10 @@ export function ModelsPage() {
const hasSearchFilters = hasModelSearchFilters(searchFilters);
const [capabilityFilter, setCapabilityFilter] =
useState<CapabilityFilter>("all");
+ // Pipeline tasks from an audio page's Search Hub link; they apply while the Audio filter is on.
+ const [linkedAudioTask, setLinkedAudioTask] = useState<
+ PipelineType[] | null
+ >(null);
const [allModelsView, setAllModelsViewState] = useState<AllModelsView>(
readAllModelsViewPreference,
);
@@ -779,12 +785,18 @@ export function ModelsPage() {
// A capability link opens the sorted Discover list with that filter on (the feed ignores it).
// The param is consumed so later filter changes stick and a repeat link re-applies.
const urlCapability = hubSearch.capability ?? null;
+ const urlTaskKey = hubSearch.audioTask?.join("|") ?? "";
useEffect(() => {
if (!urlCapability) return;
setResourceType("models");
setQuery("");
setDiscoverFormat("all");
setCapabilityFilter(urlCapability);
+ setLinkedAudioTask(
+ urlCapability === "audio" && urlTaskKey
+ ? (urlTaskKey.split("|") as PipelineType[])
+ : null,
+ );
setSortBrowseActive(true);
// The media pages run curated Unsloth uploads, so start there.
setOwnerScope("unsloth");
@@ -796,12 +808,17 @@ export function ModelsPage() {
tab: "discover",
kind: undefined,
capability: undefined,
+ audioTask: undefined,
section: undefined,
model: undefined,
}),
replace: true,
});
- }, [urlCapability, navigate, setOwnerScope]);
+ }, [urlCapability, urlTaskKey, navigate, setOwnerScope]);
+ // Picking another filter drops the link's tasks, so returning to Audio shows every audio model.
+ if (capabilityFilter !== "audio" && linkedAudioTask !== null) {
+ setLinkedAudioTask(null);
+ }
const handleSortChange = useCallback(
(next: HfSortKey) => {
@@ -912,6 +929,8 @@ export function ModelsPage() {
channel: listChannel,
ownerScope,
filters: searchFilters,
+ task:
+ capabilityFilter === "audio" ? (linkedAudioTask ?? undefined) : undefined,
});
const cachedListEntry = useHubFeedStore((state) =>
@@ -1043,6 +1062,8 @@ export function ModelsPage() {
effectiveDiscoverFormat,
)) &&
matchesCapability(row.capabilities, deferredCapabilityFilter) &&
+ (deferredCapabilityFilter !== "audio" ||
+ matchesHubAudioTask(row.result.pipelineTag, linkedAudioTask)) &&
(!activeChannel?.finetunableOnly || isUnslothFinetunable(row.result)) &&
// Models already on disk stay visible regardless of device fit, matching the chat selector.
(!fitOnDeviceOnly ||
@@ -1059,6 +1080,7 @@ export function ModelsPage() {
checkpointQuantFormats,
diffusionQuantFormats,
deferredCapabilityFilter,
+ linkedAudioTask,
activeChannel,
fitOnDeviceOnly,
]);
diff --git a/studio/frontend/src/features/hub/inventory/api.ts b/studio/frontend/src/features/hub/inventory/api.ts
index 0af84bef5ae..e048dc7aaef 100644
--- a/studio/frontend/src/features/hub/inventory/api.ts
+++ b/studio/frontend/src/features/hub/inventory/api.ts
@@ -12,6 +12,7 @@ import { localPathCacheKey } from "@/features/hub/lib/local-path";
import { isHuggingFaceOffline } from "@/features/hub/lib/network";
import { fingerprintToken } from "@/features/hub/lib/token-fingerprint";
import { bumpInventoryVersion } from "@/features/hub/stores/inventory-events";
+import { notifyModelDeleted } from "@/lib/model-lifecycle-events";
import {
discardDeletedInventoryHints,
discardDeletedModelInventoryHints,
@@ -429,6 +430,7 @@ export async function deleteCachedModel(
await throwIfNotOk(response);
discardDeletedModelInventoryHints(repoId, variant);
bumpInventoryVersion();
+ notifyModelDeleted(repoId);
} finally {
invalidateGgufVariantsCache(repoId);
}
diff --git a/studio/frontend/src/features/model-picker/components/model-selector.tsx b/studio/frontend/src/features/model-picker/components/model-selector.tsx
index 948eac2a0cf..43573399eab 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector.tsx
+++ b/studio/frontend/src/features/model-picker/components/model-selector.tsx
@@ -96,6 +96,8 @@ interface ModelSelectorProps {
additionalOnDeviceModels?: ModelOption[];
/** Task-owned runtime residency when it is separate from Chat's main slot. */
loadedModelIdOverride?: string;
+ /** Task-owned loaded quant, paired with `loadedModelIdOverride`; null means none. */
+ loadedGgufVariantOverride?: string | null;
loraModels?: LoraModelOption[];
externalModels?: ExternalModelOption[];
/** The connections behind `externalModels`, carrying each one's cached catalogue.
@@ -147,6 +149,8 @@ interface ModelSelectorProps {
rowFilter?: ModelPickerRowFilter;
/** Hub filter the Search Hub button opens with. Also shows Search Hub on curated task pickers. */
hubCapability?: CapabilityKey;
+ /** Tasks the Search Hub link narrows the Audio filter to, when the page's runs differ from `task`. */
+ hubTask?: HfTaskFilter;
/** Trigger text when nothing is loaded. Defaults to "Select model"; task pages name what they
* pick so it reads as separate from the chat model. */
placeholder?: string;
@@ -284,7 +288,8 @@ function ModelSelectorTrigger({
!subtitle && !showCloudIndicator && GAP_BEFORE,
)}
>
- {subtitle ? " - " : ""}
+ {/* Its own span: a flex item drops the leading space of its text. */}
+ {subtitle ? <span className="whitespace-pre"> - </span> : null}
{currentModel.descriptionSuffix}
</span>
)}
@@ -350,6 +355,7 @@ function ModelSelectorContent({
models,
additionalOnDeviceModels,
loadedModelIdOverride,
+ loadedGgufVariantOverride,
loraModels,
externalModels,
value,
@@ -382,6 +388,7 @@ function ModelSelectorContent({
models: ModelOption[];
additionalOnDeviceModels?: ModelOption[];
loadedModelIdOverride?: string;
+ loadedGgufVariantOverride?: string | null;
loraModels: LoraModelOption[];
externalModels: ExternalModelOption[];
value?: string;
@@ -669,9 +676,11 @@ function ModelSelectorContent({
models={models}
additionalOnDeviceModels={additionalOnDeviceModels}
loadedModelIdOverride={loadedModelIdOverride}
+ loadedGgufVariantOverride={loadedGgufVariantOverride}
loraModels={fineTunedModels}
externalModels={externalModels}
value={value}
+ valueLoaded={loaded}
onSelect={handlePick}
resolveDownloadFootprint={resolveDownloadFootprint}
onFoldersChange={onFoldersChange}
@@ -717,6 +726,7 @@ export function ModelSelector({
models,
additionalOnDeviceModels = [],
loadedModelIdOverride,
+ loadedGgufVariantOverride,
loraModels = [],
externalModels = [],
externalConnections = [],
@@ -752,6 +762,7 @@ export function ModelSelector({
opaqueKind,
rowFilter,
hubCapability,
+ hubTask,
placeholder,
loaded,
loadedCount,
@@ -814,6 +825,15 @@ export function ModelSelector({
return all;
}, [externalModels, loraModels, models]);
+ // A task-owned quant names the trigger only while the trigger shows that loaded model.
+ const triggerGgufVariant =
+ loadedGgufVariantOverride !== undefined
+ ? selected &&
+ loadedModelIdOverride &&
+ selected.toLowerCase() === loadedModelIdOverride.toLowerCase()
+ ? loadedGgufVariantOverride
+ : null
+ : activeGgufVariant;
const currentModel = useMemo(() => {
if (!selected) return undefined;
// A cached vendor copy loads for its unsloth mirror; name it by the mirror's option.
@@ -833,9 +853,9 @@ export function ModelSelector({
// No catalog entry (yet, or ever); a cached GGUF's checkpoint is a snapshot path. The leaf,
// not the namespaced public id (#7966), matches the catalog row that later replaces this one.
const fallbackName = missingExternal?.modelName ?? modelDisplayName(selected);
- if (activeGgufVariant) {
+ if (triggerGgufVariant) {
// The variant is the quant, so it goes in the suffix.
- const desc = `GGUF · ${activeGgufVariant}`;
+ const desc = `GGUF · ${triggerGgufVariant}`;
return found
? { ...found, description: undefined, descriptionSuffix: desc }
: { id: selected, name: fallbackName, descriptionSuffix: desc };
@@ -860,7 +880,7 @@ export function ModelSelector({
selected,
optionById,
catalog,
- activeGgufVariant,
+ triggerGgufVariant,
externalModels,
externalConnections,
t,
@@ -887,9 +907,15 @@ export function ModelSelector({
function handleBrowseHub() {
setOpen(false);
+ const linkedTask = hubTask ?? task;
void navigate({
to: "/hub",
- search: { tab: "discover", capability: hubCapability },
+ search: {
+ tab: "discover",
+ capability: hubCapability,
+ audioTask:
+ hubCapability === "audio" && linkedTask ? [linkedTask].flat() : undefined,
+ },
});
}
@@ -920,6 +946,7 @@ export function ModelSelector({
models={models}
additionalOnDeviceModels={additionalOnDeviceModels}
loadedModelIdOverride={loadedModelIdOverride}
+ loadedGgufVariantOverride={loadedGgufVariantOverride}
loraModels={loraModels}
externalModels={externalModels}
value={selected}
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 6eab91af3d1..3a0d2f446a4 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
@@ -3,6 +3,7 @@
import {
AUDIO_CPP_AUDIO_TYPES,
+ AUDIO_CPP_REPO,
AUDIO_CPP_SEP_AUDIO_TYPE,
} from "../../../audio/audio-cpp-catalog.ts";
import type { FormatFilter } from "./recommended-fit";
@@ -23,6 +24,19 @@ const TTS_CODECS = new Set(["snac", "csm", "bicodec", "dac"]);
* A Hub search row has no header to read, so its name, tags or library say so or nothing does. */
const AUDIO_RUNTIME_EVIDENCE = /audio[-_.]?cpp/;
+const AUDIO_CPP_UMBRELLA_NAME = /^audio[-_.]?cpp[-_.]?gguf(?:$|[-_.])/i;
+
+/** The multi-model package repo itself, or a fork or mirror of it: its folders are the models, so
+ * the root never loads as one. */
+export function isAudioCppUmbrellaRepo(id: string): boolean {
+ const parts = id.trim().split("/");
+ if (parts.length !== 2) return false;
+ return (
+ id.trim().toLowerCase() === AUDIO_CPP_REPO.toLowerCase() ||
+ AUDIO_CPP_UMBRELLA_NAME.test(parts[1])
+ );
+}
+
export type CommunityModelPolicy = "none" | "search-only" | "recommended";
export function shouldDiscoverCommunityModels(
@@ -84,6 +98,7 @@ export function communityAudioRowIsRunnable({
if (!isStt && !isTts) {
return true;
}
+ if (isAudioCppUmbrellaRepo(id)) return false;
const evidence = [id, baseModel ?? "", ...(tags ?? [])].map((value) =>
value.toLowerCase(),
);
@@ -131,6 +146,7 @@ function isAudioRuntimeGgufEvidence({
libraryName?: string | null;
audioType?: string | null;
}): boolean {
+ if (isAudioCppUmbrellaRepo(id)) return false;
return (
AUDIO_CPP_AUDIO_TYPES.has(audioType ?? "") ||
[id, baseModel ?? "", ...(tags ?? []), libraryName ?? ""].some((value) =>
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.check.ts b/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.check.ts
index 4cd50a1eff1..9c4958376ea 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.check.ts
+++ b/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.check.ts
@@ -568,14 +568,22 @@ assert.deepEqual(
catalogToModelOptions(VIDEO_CATALOG, "unknown").map((o) => o.id),
catalogToModelOptions(VIDEO_CATALOG).map((o) => o.id),
);
-// Every GGUF row ends in the suffix, whoever published it.
+// Every GGUF row ends in the suffix, whoever published it. The llama.cpp Qwen3-ASR repos share
+// their name with a bundled folder, so only they carry a runtime tag.
+const LLAMA_CPP_TWINS = new Set([
+ "unslothai/Qwen3-ASR-0.6B-GGUF",
+ "unslothai/Qwen3-ASR-1.7B-GGUF",
+]);
for (const catalog of [IMAGE_CATALOG, VIDEO_CATALOG, AUDIO_CATALOG]) {
for (const group of catalog) {
for (const artifact of group.artifacts) {
if (artifact.format !== "gguf") continue;
const row = curatedRowLabelFor(artifact.repoId, catalog);
assert.ok(row?.name.endsWith("-GGUF"), `${artifact.repoId} row reads "${row?.name}"`);
- assert.deepEqual(row?.tags, []);
+ assert.deepEqual(
+ row?.tags,
+ LLAMA_CPP_TWINS.has(artifact.repoId) ? ["llama.cpp"] : [],
+ );
}
}
}
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.ts b/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.ts
index 7230f1cfa32..a9a0e28f2e3 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.ts
+++ b/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.ts
@@ -11,6 +11,7 @@ import {
type AudioCppModel,
type AudioCppTask,
audioCppDisplayName,
+ isAudioCppFolderId,
} from "../../../audio/audio-cpp-catalog.ts";
import {
type GgufFitClass,
@@ -1113,7 +1114,21 @@ export function curatedRowLabelFor(
// GGUF reads like a text model's row: the repo name already ends in -GGUF, so a chip would only repeat the suffix.
if (hit.artifact.format === "gguf") {
const leaf = hit.artifact.repoId.split("/").pop() ?? hit.artifact.repoId;
- return { name: qualify(GGUF_SUFFIX_RE.test(leaf) ? leaf : `${leaf}-GGUF`), tags: [] };
+ // A hub repo named like a bundled folder ("Qwen3-ASR-0.6B-GGUF") would read as its twin.
+ const twin =
+ !isAudioCppFolderId(hit.artifact.repoId) &&
+ catalog.some((group) =>
+ group.artifacts.some(
+ (artifact) =>
+ artifact.format === "gguf" &&
+ artifact.repoId.toLowerCase() !== hit.artifact.repoId.toLowerCase() &&
+ artifact.repoId.split("/").pop()?.toLowerCase() === leaf.toLowerCase(),
+ ),
+ );
+ return {
+ name: qualify(GGUF_SUFFIX_RE.test(leaf) ? leaf : `${leaf}-GGUF`),
+ tags: twin ? ["llama.cpp"] : [],
+ };
}
// A group with one artifact has nothing to distinguish, so it stays bare.
if (hit.group.artifacts.length <= 1) return { name: qualify(hit.group.displayName), tags: [] };
@@ -1146,13 +1161,16 @@ export function catalogToModelOptions(
// A host that can only run the native engine is not offered pipeline rows it would be refused at
// load. The `models` prop is built only here, so this covers the trigger name and seed ids both.
if (!curatedArtifactIsOfferable(artifact.repoId, host)) continue;
+ const name =
+ curatedDisplayNameFor(artifact.repoId, catalog, host, denseQuantSchemes) ??
+ group.displayName;
options.push({
id: artifact.repoId,
- name:
- curatedDisplayNameFor(artifact.repoId, catalog, host, denseQuantSchemes) ??
- group.displayName,
+ name,
description: group.description,
- descriptionSuffix: artifact.label,
+ // "Kokoro-82M-GGUF - GGUF" would only repeat the name.
+ descriptionSuffix:
+ artifact.format === "gguf" && GGUF_SUFFIX_RE.test(name) ? undefined : artifact.label,
isGguf: artifact.format === "gguf",
deviceQuant: artifact.deviceQuant,
});
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/model-usage.ts b/studio/frontend/src/features/model-picker/components/model-selector/model-usage.ts
index 281a66c71e0..010b4aa8c81 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/model-usage.ts
+++ b/studio/frontend/src/features/model-picker/components/model-selector/model-usage.ts
@@ -36,6 +36,14 @@ export function loadedAt(times: ModelLoadTimes, id: string): number {
return times[id.toLowerCase()] ?? -1;
}
+/** The id to stamp for a selection: none unless it is actually loaded. */
+export function loadStampId(
+ value: string | null | undefined,
+ loaded?: boolean,
+): string | undefined {
+ return loaded === false || !value ? undefined : value;
+}
+
/** Load times, restamping whenever the active model changes. */
export function useModelLoadTimes(currentValue?: string): ModelLoadTimes {
const [times, setTimes] = useState<ModelLoadTimes>(() => readLoadTimes());
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 286f7bf3038..641e9895aef 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
@@ -217,6 +217,7 @@ import { ModelLoadSettingsAction } from "./model-load-settings-action";
import { ModelRowMenu } from "./model-row-menu";
import {
type ModelLoadTimes,
+ loadStampId,
loadedAt,
useModelLoadTimes,
} from "./model-usage";
@@ -231,9 +232,11 @@ import {
import {
type CuratedBudget,
type FormatFilter,
+ coerceFormatFilter,
curatedBudget,
curatedBudgetText,
estimateQuantBytes,
+ formatFilterValues,
hfModelFitsDevice,
isMlxId,
isCapableCheckpointQuant,
@@ -243,6 +246,7 @@ import {
matchesFormatFilter,
orderRecommendedRows,
paramsFromId,
+ pickerSearchMatches,
recommendedEmptyState,
searchRowFitsDevice,
searchableRecommendedIds,
@@ -1238,6 +1242,10 @@ function ModelRow({
const capabilityScope = useContext(CapabilityScope);
const capabilityBadges = visibleCapabilityBadges(caps, capabilityScope);
const showCaps = capabilityBadges.length > 0;
+ // Pinned, sole-quant and collapsed rows pass metadata's has_vision straight in; an audio scope hides it.
+ const visionShown =
+ showVision === true &&
+ (capabilityScope === null || capabilityScope.includes("vision"));
const aligned = alignMeta !== undefined;
// Reserve only what this picker's scope can draw: Images and Audio draw no glyph and Video
// draws one, so holding the chat row's slot open there is dead space.
@@ -1466,7 +1474,7 @@ function ModelRow({
)}
>
{showCaps && <CapabilityIcons caps={caps} />}
- {showVision && <VisionBadge />}
+ {visionShown && <VisionBadge />}
{partial && alignMeta !== "device" ? (
<PartialBadge resumable={partialResumable} />
) : null}
@@ -1475,7 +1483,7 @@ function ModelRow({
) : (
<>
{showCaps && <CapabilityIcons caps={caps} />}
- {showVision && <VisionBadge />}
+ {visionShown && <VisionBadge />}
{loaded && (
<DotTag
tone="success"
@@ -1934,6 +1942,10 @@ function GgufVariantExpander({
const [variants, setVariants] = useState<GgufVariantDetail[] | null>(null);
const [defaultVariant, setDefaultVariant] = useState<string | null>(null);
const [hasVision, setHasVision] = useState<boolean | undefined>(undefined);
+ const capabilityScope = useContext(CapabilityScope);
+ const visionInScope =
+ capabilityScope === null || capabilityScope.includes("vision");
+ const showVision = hasVision === true && visionInScope;
// Native max context (GGUF metadata); only set once a variant is downloaded.
const [nativeContext, setNativeContext] = useState<number | null>(null);
const [loading, setLoading] = useState(true);
@@ -1972,7 +1984,7 @@ function GgufVariantExpander({
setVariants(normalized.variants);
setDefaultVariant(normalized.defaultVariant);
setHasVision(normalized.hasVision);
- if (normalized.hasVision !== undefined) {
+ if (normalized.hasVision !== undefined && visionInScope) {
onHasVision?.(normalized.hasVision);
}
setNativeContext(normalized.contextLength);
@@ -2013,7 +2025,15 @@ function GgufVariantExpander({
canceled = true;
controller.abort();
};
- }, [repoId, localSource, refreshKey, hfToken, pipelineTag, onDevice]);
+ }, [
+ repoId,
+ localSource,
+ refreshKey,
+ hfToken,
+ pipelineTag,
+ onDevice,
+ visionInScope,
+ ]);
// Covers Unix absolute, Windows drive, UNC, relative and tilde paths.
const isLocalPath = /^(\/|\.{1,2}[\\/]|~[\\/]|[A-Za-z]:[\\/]|\\\\)/.test(
@@ -2355,7 +2375,7 @@ function GgufVariantExpander({
<span className="text-ui-10 font-semibold uppercase tracking-wider text-muted-foreground">
Quantizations
</span>
- {hasVision && (
+ {showVision && (
<span className="flex items-center gap-0.5 text-ui-9 font-medium text-indigo-700 dark:text-indigo-300">
<HugeiconsIcon
icon={ViewIcon}
@@ -2368,7 +2388,7 @@ function GgufVariantExpander({
</div>
)}
{!onDevice &&
- hasVision &&
+ showVision &&
displayVariantGroups.some((group) => group.title) && (
<div className="px-2 pt-1">
<span className="flex items-center gap-0.5 text-ui-9 font-medium text-indigo-700 dark:text-indigo-300">
@@ -2696,6 +2716,17 @@ function mediaPageForTask(
return "images";
}
+function taskFilterHasAudio(filter: HfTaskFilter): boolean {
+ const tasks: readonly string[] = filter
+ ? typeof filter === "string"
+ ? [filter]
+ : filter
+ : [];
+ return tasks.some((entry) =>
+ (AUDIO_GEN_TASKS as readonly string[]).includes(entry),
+ );
+}
+
// Editing/inpaint checkpoints are tagged image-to-image but need an input image the
// text-to-image backend rejects, so they are hidden by id (mirrors _EDIT_KEYWORDS). The
// task itself must stay, since FLUX.2-klein carries it too.
@@ -2745,7 +2776,8 @@ function passesTaskGate(
catalogTask: exactArtifact?.group.task,
pickerTask: filter,
})) &&
- !isImageEditModel(repoId)
+ // The edit-keyword hiding is an Images rule; audio edit models (DotTTS-Edit) load fine.
+ !(!taskFilterHasAudio(filter) && isImageEditModel(repoId))
) || localModel?.opaque === true;
}
// Unfiltered (chat) picker: an on-device diffusion model stays listed and routes to its page
@@ -2848,10 +2880,6 @@ const FORMAT_FILTER_OPTIONS: HubOption<FormatFilter>[] = (
),
};
});
-const FORMAT_FILTER_OPTIONS_WITHOUT_NPU = FORMAT_FILTER_OPTIONS.filter(
- (option) => option.value !== "npu",
-);
-
// Connected has no size, download date or load history, so it sorts by what a hosted catalogue
// does offer: the connection, or the name.
type ConnectedSortKey = "provider" | "name";
@@ -3007,9 +3035,11 @@ export function HubModelPicker({
models,
additionalOnDeviceModels = [],
loadedModelIdOverride,
+ loadedGgufVariantOverride,
loraModels = [],
externalModels = [],
value,
+ valueLoaded,
onSelect: onSelectProp,
resolveDownloadFootprint,
onFoldersChange,
@@ -3034,11 +3064,15 @@ export function HubModelPicker({
* example the two-file STT sidecars). */
additionalOnDeviceModels?: ModelOption[];
loadedModelIdOverride?: string;
+ /** Task-owned loaded quant; when given it replaces the chat store's, null meaning none. */
+ loadedGgufVariantOverride?: string | null;
/** Fine-tuned models, shown as a section in the On Device view. */
loraModels?: LoraModelOption[];
/** Connected provider models, shown in the Connected section. */
externalModels?: ExternalModelOption[];
value?: string;
+ /** Whether `value` is resident; false keeps it from being stamped as a load. */
+ valueLoaded?: boolean;
onSelect: (id: string, meta: ModelSelectorChangeMeta) => void;
resolveDownloadFootprint?: ModelDownloadFootprintResolver;
onFoldersChange?: () => void;
@@ -3090,6 +3124,7 @@ export function HubModelPicker({
const tasks = task ? (typeof task === "string" ? [task] : task) : [];
return tasks.some((entry) => DIFFUSION_TASKS.has(entry));
}, [task]);
+ const audioTaskPicker = taskFilterHasAudio(task);
// What the backend actually holds, not the dropdown highlight: an image or video load evicts
// the chat model and leaves the pick untouched, so rows kept a "Loaded" badge with nothing
// resident. Same predicate as the header tick.
@@ -3106,9 +3141,13 @@ export function HubModelPicker({
: undefined;
const loadedModelId = loadedModelIdOverride ?? chatLoadedModelId;
// Loaded GGUF quant of the active model; marks the matching pinned row.
- const activeGgufVariant = useChatRuntimeStore((s) => s.activeGgufVariant);
+ const storeGgufVariant = useChatRuntimeStore((s) => s.activeGgufVariant);
+ const activeGgufVariant =
+ loadedGgufVariantOverride !== undefined
+ ? loadedGgufVariantOverride
+ : storeGgufVariant;
// Last-loaded timestamps power the "Recent" sort (vs "Downloaded" = file date).
- const loadTimes = useModelLoadTimes(value);
+ const loadTimes = useModelLoadTimes(loadStampId(value, valueLoaded));
// Fade the list's top edge once scrolled, and its bottom edge while more rows sit below the fold.
const [listScrolled, setListScrolled] = useState(false);
const [listMoreBelow, setListMoreBelow] = useState(false);
@@ -3170,6 +3209,8 @@ export function HubModelPicker({
enabled: online && section === "recommended",
});
const recommendedSearch = useHubModelSearch("", {
+ // Audio keeps only task rows, so an untasked listing pages forever without finding one.
+ task: audioTaskPicker ? task : undefined,
ownerScope: "unsloth",
sortBy: recommendedSort,
sortDirection: "desc",
@@ -3662,7 +3703,8 @@ export function HubModelPicker({
// Image/Video tab (task set): only task-matching, non-editing results.
if (task)
return (
- taskMatchesFilter(r.pipelineTag, task) && !isImageEditModel(r.id)
+ taskMatchesFilter(r.pipelineTag, task) &&
+ !(!audioTaskPicker && isImageEditModel(r.id))
);
return (
classifyUnslothSupport({
@@ -3675,7 +3717,7 @@ export function HubModelPicker({
}).status !== "unsupported"
);
},
- [deviceType, task],
+ [audioTaskPicker, deviceType, task],
);
// A capable FP8 / NVFP4 checkpoint passes the runtime gate's quant-method check (vLLM loads
// compressed-tensors), never its pipeline check: an FP8 image model stays off the chat list.
@@ -3780,8 +3822,22 @@ export function HubModelPicker({
// Format filter toggle for the Unsloth listing.
const [chosenFormatFilter, setFormatFilter] = useState<FormatFilter>("all");
const npuCatalog = useNpuCatalog(npu);
- const formatFilter: FormatFilter =
- chosenFormatFilter === "npu" && !npuCatalog ? "all" : chosenFormatFilter;
+ // MLX only runs on a Mac; chat keeps it everywhere.
+ const offeredFormatFilters = useMemo(
+ () => formatFilterValues({ npu: !!npuCatalog, mlx: isMac || !task }),
+ [npuCatalog, isMac, task],
+ );
+ const formatFilterOptions = useMemo(
+ () =>
+ FORMAT_FILTER_OPTIONS.filter((option) =>
+ offeredFormatFilters.includes(option.value),
+ ),
+ [offeredFormatFilters],
+ );
+ const formatFilter = coerceFormatFilter(
+ chosenFormatFilter,
+ offeredFormatFilters,
+ );
const [npuOnDeviceCollapsed, setNpuOnDeviceCollapsed] = useState(false);
const [npuBrowseCollapsed, setNpuBrowseCollapsed] = useState(true);
// What this picker's task filter has already established about every row it can show; chat
@@ -3832,7 +3888,7 @@ export function HubModelPicker({
if (!task) return [];
return dedupe(models.map((model) => model.id))
.filter((id) => !isMobileVariant(id))
- .filter((id) => !isImageEditModel(id))
+ .filter((id) => audioTaskPicker || !isImageEditModel(id))
.filter(curatedOfferable)
.filter((id) => {
const isG = isKnownGgufRepo(id);
@@ -3852,7 +3908,15 @@ export function HubModelPicker({
// Same reason the size is curated: a seed the listing does not return has no other source for its param chip.
totalParams: catalog ? curatedTotalParamsFor(id, catalog) : undefined,
}));
- }, [catalog, models, formatFilter, isKnownGgufRepo, task, curatedOfferable]);
+ }, [
+ audioTaskPicker,
+ catalog,
+ models,
+ formatFilter,
+ isKnownGgufRepo,
+ task,
+ curatedOfferable,
+ ]);
/** The catalog's own fit verdict for a curated artifact, or undefined where it has none. Every
* list that judges a row against the device goes through this, so a badge and its filters
@@ -4781,9 +4845,12 @@ export function HubModelPicker({
return (
matchesFormatFilter(model.id, model.isGguf === true, formatFilter) &&
(!needle ||
- normalizeForSearch(
- `${model.id} ${model.name} ${model.description ?? ""} ${model.descriptionSuffix ?? ""}`,
- ).includes(needle))
+ pickerSearchMatches(
+ model.id,
+ [model.id],
+ `${model.name} ${model.description ?? ""} ${model.descriptionSuffix ?? ""}`,
+ needle,
+ ))
);
});
return sortCachedRepos(
@@ -5259,9 +5326,14 @@ export function HubModelPicker({
// Seeds included: recommendedIds hides downloaded models, which the unfiltered Recommended
// list still paints, so without them a curated pick vanishes from search once on disk.
searchableRecommendedIds(catalogSeedIds, recommendedIds)
- // A mirror row also answers to its vendor id.
+ // What the row shows, plus the vendor id a mirror row answers to.
.filter((id) =>
- aliasesOf(id).some((alias) => normalizeForSearch(alias).includes(q)),
+ pickerSearchMatches(
+ id,
+ aliasesOf(id),
+ catalog ? curatedRow(id).name : null,
+ q,
+ ),
)
.filter((id) =>
matchesFormatFilter(id, isKnownGgufRepo(id), formatFilter),
@@ -5282,6 +5354,8 @@ export function HubModelPicker({
catalogSeedIds,
recommendedIds,
aliasesOf,
+ catalog,
+ curatedRow,
formatFilter,
isKnownGgufRepo,
fitOnDeviceOnly,
@@ -5913,9 +5987,17 @@ export function HubModelPicker({
error: recommendedSearch.error,
hubPhase,
});
+ // A typed query on a community-enabled picker waits on both searches before calling it empty.
+ const communitySearchActive =
+ communityDiscoveryEnabled && debouncedQuery.trim().length > 0;
+ const communitySearching =
+ communitySearchActive && communityQuerySearch.isLoading;
+ const communitySearchError = communitySearchActive
+ ? communityQuerySearch.error
+ : null;
const searchEmpty = recommendedEmptyState({
- isLoading,
- error: searchError,
+ isLoading: isLoading || communitySearching,
+ error: searchError ?? communitySearchError,
hubPhase,
});
const downloadedEmpty =
@@ -5976,8 +6058,9 @@ export function HubModelPicker({
</span>
);
// On Device rows are already on disk, so the device-fit filter only applies to the Unsloth listing.
+ // Audio's listing is nearly all umbrella and vendor rows, which a sort cannot reorder.
const sectionSortDropdown =
- section === "recommended" ? (
+ section === "recommended" && audioTaskPicker ? null : section === "recommended" ? (
<HubOptionMenu
value={recommendedSort}
options={RECOMMENDED_SORT_OPTIONS}
@@ -7085,12 +7168,14 @@ export function HubModelPicker({
placeholder={
section === "downloaded"
? "Search local models"
- : "Search Unsloth models"
+ : communityDiscoveryEnabled
+ ? "Search models"
+ : "Search Unsloth models"
}
data-model-picker-search-input={true}
className="field-soft h-(--picker-control-h) border-0 pl-8 pr-8 text-sm"
/>
- {isLoading && (
+ {(isLoading || communitySearching) && (
<Spinner className="pointer-events-none absolute right-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" />
)}
</div>
@@ -7154,16 +7239,18 @@ export function HubModelPicker({
<div className="flex max-w-full min-w-0 flex-wrap items-center gap-2">
<HubOptionMenu
value={formatFilter}
- options={
- npuCatalog
- ? FORMAT_FILTER_OPTIONS
- : FORMAT_FILTER_OPTIONS_WITHOUT_NPU
- }
+ options={formatFilterOptions}
onValueChange={setFormatFilter}
ariaLabel="Filter by format"
align="end"
className={sortTriggerClassName}
contentClassName={sortMenuContentClassName}
+ // Audio has no sort for its listing, so the fit toggle lives here.
+ footer={
+ audioTaskPicker && section === "recommended"
+ ? fitOnDeviceFooter
+ : undefined
+ }
/>
{sectionSortDropdown}
</div>
@@ -8476,9 +8563,18 @@ export function HubModelPicker({
section === "recommended" &&
formatFilter !== "npu" ? (
<>
- {searchRowIds.length === 0 && !isLoading ? (
+ {searchRowIds.length === 0 &&
+ !isLoading &&
+ !communitySearching ? (
filteredRecommendedIds.length > 0 ? null : searchEmpty === "failed" ? (
- <HubFailureHint message={searchError} onRetry={retrySearch} />
+ <HubFailureHint
+ message={searchError ?? communitySearchError}
+ onRetry={
+ searchError
+ ? retrySearch
+ : communityQuerySearch.retry
+ }
+ />
) : (
<div className="px-2.5 py-2 text-xs text-muted-foreground">
{communityDiscoveryEnabled
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/recommended-fit.ts b/studio/frontend/src/features/model-picker/components/model-selector/recommended-fit.ts
index b8b030e40b8..21806327171 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/recommended-fit.ts
+++ b/studio/frontend/src/features/model-picker/components/model-selector/recommended-fit.ts
@@ -5,6 +5,10 @@
// the device. No React/DOM deps so they are easy to test.
import { classifyGgufFit } from "../../../../lib/gguf-fit.ts";
+import {
+ audioCppDisplayName,
+ isAudioCppFolderId,
+} from "../../../audio/audio-cpp-catalog.ts";
import { matchesRecommended } from "../../../hub/lib/format-filters.ts";
import {
classifyMediaGgufFit,
@@ -86,6 +90,48 @@ export function matchesFormatFilter(
}
}
+/** The format filters a picker offers, in menu order. MLX only where it can run, NPU only with a
+ * catalog to show. */
+export function formatFilterValues(opts: { npu: boolean; mlx: boolean }): FormatFilter[] {
+ return (["all", "gguf", "mlx", "safetensors", "npu"] as const).filter(
+ (value) => (value !== "mlx" || opts.mlx) && (value !== "npu" || opts.npu),
+ );
+}
+
+/** A remembered filter the picker no longer offers falls back to "all". */
+export function coerceFormatFilter(
+ chosen: FormatFilter,
+ offered: readonly FormatFilter[],
+): FormatFilter {
+ return offered.includes(chosen) ? chosen : "all";
+}
+
+const normalizeSearchText = (s: string): string =>
+ s.toLowerCase().replace(/[\s_.-]/g, "");
+
+/** Whether a picker search matches a row on what the row shows. A bundled folder shows only its
+ * folder name, so its package repo id matches nothing, and neither does a query that is just
+ * part of the -GGUF every folder name ends in. */
+export function pickerSearchMatches(
+ id: string,
+ aliases: readonly string[],
+ label: string | null | undefined,
+ query: string,
+): boolean {
+ const q = normalizeSearchText(query);
+ if (!q) return true;
+ if (isAudioCppFolderId(id)) {
+ const name = audioCppDisplayName(id);
+ return (
+ normalizeSearchText(name.replace(/-gguf$/i, "")).includes(q) ||
+ (!"gguf".includes(q) && normalizeSearchText(name).includes(q))
+ );
+ }
+ return (label ? [...aliases, label] : aliases).some((term) =>
+ normalizeSearchText(term).includes(q),
+ );
+}
+
// First "<n>B" token in a repo id, e.g. "Qwen3-30B-A3B" -> 30. Digits must be
// separator-bounded so "16" is never read from "bf16".
const PARAM_RE = /(?:^|[-_/. ])[eE]?(\d+(?:\.\d+)?)\s*[bB](?=$|[-_./ ])/;
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/row-meta.ts b/studio/frontend/src/features/model-picker/components/model-selector/row-meta.ts
index fe8e344d7f7..b8db50d2c33 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/row-meta.ts
+++ b/studio/frontend/src/features/model-picker/components/model-selector/row-meta.ts
@@ -75,11 +75,11 @@ export type MetaToken =
const META_SIZE_RE = /(?:KB|MB|GB|TB)\b/i;
const META_APPROX_RE = /^~/;
-const META_PARAM_RE = /^\d+(?:\.\d+)?B$/i;
+const META_PARAM_RE = /^\d+(?:\.\d+)?[MB]$/i;
const META_WHITESPACE_RE = /\s+/;
-/** Classify a meta token: size (has KB/MB/GB/TB or leading "~"), param (bare "<n>B"), format
- * keyword, or plain text. */
+/** Classify a meta token: size (has KB/MB/GB/TB or leading "~"), param (bare "<n>B" or "<n>M";
+ * never "<n>K", which is a context length), format keyword, or plain text. */
export function classifyMetaToken(raw: string): MetaToken | null {
const t = raw.trim();
if (!t) return null;
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/variant-presentation.ts b/studio/frontend/src/features/model-picker/components/model-selector/variant-presentation.ts
index dd81093a3bd..bbaba384b06 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/variant-presentation.ts
+++ b/studio/frontend/src/features/model-picker/components/model-selector/variant-presentation.ts
@@ -55,11 +55,20 @@ function h3Presentation(
return h3PresentationFor(variant.filename);
}
+const QUANT_TOKEN_RE = /^(?:ud-)?(?:bf16|f16|f32|q\d\w*|iq\d\w*|tq\d\w*)$/i;
+
+/** A raw quant key ("bf16", "sub/q8_0") as shown: the quant token uppercased. Keys stay raw. */
+export function quantDisplayCase(q: string): string {
+ const cut = q.lastIndexOf("/") + 1;
+ const leaf = q.slice(cut);
+ return QUANT_TOKEN_RE.test(leaf) ? q.slice(0, cut) + leaf.toUpperCase() : q;
+}
+
/** A GGUF quant KEY as the row's mono chip: the quant alone, since that column is capped at 7.2em
* and an H3 key is a whole file stem that clips to nonsense. The workflow and build go to
* `ggufQuantDetailLabel`. Other quants pass through. */
export function ggufQuantChipLabel(quant: string): string {
- return h3PresentationFor(quant)?.quantLabel ?? quant;
+ return h3PresentationFor(quant)?.quantLabel ?? quantDisplayCase(quant);
}
/** The same key in full, for a tooltip with room for it: workflow and build. */
@@ -81,7 +90,7 @@ export function ggufVariantPickerLabel(
? h3.quantLabel
: `${h3.quantLabel} · ${h3.build}`;
}
- return variant.display_label?.trim() || variant.quant;
+ return variant.display_label?.trim() || quantDisplayCase(variant.quant);
}
export function h3PickerHasOnlyPrunedBuilds(
diff --git a/studio/frontend/src/lib/hub-audio-task.ts b/studio/frontend/src/lib/hub-audio-task.ts
new file mode 100644
index 00000000000..828b920b7dc
--- /dev/null
+++ b/studio/frontend/src/lib/hub-audio-task.ts
@@ -0,0 +1,39 @@
+// 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 type { PipelineType } from "@huggingface/hub";
+
+// Audio pipeline tasks a picker's Search Hub link can narrow the Audio filter to.
+const HUB_AUDIO_TASKS: readonly PipelineType[] = [
+ "text-to-speech",
+ "text-to-audio",
+ "automatic-speech-recognition",
+ "audio-to-audio",
+];
+
+/** The `audioTask` search param as the Hub keeps it: known audio tasks, only with the Audio filter. */
+export function hubAudioTaskSearch(
+ raw: unknown,
+ capability: string | undefined,
+): PipelineType[] | undefined {
+ if (capability !== "audio") return undefined;
+ const tasks = (Array.isArray(raw) ? raw : [raw]).filter(
+ (task): task is PipelineType =>
+ HUB_AUDIO_TASKS.includes(task as PipelineType),
+ );
+ return tasks.length > 0 ? tasks : undefined;
+}
+
+/** Whether a Hub row fits the linked audio tasks. A typed search drops the task server-side, so the
+ * rows are checked here; a row without a pipeline tag stays, as the task listing keeps it too. */
+export function matchesHubAudioTask(
+ pipelineTag: string | null | undefined,
+ tasks: readonly PipelineType[] | null | undefined,
+): boolean {
+ return (
+ !tasks ||
+ tasks.length === 0 ||
+ !pipelineTag ||
+ tasks.includes(pipelineTag as PipelineType)
+ );
+}
diff --git a/studio/frontend/src/lib/model-lifecycle-events.ts b/studio/frontend/src/lib/model-lifecycle-events.ts
index a8c75c3318d..b03fd7c585b 100644
--- a/studio/frontend/src/lib/model-lifecycle-events.ts
+++ b/studio/frontend/src/lib/model-lifecycle-events.ts
@@ -67,6 +67,29 @@ export function subscribeModelLifecycle(
return () => window.removeEventListener(MODEL_LIFECYCLE_EVENT, handler);
}
+export const MODEL_DELETED_EVENT = "unsloth:model-deleted";
+
+/** Raised after a model's files were deleted from the Hub cache or a scanned folder. */
+export function notifyModelDeleted(repoId: string): void {
+ if (typeof window === "undefined") return;
+ window.dispatchEvent(
+ new CustomEvent(MODEL_DELETED_EVENT, { detail: { repoId } }),
+ );
+}
+
+/** Calls back with the repo id of every deleted model. Returns an unsubscriber. */
+export function subscribeModelDeleted(
+ onDeleted: (repoId: string) => void,
+): () => void {
+ if (typeof window === "undefined") return () => {};
+ const handler = (event: Event) => {
+ const repoId = (event as CustomEvent<{ repoId?: string }>).detail?.repoId;
+ if (repoId) onDeleted(repoId);
+ };
+ window.addEventListener(MODEL_DELETED_EVENT, handler);
+ return () => window.removeEventListener(MODEL_DELETED_EVENT, handler);
+}
+
/**
* Announce a load around `run`, so the indicator shows it for the whole time
* the toast does. Settles on failure too, or a failed load would leave the row
diff --git a/studio/frontend/tests/audio-cpp-catalog.test.ts b/studio/frontend/tests/audio-cpp-catalog.test.ts
index dc9173db414..7834084111c 100644
--- a/studio/frontend/tests/audio-cpp-catalog.test.ts
+++ b/studio/frontend/tests/audio-cpp-catalog.test.ts
@@ -53,7 +53,9 @@ import {
} from "../src/features/model-picker/components/model-selector/audio-picker-policy.ts";
import {
AUDIO_CATALOG,
+ IMAGE_CATALOG,
catalogToModelOptions,
+ curatedRowLabelFor,
groupForRepoId,
} from "../src/features/model-picker/components/model-selector/model-catalog.ts";
import {
@@ -211,11 +213,34 @@ test("recommended models are plain GGUF Audio rows named as on the Hub", () => {
const option = options.find((candidate) => candidate.id === model.id);
assert.ok(option, `${host}: ${model.id}`);
assert.equal(option.isGguf, true);
- assert.equal(option.descriptionSuffix, "GGUF");
+ // The name already ends in -GGUF, so a "GGUF" suffix would only repeat it.
+ assert.equal(option.descriptionSuffix, undefined, `${host}: ${model.id}`);
}
}
});
+test("a GGUF suffix is kept only where the name does not already say GGUF", () => {
+ for (const option of catalogToModelOptions([...AUDIO_CATALOG, ...IMAGE_CATALOG])) {
+ if (option.isGguf && /-gguf$/i.test(option.name)) {
+ assert.equal(option.descriptionSuffix, undefined, option.id);
+ } else {
+ assert.ok(option.descriptionSuffix, option.id);
+ }
+ }
+});
+
+test("a hub GGUF named like a bundled folder does not read as its twin", () => {
+ const hub = curatedRowLabelFor("unslothai/Qwen3-ASR-0.6B-GGUF", AUDIO_CATALOG);
+ const folder = curatedRowLabelFor(QWEN_ASR, AUDIO_CATALOG);
+ assert.equal(hub?.name, folder?.name);
+ assert.notDeepEqual(hub, folder);
+ assert.deepEqual(hub?.tags, ["llama.cpp"]);
+ assert.deepEqual(folder?.tags, []);
+ // A GGUF with no twin keeps a bare row.
+ assert.deepEqual(curatedRowLabelFor(KOKORO, AUDIO_CATALOG)?.tags, []);
+ assert.deepEqual(curatedRowLabelFor("unsloth/Z-Image-Turbo-GGUF", IMAGE_CATALOG)?.tags, []);
+});
+
test("voice conversion models are seeded with the pages they run on", () => {
for (const [name, workflows, description] of [
["RVC-GGUF", ["convert"], "Voice conversion"],
diff --git a/studio/frontend/tests/audio-loaded-quant-key.test.ts b/studio/frontend/tests/audio-loaded-quant-key.test.ts
new file mode 100644
index 00000000000..28a3549bbb7
--- /dev/null
+++ b/studio/frontend/tests/audio-loaded-quant-key.test.ts
@@ -0,0 +1,31 @@
+// 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 assert from "node:assert/strict";
+import test from "node:test";
+
+import { readSrc, registerBundlerResolver } from "./helpers/kit.ts";
+
+registerBundlerResolver();
+const { audioLoadedSelection } = await import("../src/features/audio/audio-page-policy.ts");
+const { ggufQuantLabel } = await import(
+ "../src/features/model-picker/model-config/model-identity.ts"
+);
+
+test("a quant picked from the list reads as its quant key, not the file name llama echoes", () => {
+ // The loader sends the file name, llama status echoes it, and picker rows key the quant.
+ const loaded = (gguf_variant: string | null) =>
+ audioLoadedSelection(
+ { active_model: "unsloth/orpheus-3b-0.1-ft-GGUF", gguf_variant },
+ ggufQuantLabel,
+ ).variant;
+ assert.equal(loaded("orpheus-3b-0.1-ft-q4_k_m.gguf"), "Q4_K_M");
+ assert.equal(loaded("Orpheus-3B-UD-Q4_K_XL.GGUF"), "UD-Q4_K_XL");
+ assert.equal(loaded("distilled/model-q8_0.gguf"), "distilled/Q8_0");
+ assert.equal(loaded("Q8_0"), "Q8_0");
+ assert.equal(loaded(null), null);
+ assert.match(
+ readSrc("features/audio/audio-page.tsx"),
+ /const speakLoaded = audioLoadedSelection\(status, ggufQuantLabel\);/,
+ );
+});
diff --git a/studio/frontend/tests/audio-mode-task-filter.test.ts b/studio/frontend/tests/audio-mode-task-filter.test.ts
index 76db9bbec00..ce657822ca0 100644
--- a/studio/frontend/tests/audio-mode-task-filter.test.ts
+++ b/studio/frontend/tests/audio-mode-task-filter.test.ts
@@ -53,3 +53,22 @@ test("ASR names carry the audio capability badge", () => {
true,
);
});
+
+test("Search Hub from an audio picker carries the page's pipeline tasks", () => {
+ const selector = readSrc(
+ "features/model-picker/components/model-selector.tsx",
+ );
+ assert.match(
+ selector,
+ /search: \{\s*tab: "discover",\s*capability: hubCapability,\s*audioTask:\s*hubCapability === "audio" && linkedTask \? \[linkedTask\]\.flat\(\) : undefined,\s*\}/,
+ );
+ // The picker task is a tag or a tag list; the hub param is always a list.
+ const asParam = (task: string | readonly string[]) => [task].flat();
+ assert.deepEqual(asParam(["text-to-speech", "text-to-audio"]), [
+ "text-to-speech",
+ "text-to-audio",
+ ]);
+ assert.deepEqual(asParam("automatic-speech-recognition"), [
+ "automatic-speech-recognition",
+ ]);
+});
diff --git a/studio/frontend/tests/audio-page-policy.test.ts b/studio/frontend/tests/audio-page-policy.test.ts
index 2865ad26a07..89985ec97b7 100644
--- a/studio/frontend/tests/audio-page-policy.test.ts
+++ b/studio/frontend/tests/audio-page-policy.test.ts
@@ -27,9 +27,14 @@ import {
resolveSttLoadedModel,
resolveSttResidency,
selectAutoGgufVariant,
+ settledDeleteMarkers,
stagedTtsLoadIsOwned,
sttEjectSucceeded,
sttSelectionReady,
+ audioLoadedSelection,
+ deleteCoversRememberedModel,
+ rememberedModelIsGone,
+ rememberedModelUnavailable,
} from "../src/features/audio/audio-page-policy.ts";
import {
sttEngineForRepoId,
@@ -887,6 +892,161 @@ test("the outdated-runtime notice refreshes the page however the update ran", ()
assert.doesNotMatch(notice, /toast\.success\([^;]*;\s*onUpdated\(\)/);
});
+test("the audio picker marks the main slot's loaded model and quant, not the chat model", () => {
+ assert.deepEqual(
+ audioLoadedSelection({
+ active_model: "audio-cpp/audio.cpp-gguf/Qwen3-TTS-12Hz-0.6B-Base-GGUF",
+ model_identifier: "audio-cpp/audio.cpp-gguf/Qwen3-TTS-12Hz-0.6B-Base-GGUF",
+ gguf_variant: "Q8_0",
+ }),
+ { id: "audio-cpp/audio.cpp-gguf/Qwen3-TTS-12Hz-0.6B-Base-GGUF", variant: "Q8_0" },
+ );
+ // llama-server names a custom-folder GGUF by its file stem; the picker row uses the path.
+ assert.deepEqual(
+ audioLoadedSelection({
+ active_model: "orpheus-3b-q4_k_m",
+ model_identifier: "/models/orpheus/orpheus-3b-q4_k_m.gguf",
+ gguf_variant: "Q4_K_M",
+ }),
+ { id: "/models/orpheus/orpheus-3b-q4_k_m.gguf", variant: "Q4_K_M" },
+ );
+ // A Hub model loaded from a cache snapshot keeps the repo id its row uses.
+ assert.deepEqual(
+ audioLoadedSelection({
+ active_model: "unsloth/orpheus-3b-0.1-ft-GGUF",
+ model_identifier:
+ "/data/hf/hub/models--unsloth--orpheus-3b-0.1-ft-GGUF/snapshots/abc123",
+ gguf_variant: "Q4_K_M",
+ }),
+ { id: "unsloth/orpheus-3b-0.1-ft-GGUF", variant: "Q4_K_M" },
+ );
+ assert.deepEqual(audioLoadedSelection({ active_model: null, gguf_variant: "Q8_0" }), {
+ id: null,
+ variant: null,
+ });
+ assert.deepEqual(audioLoadedSelection(null), { id: null, variant: null });
+ assert.match(audioPageSource, /const speakLoaded = audioLoadedSelection\(status, ggufQuantLabel\)/);
+ assert.match(audioPageSource, /mode === "speak"\s*\? \(speakLoaded\.id \?\? ""\)/);
+ assert.match(
+ audioPageSource,
+ /loadedGgufVariantOverride=\{\s*mode === "speak" \? speakLoaded\.variant : undefined\s*\}/,
+ );
+ assert.match(audioPageSource, /: \(speakLoaded\.id \?\? undefined\)/);
+});
+
+test("a deleted model is forgotten only once the settled inventory lacks it", () => {
+ const available = new Set(["hexgrad/kokoro-82m", "audio-cpp/audio.cpp-gguf"]);
+ const settled = { settled: true, error: false, available };
+ assert.equal(rememberedModelIsGone("hexgrad/Kokoro-82M", settled), false);
+ assert.equal(rememberedModelIsGone("unsloth/orpheus-3b-0.1-ft", settled), true);
+ assert.equal(
+ rememberedModelIsGone("unsloth/orpheus-3b-0.1-ft", { ...settled, settled: false }),
+ false,
+ );
+ assert.equal(
+ rememberedModelIsGone("unsloth/orpheus-3b-0.1-ft", { ...settled, error: true }),
+ false,
+ );
+ // An inventory without folder rows cannot tell an audio.cpp folder is gone.
+ const qwenTts = "audio-cpp/audio.cpp-gguf/Qwen3-TTS-12Hz-0.6B-Base-GGUF";
+ assert.equal(rememberedModelIsGone(qwenTts, settled), false);
+ const withFolders = new Set([...available, "audio-cpp/audio.cpp-gguf/kokoro-82m-gguf"]);
+ assert.equal(rememberedModelIsGone(qwenTts, { ...settled, available: withFolders }), true);
+ assert.equal(
+ rememberedModelIsGone(qwenTts, {
+ ...settled,
+ available: new Set([...withFolders, qwenTts.toLowerCase()]),
+ }),
+ false,
+ );
+ // Only a delete puts a model up for forgetting, so a load racing the inventory keeps it.
+ assert.match(
+ audioPageSource,
+ /subscribeModelDeleted\(\(repoId\) => \{\s*deletedModelsRef\.current\.set\(repoId\.toLowerCase\(\), availableSetRef\.current\);/,
+ );
+ assert.match(audioPageSource, /if \(rememberedModelIsGone\(id, inventory\)\) forgetModel\(id\);/);
+});
+
+test("a delete marker is spent once a newer settled listing was judged, folders included", () => {
+ // A kept package marker forgot a folder downloaded again later, before its listing arrived.
+ const atDelete = new Set(["audio-cpp/audio.cpp-gguf"]);
+ const markers = new Map([["audio-cpp/audio.cpp-gguf", atDelete]]);
+ const settled = { settled: true, error: false };
+ assert.deepEqual(settledDeleteMarkers(markers, { ...settled, available: atDelete }), []);
+ assert.deepEqual(
+ settledDeleteMarkers(markers, { settled: false, error: false, available: new Set() }),
+ [],
+ );
+ assert.deepEqual(
+ settledDeleteMarkers(markers, { settled: true, error: true, available: new Set() }),
+ [],
+ );
+ assert.deepEqual(settledDeleteMarkers(markers, { ...settled, available: new Set() }), [
+ "audio-cpp/audio.cpp-gguf",
+ ]);
+ assert.match(
+ audioPageSource,
+ /for \(const repoId of settledDeleteMarkers\(deleted, inventory\)\) \{\s*deleted\.delete\(repoId\);/,
+ );
+});
+
+test("pages a loaded model cannot run point at the page it does run, not always Speak", () => {
+ assert.doesNotMatch(audioPageSource, /label: "open Speak"/);
+ assert.match(
+ audioPageSource,
+ /const loadedModelHome = workflowForLoadedModel\(\{\s*current: "speak",\s*audioWorkflows: status\?\.audio_workflows,/,
+ );
+ assert.equal(audioPageSource.match(/openLoadedModelHome,/g)?.length, 3);
+});
+
+test("a remembered Hub repo the inventory no longer lists is not offered, but kept", () => {
+ const settled = { settled: true, error: false, available: new Set(["hexgrad/kokoro-82m"]) };
+ assert.equal(rememberedModelUnavailable("hexgrad/Kokoro-82M", settled), false);
+ // Deleted from the Hub while the Audio page was closed.
+ assert.equal(rememberedModelUnavailable("unsloth/orpheus-3b-0.1-ft", settled), true);
+ assert.equal(
+ rememberedModelUnavailable("unsloth/orpheus-3b-0.1-ft", { ...settled, settled: false }),
+ false,
+ );
+ // Trained checkpoints and local folders are not listed by repo id.
+ assert.equal(rememberedModelUnavailable("/home/me/outputs/tts-checkpoint", settled), false);
+ assert.equal(
+ rememberedModelUnavailable("audio-cpp/audio.cpp-gguf/Qwen3-TTS-12Hz-0.6B-Base-GGUF", settled),
+ false,
+ );
+ assert.match(
+ audioPageSource,
+ /rememberedPageModel &&\s*!rememberedModelUnavailable\(rememberedPageModel, \{/,
+ );
+});
+
+test("deleting the audio.cpp package forgets the folders remembered from it", () => {
+ const qwenTts = "audio-cpp/audio.cpp-gguf/Qwen3-TTS-12Hz-0.6B-Base-GGUF";
+ assert.equal(deleteCoversRememberedModel("audio-cpp/audio.cpp-gguf", qwenTts), true);
+ assert.equal(deleteCoversRememberedModel(qwenTts, qwenTts.toUpperCase()), true);
+ assert.equal(deleteCoversRememberedModel("hexgrad/Kokoro-82M", "hexgrad/Kokoro-82M"), true);
+ assert.equal(deleteCoversRememberedModel("hexgrad/Kokoro", "hexgrad/Kokoro-82M"), false);
+ assert.equal(deleteCoversRememberedModel("audio-cpp/audio.cpp-gguf", "unsloth/orpheus"), false);
+ const settled = { settled: true, error: false };
+ // The package repo is gone, so is every folder in it.
+ assert.equal(
+ rememberedModelIsGone(qwenTts, { ...settled, available: new Set(["hexgrad/kokoro-82m"]) }),
+ true,
+ );
+ assert.equal(
+ rememberedModelIsGone(qwenTts, {
+ ...settled,
+ available: new Set(["audio-cpp/audio.cpp-gguf"]),
+ }),
+ false,
+ );
+ assert.match(
+ audioPageSource,
+ /\[\.\.\.deleted\.keys\(\)\]\.some\(\(repoId\) =>\s*deleteCoversRememberedModel\(repoId, id\),?\s*\)/,
+ );
+});
+
+
test("Eject is offered only for a resident Transcribe model, and never while busy", () => {
const idle = { busy: null, hasValue: true, showLastPageModel: false } as const;
assert.equal(audioEjectAvailable({ ...idle, mode: "transcribe", sttReady: true }), true);
diff --git a/studio/frontend/tests/audio-picker-filter.test.ts b/studio/frontend/tests/audio-picker-filter.test.ts
index 065c7331d45..8113e1f0b2c 100644
--- a/studio/frontend/tests/audio-picker-filter.test.ts
+++ b/studio/frontend/tests/audio-picker-filter.test.ts
@@ -355,3 +355,24 @@ test("every seeded audio GGUF lists on exactly the pages it runs on", () => {
assert.deepEqual(listed("HeartMuLa-GGUF"), ["music"]);
assert.deepEqual(listed("Niagara-ASR-GGUF"), ["transcribe"]);
});
+
+test("the image edit-keyword hiding stays off audio pickers", () => {
+ const pickers = readSrc(
+ "features/model-picker/components/model-selector/pickers.tsx",
+ );
+ assert.match(
+ pickers,
+ /!\(!taskFilterHasAudio\(filter\) && isImageEditModel\(repoId\)\)/,
+ );
+ assert.match(
+ pickers,
+ /taskMatchesFilter\(r\.pipelineTag, task\) &&\s*!\(!audioTaskPicker && isImageEditModel\(r\.id\)\)/,
+ );
+ assert.match(
+ pickers,
+ /\.filter\(\(id\) => audioTaskPicker \|\| !isImageEditModel\(id\)\)/,
+ );
+ // Every other call keeps its gate; none is left unconditional.
+ const calls = pickers.match(/isImageEditModel\([^)]*\)/g) ?? [];
+ assert.equal(calls.length, 4);
+});
diff --git a/studio/frontend/tests/audio-picker-policy.test.ts b/studio/frontend/tests/audio-picker-policy.test.ts
index 3b08b47369f..e2bb7267534 100644
--- a/studio/frontend/tests/audio-picker-policy.test.ts
+++ b/studio/frontend/tests/audio-picker-policy.test.ts
@@ -12,6 +12,7 @@ import {
curatedAudioInventoryMatches,
curatedAudioInventoryTask,
filesystemRowsSupportedForTask,
+ isAudioCppUmbrellaRepo,
macMlxSttRowIsRunnable,
macTtsHubRowIsRunnable,
localAudioRowIsUndecodableGguf,
@@ -835,3 +836,126 @@ test("music and audio-to-audio picks route only when the Audio page runs them",
false,
);
});
+
+test("the multi-model package repo, its forks and mirrors are never a runnable row", () => {
+ const umbrellas = [
+ "audio-cpp/audio.cpp-gguf",
+ "Audio-Cpp/Audio.cpp-GGUF",
+ "saxyZ/audio.cpp-gguf-fork",
+ "CaptainArni/audio.cpp-gguf",
+ ];
+ for (const id of umbrellas) {
+ assert.equal(isAudioCppUmbrellaRepo(id), true, id);
+ for (const [isStt, isTts] of [
+ [false, true],
+ [true, false],
+ ] as const) {
+ assert.equal(
+ communityAudioRowIsRunnable({ isStt, isTts, isGguf: true, id, tags: ["audio.cpp"] }),
+ false,
+ id,
+ );
+ }
+ for (const task of [
+ "text-to-speech",
+ "automatic-speech-recognition",
+ "text-to-audio",
+ ]) {
+ assert.equal(
+ audioPickIsRoutable({ id, task, isGguf: true, isCurated: false }),
+ false,
+ `${id} ${task}`,
+ );
+ }
+ }
+ for (const id of [
+ "audio-cpp/VibeVoice-7B-GGUF",
+ "audio-cpp/audio.cpp-gguf/Kokoro-82M-GGUF",
+ "someone/audiocpp-tools",
+ ]) {
+ assert.equal(isAudioCppUmbrellaRepo(id), false, id);
+ }
+ assert.equal(
+ communityAudioRowIsRunnable({
+ isStt: false,
+ isTts: true,
+ isGguf: true,
+ id: "audio-cpp/VibeVoice-7B-GGUF",
+ }),
+ true,
+ );
+ assert.equal(
+ audioPickIsRoutable({
+ id: "audio-cpp/VibeVoice-7B-GGUF",
+ task: "text-to-audio",
+ isGguf: true,
+ isCurated: false,
+ }),
+ true,
+ );
+});
+
+test("audio pickers list only task rows, so Recommended paging ends; chat stays untasked", () => {
+ assert.match(
+ pickerSource,
+ /const recommendedSearch = useHubModelSearch\("", \{[\s\S]{0,200}?task: audioTaskPicker \? task : undefined,/,
+ );
+ assert.match(
+ pickerSource,
+ /const audioTaskPicker = taskFilterHasAudio\(task\);/,
+ );
+});
+
+test("audio Recommended has no sort control and keeps the fit toggle in the format menu", () => {
+ assert.match(
+ pickerSource,
+ /const sectionSortDropdown =\s*section === "recommended" && audioTaskPicker \? null : section === "recommended" \?/,
+ );
+ // Non-audio pickers keep the sort menu with the fit footer.
+ assert.match(
+ pickerSource,
+ /ariaLabel="Sort Unsloth models"[\s\S]{0,500}?footer=\{fitOnDeviceFooter\}/,
+ );
+ assert.match(
+ pickerSource,
+ /ariaLabel="Filter by format"[\s\S]{0,300}?footer=\{\s*audioTaskPicker && section === "recommended"\s*\? fitOnDeviceFooter\s*: undefined\s*\}/,
+ );
+});
+
+test("search waits on the community search and shows its failure", () => {
+ assert.match(
+ pickerSource,
+ /const communitySearching =\s*communitySearchActive && communityQuerySearch\.isLoading;/,
+ );
+ assert.match(
+ pickerSource,
+ /const searchEmpty = recommendedEmptyState\(\{\s*isLoading: isLoading \|\| communitySearching,\s*error: searchError \?\? communitySearchError,/,
+ );
+ assert.match(
+ pickerSource,
+ /\{searchRowIds\.length === 0 &&\s*!isLoading &&\s*!communitySearching \?/,
+ );
+ assert.match(
+ pickerSource,
+ /<HubFailureHint\s*message=\{searchError \?\? communitySearchError\}\s*onRetry=\{\s*searchError\s*\? retrySearch\s*: communityQuerySearch\.retry\s*\}/,
+ );
+});
+
+test("the search placeholder names community models only when they are searched", () => {
+ assert.match(
+ pickerSource,
+ /: communityDiscoveryEnabled\s*\? "Search models"\s*: "Search Unsloth models"/,
+ );
+});
+
+test("task pickers offer MLX only on a Mac and coerce a stale filter", () => {
+ assert.match(
+ pickerSource,
+ /formatFilterValues\(\{ npu: !!npuCatalog, mlx: isMac \|\| !task \}\)/,
+ );
+ assert.match(
+ pickerSource,
+ /const formatFilter = coerceFormatFilter\(\s*chosenFormatFilter,\s*offeredFormatFilters,\s*\);/,
+ );
+ assert.match(pickerSource, /options=\{formatFilterOptions\}/);
+});
diff --git a/studio/frontend/tests/audio-workspace-store.test.ts b/studio/frontend/tests/audio-workspace-store.test.ts
index 493d087557c..07e36e01483 100644
--- a/studio/frontend/tests/audio-workspace-store.test.ts
+++ b/studio/frontend/tests/audio-workspace-store.test.ts
@@ -67,3 +67,17 @@ test("any committed switch settles a pending request, so it never fires later",
assert.equal(ws.getState().requestedWorkflow, null);
ws.getState().commitWorkflow("speak");
});
+
+test("forgetting a deleted model clears it from every page, whatever its casing", () => {
+ const state = useAudioWorkspaceStore.getState();
+ state.rememberModel("speak", "unsloth/orpheus-3b-0.1-ft");
+ state.rememberModel("clone", "unsloth/Orpheus-3B-0.1-ft");
+ state.rememberModel("transcribe", "moonshine/tiny");
+ useAudioWorkspaceStore.getState().forgetModel("unsloth/orpheus-3b-0.1-FT");
+ assert.deepEqual(useAudioWorkspaceStore.getState().lastModelByWorkflow, {
+ transcribe: "moonshine/tiny",
+ });
+ const before = useAudioWorkspaceStore.getState().lastModelByWorkflow;
+ useAudioWorkspaceStore.getState().forgetModel("not/remembered");
+ assert.equal(useAudioWorkspaceStore.getState().lastModelByWorkflow, before);
+});
diff --git a/studio/frontend/tests/hub-audio-task-link.test.ts b/studio/frontend/tests/hub-audio-task-link.test.ts
new file mode 100644
index 00000000000..f6f4a69c720
--- /dev/null
+++ b/studio/frontend/tests/hub-audio-task-link.test.ts
@@ -0,0 +1,64 @@
+// 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 assert from "node:assert/strict";
+import test from "node:test";
+
+import { hubAudioTaskSearch, matchesHubAudioTask } from "../src/lib/hub-audio-task.ts";
+import { readSrc } from "./helpers/kit.ts";
+
+const routeSource = readSrc("app/routes/hub.tsx");
+const hubPageSource = readSrc("features/hub/hub-page.tsx");
+const discoverSource = readSrc("features/hub/hooks/use-discover-search.ts");
+
+test("the Hub link keeps only known audio tasks, and only with the Audio filter", () => {
+ assert.deepEqual(hubAudioTaskSearch(["text-to-speech", "text-to-audio"], "audio"), [
+ "text-to-speech",
+ "text-to-audio",
+ ]);
+ assert.deepEqual(hubAudioTaskSearch("automatic-speech-recognition", "audio"), [
+ "automatic-speech-recognition",
+ ]);
+ assert.deepEqual(hubAudioTaskSearch(["text-to-speech", "image-to-text", 3], "audio"), [
+ "text-to-speech",
+ ]);
+ assert.equal(hubAudioTaskSearch(["image-to-text"], "audio"), undefined);
+ assert.equal(hubAudioTaskSearch(["text-to-speech"], "vision"), undefined);
+ assert.equal(hubAudioTaskSearch(undefined, "audio"), undefined);
+ assert.match(routeSource, /hubAudioTaskSearch\(search\.audioTask, next\.capability\)/);
+});
+
+test("an audio page's Search Hub link narrows the Audio filter to its tasks", () => {
+ assert.match(hubPageSource, /urlCapability === "audio" && urlTaskKey/);
+ assert.match(hubPageSource, /capability: undefined,\s*audioTask: undefined,/);
+ assert.match(hubPageSource, /if \(capabilityFilter !== "audio" && linkedAudioTask !== null\) \{\s*setLinkedAudioTask\(null\);/);
+ assert.match(
+ hubPageSource,
+ /task:\s*capabilityFilter === "audio" \? \(linkedAudioTask \?\? undefined\) : undefined,/,
+ );
+ assert.match(discoverSource, /channel,\s*filters,\s*task,\s*\}\);/);
+});
+
+test("a typed Hub search still keeps only the linked audio tasks", () => {
+ const asr = ["automatic-speech-recognition"] as const;
+ assert.equal(matchesHubAudioTask("automatic-speech-recognition", asr), true);
+ assert.equal(matchesHubAudioTask("text-to-speech", asr), false);
+ assert.equal(matchesHubAudioTask("text-to-audio", asr), false);
+ // An untagged repo stays, as the task listing keeps it.
+ assert.equal(matchesHubAudioTask(undefined, asr), true);
+ assert.equal(matchesHubAudioTask("text-to-speech", null), true);
+ assert.equal(matchesHubAudioTask("text-to-speech", []), true);
+ assert.match(
+ hubPageSource,
+ /deferredCapabilityFilter !== "audio" \|\|\s*matchesHubAudioTask\(row\.result\.pipelineTag, linkedAudioTask\)/,
+ );
+});
+
+test("Separate's Search Hub link narrows to audio-to-audio, not the speak picker's tasks", () => {
+ // The speak tasks (text-to-speech, text-to-audio) filtered out every separation model.
+ const audioPage = readSrc("features/audio/audio-page.tsx");
+ const selector = readSrc("features/model-picker/components/model-selector.tsx");
+ assert.match(audioPage, /hubTask=\{pageWorkflow === "separate" \? "audio-to-audio" : undefined\}/);
+ assert.match(selector, /const linkedTask = hubTask \?\? task;[\s\S]{0,200}?audioTask:\s*hubCapability === "audio" && linkedTask \? \[linkedTask\]\.flat\(\)/);
+ assert.deepEqual(hubAudioTaskSearch("audio-to-audio", "audio"), ["audio-to-audio"]);
+});
diff --git a/studio/frontend/tests/model-deleted-event.test.ts b/studio/frontend/tests/model-deleted-event.test.ts
new file mode 100644
index 00000000000..2dd565730ee
--- /dev/null
+++ b/studio/frontend/tests/model-deleted-event.test.ts
@@ -0,0 +1,29 @@
+// 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 assert from "node:assert/strict";
+import test from "node:test";
+
+import { readSrc } from "./helpers/kit.ts";
+
+(globalThis as { window?: EventTarget }).window ??= new EventTarget();
+const { notifyModelDeleted, subscribeModelDeleted } = await import(
+ "../src/lib/model-lifecycle-events.ts"
+);
+
+test("a cached-model delete is announced with its repo id", () => {
+ const seen: string[] = [];
+ const unsubscribe = subscribeModelDeleted((repoId) => seen.push(repoId));
+ notifyModelDeleted("unsloth/orpheus-3b-0.1-ft-GGUF");
+ unsubscribe();
+ notifyModelDeleted("unsloth/after-unsubscribe");
+ assert.deepEqual(seen, ["unsloth/orpheus-3b-0.1-ft-GGUF"]);
+});
+
+test("only a delete the server accepted is announced", () => {
+ const api = readSrc("features/hub/inventory/api.ts");
+ assert.match(
+ api,
+ /await throwIfNotOk\(response\);\s*discardDeletedModelInventoryHints\(repoId, variant\);\s*bumpInventoryVersion\(\);\s*notifyModelDeleted\(repoId\);/,
+ );
+});
diff --git a/studio/frontend/tests/model-picker-pinned-row-fixes.test.ts b/studio/frontend/tests/model-picker-pinned-row-fixes.test.ts
index 149f32abd46..dd04093fcc1 100644
--- a/studio/frontend/tests/model-picker-pinned-row-fixes.test.ts
+++ b/studio/frontend/tests/model-picker-pinned-row-fixes.test.ts
@@ -50,3 +50,31 @@ test("that repo's pinned row is its own sole-quant row", () => {
/pinnedSoleQuantRows\.has\(row\.key\)\s*\?\s*makeModelOptionKey\("downloaded-gguf", row\.entry\.repoId\)/,
);
});
+
+test("the quant list's Vision badge and relay follow the picker's capability scope", () => {
+ assert.match(
+ pickers,
+ /const visionInScope =\s*capabilityScope === null \|\| capabilityScope\.includes\("vision"\);\s*const showVision = hasVision === true && visionInScope;/,
+ );
+ assert.match(
+ pickers,
+ /if \(normalized\.hasVision !== undefined && visionInScope\) \{\s*onHasVision\?\.\(normalized\.hasVision\);/,
+ );
+ assert.doesNotMatch(
+ pickers,
+ /\{hasVision && \(\s*<span className="flex items-center gap-0\.5/,
+ );
+ assert.doesNotMatch(pickers, /!onDevice &&\s*hasVision &&/);
+});
+
+test("collapsed, pinned and sole-quant rows hide has_vision outside a vision scope too", () => {
+ // Only the expander honoured the scope, so a one-quant audio row still drew Vision.
+ const rowStart = pickers.indexOf("function ModelRow(");
+ const row = pickers.slice(rowStart, pickers.indexOf("\nfunction ", rowStart + 10));
+ assert.match(
+ row,
+ /const visionShown =\s*showVision === true &&\s*\(capabilityScope === null \|\| capabilityScope\.includes\("vision"\)\);/,
+ );
+ assert.doesNotMatch(row, /\{showVision && <VisionBadge \/>\}/);
+ assert.equal(row.match(/\{visionShown && <VisionBadge \/>\}/g)?.length, 2);
+});
diff --git a/studio/frontend/tests/model-picker-variant-presentation.test.ts b/studio/frontend/tests/model-picker-variant-presentation.test.ts
index d17e2f29c10..75fb91befa6 100644
--- a/studio/frontend/tests/model-picker-variant-presentation.test.ts
+++ b/studio/frontend/tests/model-picker-variant-presentation.test.ts
@@ -11,6 +11,7 @@ import {
groupGgufVariantsForPicker,
h3PickerHasOnlyPrunedBuilds,
preferredGgufVariantByGroup,
+ quantDisplayCase,
} from "../src/features/model-picker/components/model-selector/variant-presentation.ts";
const GGUF_SUFFIX = /\.gguf$/i;
@@ -225,3 +226,22 @@ test("the picker label is unchanged by the key-shaped parse", () => {
);
assert.equal(groupGgufVariantsForPicker([pruned])[0]?.key, "text-frames");
});
+
+test("a lowercase quant key displays in quant case, but the key stays raw", () => {
+ assert.equal(ggufQuantChipLabel("bf16"), "BF16");
+ assert.equal(ggufQuantChipLabel("q8_0"), "Q8_0");
+ assert.equal(ggufQuantChipLabel("ud-q4_k_xl"), "UD-Q4_K_XL");
+ assert.equal(ggufQuantChipLabel("sub/f16"), "sub/F16");
+ assert.equal(quantDisplayCase("iq2_xxs"), "IQ2_XXS");
+ // Not a quant token: left as it is.
+ assert.equal(quantDisplayCase("distilled"), "distilled");
+ assert.equal(quantDisplayCase("model-bf16"), "model-bf16");
+ const raw = { filename: "model-bf16.gguf", quant: "bf16", size_bytes: 1 };
+ assert.equal(ggufVariantPickerLabel(raw), "BF16");
+ assert.equal(raw.quant, "bf16");
+ assert.equal(ggufQuantDetailLabel("bf16"), "bf16");
+ assert.equal(
+ ggufVariantPickerLabel({ ...raw, display_label: "bf16 · full" }),
+ "bf16 · full",
+ );
+});
diff --git a/studio/frontend/tests/model-row-owner.test.ts b/studio/frontend/tests/model-row-owner.test.ts
index ea5fc299064..b2cc6ea72bf 100644
--- a/studio/frontend/tests/model-row-owner.test.ts
+++ b/studio/frontend/tests/model-row-owner.test.ts
@@ -7,7 +7,9 @@
import assert from "node:assert/strict";
import test from "node:test";
import {
+ classifyMetaToken,
isUnslothOwner,
+ parseMetaTokens,
splitRepoLabel,
} from "../src/features/model-picker/components/model-selector/row-meta.ts";
@@ -27,3 +29,13 @@ test("other owners keep their prefix", () => {
// A bare model name has no owner to hide.
assert.equal(isUnslothOwner(splitRepoLabel("gemma-4-26b").owner), false);
});
+
+test("a sub-billion param count is a param chip, not text beside the name's own", () => {
+ const meta = parseMetaTokens("600.0M · GGUF");
+ assert.deepEqual(meta.texts, []);
+ assert.equal(meta.param, "600.0M");
+ assert.deepEqual(classifyMetaToken("600.0M"), { kind: "param", label: "600.0M" });
+ assert.deepEqual(classifyMetaToken("0.6B"), { kind: "param", label: "0.6B" });
+ // A context length is never read as params.
+ assert.equal(classifyMetaToken("128K")?.kind, "text");
+});
diff --git a/studio/frontend/tests/model-selector-trigger-label.test.ts b/studio/frontend/tests/model-selector-trigger-label.test.ts
index 75f8d2b570e..c2bd7f5e8a1 100644
--- a/studio/frontend/tests/model-selector-trigger-label.test.ts
+++ b/studio/frontend/tests/model-selector-trigger-label.test.ts
@@ -9,7 +9,7 @@
import assert from "node:assert/strict";
import test from "node:test";
-import { registerBundlerResolver } from "./helpers/kit.ts";
+import { readSrc, registerBundlerResolver } from "./helpers/kit.ts";
registerBundlerResolver();
@@ -96,3 +96,27 @@ test("an Ollama pick keeps the slashes in its repo name", () => {
assert.ok(namespaced);
assert.equal(loraOptionLabel(namespaced), "someuser/mymodel:latest");
});
+
+test("the trigger's suffix keeps the space in its ' - ' separator", () => {
+ const selector = readSrc(
+ "features/model-picker/components/model-selector.tsx",
+ );
+ // A blockified flex item drops the leading space of its text, so the separator is its own
+ // span that preserves white space.
+ assert.match(
+ selector,
+ /\{subtitle \? <span className="whitespace-pre"> - <\/span> : null\}\s*\{currentModel\.descriptionSuffix\}/,
+ );
+ assert.doesNotMatch(selector, /\{subtitle \? " - " : ""\}/);
+});
+
+test("an audio page's loaded quant names the trigger only for the model it belongs to", () => {
+ const selector = readSrc(
+ "features/model-picker/components/model-selector.tsx",
+ );
+ assert.match(
+ selector,
+ /const triggerGgufVariant =\s*loadedGgufVariantOverride !== undefined\s*\? selected &&\s*loadedModelIdOverride &&\s*selected\.toLowerCase\(\) === loadedModelIdOverride\.toLowerCase\(\)\s*\? loadedGgufVariantOverride\s*: null\s*: activeGgufVariant;/,
+ );
+ assert.match(selector, /const desc = `GGUF · \$\{triggerGgufVariant\}`;/);
+});
diff --git a/studio/frontend/tests/model-usage-load-stamp.test.ts b/studio/frontend/tests/model-usage-load-stamp.test.ts
new file mode 100644
index 00000000000..19b893a3657
--- /dev/null
+++ b/studio/frontend/tests/model-usage-load-stamp.test.ts
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+// "Recent" orders by load, so only a selection that is actually loaded is stamped. A remembered
+// model shown in the trigger without being loaded must leave the load times alone.
+
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import { installLocalStorageFake } from "./helpers/kit.ts";
+
+const { store } = installLocalStorageFake();
+const { loadStampId, loadedAt, recordModelLoaded } = await import(
+ "../src/features/model-picker/components/model-selector/model-usage.ts"
+);
+
+const KEY = "unsloth.model-load-times.v1";
+
+test("an unloaded selection is not stamped", () => {
+ assert.equal(loadStampId("unsloth/Kokoro-82M-GGUF", false), undefined);
+ assert.equal(loadStampId(undefined, true), undefined);
+ assert.equal(loadStampId(null), undefined);
+ assert.equal(loadStampId("", true), undefined);
+ assert.equal(store.has(KEY), false);
+});
+
+test("a loaded selection, or one with no loaded signal, still stamps", () => {
+ assert.equal(loadStampId("unsloth/Kokoro-82M-GGUF", true), "unsloth/Kokoro-82M-GGUF");
+ assert.equal(loadStampId("unsloth/Qwen3-8B"), "unsloth/Qwen3-8B");
+ const id = loadStampId("Unsloth/Qwen3-8B", true);
+ assert.ok(id);
+ const times = recordModelLoaded(id);
+ assert.ok(loadedAt(times, "unsloth/qwen3-8b") > 0);
+ assert.ok(store.get(KEY)?.includes("unsloth/qwen3-8b"));
+});
diff --git a/studio/frontend/tests/on-device-dot-and-header-alignment.test.ts b/studio/frontend/tests/on-device-dot-and-header-alignment.test.ts
index 2247449dfec..7bbf604ff10 100644
--- a/studio/frontend/tests/on-device-dot-and-header-alignment.test.ts
+++ b/studio/frontend/tests/on-device-dot-and-header-alignment.test.ts
@@ -79,7 +79,7 @@ test("the unscoped badge column is sized per list, not to the union of both", ()
// Hub keeps it in the slot, beside the vision badge.
assert.match(
PICKERS,
- /\{showVision && <VisionBadge \/>\}\n\s*\{partial && alignMeta !== "device" \? \(\n\s*<PartialBadge resumable=\{partialResumable\} \/>/,
+ /\{visionShown && <VisionBadge \/>\}\n\s*\{partial && alignMeta !== "device" \? \(\n\s*<PartialBadge resumable=\{partialResumable\} \/>/,
);
assert.match(
PICKERS,
diff --git a/studio/frontend/tests/recommended-catalog-seeds.test.ts b/studio/frontend/tests/recommended-catalog-seeds.test.ts
index 7d83b9bf0ef..93a4ee46683 100644
--- a/studio/frontend/tests/recommended-catalog-seeds.test.ts
+++ b/studio/frontend/tests/recommended-catalog-seeds.test.ts
@@ -14,6 +14,8 @@ import {
} from "../src/features/model-picker/components/model-selector/model-catalog.ts";
import { classifyGgufFit } from "../src/lib/gguf-fit.ts";
import {
+ coerceFormatFilter,
+ formatFilterValues,
hfModelFitsDevice,
loadScopedGpu,
orderRecommendedRows,
@@ -675,3 +677,32 @@ test("an empty Recommended list names a failed search or unreachable hub, not an
["empty", "failed", "failed", "failed", "loading"],
);
});
+
+test("the format menu offers MLX and NPU only where they can run", () => {
+ assert.deepEqual(formatFilterValues({ npu: true, mlx: true }), [
+ "all",
+ "gguf",
+ "mlx",
+ "safetensors",
+ "npu",
+ ]);
+ assert.deepEqual(formatFilterValues({ npu: false, mlx: false }), [
+ "all",
+ "gguf",
+ "safetensors",
+ ]);
+ assert.deepEqual(formatFilterValues({ npu: true, mlx: false }), [
+ "all",
+ "gguf",
+ "safetensors",
+ "npu",
+ ]);
+});
+
+test("a remembered filter the menu no longer offers falls back to All", () => {
+ const linux = formatFilterValues({ npu: false, mlx: false });
+ assert.equal(coerceFormatFilter("mlx", linux), "all");
+ assert.equal(coerceFormatFilter("npu", linux), "all");
+ assert.equal(coerceFormatFilter("gguf", linux), "gguf");
+ assert.equal(coerceFormatFilter("mlx", formatFilterValues({ npu: false, mlx: true })), "mlx");
+});
diff --git a/studio/frontend/tests/recommended-curated-row-metadata.test.ts b/studio/frontend/tests/recommended-curated-row-metadata.test.ts
index 93fa0099746..eda045f1327 100644
--- a/studio/frontend/tests/recommended-curated-row-metadata.test.ts
+++ b/studio/frontend/tests/recommended-curated-row-metadata.test.ts
@@ -23,9 +23,15 @@ import {
} from "../src/features/model-picker/components/model-selector/model-catalog.ts";
import {
paramsFromId,
+ pickerSearchMatches,
searchRowFitsDevice,
searchableRecommendedIds,
} from "../src/features/model-picker/components/model-selector/recommended-fit.ts";
+import {
+ AUDIO_CPP_MODELS,
+ audioCppDisplayName,
+ isAudioCppFolderId,
+} from "../src/features/audio/audio-cpp-catalog.ts";
const H3_GGUF = "unsloth/MiniMax-H3-GGUF";
const H3_BF16 = "MiniMaxAI/MiniMax-H3";
@@ -34,6 +40,34 @@ const WAN_BF16 = "Wan-AI/Wan2.2-TI2V-5B-Diffusers";
// ── search: a downloaded curated row stays findable ───────────────────────────
+test("a bundled folder is searched on the folder name its row shows", () => {
+ const folders = AUDIO_CPP_MODELS.filter((model) => isAudioCppFolderId(model.id));
+ const hits = (query: string) =>
+ folders.filter((model) => pickerSearchMatches(model.id, [model.id], null, query));
+ const audioNamed = folders.filter((model) =>
+ audioCppDisplayName(model.id).toLowerCase().includes("audio"),
+ );
+ assert.ok(audioNamed.length > 0 && audioNamed.length < folders.length);
+ assert.deepEqual(hits("audio"), audioNamed);
+ assert.deepEqual(hits("cpp"), []);
+ assert.deepEqual(hits("gguf"), []);
+ assert.deepEqual(hits("GGUF"), []);
+ assert.equal(hits("kokoro").length, 1);
+ // The full name the row shows, and its tail, still find it.
+ assert.equal(hits("Kokoro-82M-GGUF").length, 1);
+ assert.equal(hits("82M-GGUF").length, 1);
+ assert.equal(hits("kokoro 82m gguf").length, 1);
+});
+
+test("any other row is searched on its aliases and label", () => {
+ const id = "unsloth/Qwen3-8B-GGUF";
+ assert.equal(pickerSearchMatches(id, [id], "Qwen3 8B", "unsloth/qwen3"), true);
+ assert.equal(pickerSearchMatches(id, [id], "Qwen3 8B", "qwen3 8b"), true);
+ assert.equal(pickerSearchMatches(id, [id], null, "gguf"), true);
+ assert.equal(pickerSearchMatches(id, [id], "Qwen3 8B", "llama"), false);
+ assert.equal(pickerSearchMatches("a/b", ["a/b"], "", ""), true);
+});
+
test("a seed the listing pool dropped is still searchable", () => {
// recommendedIds (the listing pool) filters out everything already on disk, because a
// downloaded model has its own On Device row. The unfiltered Recommended list keeps
diff --git a/studio/frontend/tests/sole-quant-row-state.test.ts b/studio/frontend/tests/sole-quant-row-state.test.ts
index 1c03b0ecf74..e935799f683 100644
--- a/studio/frontend/tests/sole-quant-row-state.test.ts
+++ b/studio/frontend/tests/sole-quant-row-state.test.ts
@@ -75,3 +75,56 @@ test("the picker points elsewhere: not selected, even while running", () => {
{ selected: false, loaded: true },
);
});
+
+// Audio pages pass the runtime's loaded id and quant; the chat store must not stand in for either.
+const FOLDER = "audio-cpp/audio.cpp-gguf/Qwen3-TTS-12Hz-0.6B-Base-GGUF";
+const audioRow = (
+ loadedModelId: string | null,
+ activeGgufVariant: string | null,
+) =>
+ soleQuantRowState({
+ pickerValue: FOLDER,
+ repoId: FOLDER,
+ quant: "Q8_0",
+ loadedModelId,
+ activeGgufVariant,
+ });
+
+test("task override id and quant: the umbrella row is loaded", () => {
+ assert.deepEqual(audioRow(FOLDER, "Q8_0"), { selected: true, loaded: true });
+});
+
+test("task override id without a quant: not loaded", () => {
+ assert.deepEqual(audioRow(FOLDER, null), { selected: false, loaded: false });
+});
+
+test("empty task override id: nothing loaded, even with a quant", () => {
+ assert.deepEqual(audioRow("", "Q8_0"), { selected: true, loaded: false });
+});
+
+test("the picker resolves the loaded quant from the task override first", async () => {
+ const { readSrc } = await import("./helpers/kit.ts");
+ const pickers = readSrc(
+ "features/model-picker/components/model-selector/pickers.tsx",
+ );
+ assert.match(
+ pickers,
+ /const activeGgufVariant =\s*loadedGgufVariantOverride !== undefined\s*\? loadedGgufVariantOverride\s*: storeGgufVariant;/,
+ );
+ // `??` keeps an empty id override instead of falling back to the chat store.
+ assert.match(
+ pickers,
+ /const loadedModelId = loadedModelIdOverride \?\? chatLoadedModelId;/,
+ );
+ assert.match(
+ pickers,
+ /useModelLoadTimes\(loadStampId\(value, valueLoaded\)\)/,
+ );
+ const selector = readSrc(
+ "features/model-picker/components/model-selector.tsx",
+ );
+ assert.match(
+ selector,
+ /loadedGgufVariantOverride=\{loadedGgufVariantOverride\}\s*loraModels=\{fineTunedModels\}[\s\S]{0,200}?valueLoaded=\{loaded\}/,
+ );
+});