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: keep the Ask before downloading programs setting across browsers (#17240)
Nilay3d317d45f03d
diff --git a/studio/backend/routes/settings.py b/studio/backend/routes/settings.pyindex 8810ed912d2..449db994af1 100644--- a/studio/backend/routes/settings.py+++ b/studio/backend/routes/settings.py@@ -5260,6 +5260,7 @@ class BrowserPrefsPayload(BaseModel):saveDownloadHistory: Optional[bool] = NoneaskWhereToSave: Optional[bool] = NoneaskBeforeDownloading: Optional[bool] = None+ askBeforeProgramDownloads: Optional[bool] = NoneannotationScreenshots: Optional[Literal["always", "never"]] = Nonediff --git a/studio/backend/tests/test_device_sync_settings.py b/studio/backend/tests/test_device_sync_settings.pyindex 9aaf91a13b5..378aa3f5f99 100644--- a/studio/backend/tests/test_device_sync_settings.py+++ b/studio/backend/tests/test_device_sync_settings.py@@ -2,6 +2,7 @@# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0import hashlib+import reimport sqlite3import sysimport threading@@ -62,6 +63,56 @@ def test_client_preferences_start_unsaved_and_merge_by_section(client):assert isinstance(body["updatedAt"], int)+def test_download_prompts_follow_the_account(client):+ prompts = {"askBeforeDownloading": False, "askBeforeProgramDownloads": False}+ client.put("/api/settings/client-preferences", json = {"browser": prompts})+ body = client.get("/api/settings/client-preferences").json()+ assert {k: body["browser"][k] for k in prompts} == prompts+++_FRONTEND = _BACKEND.parent / "frontend" / "src" / "features"+++def _synced_store_fields(+ store: str,+ interface: str,+ skip = frozenset(),+) -> set[str]:+ source = (_FRONTEND / store).read_text(encoding = "utf-8")+ body = re.search(rf"interface {interface} \{{\n(.*?)\n\}}", source, re.S).group(1)+ fields = re.findall(r"^ (\w+)\??: (?!\()", body, re.M)+ return set(fields) - skip+++# The sync hook sends every store field and the server ignores unknown keys, so a field missing here never syncs.+def test_every_synced_store_field_is_saved():+ hook = (_FRONTEND / "settings/hooks/use-device-settings-sync.ts").read_text(encoding = "utf-8")+ local_chat = set(+ re.findall(r'"(\w+)"', re.search(r"LOCAL_CHAT_PREFS = new Set\(\[(.*?)\]", hook).group(1))+ )+ stores = {+ settings_routes.BrowserPrefsPayload: (+ "browser/prefs-store.ts",+ "BrowserPrefsState",+ frozenset(),+ ),+ settings_routes.ChatPrefsPayload: (+ "chat/stores/chat-preferences-store.ts",+ "ChatPreferencesState",+ frozenset(local_chat),+ ),+ settings_routes.PlusMenuPrefsPayload: (+ "chat/stores/plus-menu-prefs-store.ts",+ "PlusMenuPrefsState",+ frozenset(),+ ),+ }+ for model, args in stores.items():+ fields = _synced_store_fields(*args)+ assert fields, args+ assert fields <= set(model.model_fields), (model.__name__, fields - set(model.model_fields))++def test_client_preferences_reject_out_of_range_values(client):assert (client.put("/api/settings/client-preferences", json = {"interfaceScale": 400}).status_code