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 settings and the row menu on the loaded model in Recommended (#15249)

Michael Hanc9e5d4ab063d
diff --git a/studio/frontend/scripts/check-bundle-budget.ts b/studio/frontend/scripts/check-bundle-budget.ts
index 47f091e5178..dd930f18b6a 100644
--- a/studio/frontend/scripts/check-bundle-budget.ts
+++ b/studio/frontend/scripts/check-bundle-budget.ts
@@ -436,8 +436,11 @@ export const BUDGET = {
// The run settings dropdown per model (#15247: saved settings store, dropdown, pencil and Reset to Default)
// adds 9.9 KB raw / 3.2 KB transfer inside the eager model config page: 6,787.4 -> 6,797.3 KB raw, 2,047.9 ->
// 2,051.1 KB transfer against d4be247222, one machine and build, Node 26, 105 chunks. Raised by that growth.
- transferBytes: 2_100_321,
- rawBytes: 6_971_490,
+ // Settings and the row menu on the loaded model in Recommended (#15249) add 82 B raw / 176 B transfer to the eager
+ // model picker (6,960,469 -> 6,960,551 B raw, 2,100,277 -> 2,100,453 B transfer against c9ddc5ab5e, one machine and
+ // build, Node 26, 105 chunks). Raised by that growth.
+ transferBytes: 2_100_497,
+ rawBytes: 6_971_572,
};
// The chunk count is reported but not budgeted. Splitting a page out of the entry raises it while lowering the
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 099f5bca33d..bdbd5f740e1 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
@@ -263,6 +263,8 @@ import {
modelIdsMatchForPicker,
soleQuantRowState,
} from "./row-identity";
+import { isStandaloneGgufPath } from "@/features/hub/lib/model-identity";
+import { cachedRepoConfigId } from "../../model-config/model-identity";
import {
type FormatTone,
isFeaturedOnDeviceRepoId,
@@ -1123,6 +1125,8 @@ const downloadedRowShellClassName = (
const ROW_ACTIONS_CLASS =
"mr-0.5 flex w-[calc(38px*var(--ui-space-scale,1))] shrink-0 items-center justify-end -space-x-0.5 opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 has-[[data-state=open]]:opacity-100 [@media(hover:none)]:opacity-100";
+const ROW_ACTIONS_VISIBLE_CLASS = ROW_ACTIONS_CLASS.replace("opacity-0 ", "");
+
// Drop line for a pinned-row drag. A border snaps to whole pixels, so every row matches.
const PINNED_DROP_CUE_BASE =
"before:pointer-events-none before:absolute before:inset-x-2 before:z-10 before:h-0 before:border-t-[1.5px] before:border-primary before:content-['']";
@@ -6456,6 +6460,33 @@ export function HubModelPicker({
const isSelected = modelIdsMatchForPicker(value, checkpoint);
const quant = entry.quant ?? (isSelected ? activeGgufVariant : null);
const isLocal = /^(?:[a-zA-Z]:[\\/]|[\\/]|~)/.test(checkpoint);
+ // As the adapter rows classify it: a LoRA keeps its trained precision and API auto-switch skips it.
+ const adapter = quant
+ ? undefined
+ : loraModels.find((lora) => modelIdsMatchForPicker(lora.id, checkpoint));
+ const isLoraAdapter =
+ adapter !== undefined &&
+ adapter.source !== "local" &&
+ adapter.exportType !== "merged" &&
+ adapter.exportType !== "gguf";
+ const selectMeta: ModelSelectorChangeMeta = {
+ source: isLocal ? "local" : "hub",
+ isLora: isLoraAdapter,
+ ggufVariant: quant ?? undefined,
+ isDownloaded: true,
+ isGguf: Boolean(quant),
+ };
+ // As residentModelConfigTarget: a cached HF snapshot keys settings by its repo id (still loading
+ // the snapshot), a standalone .gguf by the bare path, its quant only a label from the filename.
+ const snapshotRepoId = cachedRepoConfigId(checkpoint, quant);
+ const configureArgs: [string, ModelSelectorChangeMeta] = snapshotRepoId
+ ? [snapshotRepoId, { ...selectMeta, source: "hub", loadId: checkpoint }]
+ : [
+ checkpoint,
+ isStandaloneGgufPath(checkpoint)
+ ? { ...selectMeta, ggufVariant: undefined, isGguf: true }
+ : selectMeta,
+ ];
// 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;
@@ -6478,13 +6509,7 @@ export function HubModelPicker({
? setExpandedGguf((prev) =>
prev === entry.id ? null : entry.id,
)
- : onSelect(checkpoint, {
- source: isLocal ? "local" : "hub",
- isLora: false,
- ggufVariant: quant ?? undefined,
- isDownloaded: true,
- isGguf: Boolean(quant),
- })
+ : onSelect(checkpoint, selectMeta)
}
onArrowDownIntoChildren={
expanded ? () => focusFirstChildOption(optionKey) : undefined
@@ -6493,31 +6518,48 @@ export function HubModelPicker({
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 className={ROW_ACTIONS_VISIBLE_CLASS}>
+ {onConfigure && (
+ <ModelLoadSettingsAction
+ ariaLabel={`Inference settings for ${entry.id}`}
+ onConfigure={() => onConfigure(...configureArgs)}
+ />
+ )}
+ <ModelRowMenu
+ ariaLabel={`More options for ${entry.id}`}
+ cachePath={
+ isLocal ? undefined : { repoId: checkpoint, variant: quant ?? undefined }
+ }
+ // Every loaded row ejects while several are loaded, the active one included.
+ items={
+ ejectsKept
+ ? [
+ {
+ key: "eject",
+ label: "Eject",
+ icon: (
+ <HugeiconsIcon
+ icon={RemoveCircleIcon}
+ strokeWidth={1.75}
+ className="size-icon"
+ />
+ ),
+ onSelect: () => onEject?.(checkpoint),
+ },
+ ]
+ : undefined
+ }
+ pin={
+ isLocal
+ ? undefined
+ : {
+ pinned: pinnedSet.has(pinKey(checkpoint, quant ?? undefined)),
+ pinLabel: "Pin",
+ unpinLabel: "Unpin",
+ onToggle: () => togglePinned(checkpoint, quant ?? undefined),
+ }
+ }
+ />
</span>
</div>
{expanded && (
diff --git a/studio/frontend/tests/loaded-gguf-quant-marker.test.ts b/studio/frontend/tests/loaded-gguf-quant-marker.test.ts
index 8b187188df5..fb6b8ac60a4 100644
--- a/studio/frontend/tests/loaded-gguf-quant-marker.test.ts
+++ b/studio/frontend/tests/loaded-gguf-quant-marker.test.ts
@@ -6,7 +6,9 @@ import test from "node:test";
import { readSrc } from "./helpers/kit.ts";
-const picker = readSrc("features/model-picker/components/model-selector/pickers.tsx");
+const picker = readSrc(
+ "features/model-picker/components/model-selector/pickers.tsx",
+);
test("every quant list and cached GGUF row marks the quant each loaded model runs", () => {
const expanders = picker.match(/<GgufVariantExpander\b/g)?.length ?? 0;
@@ -15,23 +17,63 @@ test("every quant list and cached GGUF row marks the quant each loaded model run
picker,
/loadedQuants\?\.some\(\(q\) => ggufVariantsMatchForPicker\(q, v\.quant\)\) \? \(\s*<span[^>]*>\s*loaded\s*<\/span>/,
);
- assert.match(picker, /loadedModels\s*\.filter\(\(m\) => m\.quant && modelIdsMatchForPicker\(m\.id, repoId\)\)/);
+ assert.match(
+ picker,
+ /loadedModels\s*\.filter\(\(m\) => m\.quant && modelIdsMatchForPicker\(m\.id, repoId\)\)/,
+ );
assert.match(
picker,
/if \(activeGgufVariant && modelIdsMatchForPicker\(loadedModelId, repoId\)\) \{\s*quants\.push\(activeGgufVariant\);/,
);
- assert.match(picker, /meta="GGUF"\s*quantChip=\{loadedQuants\.map\(ggufQuantChipLabel\)\.join\(", "\) \|\| undefined\}/);
+ assert.match(
+ picker,
+ /meta="GGUF"\s*quantChip=\{loadedQuants\.map\(ggufQuantChipLabel\)\.join\(", "\) \|\| undefined\}/,
+ );
});
test("a loaded row is selected, picked and ejected by its checkpoint, not its label", () => {
const runtime = readSrc("features/chat/hooks/use-chat-model-runtime.ts");
assert.match(runtime, /const checkpoint = checkpoints\?\.\[i\] \|\| id;/);
assert.match(runtime, /statusRes\.serving_checkpoints,\s*\);/);
- assert.match(runtime, /\.loadedModels\.map\(\(m\) => m\.checkpoint \?\? m\.id\)/);
- assert.match(picker, /const checkpoint = entry\.checkpoint \?\? entry\.id;\s*const optionKey = makeModelOptionKey\("loaded", checkpoint\);\s*const isSelected = modelIdsMatchForPicker\(value, checkpoint\);/);
- assert.match(runtime, /const known = new Map\(current\.map\(\(m\) => \[m\.checkpoint \?\? m\.id, m\]\)\);/);
- assert.match(picker, /onSelect\(checkpoint, \{/);
- assert.match(picker, /onEject\?\.\(checkpoint\);/);
+ assert.match(
+ runtime,
+ /\.loadedModels\.map\(\(m\) => m\.checkpoint \?\? m\.id\)/,
+ );
+ assert.match(
+ picker,
+ /const checkpoint = entry\.checkpoint \?\? entry\.id;\s*const optionKey = makeModelOptionKey\("loaded", checkpoint\);\s*const isSelected = modelIdsMatchForPicker\(value, checkpoint\);/,
+ );
+ assert.match(
+ runtime,
+ /const known = new Map\(current\.map\(\(m\) => \[m\.checkpoint \?\? m\.id, m\]\)\);/,
+ );
+ assert.match(picker, /onSelect\(checkpoint, selectMeta\)/);
+ assert.match(picker, /onSelect: \(\) => onEject\?\.\(checkpoint\),/);
+});
+
+test("settings opened from a loaded row use the same key as other entry points", () => {
+ // A cached HF snapshot by its repo id, still loading the snapshot.
+ assert.match(
+ picker,
+ /const snapshotRepoId = cachedRepoConfigId\(checkpoint, quant\);[\s\S]*?\[snapshotRepoId, \{ \.\.\.selectMeta, source: "hub", loadId: checkpoint \}\]/,
+ );
+ // A standalone .gguf by its bare path.
+ assert.match(
+ picker,
+ /isStandaloneGgufPath\(checkpoint\)\s*\?\s*\{ \.\.\.selectMeta, ggufVariant: undefined, isGguf: true \}\s*:\s*selectMeta/,
+ );
+ assert.match(picker, /onConfigure\(\.\.\.configureArgs\)/);
+});
+
+test("a loaded LoRA adapter keeps its classification in the row's metadata", () => {
+ assert.match(
+ picker,
+ /const isLoraAdapter =\s*adapter !== undefined &&\s*adapter\.source !== "local" &&\s*adapter\.exportType !== "merged" &&\s*adapter\.exportType !== "gguf";/,
+ );
+ assert.match(
+ picker,
+ /source: isLocal \? "local" : "hub",\s*isLora: isLoraAdapter,/,
+ );
});
test("an On Device GGUF row with several quants shows a right/down chevron its gutter toggles", () => {