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: ship the loaded models indicator off by default (#8346)
Michael Han48f010df5f7d
diff --git a/studio/frontend/src/features/loaded-models/show-loaded-models-pref.ts b/studio/frontend/src/features/loaded-models/show-loaded-models-pref.tsindex 91955daa934..44f5255c982 100644--- a/studio/frontend/src/features/loaded-models/show-loaded-models-pref.ts+++ b/studio/frontend/src/features/loaded-models/show-loaded-models-pref.ts@@ -1,9 +1,10 @@// SPDX-License-Identifier: AGPL-3.0-only// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0-// Whether the corner indicator may appear. On by default; only an explicit-// "false" (Settings -> General -> Notifications) disables it. Same shape as the-// llama.cpp update banner pref.+// Whether the corner indicator may appear. Off by default; only an explicit+// "true" (Settings -> General -> Notifications) enables it. An older explicit+// "false" still reads as off, so anyone who already turned it down stays that+// way. Tri-state on purpose: see setShowLoadedModels.import { useSyncExternalStore } from "react";@@ -29,20 +30,19 @@ function notify(): void {export function getShowLoadedModels(): boolean {try {- return localStorage.getItem(STORAGE_KEY) !== "false";+ return localStorage.getItem(STORAGE_KEY) === "true";} catch {- return true;+ return false;}}export function setShowLoadedModels(show: boolean): void {try {- if (show) {- // Remove rather than store "true" so the default stays on.- localStorage.removeItem(STORAGE_KEY);- } else {- localStorage.setItem(STORAGE_KEY, "false");- }+ // Both values written, never removed: "false" is the one an older reader+ // also treats as off, so a pre-update tab does not flip the card back on+ // through the storage event. Absent still means off here, so the default+ // is unaffected.+ localStorage.setItem(STORAGE_KEY, show ? "true" : "false");} catch {// storage unavailable}diff --git a/studio/frontend/tests/loaded-models-dismiss.test.ts b/studio/frontend/tests/loaded-models-dismiss.test.tsindex 46306e16234..0456e1ed969 100644--- a/studio/frontend/tests/loaded-models-dismiss.test.ts+++ b/studio/frontend/tests/loaded-models-dismiss.test.ts@@ -25,6 +25,38 @@ function reset(): void {store.clear();}+test("the indicator is off until it is switched on", () => {+ reset();+ assert.equal(getShowLoadedModels(), false);+});++// Written either way, never removed. A pre-update tab reads a missing key as+// on, so removing it on disable would let the storage event flip the card back+// on over there.+test("both toggles store a value the older reader also honours", () => {+ reset();+ setShowLoadedModels(true);+ assert.equal(store.get(LOADED_MODELS_PREFERENCE_KEYS.show), "true");+ setShowLoadedModels(false);+ assert.equal(store.get(LOADED_MODELS_PREFERENCE_KEYS.show), "false");+ assert.equal(getShowLoadedModels(), false);+});++// What the old build wrote when it was turned down. It must not now read as on.+test("an older explicit false still reads as off", () => {+ reset();+ store.set(LOADED_MODELS_PREFERENCE_KEYS.show, "false");+ assert.equal(getShowLoadedModels(), false);+});++// Reset all local preferences removes the key, and the default must survive it.+test("a cleared key falls back to off, not on", () => {+ reset();+ setShowLoadedModels(true);+ store.delete(LOADED_MODELS_PREFERENCE_KEYS.show);+ assert.equal(getShowLoadedModels(), false);+});+test("the card is open until something closes it", () => {reset();assert.equal(getLoadedModelsDismissed(), false);@@ -44,6 +76,7 @@ test("closing it stores the dismissal, reopening removes the key", () => {// The point of keeping them apart.test("closing the card does not switch the setting off", () => {reset();+ setShowLoadedModels(true);setLoadedModelsDismissed(true);assert.equal(getShowLoadedModels(), true);});diff --git a/tests/studio/playwright_loaded_models_indicator.py b/tests/studio/playwright_loaded_models_indicator.pyindex 3ef615ce6d9..6d3b263fc23 100644--- a/tests/studio/playwright_loaded_models_indicator.py+++ b/tests/studio/playwright_loaded_models_indicator.py@@ -233,16 +233,22 @@ def boot(state: Runtime,*,seed: dict | None = None,+ show: bool = True,) -> None:"""Reload with a known localStorage, then wait for the card to settle."""page.goto(BASE, wait_until = "domcontentloaded")+ # The indicator ships off, so every check that wants the card has to switch+ # it on. Pass show = False to exercise the default.+ seeded = dict(seed or {})+ if show:+ seeded.setdefault(SHOW_KEY, "true")page.evaluate("""([seed, keys]) => {for (const k of keys) localStorage.removeItem(k);for (const [k, v] of Object.entries(seed || {}))localStorage.setItem(k, v);}""",- [seed or {}, [POSITION_KEY, COLLAPSED_KEY, SHOW_KEY]],+ [seeded, [POSITION_KEY, COLLAPSED_KEY, SHOW_KEY]],)page.reload(wait_until = "domcontentloaded")page.wait_for_timeout(SETTLE_MS // 2)@@ -705,15 +711,19 @@ def run(page, state: Runtime) -> None:# ── The preference ──────────────────────────────────────────────────state.reset()state.chat = chat(active_model = "unsloth/Qwen3-4B", loaded = ["unsloth/Qwen3-4B"])- boot(page, state, seed = {SHOW_KEY: "false"})- check("the preference hides the card", page.locator(CARD).count() == 0)+ # Nothing stored: a fresh install shows no card even with a model resident.+ boot(page, state, show = False)+ check("the card is off by default", page.locator(CARD).count() == 0)state.status_reads = 0page.wait_for_timeout(SETTLE_MS)check(- "the preference stops the poll",+ "the default stops the poll",state.status_reads <= 1,f"{state.status_reads} status reads while off",)+ # What the old default wrote when it was turned down; still off.+ boot(page, state, seed = {SHOW_KEY: "false"}, show = False)+ check("an older explicit false still hides the card", page.locator(CARD).count() == 0)if __name__ == "__main__":