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: show newly downloaded quants of a loaded GGUF in the model picker (#15233)

Michael Han256351316f80
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 c7203134491..099f5bca33d 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
@@ -6455,61 +6455,103 @@ export function HubModelPicker({
const optionKey = makeModelOptionKey("loaded", checkpoint);
const isSelected = modelIdsMatchForPicker(value, checkpoint);
const quant = entry.quant ?? (isSelected ? activeGgufVariant : null);
+ const isLocal = /^(?:[a-zA-Z]:[\\/]|[\\/]|~)/.test(checkpoint);
+ // Its curated row is hidden while loaded, so this row must open the quant list instead.
+ const expandable = Boolean(quant) && !isLocal && isKnownGgufRepo(entry.id);
+ const expanded = expandable && expandedGguf === entry.id;
return (
- <div
- key={optionKey}
- className={downloadedRowShellClassName(isSelected)}
- >
- <div className="min-w-0 flex-1">
- <ModelRow
- label={entry.id}
- tooltipText={entry.id}
- hideOwner={isUnslothOwned(entry.id)}
- alignMeta="hub"
- meta={quant ? "GGUF" : extractParamLabel(entry.id)}
- tags={quant ? [ggufQuantChipLabel(quant)] : undefined}
- selected={isSelected}
- loaded={true}
- optionProps={hubModelList.getOptionProps(optionKey, isSelected)}
- onClick={() =>
- onSelect(checkpoint, {
- source: /^(?:[a-zA-Z]:[\\/]|[\\/]|~)/.test(checkpoint) ? "local" : "hub",
- isLora: false,
- ggufVariant: quant ?? undefined,
- isDownloaded: true,
- isGguf: Boolean(quant),
- })
- }
- vramStatus={null}
- className={downloadedRowButtonClassName}
- />
+ <div key={optionKey}>
+ <div className={downloadedRowShellClassName(isSelected)}>
+ <div className="min-w-0 flex-1">
+ <ModelRow
+ label={entry.id}
+ tooltipText={entry.id}
+ hideOwner={isUnslothOwned(entry.id)}
+ alignMeta="hub"
+ meta={quant ? "GGUF" : extractParamLabel(entry.id)}
+ tags={quant ? [ggufQuantChipLabel(quant)] : undefined}
+ selected={isSelected}
+ loaded={true}
+ optionProps={hubModelList.getOptionProps(optionKey, isSelected)}
+ onClick={() =>
+ expandable
+ ? setExpandedGguf((prev) =>
+ prev === entry.id ? null : entry.id,
+ )
+ : onSelect(checkpoint, {
+ source: isLocal ? "local" : "hub",
+ isLora: false,
+ ggufVariant: quant ?? undefined,
+ isDownloaded: true,
+ isGguf: Boolean(quant),
+ })
+ }
+ onArrowDownIntoChildren={
+ expanded ? () => focusFirstChildOption(optionKey) : undefined
+ }
+ vramStatus={null}
+ className={downloadedRowButtonClassName}
+ />
+ </div>
+ <span className={ROW_ACTIONS_CLASS}>
+ {ejectsKept ? (
+ <Tooltip delayDuration={0}>
+ <TooltipTrigger asChild={true}>
+ <button
+ type="button"
+ onClick={(e) => {
+ e.stopPropagation();
+ onEject?.(checkpoint);
+ }}
+ aria-label={`Eject ${entry.id}`}
+ className="flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-[rgb(0_0_0_/_calc(0.05*var(--contrast-wash-gain,1)))] hover:text-red-500 dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))]"
+ >
+ <HugeiconsIcon
+ icon={RemoveCircleIcon}
+ strokeWidth={1.75}
+ className="size-3.5"
+ />
+ </button>
+ </TooltipTrigger>
+ <TooltipContent side="top" className="tooltip-compact">
+ Eject
+ </TooltipContent>
+ </Tooltip>
+ ) : null}
+ </span>
</div>
- <span className={ROW_ACTIONS_CLASS}>
- {ejectsKept ? (
- <Tooltip delayDuration={0}>
- <TooltipTrigger asChild={true}>
- <button
- type="button"
- onClick={(e) => {
- e.stopPropagation();
- onEject?.(checkpoint);
- }}
- aria-label={`Eject ${entry.id}`}
- className="flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-[rgb(0_0_0_/_calc(0.05*var(--contrast-wash-gain,1)))] hover:text-red-500 dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))]"
- >
- <HugeiconsIcon
- icon={RemoveCircleIcon}
- strokeWidth={1.75}
- className="size-3.5"
- />
- </button>
- </TooltipTrigger>
- <TooltipContent side="top" className="tooltip-compact">
- Eject
- </TooltipContent>
- </Tooltip>
- ) : null}
- </span>
+ {expanded && (
+ <GgufVariantExpander
+ diffusionLoad={diffusionLoad}
+ hostPooledMemory={gpu.loadDeviceSharesHostMemory}
+ gpuCount={expanderGpuCount}
+ repoId={entry.id}
+ loadedQuants={loadedQuantsFor(entry.id)}
+ pipelineTag={pipelineTagById.get(entry.id) ?? null}
+ onSelect={onSelect}
+ resolveDownloadFootprint={resolveDownloadFootprint}
+ onConfigure={onConfigure}
+ hfToken={hfToken || undefined}
+ parentOptionKey={optionKey}
+ onNavigatePastStart={() => hubModelList.focusOption(optionKey)}
+ onNavigatePastEnd={() => hubModelList.moveFocus(optionKey, "next")}
+ gpuGb={expanderGpuGb}
+ systemRamGb={expanderRamGb || undefined}
+ budgetKnown={expanderBudgetGpu.budgetKnown}
+ variantActions={{
+ onDelete: async (variantQuant, cachePath) => {
+ await deleteCachedModel(
+ entry.id,
+ variantQuant,
+ hfToken || undefined,
+ cachePath ?? undefined,
+ );
+ prunePinnedQuantValidation(entry.id, variantQuant);
+ refreshCachedLists();
+ },
+ }}
+ />
+ )}
</div>
);
};
@@ -7037,7 +7079,28 @@ export function HubModelPicker({
/>
</span>
) : (
- <span aria-hidden="true" className={cn(ROW_ACTIONS_CLASS, "h-6")} />
+ // No chevron until the probe rules out a sole quant. The gutter is a mouse target (the row
+ // has the keyboard); pr-2.5 is the heading chevron's column.
+ <span className={cn(ROW_ACTIONS_PINNED_CLASS, "h-6")}>
+ {soleQuants.pending.has(c.repo_id) ? null : (
+ <button
+ type="button"
+ tabIndex={-1}
+ aria-hidden="true"
+ onClick={() => toggleGgufExpanded(c.repo_id, expanderOpen)}
+ className="flex h-full w-full cursor-pointer items-center justify-end pr-2.5 text-muted-foreground/80 hover:text-foreground"
+ >
+ <HugeiconsIcon
+ icon={
+ expanderOpen
+ ? ChevronDownStandardIcon
+ : ChevronRightStandardIcon
+ }
+ className="size-3"
+ />
+ </button>
+ )}
+ </span>
)}
</div>
{expanderOpen && (
diff --git a/studio/frontend/tests/loaded-gguf-quant-marker.test.ts b/studio/frontend/tests/loaded-gguf-quant-marker.test.ts
index dda4884c79c..8b187188df5 100644
--- a/studio/frontend/tests/loaded-gguf-quant-marker.test.ts
+++ b/studio/frontend/tests/loaded-gguf-quant-marker.test.ts
@@ -33,3 +33,24 @@ test("a loaded row is selected, picked and ejected by its checkpoint, not its la
assert.match(picker, /onSelect\(checkpoint, \{/);
assert.match(picker, /onEject\?\.\(checkpoint\);/);
});
+
+test("an On Device GGUF row with several quants shows a right/down chevron its gutter toggles", () => {
+ const start = picker.indexOf("const renderDownloadedGgufRow = (");
+ const row = picker.slice(start, picker.indexOf("<GgufVariantExpander", start));
+ assert.match(row, /if \(soleQuant\) return renderSoleQuantGgufRow\(c, soleQuant\);/);
+ assert.match(
+ row,
+ /\{soleQuants\.pending\.has\(c\.repo_id\) \? null : \(\s*<button[\s\S]*?onClick=\{\(\) => toggleGgufExpanded\(c\.repo_id, expanderOpen\)\}/,
+ );
+ assert.match(row, /expanderOpen\s*\?\s*ChevronDownStandardIcon\s*:\s*ChevronRightStandardIcon/);
+ assert.match(row, /<span className=\{cn\(ROW_ACTIONS_PINNED_CLASS, "h-6"\)\}>/);
+});
+
+test("a loaded hub GGUF row opens its quant list, so quants downloaded after the load stay reachable", () => {
+ const start = picker.indexOf("const renderLoadedRow = (");
+ const loadedRow = picker.slice(start, picker.indexOf("const renderConnectedModelRow", start));
+ assert.match(picker, /if \(loadedRowIds\.has\(id\.toLowerCase\(\)\)\) return moreLabel;/);
+ assert.match(loadedRow, /const expandable = Boolean\(quant\) && !isLocal && isKnownGgufRepo\(entry\.id\);/);
+ assert.match(loadedRow, /expandable\s*\?\s*setExpandedGguf\(\(prev\) =>\s*prev === entry\.id \? null : entry\.id,?\s*\)/);
+ assert.match(loadedRow, /\{expanded && \(\s*<GgufVariantExpander[\s\S]*?repoId=\{entry\.id\}/);
+});
diff --git a/studio/frontend/tests/model-picker-partial-downloads.test.ts b/studio/frontend/tests/model-picker-partial-downloads.test.ts
index 55bcfdea54b..4fb12da4d47 100644
--- a/studio/frontend/tests/model-picker-partial-downloads.test.ts
+++ b/studio/frontend/tests/model-picker-partial-downloads.test.ts
@@ -378,8 +378,8 @@ test("a partial GGUF repo carries its own menu, not an empty gutter", () => {
);
assert.match(
row,
- /\) : \(\n\s*<span aria-hidden="true" className=\{cn\(ROW_ACTIONS_CLASS, "h-6"\)\}/,
- "and a complete repo still only reserves the gutter",
+ /\) : \([\s\S]*?<span className=\{cn\(ROW_ACTIONS_PINNED_CLASS, "h-6"\)\}>\s*\{soleQuants\.pending\.has\(c\.repo_id\) \? null : \(/,
+ "and a complete repo's gutter holds only the expand chevron",
);
assert.ok(row.includes("cachePath={{ repoId: c.repo_id }}"), "reveal");
assert.ok(row.includes('title: "Delete cached model?"'), "delete");
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 c23d3085ef9..e04d25479c3 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
@@ -251,8 +251,8 @@ test("chat and the Hub answer the fit question with one formula", () => {
);
assert.equal(
PICKERS.split("gpuGb={expanderGpuGb}").length - 1,
- 9,
- "seven expanders and the two quant rows beside them",
+ 10,
+ "eight expanders and the two quant rows beside them",
);
assert.ok(
HUB_CARD.includes(
@@ -267,7 +267,7 @@ test("chat and the Hub answer the fit question with one formula", () => {
assert.ok(PICKERS.includes("mediaLoad: diffusionLoad,"));
assert.equal(
PICKERS.split("diffusionLoad={diffusionLoad}").length - 1,
- 7,
+ 8,
"every task-scoped expander",
);
// On a host pool drop the RAM tier, or the APU window is counted with the RAM it maps.
@@ -311,7 +311,7 @@ test("chat and the Hub answer the fit question with one formula", () => {
);
assert.equal(
PICKERS.split("gpuCount={expanderGpuCount}").length - 1,
- 7,
+ 8,
"every task-scoped expander counts the scoped inventory",
);
assert.equal(
@@ -321,7 +321,7 @@ test("chat and the Hub answer the fit question with one formula", () => {
);
assert.equal(
PICKERS.split("<GgufVariantExpander").length - 1,
- 8,
+ 9,
"and that is every expander there is",
);
// Pass raw devices to gpuSharedHostMemoryGb; pre-folding undercounted multi-socket hosts.
@@ -466,7 +466,7 @@ test("a diffusion model too big for a shared pool is refused, not offloaded", ()
assert.equal(
PICKERS.split("hostPooledMemory={gpu.loadDeviceSharesHostMemory}").length -
1,
- 7,
+ 8,
"every task-scoped expander learns the pool kind",
);
});