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
Fix main's red CI after #14437, #14455 and #14473 (#14517)
Daniel Hanf4077f8c5506
diff --git a/scripts/risky_loaders_baseline.json b/scripts/risky_loaders_baseline.jsonindex 8cd6e9a1e6d..d58d5d89e41 100644--- a/scripts/risky_loaders_baseline.json+++ b/scripts/risky_loaders_baseline.json@@ -250,6 +250,14 @@"count": 1,"reason": "The metadata reference is accepted only with the sentence_transformers. prefix, so it can import installed package code only; non-package refs are skipped and the real loader performs the same lookup."},+ {+ "file": "studio/backend/core/rag/embeddings.py",+ "rule": "dynamic-import",+ "sink": "import_module",+ "digest": "d78c0ba207ccee5a",+ "count": 1,+ "reason": "Written-out names only: the three sentence_transformers.models module paths in a literal tuple, imported to wrap their import_from_string with the trust gate (#14437)."+ },{"file": "studio/backend/core/systemone/laya_runtime.py","rule": "dynamic-import",@@ -647,8 +655,8 @@"rule": "dynamic-import","sink": "import_from_string","digest": "180573f5aeefdb98",- "count": 2,- "reason": "Gated: classes outside sentence_transformers.* need trust_remote_code; inside it the path must be dotted identifiers resolving to a module class (#12436)."+ "count": 3,+ "reason": "Gated: classes outside sentence_transformers.* need trust_remote_code; inside it the path must be dotted identifiers resolving to a module class (#12436). The WordEmbeddings tokenizer_class check imports only after the caller refuses anything outside sentence_transformers.* (#14437)."},{"file": "unsloth/models/sentence_transformer.py",diff --git a/studio/frontend/src/features/chat/utils/conversation-markdown-import.ts b/studio/frontend/src/features/chat/utils/conversation-markdown-import.tsindex 5133eaea9cf..a58c6f5ab02 100644--- a/studio/frontend/src/features/chat/utils/conversation-markdown-import.ts+++ b/studio/frontend/src/features/chat/utils/conversation-markdown-import.ts@@ -34,7 +34,7 @@ function parseFramedDocument(const frameStart = offset + (title?.[0].length ?? 0);if (!text.startsWith(CONVERSATION_MARKDOWN_FRAME_PREFIX, frameStart)) {if (offset === 0) return;- throw new Error("Missing Unsloth Studio Markdown conversation framing.");+ throw new Error("Missing Unsloth Markdown conversation framing.");}const metadataStart =frameStart + CONVERSATION_MARKDOWN_FRAME_PREFIX.length;@@ -43,7 +43,7 @@ function parseFramedDocument(try {lengths = JSON.parse(text.slice(metadataStart, metadataEnd));} catch {- throw new Error("Invalid Unsloth Studio Markdown conversation framing.");+ throw new Error("Invalid Unsloth Markdown conversation framing.");}if (metadataEnd < 0 ||@@ -51,7 +51,7 @@ function parseFramedDocument(lengths.length === 0 ||!lengths.every((length) => Number.isSafeInteger(length) && length > 0)) {- throw new Error("Invalid Unsloth Studio Markdown message lengths.");+ throw new Error("Invalid Unsloth Markdown message lengths.");}offset = metadataEnd + FRAME_END.length;const messages: ConversationMarkdownMessage[] = [];@@ -59,7 +59,7 @@ function parseFramedDocument(const section = text.slice(offset, offset + length);const heading = ROLE_LINE.exec(section);if (section.length !== length || !heading) {- throw new Error("Incomplete Unsloth Studio Markdown message.");+ throw new Error("Incomplete Unsloth Markdown message.");}const label = heading[1];messages.push({@@ -71,18 +71,18 @@ function parseFramedDocument(offset += length;const separator = index === lengths.length - 1 ? "\n" : "\n\n";if (!text.startsWith(separator, offset)) {- throw new Error("Invalid Unsloth Studio Markdown message boundary.");+ throw new Error("Invalid Unsloth Markdown message boundary.");}offset += separator.length;}conversations.push({ title: title?.[1] ?? fallbackTitle, messages });if (!text.slice(offset).trim()) break;if (!text.startsWith(CHAT_SEPARATOR, offset)) {- throw new Error("Invalid Unsloth Studio Markdown conversation boundary.");+ throw new Error("Invalid Unsloth Markdown conversation boundary.");}offset += CHAT_SEPARATOR.length;if (offset === text.length) {- throw new Error("Missing Unsloth Studio Markdown conversation framing.");+ throw new Error("Missing Unsloth Markdown conversation framing.");}}return conversations;diff --git a/studio/frontend/tests/conversation-markdown-import.test.ts b/studio/frontend/tests/conversation-markdown-import.test.tsindex 235378c04d4..5147acea40e 100644--- a/studio/frontend/tests/conversation-markdown-import.test.ts+++ b/studio/frontend/tests/conversation-markdown-import.test.ts@@ -158,7 +158,7 @@ test("rejects damaged framed exports rather than importing partial messages", as]) {assert.throws(() => parseConversationMarkdownDocument(invalid, "chat"),- /Studio Markdown/,+ /Unsloth Markdown/,);}});diff --git a/studio/src-tauri/src/main.rs b/studio/src-tauri/src/main.rsindex b3663233b75..946174a7a04 100644--- a/studio/src-tauri/src/main.rs+++ b/studio/src-tauri/src/main.rs@@ -2381,7 +2381,7 @@ fn main() {.manage(browser_downloads::new_browser_downloads()).invoke_handler(|invoke| {if invoke.message.webview().label() != "main" || invoke.message.webview().window().label() != "main" {- invoke.resolver.reject("Unsloth Studio commands are only available to the main webview");+ invoke.resolver.reject("Unsloth commands are only available to the main webview");return true;}let handler: fn(tauri::ipc::Invoke<tauri::Wry>) -> bool = tauri::generate_handler![diff --git a/tests/studio/test_settings_compact_overflow_contract.py b/tests/studio/test_settings_compact_overflow_contract.pyindex 1f4f9962ed2..29a0c15502b 100644--- a/tests/studio/test_settings_compact_overflow_contract.py+++ b/tests/studio/test_settings_compact_overflow_contract.py@@ -29,14 +29,16 @@ def test_dialog_content_can_shrink_inside_the_dialog_grid():def test_api_monitor_entries_and_expanded_text_can_shrink():source = API_MONITOR_PAGE.read_text(encoding = "utf-8")- # Flex parents need min-w-0, or a long model id widens the layout past the viewport.- assert '"flex w-full min-w-0 flex-col gap-1 border-b border-border/50' in source+ # Flex parents need min-w-0, or a long model id widens the layout past the viewport. Entry rows+ # are rounded cards since #14455, so only the row's own sizing tokens are pinned.+ assert '"flex w-full min-w-0 flex-col gap-1 ' in sourceassert '<section className="flex min-w-0 flex-col gap-1.5">' in source# Prompt and reply are unbounded user text: height-capped, scrollable, wrapped; read as tokens.+ # The rounding is now conditional (pill for one line), so whitespace-pre-wrap marks the box.text_boxes = [set(literal.split())for literal in re.findall(r'"([^"\n]*)"', source)- if {"whitespace-pre-wrap", "rounded-lg"} <= set(literal.split())+ if "whitespace-pre-wrap" in set(literal.split())]assert text_boxes, "no wrapped, rounded text box in the API monitor"for tokens in text_boxes:diff --git a/tests/studio/test_usage_examples_model_source_contract.py b/tests/studio/test_usage_examples_model_source_contract.pyindex 4e19d78141b..aaabebafc69 100644--- a/tests/studio/test_usage_examples_model_source_contract.py+++ b/tests/studio/test_usage_examples_model_source_contract.py@@ -119,6 +119,9 @@ def test_usage_examples_has_no_duplicate_auto_switch_control():API_MONITOR_TSX = REPO / "studio/frontend/src/features/api-monitor/api-monitor-page.tsx"# Own module: the overlay mounts from __root.tsx, so importing the page made it eager.API_MONITOR_LIFECYCLE_TS = REPO / "studio/frontend/src/features/api-monitor/lifecycle.ts"+API_MODEL_LOAD_CONTROLS_TSX = (+ REPO / "studio/frontend/src/features/api-monitor/components/api-model-load-controls.tsx"+)MONITOR_LINK_TSX = SETTINGS / "components/monitor-link.tsx"@@ -142,10 +145,12 @@ def test_api_monitor_renders_lifecycle_rows():assert 'from "./lifecycle"' in src-def test_auto_switch_section_sits_above_the_usage_examples():+def test_auto_switch_section_sits_below_the_monitor_link():+ # #14455 moved the usage examples up, under the key form (api-settings-tab.test.ts pins that);+ # the auto-switch section still follows the monitor link.tab = API_KEYS_TAB_TSX.read_text(encoding = "utf-8")+ assert tab.index("<UsageExamples") < tab.index("<MonitorLink />")assert tab.index("<MonitorLink />") < tab.index("<ModelAutoSwitchSection />")- assert tab.index("<ModelAutoSwitchSection />") < tab.index("<UsageExamples")AUTO_SWITCH_TSX = SETTINGS / "components/model-auto-switch-section.tsx"@@ -161,17 +166,18 @@ def test_api_monitor_renders_download_rows():def test_monitor_can_unload_the_loaded_model():src = API_MONITOR_TSX.read_text(encoding = "utf-8")- assert "unloadActiveModel" in src- # Always rendered so the manual release stays discoverable; disabled, not hidden. Read the- # button's own disabled= as a set of || terms: #11223 added `modelLoading` (no unload while a- # model loads), and the guard is that these two stay among them, not the exact spelling.- click = "onClick={() => void unloadActiveModel()}"- button = src[src.index(click) + len(click) :]- disabled = re.match(r"\s*disabled=\{([^}]*)\}", button)- assert disabled, "the unload button no longer sits next to its disabled= prop"- terms = {term.strip() for term in disabled.group(1).split("||")}- assert {"unloading", "!data?.active_model"} <= terms, terms- assert "{data?.active_model ? (" not in src+ controls = API_MODEL_LOAD_CONTROLS_TSX.read_text(encoding = "utf-8")+ # The redesigned page (#14455) unloads through the model picker's eject, wired to the page's+ # unloadActiveModel; the standalone always-visible button went with it.+ assert "const unloadActiveModel = async" in src+ assert "onUnloadActive={unloadActiveModel}" in src+ assert "onUnloadActive();" in controls+ # #11223: no unload while a model loads, or while one is already unloading. Read busy= as a set+ # of || terms, so the guard is that both stay among them, not the exact spelling.+ busy = re.search(r"const busy = ([^;]+);", controls)+ assert busy, "the load controls no longer compute busy"+ assert {"modelLoading", "unloading"} <= {term.strip() for term in busy.group(1).split("||")}+ assert "onEject={busy ? undefined : handleEject}" in controls# /unload matches on the internal id, omitted here (a host path), so read it from status.assert "resolveInferenceCheckpointId(status)" in srcassert "unloadModel({ model_path: checkpoint })" in src