Skip to content

Unsloth Studio: show which models have saved run settings and reset them from the model menu - #12608

Merged
LeoBorcherding merged 35 commits into
unslothai:mainfrom
LeoBorcherding:studio/run-settings-saved-indicator-and-reset
Nov 10, 2026
Merged

LeoBorcherding merged 35 commits into
unslothai:mainfrom
LeoBorcherding:studio/run-settings-saved-indicator-and-reset

Conversation

@LeoBorcherding

@LeoBorcherding LeoBorcherding commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Since #10216 you can save a model's run settings without loading it. Once you do that for a few models, they get hard to manage:

  • Nothing in the model list shows which models have saved settings, so you have to open each one to check.
  • There's no way to clear a model's saved settings without opening its panel.

What's new

  • Saved models keep their gear visible. A model with saved run settings keeps its row buttons on screen instead of showing them only on hover. Its gear's tooltip reads "Edit saved run settings".
  • Reset run settings in the ⋮ menu. This item only shows when the model has saved settings. One click clears them without opening the panel. If a saved Run preset is selected or pinned for the model, it goes back to Default, the same way main's server-side forget does. The toast ("Run settings reset for …, takes effect the next time it loads") offers Undo for 10 seconds, and Undo restores the settings and the preset.
  • Save state under the model name. The Run Settings panel shows main's existing save status in its header ("Saved for this model", "Unsaved changes", "Loads every time", "Using the default settings" and so on), so you can see it without scrolling to the footer. The footer button is renamed Reset all.
  • The new loaded-model row from main gets the same visible gear and the same row-menu reset.

Nothing new becomes editable. Every gear here already opens on main. This PR shows what's saved and lets you take it back.

Not changed

This PR doesn't change what gets saved, the storage format, or what's sent when the model loads. Reset goes through the same path as the existing Forget settings. If a model was saved again after you reset it, a later reset that started from older data won't wipe that newer save.

Before / after

Two isolated Unsloth Studio installs on a MacBook Pro M5 (macOS 26): the merge base with main 4089c57a82 (before) and this branch 73c60cd98a (after). Same seeded cache, two small GGUFs. On both sides gemma-3-270m-it-GGUF UD-Q4_K_XL has KV cache q8_0 and Parallel Slots 2 saved through the panel's own Save. SmolLM2-135M has nothing saved.

Model list, mouse away from every row. The saved model keeps its gear and ⋮ visible; the unsaved one doesn't. Its gear tooltip reads "Edit saved run settings".

Row ⋮ menu. "Reset run settings" appears only for a model with saved settings.

Run Settings panel. "Saved for this model" under the model name, and the footer button is now "Reset all".

After Reset run settings. The row's buttons go back to hover-only, and the toast keeps Undo for 10 seconds.

Tests

Measured at 73c60cd98a (main 4089c57a82 merged):

  • 69 frontend tests across remembered-run-settings, its legacy-snapshot test, override-forget-alias-order and recommended-curated-row-metadata. They cover the saved-settings lookup, reset + Undo (preset included), a newer save surviving a stale Undo, and forget ordering across aliases.
  • test_model_picker_contracts.py: 201 pass. The 2 failures (test_remembered_slots_are_read_through_the_cached_repo_alias, test_a_standalone_gguf_has_one_settings_identity_in_the_picker) fail the same way on main.
  • tsc clean, startup bundle within budget. The contract and Playwright tests look for Reset all by its exact name.
  • Codex is clean at this tree on the mirror (LeoBorcherding/unsloth#131).

Main reverted the custom llama.cpp INI page, which took VisionRow with it, so the Vision reset button moves onto the inline Vision row. The row menu keeps both main's eject items and the run settings reset.
…d, and a loaded model's panel that sees a reset

The per-field and row-menu reset use Undo02Icon instead of a hand-gesture glyph, and sit right after the label rather than past the hover-only hint. The header compares against the saved record, so a field put back reads as saved again. Resetting from the row menu clears the saved flags on a mounted editor's draft (the loaded model's editor stays mounted), and Undo sets them back. Auto speculative decoding counts as the default. The Undo toast stays 10 s.
@LeoBorcherding

LeoBorcherding commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator Author

Merged main (4034997), no conflicts and nothing in this PR's files changed. Since the last review: reset icon is now Undo02, the per-field arrows sit right after each label, the header compares against the saved record, resetting the loaded model from the row menu marks its open panel unsaved, and Speculative Decoding "Auto" counts as the default. Tests added for the last two.

