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: show mlx-community models as MLX in the model picker (#10457)
Nilaya37dea7f4430
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/recommended-fit.ts b/studio/frontend/src/features/model-picker/components/model-selector/recommended-fit.tsindex abde74ab59e..384102905c5 100644--- a/studio/frontend/src/features/model-picker/components/model-selector/recommended-fit.ts+++ b/studio/frontend/src/features/model-picker/components/model-selector/recommended-fit.ts@@ -8,14 +8,21 @@ import { classifyGgufFit } from "../../../../lib/gguf-fit.ts";import { classifyMediaGgufFit } from "./model-catalog.ts";const GGUF_SUFFIX_RE = /-GGUF(?:$|-)/i;-const MLX_RE = /-MLX(?:$|-)/i;+// Mirrors the backend's _looks_like_mlx_repo: owner prefix, or a bounded mlx token in the leaf.+const MLX_RE = /(?:^|[-_.])mlx(?:$|[-_.])/i;+const MLX_OWNER_PREFIX = "mlx-community/";+// Callers pass LocalModelInfo.id, a filesystem path, so a Windows one must split too.+const PATH_SEP_RE = /[\\/]/;export function isGgufId(id: string, hintedIsGguf?: boolean): boolean {return Boolean(hintedIsGguf) || GGUF_SUFFIX_RE.test(id);}export function isMlxId(id: string): boolean {- return MLX_RE.test(id);+ const trimmed = id.trim();+ if (trimmed.toLowerCase().startsWith(MLX_OWNER_PREFIX)) return true;+ const leaf = trimmed.split(PATH_SEP_RE).filter(Boolean).at(-1) ?? trimmed;+ return MLX_RE.test(leaf);}// "mobile" build token (e.g. "gemma-4-E4B-it-qat-mobile-GGUF"); bounded so it never matches inside a longer word.diff --git a/studio/frontend/tests/mlx-community-repo-detection.test.ts b/studio/frontend/tests/mlx-community-repo-detection.test.tsnew file mode 100644index 00000000000..c959b878fe1--- /dev/null+++ b/studio/frontend/tests/mlx-community-repo-detection.test.ts@@ -0,0 +1,60 @@+// 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 {+ isMlxId,+ matchesFormatFilter,+} from "../src/features/model-picker/components/model-selector/recommended-fit.ts";++const COMMUNITY = "mlx-community/Qwen3-8B-4bit";++test("an mlx-community repo is MLX even without an -MLX suffix", () => {+ assert.equal(isMlxId(COMMUNITY), true);+ assert.equal(isMlxId("MLX-Community/gemma-3-27b-it-8bit"), true);+ assert.equal(isMlxId("mlx-community/Llama-3.2-3B-Instruct-4bit"), true);+});++test("an mlx token in the repo leaf is MLX wherever it sits", () => {+ assert.equal(isMlxId("unsloth/Qwen3-8B-MLX"), true);+ assert.equal(isMlxId("unsloth/Qwen3-MLX-8B"), true);+ assert.equal(isMlxId("unsloth/mlx_Qwen3-8B"), true);+ assert.equal(isMlxId("Qwen3-8B-4bit-mlx"), true);+});++test("the mlx token stays bounded, so a longer word is not MLX", () => {+ assert.equal(isMlxId("org/mlxray-7B"), false);+ assert.equal(isMlxId("org/Qwen-mlxtra"), false);+ assert.equal(isMlxId("mlxcommunity/Qwen3-8B-4bit"), false);+ assert.equal(isMlxId("unsloth/Qwen3-8B-GGUF"), false);+});++test("the format filter routes an mlx-community repo to MLX, not Safetensors", () => {+ assert.equal(matchesFormatFilter(COMMUNITY, false, "mlx"), true);+ assert.equal(matchesFormatFilter(COMMUNITY, false, "safetensors"), false);+ assert.equal(matchesFormatFilter(COMMUNITY, false, "gguf"), false);+ assert.equal(matchesFormatFilter(COMMUNITY, false, "all"), true);+});++// localModelIsMlx passes LocalModelInfo.id, a filesystem path: parent directories must not decide.+test("a local path is judged by its leaf on both separators", () => {+ assert.equal(isMlxId("/Users/me/models/Qwen3-8B-MLX"), true);+ assert.equal(isMlxId("C:\\Users\\me\\models\\Qwen3-8B-MLX"), true);+ assert.equal(isMlxId("/Users/me/Qwen-MLX-builds/Qwen3-8B"), false);+ assert.equal(isMlxId("C:\\Users\\me\\Qwen-MLX-builds\\Qwen3-8B"), false);+ assert.equal(isMlxId("/Users/me/Qwen3-MLX-4bit/model.gguf"), false);+ assert.equal(isMlxId("C:\\Users\\me\\Qwen3-MLX-4bit\\model.gguf"), false);+ assert.equal(isMlxId("mlx-community/Qwen3-8B-4bit"), true);+});++test("a plain safetensors repo still answers the safetensors filter", () => {+ const plain = "unsloth/Qwen3-8B";+ assert.equal(matchesFormatFilter(plain, false, "safetensors"), true);+ assert.equal(matchesFormatFilter(plain, false, "mlx"), false);+ assert.equal(+ matchesFormatFilter("org/mlxray-7B", false, "safetensors"),+ true,+ );+});