Skip to content

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.

Studio: keep Start Export off for a Hub push until the repo is named (#13651)

Nilaye4a00b00c640
diff --git a/studio/frontend/src/features/export/components/export-run-panel.tsx b/studio/frontend/src/features/export/components/export-run-panel.tsx
index c259fe1033d..4c24d29611f 100644
--- a/studio/frontend/src/features/export/components/export-run-panel.tsx
+++ b/studio/frontend/src/features/export/components/export-run-panel.tsx
@@ -219,6 +219,10 @@ export function ExportRunPanel(props: ExportRunPanelProps) {
(v) => findMergedFormat(v)?.label ?? v,
);
const showProgress = isExporting || isTerminal;
+ const hubRepoMissing =
+ destination === "hub" &&
+ !decisionNote &&
+ (!hfUsername.trim() || !modelName.trim());
return (
<div className="flex flex-col gap-4 rounded-2xl border border-border/50 bg-muted/20 p-4">
@@ -352,6 +356,11 @@ export function ExportRunPanel(props: ExportRunPanelProps) {
/>
</div>
</div>
+ {hubRepoMissing && (
+ <p className="-mt-2 text-ui-11 text-muted-foreground/70">
+ Enter a Username / Org and Model Name to push to the Hub.
+ </p>
+ )}
<div className="flex flex-col gap-1.5">
<div className="flex items-center justify-between">
@@ -617,7 +626,9 @@ export function ExportRunPanel(props: ExportRunPanelProps) {
<Button variant="outline" onClick={onClose}>
Cancel
</Button>
- <Button onClick={onStart}>Start Export</Button>
+ <Button onClick={onStart} disabled={hubRepoMissing}>
+ Start Export
+ </Button>
</>
)}
{isExporting && (
diff --git a/studio/frontend/src/features/export/export-page.tsx b/studio/frontend/src/features/export/export-page.tsx
index 3e610b2ebb5..ba00cb5ebf0 100644
--- a/studio/frontend/src/features/export/export-page.tsx
+++ b/studio/frontend/src/features/export/export-page.tsx
@@ -879,6 +879,8 @@ export function ExportPage() {
const checkpointPath = selectedCp?.path ?? null;
const pushToHub = destination === "hub";
+ if (pushToHub && !isDecision && (!hfUsername.trim() || !modelName.trim()))
+ return;
const preparedToken = await prepareHfTokenForUse(hfToken, {
allowAnonymous: !pushToHub,
});
@@ -886,8 +888,8 @@ export function ExportPage() {
const actionHfToken = preparedToken.token ?? "";
const repoId =
- pushToHub && hfUsername && modelName
- ? `${hfUsername}/${modelName}`
+ pushToHub && hfUsername.trim() && modelName.trim()
+ ? `${hfUsername.trim()}/${modelName.trim()}`
: undefined;
const token = pushToHub && actionHfToken ? actionHfToken : undefined;
// The GGUF method with the LoRA target reuses the LoRA-adapter export path.
diff --git a/studio/frontend/tests/export-hub-repo-required.test.ts b/studio/frontend/tests/export-hub-repo-required.test.ts
new file mode 100644
index 00000000000..a4d32a3beb3
--- /dev/null
+++ b/studio/frontend/tests/export-hub-repo-required.test.ts
@@ -0,0 +1,138 @@
+// 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 * as React from "react";
+import * as jsxRuntime from "react/jsx-runtime";
+import { renderToStaticMarkup } from "react-dom/server";
+import type * as ExportRunPanelModule from "../src/features/export/components/export-run-panel.tsx";
+import * as constants from "../src/features/export/constants.ts";
+import * as logStyle from "../src/features/export/lib/log-style.ts";
+import { loadWithStubs } from "./helpers/module-stubs.ts";
+
+const tag =
+ (name: string) =>
+ ({
+ children,
+ asChild: _a,
+ variant: _v,
+ size: _s,
+ ...rest
+ }: Record<string, unknown>) =>
+ React.createElement(name, rest, children as React.ReactNode);
+const none = () => null;
+
+const runState = {
+ phase: "idle",
+ isExporting: false,
+ logLines: [],
+ connected: false,
+ reconnecting: false,
+ stage: null,
+ quantIndex: 0,
+ quantTotal: 0,
+ startedAt: null,
+ result: null,
+ error: null,
+ summary: null,
+ requestCancel: async () => {},
+};
+
+const { ExportRunPanel } = loadWithStubs<typeof ExportRunPanelModule>(
+ new URL(
+ "../src/features/export/components/export-run-panel.tsx",
+ import.meta.url,
+ ),
+ {
+ react: React,
+ "react/jsx-runtime": jsxRuntime,
+ "@/components/ui/button": { Button: tag("button") },
+ "@/components/ui/input": { Input: tag("input") },
+ "@/components/ui/input-group": {
+ InputGroup: tag("div"),
+ InputGroupAddon: tag("div"),
+ InputGroupInput: tag("input"),
+ },
+ "@/components/ui/progress": { Progress: none },
+ "@/components/ui/spinner": { Spinner: none },
+ "@/components/ui/switch": { Switch: none },
+ "@/components/ui/tooltip": {
+ Tooltip: tag("span"),
+ TooltipTrigger: tag("span"),
+ TooltipContent: none,
+ },
+ "@/features/model-picker": { FolderBrowser: none },
+ "@hugeicons/core-free-icons": {},
+ "@hugeicons/react": { HugeiconsIcon: none },
+ "lucide-react": { ChevronRightIcon: none },
+ "zustand/react/shallow": { useShallow: (fn: unknown) => fn },
+ "../constants": constants,
+ "../lib/log-style": logStyle,
+ "../stores/export-runtime-store": {
+ useExportRuntimeStore: (select: (s: typeof runState) => unknown) =>
+ select(runState),
+ selectExportProgressPercent: () => 0,
+ },
+ },
+);
+
+type Props = React.ComponentProps<typeof ExportRunPanel>;
+const props: Props = {
+ exportMethod: "gguf",
+ quantLevels: ["q4_k_m"],
+ checkpoint: "unsloth/Qwen3-0.6B",
+ baseModelName: "unsloth/Qwen3-0.6B",
+ isAdapter: false,
+ destination: "hub",
+ onDestinationChange: () => {},
+ saveDirectory: "exports/qwen",
+ saveDirectoryInput: "",
+ defaultSaveDirectory: "exports/qwen",
+ saveDirectoryOverridden: false,
+ onSaveDirectoryChange: () => {},
+ hfUsername: "nilay",
+ onHfUsernameChange: () => {},
+ modelName: "qwen-gguf",
+ onModelNameChange: () => {},
+ hfToken: "",
+ onHfTokenChange: () => {},
+ privateRepo: false,
+ onPrivateRepoChange: () => {},
+ onStart: () => {},
+ onClose: () => {},
+};
+
+function startButton(overrides: Partial<Props>): string {
+ const html = renderToStaticMarkup(
+ React.createElement(ExportRunPanel, { ...props, ...overrides }),
+ );
+ const button = html.match(/<button\b[^>]*>Start Export<\/button>/)?.[0];
+ assert.ok(button, "Start Export is not rendered");
+ return button;
+}
+
+test("a Hub push cannot start until Username / Org and Model Name are filled", () => {
+ for (const blank of [
+ { modelName: "" },
+ { hfUsername: "" },
+ { hfUsername: " ", modelName: " " },
+ ]) {
+ assert.match(startButton(blank), /disabled=""/, JSON.stringify(blank));
+ }
+ assert.doesNotMatch(startButton({}), /disabled/);
+});
+
+test("a local export starts without the Hub fields", () => {
+ assert.doesNotMatch(
+ startButton({ destination: "local", hfUsername: "", modelName: "" }),
+ /disabled/,
+ );
+});
+
+test("a decision export, which hides the Hub fields, is not held back by them", () => {
+ assert.doesNotMatch(
+ startButton({ decisionNote: "Saved to the run folder", modelName: "" }),
+ /disabled/,
+ );
+});