…out resolving the global speculative mode

A saved Auto (null) and the "auto" a loaded model's status writes still match, but an explicit
mode no longer folds into Auto when it equals today's global, so the header says Unsaved changes.
… them

Local GGUF and checkpoint rows, Hub search rows, NPU rows and fine-tuned rows opened run settings
but never passed savedFor, so a model saved through them showed no dot and no menu reset.
@LeoBorcherding

Copy link
Copy Markdown
Collaborator Author

Pushed d0d5cfe. Codex converged on the review mirror, LeoBorcherding/unsloth#131: clean at 12a9642, and d0d5cfe only touches tests.

Changes in this push (4034997..d0d5cfe):

  • a60d11a: a run-settings draft is compared to its saved record without resolving the global speculative mode, so Auto and a saved unset value no longer read as a change.
  • 7b37f2e, c6ba313: every row whose gear opens run settings now shows the saved mark and the reset action. That covers Hub search, NPU, local GGUF and checkpoint rows, and adapters. A contract test checks every gear.
  • b6f8c97, 4bd5adc: an Undo clicked before Forget's server reply is no longer deleted when that reply arrives. The same goes for a save under the model's other name (Hub repo id vs snapshot path).
  • 9ad54e3, 65f6d7f: the same protection for a save made in another tab, identical re-saves included. Each save now gets a unique stamp in localStorage.
  • 9ad54e3: non-GGUF models (Max Seq Length, MLX and NPU Context Length) get the per-field reset. It clears a saved pin in either field.
  • 7de4580, 12a9642: the saved-settings read returns a stable snapshot before the first subscription, including the read that migrates legacy settings.
  • d0d5cfe: test typing fix for tsconfig.test.json.

Each fix has a test that fails before it and passes after. "Repo tests (CPU, studio)" fails 2 tests (test_the_lengths_these_contracts_measure_still_follow_the_ui_scale, test_every_copy_source_is_allowed_by_the_dockerignore). Both fail the same way on main 115777d.

@LeoBorcherding
LeoBorcherding marked this pull request as ready for review October 7, 2026 14:56
@danielhanchen danielhanchen self-assigned this Oct 8, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 8, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 8, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 8, 2026
@shimmyshimmer

Copy link
Copy Markdown
Member

Review record for #12608, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#531.

Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found.

Round 1: reviewed mirror 6583b02a1 (no equivalent commit found on this PR)

chatgpt-codex-connector[bot] on studio/frontend/src/features/model-picker/model-config/saved-run-settings.ts (on the mirror)

