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 Run settings: restore saved settings on a fresh editor, show save state, group Advanced rows (#14589)

Michael Han7fd4988b115f
diff --git a/studio/frontend/scripts/check-bundle-budget.ts b/studio/frontend/scripts/check-bundle-budget.ts
index 109a718ba16..4ca083dfb6e 100644
--- a/studio/frontend/scripts/check-bundle-budget.ts
+++ b/studio/frontend/scripts/check-bundle-budget.ts
@@ -365,8 +365,10 @@ export const BUDGET = {
// Shortcut fixes (#14597): stop action, isModEnter, zoom guard and strings in the eager locales:
// +3,339 B raw / +1,727 B transfer (6,881,936 -> 6,885,275 B raw,
// 2,073,188 -> 2,074,915 B transfer against b2ba86a514, Node 26, 98 chunks). Raised by that.
- transferBytes: 2_075_036,
- rawBytes: 6_885_450,
+ // Run settings save state and Advanced groups (#14589) merged with main at 8bcbf837bd: 6,725.4 KB raw /
+ // 2,026.7 KB transfer (Node 24, 98 chunks). Raised to that plus about 200 B.
+ transferBytes: 2_075_550,
+ rawBytes: 6_887_000,
};
// 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/api/model-overrides.ts b/studio/frontend/src/features/model-picker/api/model-overrides.ts
index 205c18df66b..79fb5c01582 100644
--- a/studio/frontend/src/features/model-picker/api/model-overrides.ts
+++ b/studio/frontend/src/features/model-picker/api/model-overrides.ts
@@ -239,6 +239,19 @@ export async function fetchLoadModelOverride(
if (ggufVariant) {
query.set("gguf_variant", ggufVariant);
}
+ // After queued writes: a read racing Forget re-saved the old row.
+ await Promise.all(
+ [loadId, aliasId].map((id) =>
+ writesByKey
+ .get(
+ modelOverrideKey(
+ normalizeModelIdentity(id),
+ normalizeGgufVariantIdentity(ggufVariant),
+ ),
+ )
+ ?.catch(() => {}),
+ ),
+ );
const res = await authFetch(`${OVERRIDES_URL}?${query.toString()}`);
if (!res.ok) {
throw new Error(
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.tsx
index c94f32f37e4..49351de3509 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
@@ -195,6 +195,7 @@ import {
savedContextPin,
normalizeMaxSeqLength,
normalizePerModelConfig,
+ PER_MODEL_CONFIG_UPDATED_EVENT,
perModelConfigStorageChanged,
pinSpeculativeMode,
readAdvancedSettingsOpen,
@@ -1244,6 +1245,44 @@ function AdvancedSettingsToggle({
);
}
+function useStoredPerModelConfig(
+ configId: string,
+ ggufVariant: string | null | undefined,
+) {
+ const [version, setVersion] = useState(0);
+ useEffect(() => {
+ const bump = () => setVersion((v) => v + 1);
+ window.addEventListener(PER_MODEL_CONFIG_UPDATED_EVENT, bump);
+ window.addEventListener("storage", bump);
+ return () => {
+ window.removeEventListener(PER_MODEL_CONFIG_UPDATED_EVENT, bump);
+ window.removeEventListener("storage", bump);
+ };
+ }, []);
+ // biome-ignore lint/correctness/useExhaustiveDependencies: version is the storage write signal
+ return useMemo(
+ () => resolveInitialConfig(configId, ggufVariant),
+ [configId, ggufVariant, version],
+ );
+}
+
+function AdvancedGroup({
+ title,
+ children,
+}: {
+ title: string;
+ children: ReactNode;
+}) {
+ return (
+ <section aria-label={title} className="space-y-3 pt-2">
+ <h3 className="text-ui-10 font-semibold uppercase leading-none tracking-wider text-muted-foreground">
+ {title}
+ </h3>
+ <div className="space-y-5">{children}</div>
+ </section>
+ );
+}
+
const GGUF_PARALLEL_HINT =
"Decode slots (--parallel) for concurrent requests. Leave blank for the server " +
"default. More slots share the context pool and use more VRAM.";
@@ -1713,6 +1752,7 @@ function GgufAdvancedSettings({
config.nUbatch != null && config.nUbatch > effectiveBatch;
return (
<>
+ <AdvancedGroup title="Memory">
<div className={ROW_CLASS}>
<div className="flex min-w-0 items-center gap-1.5">
<span className={LABEL_CLASS}>KV Cache Dtype</span>
@@ -1748,6 +1788,38 @@ function GgufAdvancedSettings({
</Select>
</div>
+ <GpuMemorySettings
+ config={config}
+ update={update}
+ layerCount={layerCount}
+ moeLayerCount={moeLayerCount}
+ isDiffusion={isDiffusion}
+ gpuDevices={gpuDevices}
+ gpuLayersInputRef={gpuLayersInputRef}
+ moeLayersInputRef={moeLayersInputRef}
+ />
+
+ {!isDiffusion && (
+ <div className={ROW_CLASS}>
+ <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 that VRAM for more layers on the GPU. Text generation
+ is unaffected either way.
+ </InfoHint>
+ </div>
+ <Switch
+ className="panel-switch shrink-0"
+ aria-label="Vision"
+ checked={!config.disableVision}
+ onCheckedChange={(checked) => update({ disableVision: !checked })}
+ />
+ </div>
+ )}
+ </AdvancedGroup>
+
+ <AdvancedGroup title="Speed">
<div className={ROW_CLASS}>
<div className="flex min-w-0 items-center gap-1.5">
<span className={LABEL_CLASS_WRAP}>Speculative Decoding</span>
@@ -1980,47 +2052,32 @@ function GgufAdvancedSettings({
</div>
<Switch
className="panel-switch shrink-0"
+ aria-label="Tensor Parallelism"
checked={config.tensorParallel}
onCheckedChange={(checked) => update({ tensorParallel: checked })}
/>
</div>
)}
+ </AdvancedGroup>
- {/* withoutUnsupportedDiffusionSettings forces disableVision back to false on a diffusion model
- and the runner never reads it, so the switch would flip back under the pointer. */}
- {!isDiffusion && (
- <div className={ROW_CLASS}>
- <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 that VRAM for more layers on the GPU. Text generation
- is unaffected either way.
- </InfoHint>
- </div>
- <Switch
- className="panel-switch shrink-0"
- checked={!config.disableVision}
- onCheckedChange={(checked) => update({ disableVision: !checked })}
- />
- </div>
- )}
-
+ <AdvancedGroup title="Output">
{!isDiffusion && (
<div className={ROW_CLASS}>
<div className="flex min-w-0 items-center gap-1.5">
<span className={LABEL_CLASS}>Reasoning Budget</span>
<InfoHint>
- Maximum thinking tokens. -1 is unlimited and 0 turns reasoning
- off.
+ Maximum thinking tokens. Leave blank for unlimited; 0 turns
+ reasoning off.
</InfoHint>
</div>
+ {/* Blank, not -1: a literal -1 made the next digit typed read -15 and clamp back. */}
<input
type="number"
min={-1}
max={2_147_483_647}
step={1}
- value={config.reasoningBudget}
+ value={config.reasoningBudget === -1 ? "" : config.reasoningBudget}
+ placeholder="unlimited"
onChange={(event) => {
const raw = event.target.value;
if (raw === "") {
@@ -2067,23 +2124,12 @@ function GgufAdvancedSettings({
</div>
)}
- <GpuMemorySettings
- config={config}
- update={update}
- layerCount={layerCount}
- moeLayerCount={moeLayerCount}
- isDiffusion={isDiffusion}
- gpuDevices={gpuDevices}
- gpuLayersInputRef={gpuLayersInputRef}
- moeLayersInputRef={moeLayersInputRef}
- />
-
<ChatTemplateSetting config={config} onEditTemplate={onEditTemplate} />
+ </AdvancedGroup>
- {/* Host-side knobs, after the ones that shape the model itself. All three are llama-server's
- own, and the diffusion runner launches no llama-server, so they are hidden for it. */}
+ {/* llama-server-only knobs; the diffusion runner launches no llama-server. */}
{!isDiffusion && (
- <>
+ <AdvancedGroup title="Server">
<LoadModeRow config={config} update={update} />
<div className={ROW_CLASS}>
@@ -2161,18 +2207,15 @@ function GgufAdvancedSettings({
className={NUMBER_INPUT_CLASS}
/>
</div>
- </>
- )}
- {/* Last, because it is the escape hatch for everything the rows above do not cover, and
- llama.cpp's last-wins parsing means these really are appended after them. GGUF only. */}
- {!isDiffusion && (
- <ExtraArgsRow
- config={config}
- update={update}
- onLoadableChange={onExtraArgsLoadableChange}
- draftKey={draftKey}
- />
+ {/* Last: llama.cpp parsing is last-wins, and these are appended after the rows above. */}
+ <ExtraArgsRow
+ config={config}
+ update={update}
+ onLoadableChange={onExtraArgsLoadableChange}
+ draftKey={draftKey}
+ />
+ </AdvancedGroup>
)}
</>
);
@@ -2378,6 +2421,7 @@ export function ModelConfigPage({
focusField,
}: ModelConfigPageProps) {
const rememberId = useId();
+ const saveStatusId = useId();
const platformDeviceType = usePlatformStore((s) => s.deviceType);
// Apple Silicon specifically, and used ONLY for wording: "Unified" is what Apple calls its
// pool, where an AMD APU's is "Shared". NOT the signal for capacity - see hasUnifiedMemory.
@@ -2914,11 +2958,12 @@ export function ModelConfigPage({
// edit made while the request was in flight.
// The edited check is load-bearing: an edit the OTHER editor made before this read
// started is already in configAtStart, so the comparison below reads as untouched.
+ // By value: the primed draft is a new object, so identity refused every row on a fresh editor.
if (
resolvedRow &&
serverConfig &&
!isModelConfigDraftEdited(draftKey) &&
- configRef.current === configAtStart &&
+ perModelConfigsEqual(configRef.current, configAtStart) &&
rememberRef.current === rememberAtStart
) {
const storedConfig = resolveInitialConfig(
@@ -3107,12 +3152,7 @@ export function ModelConfigPage({
const baseline = resolvedIsDiffusion
? withoutUnsupportedDiffusionSettings(rawBaseline, gpuIndexKind)
: rawBaseline;
- const platform = usePlatformStore();
- const targetIsMlx = isServedByMlx(
- target.isGguf,
- platform.deviceType,
- platform.chatOnlyReason,
- );
+ const targetIsMlx = servedByMlx;
const pinsContextLength = targetIsMlx || targetIsNpu;
const atBaseline = perModelConfigsEqual(config, baseline, {
followGlobal: true,
@@ -3442,6 +3482,25 @@ export function ModelConfigPage({
});
const rememberChanged = remember !== savedRemember;
+ const storedRecord = useStoredPerModelConfig(configId, target.ggufVariant);
+ const matchesStored =
+ storedRecord.remembered &&
+ perModelConfigsEqual(
+ normalizePerModelConfig(storedSpeculativeAuto(runtimeConfig, targetIsMlx)),
+ storedRecord.config,
+ );
+ // Never mounted on demand: the click that saves would move Load.
+ const saveStatus = savedRemember
+ ? remember
+ ? matchesStored
+ ? "Saved for this model"
+ : "Unsaved changes"
+ : "Saved settings will be forgotten"
+ : remember
+ ? "Not saved yet"
+ : atDefault
+ ? "Using default settings"
+ : "Not remembered for this model";
const persistenceOnly = isActiveModel && atBaseline && rememberChanged;
const primaryActionLabel = persistenceOnly
? remember
@@ -3534,15 +3593,24 @@ export function ModelConfigPage({
// Judge what storage keeps: savePerModelConfig normalizes first, so the raw object over-reports.
const normalized = normalizePerModelConfig(storedSpeculativeAuto(next, targetIsMlx));
const evicted: { modelId: string; ggufVariant: string | null }[] = [];
+ // Only a Remember that was on can be forgotten: an unticked seeded/failed-read box deleted unseen rows.
+ const forgets = !remember && savedRemember;
const saved = remember
? savePerModelConfig(configId, target.ggufVariant, normalized, evicted)
- : deletePerModelConfig(configId, target.ggufVariant);
+ : forgets
+ ? deletePerModelConfig(configId, target.ggufVariant)
+ : true;
// Mirror to the server so an API load gets these settings, not app defaults. Best-effort, and
// skipped when the localStorage write failed or the two would permanently disagree. Gated on
// auto-switch reach, not GGUF-ness: the resolver skips a materialized Ollama link, and a
// native-path lease is the same.
// A forget also drops the local records for every other spelling the server reports clearing.
- if (saved && (target.apiLoadable ?? target.isGguf) && !nativePathToken) {
+ if (
+ saved &&
+ (remember || forgets) &&
+ (target.apiLoadable ?? target.isGguf) &&
+ !nativePathToken
+ ) {
syncModelOverride(
configId,
target.ggufVariant,
@@ -3905,9 +3973,11 @@ export function ModelConfigPage({
{/* Stacked in both variants: a row that wraps on demand reflows when the same click that
commits a draft mounts Save settings, moving Load out from under the cursor. */}
<div className="mt-5 flex flex-col gap-3.5 border-t border-border pt-5">
+ <div className="flex min-w-0 flex-col gap-1">
<div className="flex min-w-0 items-center gap-2">
<Checkbox
id={rememberId}
+ aria-describedby={saveStatusId}
checked={remember}
onCheckedChange={(checked) => {
// Not in setRemember, which the save path calls again to settle the box. An
@@ -3923,6 +3993,15 @@ export function ModelConfigPage({
Remember for this model
</label>
</div>
+ <p
+ id={saveStatusId}
+ aria-live="polite"
+ data-state={saveStatus === "Unsaved changes" ? "dirty" : undefined}
+ className="truncate pl-6 text-ui-11 leading-snug text-muted-foreground data-[state=dirty]:text-amber-600 dark:data-[state=dirty]:text-amber-400"
+ >
+ {saveStatus}
+ </p>
+ </div>
<div className="flex flex-wrap items-center gap-2">
{/* Primary action first, like the Preset row's Save/Delete. */}
<Button
diff --git a/studio/frontend/src/features/model-picker/components/sidebar-model-config.tsx b/studio/frontend/src/features/model-picker/components/sidebar-model-config.tsx
index 9f314d3b4f6..782d10fbf3f 100644
--- a/studio/frontend/src/features/model-picker/components/sidebar-model-config.tsx
+++ b/studio/frontend/src/features/model-picker/components/sidebar-model-config.tsx
@@ -1,7 +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 { useMemo } from "react";
+import { memo, useMemo } from "react";
import { modelConfigInstanceKey } from "../model-config/config-signature";
import { residentModelConfigTarget } from "../model-config/model-config-handoff";
import type { PerModelConfig } from "../model-config/per-model-config";
@@ -19,7 +19,8 @@ interface SidebarModelConfigProps {
onReload: (config: PerModelConfig) => void;
}
-export function SidebarModelConfig({
+// Memoized: the chat page re-renders it on every event, even with the panel collapsed.
+export const SidebarModelConfig = memo(function SidebarModelConfig({
modelId,
ggufVariant,
isGguf,
@@ -53,4 +54,4 @@ export function SidebarModelConfig({
isDiffusion={isDiffusion}
/>
);
-}
+});
diff --git a/studio/frontend/src/features/model-picker/hooks/use-active-model-config.ts b/studio/frontend/src/features/model-picker/hooks/use-active-model-config.ts
index cc43710e4e4..3b166a93919 100644
--- a/studio/frontend/src/features/model-picker/hooks/use-active-model-config.ts
+++ b/studio/frontend/src/features/model-picker/hooks/use-active-model-config.ts
@@ -87,11 +87,12 @@ export function useActiveModelConfig(): ActiveModelConfigState {
activeNativePathToken,
checkpoint,
});
- const platform = usePlatformStore();
+ const deviceType = usePlatformStore((s) => s.deviceType);
+ const chatOnlyReason = usePlatformStore((s) => s.chatOnlyReason);
const isMlx = residentIsServedByMlx(
isGguf,
- platform.deviceType,
- platform.chatOnlyReason,
+ deviceType,
+ chatOnlyReason,
loadedIsMlx,
);
diff --git a/studio/frontend/tests/llama-extra-args-panel-hydration.test.ts b/studio/frontend/tests/llama-extra-args-panel-hydration.test.ts
index cd5b639682c..e36d5c1ca4c 100644
--- a/studio/frontend/tests/llama-extra-args-panel-hydration.test.ts
+++ b/studio/frontend/tests/llama-extra-args-panel-hydration.test.ts
@@ -188,7 +188,11 @@ test("the panel adopts a shared server config without overwriting a live edit",
PANEL,
/savePerModelConfig\(\s*configId,\s*target\.ggufVariant,\s*storedSpeculativeAuto\(rememberedConfig, !target\.isGguf\),/,
);
- assert.match(PANEL, /configRef\.current === configAtStart/);
+ // By value: the primed draft is a different object from the first render's fallback.
+ assert.match(
+ PANEL,
+ /perModelConfigsEqual\(configRef\.current, configAtStart\)/,
+ );
assert.match(PANEL, /rememberRef\.current === rememberAtStart/);
// To the shared draft, so the adopted row reaches both hosts, not just the one that read it.
assert.match(
diff --git a/studio/frontend/tests/run-settings-save-state.test.ts b/studio/frontend/tests/run-settings-save-state.test.ts
new file mode 100644
index 00000000000..ea4f865a003
--- /dev/null
+++ b/studio/frontend/tests/run-settings-save-state.test.ts
@@ -0,0 +1,120 @@
+// 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 { readFileSync } from "node:fs";
+import path from "node:path";
+import test from "node:test";
+import { fileURLToPath } from "node:url";
+
+const HERE = path.dirname(fileURLToPath(import.meta.url));
+const CONFIG_PAGE = readFileSync(
+ path.join(
+ HERE,
+ "..",
+ "src/features/model-picker/components/model-config-page.tsx",
+ ),
+ "utf8",
+);
+
+function bodyOf(name: string): string {
+ const start = CONFIG_PAGE.indexOf(`function ${name}(`);
+ assert.notEqual(start, -1, `missing ${name}`);
+ const next = CONFIG_PAGE.indexOf("\nfunction ", start + 1);
+ return CONFIG_PAGE.slice(start, next === -1 ? undefined : next);
+}
+
+test("the save status covers every Remember state and is always rendered", () => {
+ for (const label of [
+ "Saved for this model",
+ "Unsaved changes",
+ "Saved settings will be forgotten",
+ "Not saved yet",
+ "Using default settings",
+ "Not remembered for this model",
+ ]) {
+ assert.ok(CONFIG_PAGE.includes(`"${label}"`), `missing status: ${label}`);
+ }
+ // Mounted on demand it would push Load down under the cursor on the click that saves.
+ assert.match(CONFIG_PAGE, /\{saveStatus\}/);
+ assert.doesNotMatch(CONFIG_PAGE, /saveStatus &&/);
+});
+
+test("the status compares what Save would store against the stored record", () => {
+ assert.match(
+ CONFIG_PAGE,
+ /normalizePerModelConfig\(storedSpeculativeAuto\(runtimeConfig, targetIsMlx\)\),\s*storedRecord\.config/,
+ );
+ assert.match(
+ CONFIG_PAGE,
+ /addEventListener\(PER_MODEL_CONFIG_UPDATED_EVENT, bump\)/,
+ );
+});
+
+test("an unticked Load forgets only a Remember that was on", () => {
+ const persist = CONFIG_PAGE.slice(
+ CONFIG_PAGE.indexOf("const persistConfig = "),
+ CONFIG_PAGE.indexOf("const finishPersist = "),
+ );
+ assert.match(persist, /const forgets = !remember && savedRemember;/);
+ assert.match(
+ persist,
+ /: forgets\s*\?\s*deletePerModelConfig\(configId, target\.ggufVariant\)\s*:\s*true;/,
+ );
+ assert.match(persist, /saved &&\s*\(remember \|\| forgets\) &&/);
+});
+
+test("a fresh editor adopts the server row when nothing changed in flight", () => {
+ // Identity check refused every row: fallback and primed draft are distinct objects.
+ assert.match(
+ CONFIG_PAGE,
+ /!isModelConfigDraftEdited\(draftKey\) &&\s*perModelConfigsEqual\(configRef\.current, configAtStart\) &&/,
+ );
+ assert.doesNotMatch(CONFIG_PAGE, /configRef\.current === configAtStart/);
+});
+
+test("Reasoning Budget shows unlimited as a blank box", () => {
+ assert.match(
+ CONFIG_PAGE,
+ /value=\{config\.reasoningBudget === -1 \? "" : config\.reasoningBudget\}/,
+ );
+});
+
+test("GGUF Advanced rows sit in titled groups, the llama-server ones hidden for diffusion", () => {
+ const gguf = bodyOf("GgufAdvancedSettings");
+ const order = ["Memory", "Speed", "Output", "Server"].map((title) =>
+ gguf.indexOf(`<AdvancedGroup title="${title}">`),
+ );
+ assert.ok(
+ order.every((at) => at !== -1),
+ "a group is missing",
+ );
+ assert.deepEqual(
+ [...order].sort((a, b) => a - b),
+ order,
+ );
+ const server = gguf.slice(order[3] - 40, order[3]);
+ assert.match(server, /!isDiffusion && \(\s*$/);
+ assert.ok(
+ gguf.indexOf("<ExtraArgsRow") > order[3],
+ "extra args left the Server group",
+ );
+});
+
+test("the overrides read waits for this model's queued writes", () => {
+ const overrides = readFileSync(
+ path.join(HERE, "..", "src/features/model-picker/api/model-overrides.ts"),
+ "utf8",
+ );
+ const fetchBody = overrides.slice(
+ overrides.indexOf("export async function fetchLoadModelOverride("),
+ overrides.indexOf("export async function fetchLoadExtraArgs("),
+ );
+ const waits = fetchBody.indexOf("writesByKey");
+ assert.notEqual(waits, -1, "the read no longer waits on writesByKey");
+ assert.ok(
+ waits < fetchBody.indexOf("authFetch("),
+ "the read starts before the writes settle",
+ );
+});
diff --git a/studio/frontend/tests/server-tuning-upgrade-downgrade-compat.test.ts b/studio/frontend/tests/server-tuning-upgrade-downgrade-compat.test.ts
index 37caaba342f..303057473f5 100644
--- a/studio/frontend/tests/server-tuning-upgrade-downgrade-compat.test.ts
+++ b/studio/frontend/tests/server-tuning-upgrade-downgrade-compat.test.ts
@@ -709,7 +709,7 @@ test("opening the panel ticks Remember for any model with a resolvable row", ()
// Load-bearing once the editors share a draft: an edit the OTHER one made before this
// read started is already in configAtStart, so the comparison below reads as untouched.
"!isModelConfigDraftEdited\\(draftKey\\) &&",
- "configRef\\.current === configAtStart &&",
+ "perModelConfigsEqual\\(configRef\\.current, configAtStart\\) &&",
"rememberRef\\.current === rememberAtStart",
"\\) \\{",
].join("\\s*\\n\\s*");
diff --git a/tests/studio/test_model_picker_contracts.py b/tests/studio/test_model_picker_contracts.py
index 1d7e237a163..0d734698fa1 100644
--- a/tests/studio/test_model_picker_contracts.py
+++ b/tests/studio/test_model_picker_contracts.py
@@ -1221,9 +1221,10 @@ def test_an_mlx_target_is_offered_a_context_length_not_a_sequence_length():
assert "update(contextPinPatch(value, pinsContextLength))" in page
# "Anything not GGUF" would relabel CUDA; the platform decides.
assert (
- "isServedByMlx(\n target.isGguf,\n platform.deviceType,\n platform.chatOnlyReason,\n )"
+ "isServedByMlx(\n target.isGguf,\n platformDeviceType,\n platformChatOnlyReason,\n )"
in page
)
+ assert "const targetIsMlx = servedByMlx;" in page
# Both props are optional, so dropping either still typechecks.
assert "isMlx={pinsContextLength}" in page
assert "windowUnknown={" in page
@@ -1422,7 +1423,8 @@ def test_the_run_settings_footer_does_not_reflow_under_the_pointer():
blur-committed draft mounted Save, so the click was never dispatched (#10216)."""
src = " ".join(_read("features/model-picker/components/model-config-page.tsx").split())
before = src.split("<Checkbox id={rememberId}", 1)[0]
- footer = before.rsplit("<div", 2)[1]
+ # Footer is the third <div back: the status line sits in the Remember column.
+ footer = before.rsplit("<div", 3)[1]
assert "flex-wrap" not in footer, footer[:200]
assert "variant ===" not in footer and "flex flex-col" in footer, footer[:200]
@@ -2550,8 +2552,8 @@ def test_only_gguf_configs_are_mirrored_to_the_server():
resolver indexes GGUFs only."""
src = " ".join(_read("features/model-picker/components/model-config-page.tsx").split())
assert (
- "if (saved && (target.apiLoadable ?? target.isGguf) && !nativePathToken) "
- "{ syncModelOverride(" in src
+ "if ( saved && (remember || forgets) && (target.apiLoadable ?? target.isGguf) && "
+ "!nativePathToken ) { syncModelOverride(" in src
)
assert "const saved = remember ? savePerModelConfig(" in src
@@ -2561,7 +2563,7 @@ def test_a_native_leased_gguf_is_not_mirrored_to_the_server():
/api/inference/status reports model_identifier as null for it, so the checkpoint the
browser keys settings by is the bare file name the backend echoes back."""
page = " ".join(_read("features/model-picker/components/model-config-page.tsx").split())
- assert "&& !nativePathToken) { syncModelOverride(" in page
+ assert "&& !nativePathToken ) { syncModelOverride(" in page
assert (
"const nativePathToken = target.meta.nativePathToken ?? "
"(isActiveModel ? activeNativePathToken : null);" in page