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.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: tidy the run settings panel (#11346)
Michael Han606d87e76220
diff --git a/studio/frontend/src/features/chat/chat-settings-sheet.tsx b/studio/frontend/src/features/chat/chat-settings-sheet.tsxindex 509cd724754..409d7f2734e 100644--- a/studio/frontend/src/features/chat/chat-settings-sheet.tsx+++ b/studio/frontend/src/features/chat/chat-settings-sheet.tsx@@ -216,7 +216,7 @@ export function ParamSlider({);}return (- <div className="space-y-3.5">+ <div className="space-y-2"><div className="flex min-h-8 items-center justify-between gap-3"><div className="flex min-w-0 items-center gap-1.5"><span className="min-w-0 text-ui-13 font-medium leading-[1.25] tracking-nav text-nav-fg">@@ -1125,7 +1125,7 @@ export function ChatSettingsPanel({<div className="px-[18px] pt-3">{(hasModelContent || modelConfig) && (<CollapsibleSection label="Model" defaultOpen={true} first={true}>- <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-5">{modelConfig}{showSpecFallback && (<div className="rounded-lg bg-amber-500/[0.08] px-3 py-2 text-ui-12 leading-[1.4] text-nav-fg/80">@@ -1197,7 +1197,7 @@ export function ChatSettingsPanel({defaultOpen={true}first={!hasModelContent && !modelConfig}>- <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-2"><DropdownMenu><DropdownMenuTrigger asChild={true}><div@@ -1278,7 +1278,8 @@ export function ChatSettingsPanel({))}</DropdownMenuContent></DropdownMenu>- <div className="grid grid-cols-2 gap-3">+ {/* Each pill is as wide as its label, not half the panel. */}+ <div className="flex flex-wrap items-center gap-2"><Buttontype="button"onClick={() => savePresetWithName(presetNameInput)}@@ -1288,7 +1289,7 @@ export function ChatSettingsPanel({}size="sm"className={cn(- "h-9 w-full rounded-full text-ui-13 font-medium tracking-nav",+ "h-9 w-auto px-4 rounded-full text-ui-13 font-medium tracking-nav",presetSaveState.isSaveReady &&"bg-primary text-primary-foreground hover:bg-primary/90",)}@@ -1303,7 +1304,7 @@ export function ChatSettingsPanel({disabled={!(settingsHydrated && activeCustomPreset)}variant="outline"size="sm"- className="h-9 w-full rounded-full text-ui-13 font-medium tracking-nav text-muted-foreground"+ className="h-9 w-auto px-4 rounded-full text-ui-13 font-medium tracking-nav text-muted-foreground"title={activeCustomPreset? activeBuiltinPreset@@ -1343,7 +1344,7 @@ export function ChatSettingsPanel({/></div>{showPromptCacheTtlControl && promptCachingEnabled ? (- <div className="flex min-h-8 items-center justify-between gap-3 pt-3.5">+ <div className="flex min-h-8 items-center justify-between gap-3 pt-5"><div className="flex min-w-0 items-center gap-1.5"><span className="min-w-0 text-ui-13 font-medium leading-[1.25] tracking-nav text-nav-fg">Cache TTL@@ -1367,7 +1368,10 @@ export function ChatSettingsPanel({}}><SelectTrigger- className="panel-select-trigger h-8 shrink-0"+ size="sm"+ icon={ChevronDownStandardIcon}+ iconClassName="size-3.5"+ className="panel-select-trigger shrink-0"aria-label="Prompt cache TTL"><SelectValue />@@ -1380,7 +1384,7 @@ export function ChatSettingsPanel({</div>) : null}{showFastModeControl ? (- <div className="flex min-h-8 items-center justify-between gap-3 pt-3.5">+ <div className="flex min-h-8 items-center justify-between gap-3 pt-5"><div className="flex min-w-0 items-center gap-1.5"><span className="min-w-0 text-ui-13 font-medium leading-[1.25] tracking-nav text-nav-fg">Fast mode@@ -1449,7 +1453,7 @@ export function ChatSettingsPanel({{/* Rounded wrapper clips overflowing text and the scrollbar. */}<divclassName={cn(- "panel-text-surface -mt-1 h-20 w-full overflow-hidden corner-squircle",+ "panel-text-surface h-20 w-full overflow-hidden corner-squircle",systemPromptOverflows && "cursor-pointer",)}>@@ -1516,9 +1520,9 @@ export function ChatSettingsPanel({/>) : null}{showMinP ? (- <div className="space-y-3">+ <div className="space-y-5">{isVllm ? (- <div className="space-y-2">+ <div className="space-y-1"><Selectvalue={effectiveMinPMode(params)}onValueChange={(value) => {@@ -1619,35 +1623,34 @@ export function ChatSettingsPanel({are batched and that moves the result.</InfoHint></div>- <InputGroup className="panel-input-group w-[8.5rem] shrink-0">- <InputGroupInput- id="inference-seed"- // A TEXT input: type="number" reports an unreadable entry as "", clearing the pin.- type="text"- inputMode="numeric"- autoComplete="off"- spellCheck={false}- value={- seedDraft ??- (params.seed == null ? "" : String(params.seed))- }- onChange={(e) =>- setSeedDraft(e.target.value.replace(/\D/g, ""))- }- onBlur={() => {- if (seedDraft === null) return;- setSeedDraft(null);- setSeed(committedSeed);- }}- onKeyDown={(e) => {- // Blur is the only commit, so Enter has to reach it.- if (e.key === "Enter") e.currentTarget.blur();- }}- placeholder="Random"- aria-label="Seed"- className="!h-9 min-h-0 min-w-0 self-stretch !px-3 py-0 text-ui-13 font-medium leading-9 text-nav-fg md:text-ui-13"- />- </InputGroup>+ {/* A plain field, sized like the model rows': the input group+ it used to sit in is 36px and full width. */}+ <input+ id="inference-seed"+ // A TEXT input: type="number" reports an unreadable entry as "", clearing the pin.+ type="text"+ inputMode="numeric"+ autoComplete="off"+ spellCheck={false}+ value={+ seedDraft ?? (params.seed == null ? "" : String(params.seed))+ }+ onChange={(e) =>+ setSeedDraft(e.target.value.replace(/\D/g, ""))+ }+ onBlur={() => {+ if (seedDraft === null) return;+ setSeedDraft(null);+ setSeed(committedSeed);+ }}+ onKeyDown={(e) => {+ // Blur is the only commit, so Enter has to reach it.+ if (e.key === "Enter") e.currentTarget.blur();+ }}+ placeholder="Random"+ aria-label="Seed"+ className="panel-field h-8 w-[84px] shrink-0"+ /></div>) : null}</div>@@ -1772,14 +1775,18 @@ export function ChatSettingsPanel({)}</div>) : null}- <Textarea- value={systemPromptDraft}- onChange={(event) => setSystemPromptDraft(event.target.value)}- placeholder="You are a helpful assistant..."- fieldSizing="fixed"- className="min-h-[20rem] max-h-[48dvh] overflow-y-auto border-0 text-sm leading-6 corner-squircle focus-visible:ring-0"- rows={14}- />+ {/* Squircle on the wrapper: Chrome leaves a scroll area's own+ corners square. */}+ <div className="corner-squircle overflow-hidden rounded-xl">+ <Textarea+ value={systemPromptDraft}+ onChange={(event) => setSystemPromptDraft(event.target.value)}+ placeholder="You are a helpful assistant..."+ fieldSizing="fixed"+ className="min-h-[20rem] max-h-[48dvh] overflow-y-auto rounded-none border-0 text-sm leading-6 focus-visible:ring-0"+ rows={14}+ />+ </div></div><DialogFooter className="flex-wrap gap-2 sm:justify-between"><Buttondiff --git a/studio/frontend/src/features/model-picker/components/chat-template-editor-dialog.tsx b/studio/frontend/src/features/model-picker/components/chat-template-editor-dialog.tsxindex 6448f6651b7..0ee31a08596 100644--- a/studio/frontend/src/features/model-picker/components/chat-template-editor-dialog.tsx+++ b/studio/frontend/src/features/model-picker/components/chat-template-editor-dialog.tsx@@ -117,19 +117,23 @@ export function ChatTemplateEditorDialog({: "Override the model's chat template with custom Jinja. The change applies when the model loads. Saving an empty template or one that matches the default clears the override."}</DialogDescription></DialogHeader>- <Textarea- value={renderedDraft}- onChange={(event) => {- if (readOnly) return;- setDraft(event.target.value);- setError(null);- }}- readOnly={readOnly}- className="min-h-[20rem] max-h-[50dvh] overflow-y-auto border-0 font-mono text-xs leading-5 corner-squircle focus-visible:ring-0"- rows={14}- spellCheck={false}- placeholder={defaultLoading ? "Loading model default..." : ""}- />+ {/* Chrome does not clip a scroll area to a squircle, which squared off+ the scrollbar's corners. The wrapper carries the shape instead. */}+ <div className="corner-squircle overflow-hidden rounded-xl">+ <Textarea+ value={renderedDraft}+ onChange={(event) => {+ if (readOnly) return;+ setDraft(event.target.value);+ setError(null);+ }}+ readOnly={readOnly}+ className="min-h-[20rem] max-h-[50dvh] overflow-y-auto rounded-none border-0 font-mono text-xs leading-5 focus-visible:ring-0"+ rows={14}+ spellCheck={false}+ placeholder={defaultLoading ? "Loading model default..." : ""}+ />+ </div>{readOnly ? null : (<div className="flex items-center justify-between gap-3 px-0.5 text-ui-11"><spandiff --git a/studio/frontend/src/features/model-picker/components/memory-estimate-row.tsx b/studio/frontend/src/features/model-picker/components/memory-estimate-row.tsxindex 327aa1d8078..cb099f19c07 100644--- a/studio/frontend/src/features/model-picker/components/memory-estimate-row.tsx+++ b/studio/frontend/src/features/model-picker/components/memory-estimate-row.tsx@@ -105,7 +105,7 @@ function MemoryFigure({ref={buttonRef}type="button"aria-label={`${label}: ${value}`}- className={`relative inline-flex h-8 w-auto min-w-[64px] max-w-full shrink-0 cursor-default! items-center justify-center overflow-hidden rounded-full border-transparent bg-black/[0.04] px-3.5 text-ui-13 font-medium leading-none tabular-nums focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 dark:bg-white/[0.05] ${tone ?? "text-nav-fg"}`}+ className={`relative inline-flex h-8 w-auto min-w-[64px] max-w-full shrink-0 cursor-default! items-center justify-center overflow-hidden rounded-full border-transparent bg-[var(--panel-input-surface)] px-3.5 text-ui-13 font-medium leading-none tabular-nums focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 ${tone ?? "text-nav-fg"}`}><span aria-hidden="true" className="min-w-0 truncate">{candidates[displayIndex] ?? value}@@ -230,7 +230,7 @@ export function MemoryEstimateRow({estimate.drafterRuntimeBytes,);return (- <div className="flex flex-col border-b border-border/60 pb-3.5">+ <div className="flex flex-col border-b border-border/60 pb-5"><buttontype="button"onClick={() => onExpandedChange(!expanded)}diff --git a/studio/frontend/src/features/model-picker/components/model-config-page.tsx b/studio/frontend/src/features/model-picker/components/model-config-page.tsxindex 747c57990a9..dba4f660c45 100644--- a/studio/frontend/src/features/model-picker/components/model-config-page.tsx+++ b/studio/frontend/src/features/model-picker/components/model-config-page.tsx@@ -185,22 +185,23 @@ const LABEL_CLASS ="min-w-0 truncate text-ui-13 font-medium leading-[1.25] tracking-nav text-nav-fg";const LABEL_CLASS_WRAP ="min-w-0 text-ui-13 font-medium leading-[1.25] tracking-nav text-nav-fg";+// Same surface token as the panel's fields and textareas.const CONTROL_SURFACE =- "rounded-full border-transparent bg-black/[0.04] dark:bg-white/[0.05] hover:bg-black/[0.06] dark:hover:bg-white/[0.1]";+ "rounded-full border-transparent bg-[var(--panel-input-surface)] hover:bg-[var(--panel-input-surface-hover)] dark:bg-[var(--panel-input-surface)] dark:hover:bg-[var(--panel-input-surface-hover)]";// One width for every typed field: a box that resized per keystroke would jump under the// caret. Narrow, so the label beside it is not clipped in a ~240px panel.const INPUT_WIDTH_CLASS = "w-[84px] shrink-0";// A select holds one of a known set of values, so it sizes to that value.const SELECT_WIDTH_CLASS = "w-auto max-w-full shrink-0";-// 14px each side optically. The chevron's stroke fills 14 of its 24 viewBox units, so its-// box carries ~3px of slack; pr-[11px] pays that back.-const SELECT_TRIGGER_CLASS = `grid h-8! min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2 ${SELECT_WIDTH_CLASS} ${CONTROL_SURFACE} pl-3.5 pr-[11px] py-0 text-ui-13! font-medium text-nav-fg focus-visible:ring-0 focus-visible:border-transparent [&_[data-slot=select-value]]:min-w-0 [&_[data-slot=select-value]]:truncate [&>svg]:shrink-0`;-// Left-aligned like every other value here. These fields share one width, so reading from-// the left puts their values on a single edge.-const NUMBER_INPUT_CLASS = `h-8 ${INPUT_WIDTH_CLASS} ${CONTROL_SURFACE} px-3.5 py-0 text-ui-13 font-medium text-nav-fg outline-none focus-visible:ring-0`;-const TEXT_INPUT_CLASS = `h-8 ${INPUT_WIDTH_CLASS} min-w-0 ${CONTROL_SURFACE} px-3.5 py-0 text-ui-13 font-medium text-nav-fg outline-none focus-visible:ring-0`;+// .panel-select-trigger carries the surface, padding and type; this adds the layout.+const SELECT_TRIGGER_CLASS = `panel-select-trigger grid h-8! min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2 ${SELECT_WIDTH_CLASS} [&_[data-slot=select-value]]:min-w-0 [&_[data-slot=select-value]]:truncate [&>svg]:shrink-0`;+// .panel-field carries the surface and the value's alignment; the field adds its size.+const NUMBER_INPUT_CLASS = `panel-field h-8 ${INPUT_WIDTH_CLASS}`;+const TEXT_INPUT_CLASS = `panel-field h-8 ${INPUT_WIDTH_CLASS} min-w-0`;// Matches the Preset section's Save/Delete pair rather than the Button's own `sm` metrics.-const FOOTER_BUTTON_CLASS = "h-9 rounded-full text-ui-13 font-medium tracking-nav";+// Width is the label plus this padding, so a pill is never wider than what it says.+const FOOTER_BUTTON_CLASS =+ "h-9 w-auto px-4 rounded-full text-ui-13 font-medium tracking-nav";// Mirrors the backend's Auto default once GPU-only placement is impossible.const AUTO_OFFLOAD_CONTEXT_LENGTH = 8192;@@ -387,8 +388,8 @@ function ChatTemplateSetting({<span className={LABEL_CLASS}>Chat Template</span><InfoHint>{readOnly- ? "Preview the model's chat template. This model's backend cannot take a custom one."- : "Override the model's chat template with custom Jinja. Applies when the model loads."}+ ? "Preview the model's chat template. This backend cannot take a custom one."+ : "Replace the model's chat template with custom Jinja. Applies on load."}</InfoHint></div><div className="flex shrink-0 items-center gap-2">@@ -434,15 +435,14 @@ function MaxSeqLengthSetting({// shows the length that will be served, not "Auto". A dash only while it is unknown.const label = isMlx ? "Context Length" : "Max Seq Length";return (- <div className="space-y-3">+ <div className="space-y-2"><div className={ROW_CLASS}><div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS}>{label}</span><InfoHint>{isMlx- ? "Tokens of context the model is sized for. Whether it also caps the " +- "cache depends on the architecture."- : "Maximum context window size in tokens. Applies when the model loads."}+ ? "Tokens of context the model is sized for."+ : "Maximum context window in tokens. Applies on load."}</InfoHint></div><NumericValueInput@@ -504,7 +504,7 @@ function AdvancedGpuSlider({disabled?: boolean;}) {return (- <div className="space-y-3">+ <div className="space-y-2"><div className={ROW_CLASS}><div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS}>{label}</span>@@ -824,8 +824,7 @@ function GpuMemorySettings({</div><div><span className="font-medium">Manual:</span> set GPU Layers- yourself. Leave it on Auto to let llama.cpp size the context and- offload overflow (including MoE experts) to RAM.+ yourself.</div></div></InfoHint>@@ -880,8 +879,7 @@ function GpuMemorySettings({info={<>Layers to keep on the GPU (--gpu-layers); the rest run on CPU.- Auto lets llama.cpp size the split (and the context) to fit- VRAM. At the maximum, the whole model is on the GPU.+ Auto sizes the split to fit VRAM.</>}/>@@ -896,8 +894,7 @@ function GpuMemorySettings({info={<>Keep the experts of this many MoE layers on the CPU- (--n-cpu-moe) to save VRAM. 0 = all experts on the GPU; at the- maximum, all are on the CPU.+ (--n-cpu-moe) to save VRAM. 0 keeps every expert on the GPU.</>}/>@@ -909,11 +906,11 @@ function GpuMemorySettings({<div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS}>GPUs</span><InfoHint>- By default, Unsloth chooses GPUs automatically. Editing this list- makes the checked GPUs the explicit candidate pool.+ Unsloth picks GPUs automatically. Checking them here limits it to+ those.{!isDiffusion &&- " Their order here is the order they are given to the model, so the first one takes the prompt."}{" "}- At least one GPU must stay selected.+ " Their order here is the order the model gets them."}{" "}+ Keep at least one selected.</InfoHint></div><div className="flex flex-col gap-2">@@ -979,7 +976,7 @@ function AdvancedSettingsToggle({}) {return (// Ruled off from the context controls above, matching the estimate row's divider.- <div className={`${ROW_CLASS} border-t border-border/60 pt-3.5`}>+ <div className={`${ROW_CLASS} border-t border-border/60 pt-5`}><div className="flex min-w-0 items-center gap-1.5"><span className="min-w-0 text-ui-13 font-medium leading-[1.25] tracking-nav text-muted-foreground">Advanced settings@@ -1018,16 +1015,16 @@ function MlxAdvancedSettings({templateOutcome: string | null;}) {return (- <div className="flex flex-col gap-1">+ // Same row spacing as the GGUF rows, whose fragment sits in the list above.+ <div className="flex flex-col gap-5">{servedByMlx && (- <>+ <div className="space-y-1"><div className={ROW_CLASS}><div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS}>KV Cache Dtype</span><InfoHint>- Lower KV cache precision to save memory at the cost of some- quality. Auto keeps full precision; 8-bit is the safest reduction,- and lower widths save more memory.+ Lower KV cache precision to save memory, at some cost to quality.+ Auto keeps full precision; 8-bit is the safest step down.</InfoHint></div><Select@@ -1055,22 +1052,20 @@ function MlxAdvancedSettings({</Select></div>{outcome ? (- <p className="text-ui-11 leading-snug text-muted-foreground">- {outcome}- </p>+ <p className="text-ui-11 text-muted-foreground">{outcome}</p>) : null}- </>+ </div>)}- <ChatTemplateSetting- config={config}- onEditTemplate={onEditTemplate}- readOnly={!servedByMlx}- />- {templateOutcome ? (- <p className="text-ui-11 leading-snug text-muted-foreground">- {templateOutcome}- </p>- ) : null}+ <div className="space-y-1">+ <ChatTemplateSetting+ config={config}+ onEditTemplate={onEditTemplate}+ readOnly={!servedByMlx}+ />+ {templateOutcome ? (+ <p className="text-ui-11 text-muted-foreground">{templateOutcome}</p>+ ) : null}+ </div></div>);}@@ -1111,14 +1106,10 @@ function LoadModeRow({<span className={LABEL_CLASS}>Mmap/Mlock</span><InfoHint>How the weights are read off disk (--load-mode). Auto is the- default: Unsloth picks None when it can prove the model fits without- paging, since a mapped read is slower, and otherwise leaves the- choice to llama.cpp, which memory-maps unless a device cannot. mmap- forces the mapping, mlock keeps the model in RAM rather than letting- it swap or compress, mmap+mlock does both, DirectIO streams the file- where the platform supports it, and None asks for no special mode.- Model Memory, in Settings, owns this when either of its toggles is- on.+ default and lets Unsloth pick. mmap maps the file, mlock keeps the+ model in RAM, DirectIO streams it, and None asks for no special+ mode.+ Model Memory, in Settings, overrides this when it is on.</InfoHint></div><Select@@ -1212,9 +1203,8 @@ function GgufAdvancedSettings({<div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS}>KV Cache Dtype</span><InfoHint>- Lower KV cache precision to save VRAM at the cost of some quality.- f16 is the default; bf16 and f32 are full precision; q8_0 through- iq4_nl are quantized.+ Lower KV cache precision to save VRAM, at some cost to quality. f16+ is the default; q8_0 through iq4_nl are quantized.</InfoHint></div><Select@@ -1249,12 +1239,9 @@ function GgufAdvancedSettings({<span className={LABEL_CLASS_WRAP}>Speculative Decoding</span><InfoHint>Faster generation. Auto picks the best strategy for the model and- platform: DSpark or DFlash when the model ships a drafter sidecar,- otherwise MTP / ngram. Pick a strategy to force it, or Off to- disable. DSpark downloads a sidecar of about 11 GB and DFlash one of- about 1.5 GB, both trading VRAM for speed; on quantized targets- their greedy output can differ from a non speculative run. MTP and- ngram do not change output.+ platform, or choose one to force it. DSpark and DFlash download a+ drafter sidecar (about 11 GB and 1.5 GB) and trade VRAM for speed;+ MTP and ngram do not change output.</InfoHint></div><Select@@ -1296,8 +1283,8 @@ function GgufAdvancedSettings({<div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS}>Draft Tokens</span><InfoHint>- Max draft tokens per step. Leave blank for the default (MTP and- DFlash: 2 on GPU, 3 on CPU/Mac; DSpark: 3).+ Max draft tokens per step. Leave blank for the default (2 or 3,+ depending on the strategy and device).</InfoHint></div><input@@ -1329,12 +1316,9 @@ function GgufAdvancedSettings({<div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS_WRAP}>Spec Decoding KV Cache Dtype</span><InfoHint>- KV cache precision for the draft model's own context- (--spec-draft-type-k / --spec-draft-type-v). Separate from the KV- Cache Dtype above, which is the target model's. f16 is the- default; bf16 and f32 are full precision; q8_0 through iq4_nl are- quantized, and a quantized draft cache saves VRAM on a drafter- whose output is verified by the target anyway.+ KV cache precision for the draft model's own context, separate+ from the KV Cache Dtype above. f16 is the default; quantizing it+ saves VRAM on a drafter the target verifies anyway.</InfoHint></div><Select@@ -1371,10 +1355,9 @@ function GgufAdvancedSettings({<div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS}>Parallel Slots</span><InfoHint>- llama-server decode slots (--parallel) for concurrent requests.- Leave blank for the server default. More slots share the context- pool and use more VRAM; if they don't fit on GPU, fewer slots are- launched.+ Decode slots (--parallel) for concurrent requests. Leave blank for+ the server default. More slots share the context pool and use more+ VRAM.</InfoHint></div><input@@ -1412,8 +1395,7 @@ function GgufAdvancedSettings({<span className={LABEL_CLASS}>Batch Size</span><InfoHint>Logical prompt batch size (--batch-size). Leave blank for the- llama.cpp default (2048). Rarely needs changing; the micro-batch- below is what usually matters.+ default (2048). The micro-batch below usually matters more.</InfoHint></div><input@@ -1458,11 +1440,10 @@ function GgufAdvancedSettings({<div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS}>Micro-batch Size</span><InfoHint>- Physical prompt micro-batch size (--ubatch-size). Leave blank for- the llama.cpp default (512), raised to 1120 on Gemma 4 vision- models, whose images do not fit in 512. Other vision models keep- the 512 default. Larger values speed up prompt processing but use- more VRAM for the compute buffer; capped at the batch size.+ Physical prompt micro-batch size (--ubatch-size). Leave blank+ for the default (512, or 1120 on Gemma 4 vision models). Larger+ values speed up prompt processing but use more VRAM; capped at+ the batch size.</InfoHint></div><input@@ -1506,8 +1487,8 @@ function GgufAdvancedSettings({<div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS}>Tensor Parallelism</span><InfoHint>- No effect on a single GPU. On multi-GPU setups, improves tokens/sec- for dense models. MoE models don't benefit.+ Speeds up dense models across multiple GPUs. No effect on a single+ GPU, and MoE models don't benefit.</InfoHint></div><Switch@@ -1525,11 +1506,9 @@ function GgufAdvancedSettings({<div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS}>Vision</span><InfoHint>- Loads the vision projector so the model can read images. Turning it- off frees the VRAM the projector would use, which can leave room for- more layers on the GPU. Text generation is unaffected either way.- Models that ship no projector have nothing to load, so the setting- does nothing for them.+ Loads the vision projector so the model can read images. Turning+ it off frees that VRAM for more layers on the GPU. Text generation+ is unaffected either way.</InfoHint></div><Switch@@ -1545,8 +1524,8 @@ function GgufAdvancedSettings({<div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS}>Reasoning Budget</span><InfoHint>- Maximum thinking tokens. -1 is unrestricted, 0 ends reasoning- immediately, and a positive value sets a token budget.+ Maximum thinking tokens. -1 is unlimited and 0 turns reasoning+ off.</InfoHint></div><input@@ -1582,8 +1561,8 @@ function GgufAdvancedSettings({<div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS_WRAP}>Reasoning Budget Message</span><InfoHint>- Optional text injected before the end-of-thinking tag when the- model reaches its reasoning budget.+ Optional text added before the end-of-thinking tag when the budget+ runs out.</InfoHint></div><input@@ -1624,12 +1603,10 @@ function GgufAdvancedSettings({<div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS}>Checkpoints</span><InfoHint>- Context checkpoints kept per slot (--ctx-checkpoints), which let- a sliding-window model rewind instead of re-processing the- prompt. Leave blank for the llama.cpp default (- {CTX_CHECKPOINTS_LLAMA_DEFAULT}); 0 disables them. Each one costs- host memory, and models without a sliding window ignore the- setting.+ Checkpoints kept per slot (--ctx-checkpoints), which let a+ sliding-window model rewind instead of re-processing the prompt.+ Leave blank for the default ({CTX_CHECKPOINTS_LLAMA_DEFAULT}); 0+ disables them. Each one costs host memory.</InfoHint></div><input@@ -1664,11 +1641,10 @@ function GgufAdvancedSettings({<div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS}>Cache RAM</span><InfoHint>- Host memory in MiB llama-server may spend caching prompt state it- has evicted from a slot (--cache-ram), so a returning- conversation is not re-processed. Leave blank for the llama.cpp- default ({CACHE_RAM_LLAMA_DEFAULT}); 0 disables the cache and -1- lifts the limit.+ Host memory in MiB for caching prompt state evicted from a slot+ (--cache-ram), so a returning conversation is not re-processed.+ Leave blank for the default ({CACHE_RAM_LLAMA_DEFAULT}); 0+ disables it and -1 lifts the limit.</InfoHint></div><input@@ -1832,14 +1808,13 @@ function ExtraArgsRow({<InfoHint><div className="flex flex-col gap-1.5"><div>- Passed straight to llama-server for this model, after the settings- above, so anything set in both is taken from here.+ Passed straight to llama-server after the settings above, so+ anything set in both is taken from here.</div><div>- Quote a value containing spaces or backslashes, including a- Windows path. Nothing runs a shell, so $HOME, ; and | are ordinary- characters. Flags Unsloth owns, like the model, the port and the- API key, are refused.+ Quote values with spaces or backslashes. Nothing runs a shell, so+ $HOME, ; and | are ordinary characters. Flags Unsloth owns, like+ the model and the port, are refused.</div></div></InfoHint>@@ -3125,7 +3100,7 @@ export function ModelConfigPage({{variant === "page" && showHeader && (// -ml-1.5 cancels the icon's inset in its 28px circle, so the chevron starts on// the same left edge as the rows below.- <div className="flex items-center gap-2.5 pb-4">+ <div className="flex items-center gap-2.5 pb-5">{onBack && (<buttontype="button"@@ -3150,7 +3125,7 @@ export function ModelConfigPage({</div>)}- <div className="space-y-3.5">+ <div className="space-y-5">{target.isGguf && (<>{/* Above Context Length on purpose: that is the control moving this number most, and a readout@@ -3175,15 +3150,14 @@ export function ModelConfigPage({expanded={memoryBreakdownOpen}onExpandedChange={setMemoryBreakdownOpen}/>- <div className="space-y-3">+ <div className="space-y-2"><div className={ROW_CLASS}><div className="flex min-w-0 items-center gap-1.5"><span className={LABEL_CLASS}>Context Length</span><InfoHint>- Drag all the way left for Auto, which chooses a context that- fits while prioritizing GPU speed. Custom values request an- exact context; higher values use more memory and may move- model layers to system RAM.+ Drag all the way left for Auto, which picks a context that+ fits while keeping GPU speed. Custom values request an exact+ context; higher ones use more memory.{contextIsAuto && activeLoadedContext != null? ` Auto currently selected ${activeLoadedContext.toLocaleString()} tokens.`: ""}@@ -3209,7 +3183,7 @@ export function ModelConfigPage({{/* Grouped so the warning sits 4px under the slider, as advice does elsewhere. */}<div className="space-y-1">{nativeContextLength != null ? (- <div className="space-y-1.5">+ <div className="space-y-1"><Slidermin={0}max={maxContext}@@ -3319,8 +3293,8 @@ export function ModelConfigPage({<divclassName={variant === "sidebar"- ? "mt-4 flex flex-col gap-3 border-t border-border/60 pt-4"- : "mt-4 flex items-center justify-between gap-3 border-t border-border/60 pt-4"+ ? "mt-5 flex flex-col gap-2 border-t border-border/60 pt-5"+ : "mt-5 flex items-center justify-between gap-3 border-t border-border/60 pt-5"}><div className="flex min-w-0 items-center gap-2">@@ -3344,15 +3318,35 @@ export function ModelConfigPage({<divclassName={variant === "sidebar"- ? "grid grid-cols-2 gap-3"+ ? "flex flex-wrap items-center gap-2": "flex shrink-0 items-center gap-2"}>+ {/* Primary action first, like the Preset row's Save/Delete. */}+ <Button+ type="button"+ size="sm"+ className={FOOTER_BUTTON_CLASS}+ disabled={+ stagedMetadataPending ||+ budgetSettling ||+ (!extraArgsLoadable && !sharedExtraArgsCleared) ||+ sharedExtraArgsRefused ||+ extraArgsHydrating ||+ (isActiveModel &&+ atBaseline &&+ !rememberChanged &&+ !budgetReloadRequired)+ }+ onClick={handleRun}+ >+ {primaryActionLabel}+ </Button><Buttontype="button"variant="outline"size="sm"- className={`${FOOTER_BUTTON_CLASS} text-muted-foreground${variant === "sidebar" ? " w-full" : ""}`}+ className={`${FOOTER_BUTTON_CLASS} text-muted-foreground`}disabled={atDefault}onClick={() => {// Reset writes through setConfig, not update, so it marks the draft itself.@@ -3370,25 +3364,6 @@ export function ModelConfigPage({>Reset</Button>- <Button- type="button"- size="sm"- className={`${FOOTER_BUTTON_CLASS}${variant === "sidebar" ? " w-full" : ""}`}- disabled={- stagedMetadataPending ||- budgetSettling ||- (!extraArgsLoadable && !sharedExtraArgsCleared) ||- sharedExtraArgsRefused ||- extraArgsHydrating ||- (isActiveModel &&- atBaseline &&- !rememberChanged &&- !budgetReloadRequired)- }- onClick={handleRun}- >- {primaryActionLabel}- </Button></div></div>diff --git a/studio/frontend/src/features/rag/components/retrieval-settings-section.tsx b/studio/frontend/src/features/rag/components/retrieval-settings-section.tsxindex 99b67cc57b9..3c31fbf672a 100644--- a/studio/frontend/src/features/rag/components/retrieval-settings-section.tsx+++ b/studio/frontend/src/features/rag/components/retrieval-settings-section.tsx@@ -1,6 +1,7 @@// 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 { InfoHint } from "@/components/ui/info-hint";import {Select,SelectContent,@@ -11,19 +12,13 @@ import {import { Slider } from "@/components/ui/slider";import { Switch } from "@/components/ui/switch";import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";-import {- Tooltip,- TooltipContent,- TooltipTrigger,-} from "@/components/ui/tooltip";import {type RagAutoInject,type RagMode,useChatRuntimeStore,} from "@/features/chat/stores/chat-runtime-store";+import { ChevronDownStandardIcon } from "@/lib/chevron-icons";import { cn } from "@/lib/utils";-import { InfoIcon } from "lucide-react";-import type { ReactNode } from "react";const MODE_LABEL: Record<RagMode, string> = {hybrid: "Hybrid",@@ -31,23 +26,6 @@ const MODE_LABEL: Record<RagMode, string> = {lexical: "BM25 only",};-function InfoHint({ children }: { children: ReactNode }) {- return (- <Tooltip>- <TooltipTrigger asChild={true}>- <button- type="button"- aria-label="More info"- className="text-muted-foreground/50 hover:text-muted-foreground"- >- <InfoIcon className="size-3.5" />- </button>- </TooltipTrigger>- <TooltipContent className="max-w-xs">{children}</TooltipContent>- </Tooltip>- );-}-function SliderRow({label,value,@@ -74,7 +52,7 @@ function SliderRow({disabled && "pointer-events-none opacity-50",)}>- <div className="flex items-center justify-between">+ <div className="flex min-h-8 items-center justify-between"><span className="text-ui-13 font-medium leading-[1.25] tracking-nav text-nav-fg">{label}</span>@@ -128,7 +106,9 @@ export function RetrievalSettingsSection() {onValueChange={(value) => setRagMode(value as RagMode)}><SelectTrigger- className="panel-select-trigger h-8 w-full"+ icon={ChevronDownStandardIcon}+ iconClassName="size-3.5"+ className="panel-select-trigger w-full"aria-label="Search mode"><SelectValue />@@ -142,7 +122,7 @@ export function RetrievalSettingsSection() {</div><div className="flex flex-col gap-2">- <div className="flex items-center justify-between">+ <div className="flex min-h-8 items-center justify-between"><span className="text-ui-13 font-medium leading-[1.25] tracking-nav text-nav-fg">Passages (top K)</span>@@ -161,7 +141,7 @@ export function RetrievalSettingsSection() {/></div>- <div className="flex flex-col gap-3">+ <div className="flex flex-col gap-2"><div className="flex flex-col"><span className="flex items-center gap-1.5 text-ui-13 font-medium leading-[1.25] tracking-nav text-nav-fg">Auto-retrieve documents@@ -229,7 +209,7 @@ export function RetrievalSettingsSection() {checked={ragOcrScanned}onCheckedChange={setRagOcrScanned}aria-label="OCR scanned pages"- className="mt-0.5"+ className="panel-switch mt-0.5"/></div>@@ -251,7 +231,7 @@ export function RetrievalSettingsSection() {checked={ragCaptionFigures}onCheckedChange={setRagCaptionFigures}aria-label="Describe figures and charts"- className="mt-0.5"+ className="panel-switch mt-0.5"/></div></div>diff --git a/studio/frontend/src/index.css b/studio/frontend/src/index.cssindex c3fed506d71..7d56e136cf7 100644--- a/studio/frontend/src/index.css+++ b/studio/frontend/src/index.css@@ -1473,13 +1473,41 @@ html[data-chat-font] .aui-root {fade-in, just enough to read as interactive without competingwith the slider row's quiet aesthetic. *//* Wider right gutter: the value is right-aligned on the panel's own edge. */+ /* 32px like every other inline control on the panel. */.panel-number-input {- @apply h-7 min-w-8 shrink-0 rounded-full border-0 bg-transparent pl-2 pr-3 text-right text-ui-13! font-medium tabular-nums text-nav-fg shadow-none transition-colors hover:bg-black/[0.04] focus:bg-black/[0.05] focus-visible:ring-0! focus-visible:outline-none md:text-ui-13!;+ @apply h-8 min-w-8 shrink-0 rounded-full border-0 bg-transparent pl-2 pr-3 text-right text-ui-13! font-medium tabular-nums text-nav-fg shadow-none transition-colors hover:bg-black/[0.04] focus:bg-black/[0.05] focus-visible:ring-0! focus-visible:outline-none md:text-ui-13!;}.dark .panel-number-input {@apply hover:bg-white/[0.04] focus:bg-white/[0.06];}+ /* Select trigger on the panel: the surface and padding the model rows+ use. Height and width stay with the caller, since an inline select+ is 32px and a full-width one 36px. */+ /* Inline field on the panel: the filled box a row's value is typed+ into. These share one width, so a left-aligned value puts them all+ on a single edge. Width and height stay with the caller. */+ .panel-field {+ @apply rounded-full border-transparent bg-[var(--panel-input-surface)] px-3.5 py-0 text-left text-ui-13 font-medium text-nav-fg outline-none hover:bg-[var(--panel-input-surface-hover)] focus-visible:ring-0;+ }++ /* Important like .panel-input-group: these all override a base+ SelectTrigger class of the same weight. 14px each side optically:+ the chevron's stroke fills 14 of its 24 viewBox units, so its box+ carries ~3px of slack and pr-[11px] pays that back. */+ .panel-select-trigger {+ @apply rounded-full! border-transparent! bg-[var(--panel-input-surface)]! py-0! pl-3.5! pr-[11px]! text-ui-13! font-medium! text-nav-fg shadow-none! hover:bg-[var(--panel-input-surface-hover)]! focus-visible:ring-0!;+ }++ /* These controls suppress the ring, so keyboard focus would otherwise+ land with nothing drawn. Same soft 1px halo as .composer-pill-btn. */+ .panel-field:focus-visible,+ .panel-select-trigger:focus-visible,+ .panel-number-input:focus-visible {+ outline: none;+ box-shadow: 0 0 0 1px var(--ring-soft) !important;+ }+/* Switch — unsloth-green track when active, slider-gray thumb inboth states. Keeps the on-state recognizable as an "engaged"primary control while the moving thumb sits in the same neutraldiff --git a/studio/frontend/tests/gpu-order.test.ts b/studio/frontend/tests/gpu-order.test.tsindex 1539c5e66c6..813338902e1 100644--- a/studio/frontend/tests/gpu-order.test.ts+++ b/studio/frontend/tests/gpu-order.test.ts@@ -83,7 +83,7 @@ test("the ordering controls and their promise are withheld for diffusion", () =>);assert.match(src,- /!isDiffusion &&\s*" Their order here is the order they are given to the model/,+ /!isDiffusion &&\s*" Their order here is the order the model gets them/,"the help text must not promise ordering for a diffusion model",);});