@@ -0,0 +1,192 @@
+// 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 { useSyncExternalStore } from "react";
+import { syncModelOverride } from "../api/model-overrides";
+import type { ModelPickTarget } from "../components/model-selector/types";
+import {
+  type ModelConfigDraftSnapshot,
+  isModelConfigDraftEdited,
+  modelConfigDraftKey,
+  readModelConfigDraft,
+  replaceModelConfigDraft,
+  setModelConfigDraftRemember,
+} from "./model-config-draft";
+import { modelStorageKey } from "./model-identity";
+import {
+  PER_MODEL_CONFIG_STORAGE_KEY,
+  PER_MODEL_CONFIG_UPDATED_EVENT,
+  type PerModelConfig,
+  deletePerModelConfig,
+  resolveInitialConfig,
+  savePerModelConfig,
+} from "./per-model-config";
+
+// Every picker row asks, so answers are cached until the next write rather than re-parsing the map per row.
+let savedByKey = new Map<string, PerModelConfig | null>();
+const listeners = new Set<() => void>();
+let detach: (() => void) | null = null;
+// What the cache was read from while unsubscribed, when only a re-read can notice a write.
+let cachedRaw: string | null | undefined;
+
+function invalidate(): void {
+  savedByKey = new Map();
+  cachedRaw = undefined;
+}
+
+function storedRaw(): string | null {
+  try {
+    return localStorage.getItem(PER_MODEL_CONFIG_STORAGE_KEY);
+  } catch {
+    return null;
+  }
+}
+
+function settingsKey(target: ModelPickTarget): [string, string | null] {
+  return [target.configId ?? target.id, target.ggufVariant ?? null];
+}
+
+/** The settings this row would load with, or null when nothing is saved for it. */
+export function savedRunSettings(
+  target: ModelPickTarget,
+): PerModelConfig | null {
+  const [id, variant] = settingsKey(target);
+  const key = modelStorageKey(id, variant);
+  // Cached either way, since useSyncExternalStore needs a stable snapshot before it subscribes.
+  if (!detach) {
+    const raw = storedRaw();
+    if (raw !== cachedRaw) {
+      invalidate();
+      cachedRaw = raw;
+    }
+  }
+  const cached = savedByKey.get(key);
+  if (cached !== undefined) {
+    return cached;
+  }
+  const resolved = resolveInitialConfig(id, variant);
+  const value = resolved.remembered ? resolved.config : null;
+  savedByKey.set(key, value);
+  if (!detach) {
+    // The first read can migrate legacy records into the store; that is not a new write.
+    cachedRaw = storedRaw();
+  }
+  return value;
+}
+
+function notify(): void {
+  invalidate();
+  for (const listener of [...listeners]) {
+    listener();
+  }
+}
+
+export function subscribeSavedRunSettings(onChange: () => void): () => void {
+  listeners.add(onChange);
+  if (!detach && typeof window?.addEventListener === "function") {
+    // Writes made while nobody listened never invalidated the cache; an unchanged store keeps
+    // the snapshot React already rendered, so subscribing doesn't force a second render.
+    if (storedRaw() !== cachedRaw) {
+      invalidate();
+    }
+    const onStorage = (event: StorageEvent) => {
+      if (event.key === null || event.key === PER_MODEL_CONFIG_STORAGE_KEY) {
+        notify();
+      }
+    };
+    window.addEventListener(PER_MODEL_CONFIG_UPDATED_EVENT, notify);
+    window.addEventListener("storage", onStorage);
+    detach = () => {
+      window.removeEventListener(PER_MODEL_CONFIG_UPDATED_EVENT, notify);
+      window.removeEventListener("storage", onStorage);
+    };
+  }
+  return () => {
+    listeners.delete(onChange);
+    if (listeners.size === 0 && detach) {
+      detach();
+      detach = null;
+      invalidate();
+    }
+  };
+}
+
+export function useSavedRunSettings(
+  target: ModelPickTarget | null,
+): PerModelConfig | null {
+  return useSyncExternalStore(
+    subscribeSavedRunSettings,
+    () => (target ? savedRunSettings(target) : null),
+    () => null,
+  );
+}
+
+export function useHasSavedRunSettings(
+  target: ModelPickTarget | null,
+): boolean {
+  return useSyncExternalStore(
+    subscribeSavedRunSettings,
+    () => (target ? savedRunSettings(target) !== null : false),
+    () => false,
+  );
+}
+
+// An editor opened after the reset seeded defaults; left alone, its next load forgets again.
+function restoreDraftAfterUndo(
+  draftKey: string,
+  atReset: ModelConfigDraftSnapshot | null,
+  snapshot: PerModelConfig,
+): void {
+  const draft = readModelConfigDraft(draftKey);
+  if (!draft || (atReset && !atReset.savedRemember)) {
+    return;
+  }
+  if (
+    !atReset &&
+    draft.appliedLiveSignature === "none" &&
+    !isModelConfigDraftEdited(draftKey)
+  ) {
+    replaceModelConfigDraft(draftKey, snapshot, {
+      remember: true,
+      savedRemember: true,
+    });
+    return;
+  }
+  setModelConfigDraftRemember(draftKey, true, true);
+}
+
+/** Drops a model's saved run settings here and on the server, like the panel's Forget. Returns an
+ *  undo that puts them back, or null when there was nothing to forget or the delete failed. */
+export function forgetRunSettings(
+  target: ModelPickTarget,
+): (() => boolean) | null {
+  const [id, variant] = settingsKey(target);
+  const resolved = resolveInitialConfig(id, variant);
+  if (!resolved.remembered) {
+    return null;
+  }
+  const snapshot = resolved.config;
+  if (!deletePerModelConfig(id, variant)) {
+    return null;
+  }
+  const mirrored = target.apiLoadable ?? target.isGguf;
+  if (mirrored) {
+    syncModelOverride(id, variant, null);
+  }
+  // The loaded model's editor stays mounted in the sidebar, so its draft would keep saying saved.
+  const draftKey = modelConfigDraftKey(id, variant);
+  const draft = readModelConfigDraft(draftKey);
+  if (draft?.savedRemember) {
+    setModelConfigDraftRemember(draftKey, false, false);
+  }
+  return () => {
+    if (!savePerModelConfig(id, variant, snapshot)) {

P2 Badge Mirror models evicted by Undo

If another save consumes the storage capacity freed by the reset before Undo is clicked, savePerModelConfig can return success while evicting an unrelated model. Unlike the normal persistence paths, this call supplies no eviction collector, so the evicted model's server override remains active even though its local record and saved-settings indicator disappear; collect the evictions and clear their mirrored overrides.

Useful? React with 👍 / 👎.

Rejected on the mirror

Reply from danielhanchen:

Needs another save to fill the storage budget inside the 10 s Undo window; not a realistic path for this change.

Round 2: reviewed mirror 06d857682 (no equivalent commit found on this PR)

chatgpt-codex-connector[bot] on studio/frontend/src/features/model-picker/components/model-config-page.tsx (on the mirror)

@@ -3139,6 +3240,28 @@ export function ModelConfigPage({
     });
 
   const rememberChanged = remember !== savedRemember;
+  // Against the saved record, not the edited flag: a field put back is no longer a change.
+  const storedRunSettings = useSavedRunSettings(target);
+  const savedNow = savedRemember && storedRunSettings != null;

P2 Badge Treat newly stored settings as saved

When this editor opens with no remembered record and another tab subsequently saves settings for the same model, useSavedRunSettings observes the new record but savedRemember remains the draft's original false. This conjunction therefore keeps savedNow false and reports "Using defaults" or "Not saved" even though the model now has persisted settings; derive the current saved state from storedRunSettings and use the draft flag only to determine whether the visible draft differs.

Useful? React with 👍 / 👎.

Rejected on the mirror

Reply from danielhanchen:

Needs a second tab saving the same model while this panel is open, and only the status line is stale; this tab's next save writes its own state anyway. Same-tab Undo already resyncs the draft.

chatgpt-codex-connector[bot] on studio/frontend/src/features/model-picker/model-config/saved-run-settings.ts (on the mirror)

@@ -0,0 +1,196 @@
+// 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 { useSyncExternalStore } from "react";
+import { syncModelOverride } from "../api/model-overrides";
+import type { ModelPickTarget } from "../components/model-selector/types";
+import {
+  type ModelConfigDraftSnapshot,
+  isModelConfigDraftEdited,
+  modelConfigDraftKey,
+  readModelConfigDraft,
+  replaceModelConfigDraft,
+  setModelConfigDraftRemember,
+} from "./model-config-draft";
+import { modelStorageKey } from "./model-identity";
+import {
+  PER_MODEL_CONFIG_STORAGE_KEY,
+  PER_MODEL_CONFIG_UPDATED_EVENT,
+  type PerModelConfig,
+  deletePerModelConfig,
+  resolveInitialConfig,
+  savePerModelConfig,
+} from "./per-model-config";
+
+// Every picker row asks, so answers are cached until the next write rather than re-parsing the map per row.
+let savedByKey = new Map<string, PerModelConfig | null>();
+const listeners = new Set<() => void>();
+let detach: (() => void) | null = null;
+// What the cache was read from while unsubscribed, when only a re-read can notice a write.
+let cachedRaw: string | null | undefined;
+
+function invalidate(): void {
+  savedByKey = new Map();
+  cachedRaw = undefined;
+}
+
+function storedRaw(): string | null {
+  try {
+    return localStorage.getItem(PER_MODEL_CONFIG_STORAGE_KEY);
+  } catch {
+    return null;
+  }
+}
+
+function settingsKey(target: ModelPickTarget): [string, string | null] {
+  return [target.configId ?? target.id, target.ggufVariant ?? null];
+}
+
+/** The settings this row would load with, or null when nothing is saved for it. */
+export function savedRunSettings(
+  target: ModelPickTarget,
+): PerModelConfig | null {
+  const [id, variant] = settingsKey(target);
+  const key = modelStorageKey(id, variant);
+  // Cached either way, since useSyncExternalStore needs a stable snapshot before it subscribes.
+  if (!detach) {
+    const raw = storedRaw();
+    if (raw !== cachedRaw) {
+      invalidate();
+      cachedRaw = raw;
+    }
+  }
+  const cached = savedByKey.get(key);
+  if (cached !== undefined) {
+    return cached;
+  }
+  const resolved = resolveInitialConfig(id, variant);
+  const value = resolved.remembered ? resolved.config : null;
+  savedByKey.set(key, value);
+  if (!detach) {
+    // The first read can migrate legacy records into the store; that is not a new write.
+    cachedRaw = storedRaw();
+  }
+  return value;
+}
+
+function notify(): void {
+  invalidate();
+  for (const listener of [...listeners]) {
+    listener();
+  }
+}
+
+export function subscribeSavedRunSettings(onChange: () => void): () => void {
+  listeners.add(onChange);
+  if (!detach && typeof window?.addEventListener === "function") {
+    // Writes made while nobody listened never invalidated the cache; an unchanged store keeps
+    // the snapshot React already rendered, so subscribing doesn't force a second render.
+    if (storedRaw() !== cachedRaw) {
+      invalidate();
+    }
+    const onStorage = (event: StorageEvent) => {
+      if (event.key === null || event.key === PER_MODEL_CONFIG_STORAGE_KEY) {
+        notify();
+      }
+    };
+    window.addEventListener(PER_MODEL_CONFIG_UPDATED_EVENT, notify);
+    window.addEventListener("storage", onStorage);
+    detach = () => {
+      window.removeEventListener(PER_MODEL_CONFIG_UPDATED_EVENT, notify);
+      window.removeEventListener("storage", onStorage);
+    };
+  }
+  return () => {
+    listeners.delete(onChange);
+    if (listeners.size === 0 && detach) {
+      detach();
+      detach = null;
+      invalidate();
+    }
+  };
+}
+
+export function useSavedRunSettings(
+  target: ModelPickTarget | null,
+): PerModelConfig | null {
+  return useSyncExternalStore(
+    subscribeSavedRunSettings,
+    () => (target ? savedRunSettings(target) : null),
+    () => null,
+  );
+}
+
+export function useHasSavedRunSettings(
+  target: ModelPickTarget | null,
+): boolean {
+  return useSyncExternalStore(
+    subscribeSavedRunSettings,
+    () => (target ? savedRunSettings(target) !== null : false),
+    () => false,
+  );
+}
+
+// An editor opened after the reset seeded defaults; left alone, its next load forgets again.
+function restoreDraftAfterUndo(
+  draftKey: string,
+  atReset: ModelConfigDraftSnapshot | null,
+  snapshot: PerModelConfig,
+): void {
+  const draft = readModelConfigDraft(draftKey);
+  if (!draft || (atReset && !atReset.savedRemember)) {
+    return;
+  }
+  if (
+    !atReset &&
+    draft.appliedLiveSignature === "none" &&
+    !isModelConfigDraftEdited(draftKey)
+  ) {
+    replaceModelConfigDraft(draftKey, snapshot, {
+      remember: true,
+      savedRemember: true,
+    });
+    return;
+  }
+  setModelConfigDraftRemember(draftKey, true, true);
+}
+
+/** Drops a model's saved run settings here and on the server, like the panel's Forget. Returns an
+ *  undo that puts them back, or null when there was nothing to forget or the delete failed. */
+export function forgetRunSettings(
+  target: ModelPickTarget,
+): (() => boolean) | null {
+  const [id, variant] = settingsKey(target);
+  const resolved = resolveInitialConfig(id, variant);
+  if (!resolved.remembered) {
+    return null;
+  }
+  const snapshot = resolved.config;
+  if (!deletePerModelConfig(id, variant)) {
+    return null;
+  }
+  const mirrored = target.apiLoadable ?? target.isGguf;
+  if (mirrored) {
+    syncModelOverride(id, variant, null);
+  }
+  // The loaded model's editor stays mounted in the sidebar, so its draft would keep saying saved.
+  const draftKey = modelConfigDraftKey(id, variant);
+  const draft = readModelConfigDraft(draftKey);
+  if (draft?.savedRemember) {
+    setModelConfigDraftRemember(draftKey, false, false);
+  }
+  return () => {
+    // A save since the reset (this tab or another) is newer than the snapshot.
+    if (
+      resolveInitialConfig(id, variant).remembered ||
+      !savePerModelConfig(id, variant, snapshot)
+    ) {
+      return false;
+    }
+    if (mirrored) {
+      syncModelOverride(id, variant, snapshot);

P2 Badge Serialize Undo after the pending forget request

When the user clicks Undo while the reset request is still in flight, this starts a second, concurrent PUT for the restored snapshot. If the restore reaches the backend lock first and the earlier DELETE runs afterward, the server finishes with no override even though local storage and the UI say the settings were restored; the sequence/stamp checks in syncModelOverride only protect local records from stale responses. Queue this restore behind completion of the corresponding forget, or add server-side sequencing so the Undo write is guaranteed to win.

Useful? React with 👍 / 👎.

Rejected on the mirror

Reply from danielhanchen:

Already serialized: putModelOverride chains every write for the same folded model key on writesByKey (model-overrides.ts putModelOverride), and the forget and the Undo use the same id and variant, so the Undo PUT is sent only after the forget settles.

chatgpt-codex-connector[bot] on studio/frontend/src/features/model-picker/api/model-overrides.ts (on the mirror)

@@ -632,9 +637,17 @@ export function syncModelOverride(
   config: PerModelConfig | null,
   options?: PutModelOverrideOptions,
 ): void {
+  const seq = ++syncSeq;
+  lastWriteSeq.set(foldOverrideKey(modelOverrideKey(modelId, ggufVariant)), seq);
+  // localStorage is shared, so this also catches a save from another tab meanwhile.
+  const sent = config === null ? perModelConfigSnapshot() : undefined;
   void putModelOverride(modelId, ggufVariant, config, options)
     .then(({ removedKeys }) => {
-      if (!deletePerModelConfigsForOverrideKeys(removedKeys)) {
+      // An undo, or a save under another alias, already rewrote what this forget reports.
+      const stale = removedKeys.filter(
+        (key) => (lastWriteSeq.get(foldOverrideKey(key)) ?? 0) <= seq,

P2 Badge Serialize forgets with writes under cached aliases

When a forget under a repository ID overlaps a newer save under its cached-path alias, putModelOverride places the requests in different per-key queues, so the backend may process the save first and then have the forget remove every alias. The sequence and snapshot checks here only preserve the newer local record; the server can still finish without its override, causing API auto-switch loads to use defaults. Unlike the previously discussed Undo case, the fresh evidence is this newly supported “save under another alias” path, whose identifiers do not share the same writesByKey key.

Useful? React with 👍 / 👎.

Rejected on the mirror

Reply from danielhanchen:

Needs a forget under the repo id and a save under its snapshot-path alias in flight in the same window; the server clearing every alias on a forget is main's existing behaviour, unchanged here.

chatgpt-codex-connector[bot] on studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx (on the mirror)

@@ -5976,21 +5981,22 @@ export function HubModelPicker({
         </div>
       );
     }
+    const configId = cachedIdFor(id) ?? id;
+    const configMeta: ModelSelectorChangeMeta = {
+      source: "hub",
+      isLora: false,
+      isGguf: false,
+      isDownloaded: cachedIdFor(id) !== null,
+      pipelineTag: pipelineTagById.get(id) ?? null,
+    };
     return (
       <div className={downloadedRowShellClassName(isValueRow(id))}>
         <div className="min-w-0 flex-1">{row}</div>
         <span className={ROW_ACTIONS_CLASS}>
           <ModelLoadSettingsAction
             ariaLabel={`Inference settings for ${id}`}
-            onConfigure={() =>
-              onConfigure(cachedIdFor(id) ?? id, {
-                source: "hub",
-                isLora: false,
-                isGguf: false,
-                isDownloaded: cachedIdFor(id) !== null,
-                pipelineTag: pipelineTagById.get(id) ?? null,
-              })
-            }
+            onConfigure={() => onConfigure(configId, configMeta)}
+            savedFor={modelConfigTarget(configId, configMeta)}
           />

P2 Badge Add the reset menu to gear-only model rows

For non-GGUF Hub search/recommended rows, settings can be saved before the model is downloaded, but this action span renders only the settings gear. The new saved dot therefore appears while no ModelRowMenu exists to expose “Reset run settings,” leaving these models resettable only by reopening the panel; the local-model result blocks repeat the same gear-only pattern. Render a menu with the same target when settings are saved.

Useful? React with 👍 / 👎.

Rejected on the mirror

Reply from danielhanchen:

Completeness, not a bug: those rows have no menu today, and their saved settings stay resettable from the panel. Out of scope for this change.

Round 3: reviewed mirror 9ecb7818a (no equivalent commit found on this PR)

chatgpt-codex-connector[bot] (on the mirror)

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 9ecb7818ae

No triage reaction was recorded on the mirror

Verdict

The round converged at mirror 9ecb7818a (no equivalent commit found on this PR).

This is the review as it stood at that commit. Anything pushed to this PR afterwards was not part of it.

danielhanchen added a commit to Imagineer99/unsloth that referenced this pull request Oct 8, 2026
LeoBorcherding added a commit to LeoBorcherding/unsloth that referenced this pull request Oct 24, 2026
…r-field reset

Main's named Run presets (v0.1.911) landed in the same model-picker files.
Main's saved-run-settings.ts and its test keep their paths; this PR's module
moves to remembered-run-settings.ts. The panel is main's, with the header
line now showing main's saveStatus and the footer button named Reset all.

- Saved gears are plain gears now: no dot. They still stay visible and
  their tooltip still says the settings are saved.
- Per-field reset is gone: setting-reset.ts, setting-reset-button.tsx,
  their test and the unsetIsAuto option only the old header used.
- The row menu reset also puts a selected or pinned preset back on Default,
  as main's server forget does, and Undo restores both.
- A stale server forget skips selections whose record was saved again.
- Main's new loaded-model row gets savedFor and the row menu reset too.
@LeoBorcherding

Copy link
Copy Markdown
Collaborator Author

Pushed 73c60cd98a, a clean merge of main at 4089c57a82 on top of a62b7f70fd. Codex is clean at this tree on the mirror (LeoBorcherding/unsloth#131). Typecheck clean, PR frontend tests 69/69, bundle within budget.

@LeoBorcherding LeoBorcherding changed the title Unsloth Studio: show which models have saved run settings and reset them per field or from the model menu Unsloth Studio: show which models have saved run settings and reset them from the model menu Oct 30, 2026
Main moved the downloaded, sole-quant GGUF and local on-device rows into
their own memo components; their gears and row menus now carry savedFor
and runSettings like the rest. The gear guard counts actions.configure
gears too.
A forget's cleanup in another tab that ran between the record write and
the stamp write saw an identical record under the old stamp and deleted
the re-save. The stamp now goes first and is put back if the record
write fails.
Saves write the stamp first, so the baseline snapshot reads stamps first
and the cleanup's re-read reads records first; an identical save landing
between either pair of reads now shows as a change.
The cleanup compared a snapshot taken before it listed owners and
deleted in a later read, so an identical save in between was lost. The
check now runs against the map the delete itself writes back.
Main gives every GGUF quant a settings gear, downloaded or not, through
one variantSelectMeta. The saved marker and Reset follow it onto every
quant row.
A GGUF quant that is not on disk has no row menu, so settings saved from
its gear had no Reset. SavedRunSettingsMenu shows one there once they are
saved, and holds the menu slot otherwise.
@LeoBorcherding

Copy link
Copy Markdown
Collaborator Author

Pushed 7a8791ac31, which merges main at 91be109608. Main had moved the on-device rows into their own components and given every GGUF quant a settings gear, downloaded or not. The saved marker and Reset follow both changes, including on a quant whose settings were saved before it was downloaded. This push also fixes three cross-tab ordering bugs where a forget's cleanup could delete an identical re-save from another tab; each fix comes with a test that fails without it.

Codex converged on the mirror (LeoBorcherding/unsloth#131): clean at 2cc35eec66, same tree as this head.

@LeoBorcherding

Copy link
Copy Markdown
Collaborator Author

Fork CI is clean on the mirror (LeoBorcherding/unsloth#131) at 2cc35ee, which has the same tree as this head 7a8791a: Frontend, Unsloth UI, Backend, Core, Lint, Wheel, Composer, studiobench parity.

@LeoBorcherding

Copy link
Copy Markdown
Collaborator Author

Before/after in Unsloth Studio, merge base 91be109 vs this head 7a8791a, on a Colab T4 (Linux). Same steps on both builds: open gemma-3-270m's gear, change two settings, Save. SmolLM2 is left unsaved as the control.

Picker: the saved model's gear and menu stay visible without hover; the unsaved row is unchanged.
picker

Row menu: gains Reset run settings.
menu

Run Settings panel: "Saved for this model" under the title, and the footer's Reset becomes Reset all.
panel

Reset: toast with Undo; the row goes back to hover-only (head only).
toast

@LeoBorcherding LeoBorcherding left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LeoBorcherding
LeoBorcherding merged commit 22812d8 into unslothai:main Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants