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.

Model catalog network check: judge FLUX.3 Klein by the mirror the backend fetches (#14316)

Daniel Hanf142f574d558
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.check.ts b/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.check.ts
index 4821ce7c0c7..a19145a3098 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.check.ts
+++ b/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.check.ts
@@ -1609,7 +1609,10 @@ async function checkCatalogAgainstTheHub(catalogs: CatalogGroup[][]): Promise<st
const artifactsByRepo = new Map<string, ModelArtifact[]>();
for (const group of groups) {
for (const artifact of group.artifacts) {
- const hubRepo = isAudioCppFolderId(artifact.repoId) ? AUDIO_CPP_REPO : artifact.repoId;
+ // A gated vendor id the backend fetches from an open mirror is judged by that mirror.
+ const hubRepo =
+ artifact.fetchedFrom ??
+ (isAudioCppFolderId(artifact.repoId) ? AUDIO_CPP_REPO : artifact.repoId);
const bucket = artifactsByRepo.get(hubRepo);
if (bucket) bucket.push(artifact);
else artifactsByRepo.set(hubRepo, [artifact]);
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.ts b/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.ts
index 8588d2bc4e5..ed852b34397 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.ts
+++ b/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.ts
@@ -41,6 +41,9 @@ export interface ModelArtifact {
repoId: string;
/** Vendor repo this unsloth mirror copies byte for byte; its id (a cached copy) resolves here too. */
upstreamRepoId?: string;
+ /** The open repo the backend downloads this vendor id from (diffusion_families._GATED_MIRROR_PAIRS),
+ * so a gate on repoId never reaches the user. The network check judges this repo instead. */
+ fetchedFrom?: string;
format: ArtifactFormat;
loadKind: LoadKind;
/** single_file loads name their exact checkpoint inside the repo. */
@@ -259,6 +262,7 @@ export const IMAGE_CATALOG: CatalogGroup[] = [
bf16Pipeline("black-forest-labs/flux-3-image-klein", 18.92, {
totalParams: 5548681984,
prequantRepo: "unsloth/flux-3-image-klein-FP8",
+ fetchedFrom: "unsloth/flux-3-image-klein-FP8",
prequantSizeGb: { fp8: 6.0, int8: 6.0 },
}),
gguf("unsloth/flux-3-image-klein-GGUF"),
@@ -276,6 +280,7 @@ export const IMAGE_CATALOG: CatalogGroup[] = [
bf16Pipeline("black-forest-labs/flux-3-image-klein-base", 18.9, {
totalParams: 5538458368,
prequantRepo: "unsloth/flux-3-image-klein-base-FP8",
+ fetchedFrom: "unsloth/flux-3-image-klein-base-FP8",
// The INT8 file is BFL's own int8_convrot denoiser, smaller than the FP8.
prequantSizeGb: { fp8: 5.98, int8: 5.41 },
}),
diff --git a/studio/frontend/tests/model-catalog-fetched-from.test.ts b/studio/frontend/tests/model-catalog-fetched-from.test.ts
new file mode 100644
index 00000000000..f7ce3391d31
--- /dev/null
+++ b/studio/frontend/tests/model-catalog-fetched-from.test.ts
@@ -0,0 +1,58 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+// A catalog row on a gated vendor id is still a one-click download when the backend fetches it from an
+// open unsloth mirror, so it carries `fetchedFrom` and no `gated: true` (which would make the router skip
+// it). The nightly network check then judges the mirror. That is only true while the backend really
+// does redirect the id, so every `fetchedFrom` must be one of diffusion_families' gated mirror pairs.
+
+import assert from "node:assert/strict";
+import test from "node:test";
+import { readFileSync } from "node:fs";
+import { fileURLToPath } from "node:url";
+
+import {
+ IMAGE_CATALOG,
+ VIDEO_CATALOG,
+} from "../src/features/model-picker/components/model-selector/model-catalog.ts";
+
+const FAMILIES = fileURLToPath(
+ new URL("../../backend/core/inference/diffusion_families.py", import.meta.url),
+);
+
+function gatedMirrorPairs(): Set<string> {
+ const source = readFileSync(FAMILIES, "utf8");
+ const pairs = new Set<string>();
+ for (const table of ["_GATED_MIRROR_PAIRS", "_VIDEO_GATED_MIRROR_PAIRS"]) {
+ const body = source.match(new RegExp(`^${table}: [^=]+= \\(\\n([\\s\\S]*?)^\\)`, "m"));
+ assert.ok(body, `diffusion_families.py no longer defines ${table}`);
+ for (const [, upstream, mirror] of body[1].matchAll(/\("([^"]+)",\s*"([^"]+)"\)/g)) {
+ pairs.add(`${upstream} -> ${mirror}`);
+ }
+ }
+ assert.ok(pairs.size >= 10, `read only ${pairs.size} gated mirror pairs; the table format moved`);
+ return pairs;
+}
+
+const rows = [...IMAGE_CATALOG, ...VIDEO_CATALOG].flatMap((group) => group.artifacts);
+
+test("every fetchedFrom is a mirror the backend actually fetches the vendor id from", () => {
+ const pairs = gatedMirrorPairs();
+ const declared = rows.filter((artifact) => artifact.fetchedFrom);
+ assert.ok(declared.length > 0, "no catalog row declares fetchedFrom any more");
+ for (const artifact of declared) {
+ assert.ok(
+ pairs.has(`${artifact.repoId} -> ${artifact.fetchedFrom}`),
+ `${artifact.repoId} declares fetchedFrom ${artifact.fetchedFrom}, which is not in _GATED_MIRROR_PAIRS`,
+ );
+ assert.notEqual(artifact.gated, true, `${artifact.repoId}: a mirrored row is not gated for the user`);
+ }
+});
+
+test("the FLUX.3 Klein bf16 rows on the gated BFL ids name their open mirror", () => {
+ for (const id of ["black-forest-labs/flux-3-image-klein", "black-forest-labs/flux-3-image-klein-base"]) {
+ const row = rows.find((artifact) => artifact.repoId === id && artifact.format === "bf16");
+ assert.ok(row, id);
+ assert.equal(row.fetchedFrom, `unsloth/${id.split("/")[1]}-FP8`);
+ }
+});