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: point Desktop Chat only users at Repair installation on the Export page (#14438)
oobabooga93eed9e01d66
diff --git a/studio/frontend/src/features/export/export-page.tsx b/studio/frontend/src/features/export/export-page.tsxindex ba00cb5ebf0..eb5763a5f6e 100644--- a/studio/frontend/src/features/export/export-page.tsx+++ b/studio/frontend/src/features/export/export-page.tsx@@ -49,6 +49,7 @@ import { confirmRemoteCodeIfNeeded } from "@/features/security";import { GuidedTour, useGuidedTourController } from "@/features/tour";import type { LocalModelInfo } from "@/features/training";import { useDebouncedValue, useHfTokenValidation } from "@/hooks";+import { useTauriRepairController } from "@/hooks/tauri-repair-context";import { useHardwareInfo } from "@/hooks/use-hardware-info";import { useT } from "@/i18n";import { ChevronDownStandardIcon } from "@/lib/chevron-icons";@@ -97,6 +98,7 @@ import {import { confirmLlmCompressorInstallIfNeeded } from "./hooks/use-llm-compressor-consent";import { useExportSizeEstimate } from "./hooks/use-export-size-estimate";import { saveDirectoryField } from "./lib/save-directory";+import { exportUnsupportedText } from "./lib/unsupported-text";import {isExportPanelActive,useExportRuntimeStore,@@ -253,9 +255,13 @@ export function ExportPage() {// Only gray out on an authoritative unsupported response; the backend supplies the reason.const exportUnsupported =hardware.loaded && hardware.exportSupported === false;- const exportUnsupportedMessage =- hardware.exportUnsupportedMessage ??- "Export requires a supported accelerator (NVIDIA, AMD, or Intel GPU, or Apple Silicon) with PyTorch or MLX installed.";+ // Null off Desktop; an attached terminal-started backend has no Repair action to point at.+ const repair = useTauriRepairController();+ const exportUnsupportedMessage = exportUnsupportedText(+ hardware.exportUnsupportedReason,+ hardware.exportUnsupportedMessage,+ repair !== null && !repair.isExternalServer,+ );const availableFormats = useMemo<MergedFormatOption[]>(() =>MERGED_FORMATS.filter((f) => {diff --git a/studio/frontend/src/features/export/lib/unsupported-text.ts b/studio/frontend/src/features/export/lib/unsupported-text.tsnew file mode 100644index 00000000000..aeb54119ad8--- /dev/null+++ b/studio/frontend/src/features/export/lib/unsupported-text.ts@@ -0,0 +1,18 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++// Kept out of config/hardware-verdict.ts (startup bundle): only the lazy Export route needs it.++/** A Desktop Chat only user never typed the --no-torch the backend names: point at Repair instead. */+export function exportUnsupportedText(+ reason: string | null,+ message: string | null,+ canRepair: boolean,+): string {+ if (reason === "no_torch" && canRepair)+ return "Export was left out of this install (Chat only). Use Repair installation in Settings to add it.";+ return (+ message ??+ "Export requires a supported accelerator (NVIDIA, AMD, or Intel GPU, or Apple Silicon) with PyTorch or MLX installed."+ );+}diff --git a/studio/frontend/src/hooks/use-tauri-backend.ts b/studio/frontend/src/hooks/use-tauri-backend.tsindex 22ca001b1f6..5502a915941 100644--- a/studio/frontend/src/hooks/use-tauri-backend.ts+++ b/studio/frontend/src/hooks/use-tauri-backend.ts@@ -9,6 +9,7 @@ import {useSyncExternalStore,} from "react";import { isTauri, setApiBase } from "@/lib/api-base";+import { invalidateHardwareInfo } from "@/hooks/use-hardware-info";import {MANAGED_ENVIRONMENT_BUSY,MANAGED_ENVIRONMENT_UPDATING,@@ -512,6 +513,9 @@ export function useTauriBackend() {try {await invoke("start_managed_repair", { forceInstaller });recordRuntimeRepair(repairReasonRef.current);+ // The old backend's export verdict would otherwise outlive the repair: the shell remounts+ // from the module cache, so Export stays disabled after Repair added PyTorch.+ invalidateHardwareInfo();// The repair ends here; what follows is an ordinary start, and holding the flag across it// swallows the Retry that server-start-timeout offers.releaseRepair();diff --git a/studio/frontend/tests/export-unsupported-text.test.ts b/studio/frontend/tests/export-unsupported-text.test.tsnew file mode 100644index 00000000000..828472cd656--- /dev/null+++ b/studio/frontend/tests/export-unsupported-text.test.ts@@ -0,0 +1,46 @@+// 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 test from "node:test";++import { readSrcAsync, registerBundlerResolver } from "./helpers/kit.ts";++registerBundlerResolver();++const { exportUnsupportedText } = await import("../src/features/export/lib/unsupported-text.ts");++const NO_TORCH_MESSAGE =+ "This install was set up without the training stack (--no-torch), so export is disabled. Reinstall Unsloth Studio without --no-torch to enable export.";++test("a Desktop Chat only install is pointed at Repair installation", () => {+ const text = exportUnsupportedText("no_torch", NO_TORCH_MESSAGE, true);+ assert.match(text, /Use Repair installation in Settings/);+ assert.doesNotMatch(text, /--no-torch/);+});++test("without a Repair action the backend's --no-torch advice stays", () => {+ // Web, CLI install.sh --no-torch, or a Desktop attached to a terminal-started backend.+ assert.equal(exportUnsupportedText("no_torch", NO_TORCH_MESSAGE, false), NO_TORCH_MESSAGE);+});++test("other reasons keep the backend's message even when Repair is available", () => {+ const msg = "Studio is running under Rosetta (x86_64 Python), so export is disabled.";+ assert.equal(exportUnsupportedText("rosetta", msg, true), msg);+ assert.equal(exportUnsupportedText(null, msg, true), msg);+});++test("no backend message falls back to the generic accelerator text", () => {+ assert.match(exportUnsupportedText(null, null, false), /^Export requires a supported accelerator/);+});++test("a successful repair drops the cached hardware verdict before the backend restarts", async () => {+ // The hook cannot be rendered here, so the order is read off the source as in+ // repair-single-flight.test.ts.+ const hook = await readSrcAsync("hooks/use-tauri-backend.ts");+ const body = hook.slice(hook.indexOf("async function runRepair("), hook.indexOf("async function startServer()"));+ const native = body.indexOf('invoke("start_managed_repair"');+ const invalidate = body.indexOf("invalidateHardwareInfo();");+ const start = body.indexOf("await startManagedServer();");+ assert.ok(native > 0 && invalidate > native && start > invalidate);+});