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.

Unsloth Studio: stop a Mac browser hiding GPU-only models from a remote CUDA / ROCm / Intel server (#8833)

Daniel Han60bf93c3a264
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/host-artifact-policy.ts b/studio/frontend/src/features/model-picker/components/model-selector/host-artifact-policy.ts
index 612b4461f18..7ea0cee15d0 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/host-artifact-policy.ts
+++ b/studio/frontend/src/features/model-picker/components/model-selector/host-artifact-policy.ts
@@ -25,16 +25,15 @@ export function classifyHost({
/** Backend-reported dense quant capability. */
denseQuantSupported?: boolean;
}): HostClass {
- // Mac outranks the backend string. Apple GPUs report as available and Unsloth may name the
- // backend mlx or cpu, but no Mac can place a Modular Diffusers workflow: it needs
- // mem_get_info, which torch.mps does not expose, and video.py refuses the load.
- if (deviceType === "mac") return "gguf-only";
const backend = (deviceBackend ?? "").trim().toLowerCase();
- if (!(backend && budgetKnown)) return "unknown";
- if (GGUF_ONLY_BACKENDS.has(backend)) return "gguf-only";
- if (ACCELERATED_BACKENDS.has(backend)) {
+ // Backend outranks the OS: no Mac reports one of these, but deviceType can be the BROWSER's platform (config/env.ts).
+ if (backend && budgetKnown && ACCELERATED_BACKENDS.has(backend)) {
return denseQuantSupported ? "dense-quant" : "accelerated";
}
+ // No Mac can place a Modular Diffusers workflow: it needs mem_get_info, which torch.mps lacks.
+ if (deviceType === "mac") return "gguf-only";
+ if (!(backend && budgetKnown)) return "unknown";
+ if (GGUF_ONLY_BACKENDS.has(backend)) return "gguf-only";
// An unrecognised backend is a new accelerator, not a CPU. Show what we show today.
return "unknown";
}
diff --git a/studio/frontend/tests/host-artifact-policy.test.ts b/studio/frontend/tests/host-artifact-policy.test.ts
index 457951cdffd..f4c079a1e96 100644
--- a/studio/frontend/tests/host-artifact-policy.test.ts
+++ b/studio/frontend/tests/host-artifact-policy.test.ts
@@ -51,6 +51,19 @@ test("the dense-quant class follows the backend's capability answer, not its nam
for (const host of ["gguf-only", "unknown"] as const) {
assert.equal(hostRunsDenseQuant(host), false, host);
}
+ // A Mac only ever reports mlx or cpu; mac + cuda means a browser-derived Mac on a remote host.
+ for (const deviceBackend of ["mlx", "cpu"]) {
+ assert.equal(
+ classifyHost({
+ deviceType: "mac",
+ deviceBackend,
+ budgetKnown: true,
+ denseQuantSupported: true,
+ }),
+ "gguf-only",
+ deviceBackend,
+ );
+ }
assert.equal(
classifyHost({
deviceType: "mac",
@@ -58,7 +71,7 @@ test("the dense-quant class follows the backend's capability answer, not its nam
budgetKnown: true,
denseQuantSupported: true,
}),
- "gguf-only",
+ "dense-quant",
);
});
@@ -72,10 +85,20 @@ test("the backends that only run the native engine are gguf-only", () => {
}
});
+test("a resolved accelerated backend outranks a browser-derived Mac", () => {
+ for (const deviceBackend of ["cuda", "rocm", "xpu"]) {
+ assert.equal(
+ classifyHost({ deviceType: "mac", deviceBackend, budgetKnown: true }),
+ "accelerated",
+ deviceBackend,
+ );
+ }
+});
+
test("a Mac is gguf-only whatever backend it reports", () => {
// Apple GPUs report as available and the backend string varies with what torch found, but no
// Mac can place the Modular Diffusers workflow: video.py refuses the load outright.
- for (const deviceBackend of ["mlx", "cpu", "cuda", null]) {
+ for (const deviceBackend of ["mlx", "cpu", null]) {
assert.equal(
classifyHost({ deviceType: "mac", deviceBackend, budgetKnown: true }),
"gguf-only",