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: name the checkpoint on MiniMax H3 quant chips (#8466)
Daniel Hane3897f47f0b7
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx b/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsxindex 5e472db2a5f..ae8eece5967 100644--- a/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx+++ b/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx@@ -189,6 +189,8 @@ import type {} from "./types";import { describeVariantListingError } from "./variant-listing-error";import {+ ggufQuantChipLabel,+ ggufQuantDetailLabel,ggufVariantPickerLabel,groupGgufVariantsForPicker,h3PickerHasOnlyPrunedBuilds,@@ -1426,6 +1428,8 @@ function GgufVariantExpander({}return recommended;}, [variantGroups, preferredByGroup, totalBudgetGb, budgetKnown, getGgufFit]);+ // Flattened, for readers with no row to ask about (the footprint representative+ // below). A ROW asks its own group, or it lights the other group's pick too.const effectiveRecommended = useMemo(() => new Set(effectiveRecommendedByGroup.values()),[effectiveRecommendedByGroup],@@ -1678,6 +1682,11 @@ function GgufVariantExpander({);const showGroupHeading =group?.title != null && group.variants[0]?.filename === v.filename;+ // Its own group's pick. Matching on the quant alone happens to work only+ // because an H3 key is unique per file, which is the backend's rule.+ const isRecommended =+ group != null &&+ effectiveRecommendedByGroup.get(group.key) === v.quant;const fit = getGgufFit(v.size_bytes);const oom = fit === "oom";const tight = fit === "tight";@@ -1731,7 +1740,7 @@ function GgufVariantExpander({</span>) : null}</>- ) : effectiveRecommended.has(v.quant) ? (+ ) : isRecommended ? (<span className="ml-1.5 text-ui-9 font-sans font-medium text-primary/70">recommended</span>@@ -2151,10 +2160,17 @@ function localModelIsGguf(m: LocalModelInfo): boolean {);}-function localPathTooltip(name: string, path: string): ReactNode {+function localPathTooltip(+ name: string,+ path: string,+ // Which checkpoint, since the path cannot say: an H3 repo holds its keyframe+ // and reference partitions in one directory.+ detail?: string,+): ReactNode {return (<><span className="block break-words">{name}</span>+ {detail ? <span className="mt-0.5 block break-words">{detail}</span> : null}<span className="block mt-1 text-ui-10 text-muted-foreground break-all">{path}</span>@@ -4424,9 +4440,11 @@ export function HubModelPicker({<div className="min-w-0 flex-1"><ModelRowlabel={entry.repoId}- tooltipText={`${entry.repoId} (${entry.quant})`}+ tooltipText={`${entry.repoId} (${ggufQuantDetailLabel(+ entry.quant,+ )})`}meta="GGUF"- quantChip={entry.quant}+ quantChip={ggufQuantChipLabel(entry.quant)}alignMeta="device"selected={isSelected}loaded={isLoaded}@@ -4544,9 +4562,13 @@ export function HubModelPicker({<div className="min-w-0 flex-1"><ModelRowlabel={c.repo_id}- tooltipText={localPathTooltip(c.repo_id, c.cache_path)}+ tooltipText={localPathTooltip(+ c.repo_id,+ c.cache_path,+ ggufQuantDetailLabel(variant.quant),+ )}meta={`GGUF · ${formatBytes(variant.size_bytes)}`}- quantChip={variant.quant}+ quantChip={ggufQuantChipLabel(variant.quant)}showVision={c.has_vision || sole.hasVision}selected={isSelected}loaded={rowState.loaded}diff --git a/studio/frontend/src/features/model-picker/components/model-selector/variant-presentation.ts b/studio/frontend/src/features/model-picker/components/model-selector/variant-presentation.tsindex 64f0b23c22d..67fcbeec64e 100644--- a/studio/frontend/src/features/model-picker/components/model-selector/variant-presentation.ts+++ b/studio/frontend/src/features/model-picker/components/model-selector/variant-presentation.ts@@ -15,22 +15,29 @@ export type GgufVariantPresentationGroup<T extends PresentableGgufVariant> = {variants: T[];};-const H3_FILENAME = /^minimax_h3_(fl2va|ref2va)(?:_pruned)?-(.+)\.gguf$/i;+// `.gguf` optional: an H3 quant KEY is the file stem the backend keyed it by+// (`_unknown_gguf_variant_key`), so the same parser reads both. Lazy quant group+// so the suffix wins when present.+const H3_FILENAME = /^minimax_h3_(fl2va|ref2va)(?:_pruned)?-(.+?)(?:\.gguf)?$/i;const GGUF_SHARD_SUFFIX = /-\d{5}-of-\d{5}$/i;const PATH_SEPARATOR = /[\\/]/;+// The backend's own wording (`_apply_gguf_display_labels`), so the Hub card and a+// row's tooltip name one checkpoint the same way.+const H3_WORKFLOW_LABEL = {+ "text-frames": "Text & frames",+ "reference-media": "References",+} as const;+type H3Presentation = {group: "text-frames" | "reference-media";quantLabel: string;build: "Full" | "Pruned";};-function h3Presentation(- variant: PresentableGgufVariant,-): H3Presentation | null {- const filename =- variant.filename.split(PATH_SEPARATOR).at(-1) ?? variant.filename;- const match = H3_FILENAME.exec(filename);+function h3PresentationFor(name: string): H3Presentation | null {+ const leaf = name.split(PATH_SEPARATOR).at(-1) ?? name;+ const match = H3_FILENAME.exec(leaf);if (!match) {return null;}@@ -38,10 +45,32 @@ function h3Presentation(group:match[1].toLowerCase() === "ref2va" ? "reference-media" : "text-frames",quantLabel: match[2].replace(GGUF_SHARD_SUFFIX, ""),- build: filename.toLowerCase().includes("_pruned-") ? "Pruned" : "Full",+ build: leaf.toLowerCase().includes("_pruned-") ? "Pruned" : "Full",};}+function h3Presentation(+ variant: PresentableGgufVariant,+): H3Presentation | null {+ return h3PresentationFor(variant.filename);+}++/** A GGUF quant KEY as the row's mono chip: the quant alone, since that column is+ * capped at 7.2em and an H3 key is a whole file stem that clips to nonsense. The+ * workflow and build go to `ggufQuantDetailLabel`. Other quants pass through. */+export function ggufQuantChipLabel(quant: string): string {+ return h3PresentationFor(quant)?.quantLabel ?? quant;+}++/** The same key in full, for a tooltip with room for it: workflow and build. */+export function ggufQuantDetailLabel(quant: string): string {+ const h3 = h3PresentationFor(quant);+ if (!h3) {+ return quant;+ }+ return `${H3_WORKFLOW_LABEL[h3.group]} · ${h3.quantLabel} · ${h3.build}`;+}+export function ggufVariantPickerLabel(variant: PresentableGgufVariant,options?: { h3Grouped?: boolean; hideH3PrunedBuild?: boolean },diff --git a/studio/frontend/tests/model-picker-variant-presentation.test.ts b/studio/frontend/tests/model-picker-variant-presentation.test.tsindex fd7616154c9..d17e2f29c10 100644--- a/studio/frontend/tests/model-picker-variant-presentation.test.ts+++ b/studio/frontend/tests/model-picker-variant-presentation.test.ts@@ -5,6 +5,8 @@ import assert from "node:assert/strict";import test from "node:test";import {+ ggufQuantChipLabel,+ ggufQuantDetailLabel,ggufVariantPickerLabel,groupGgufVariantsForPicker,h3PickerHasOnlyPrunedBuilds,@@ -169,3 +171,57 @@ test("each workflow uses the nearest-size fallback for different quant names", (assert.equal(preferred.get("text-frames"), textRecommended);assert.equal(preferred.get("reference-media"), referenceQ3);});++test("an H3 quant chip is the quant alone, because the column is capped", () => {+ // The column fits UD-Q4_K_XL and no more.+ assert.equal(ggufQuantChipLabel("minimax_h3_fl2va_pruned-Q4_K_M"), "Q4_K_M");+ assert.equal(+ ggufQuantChipLabel("minimax_h3_ref2va-UD-Q3_K_XL"),+ "UD-Q3_K_XL",+ );+ // A suffix still on, and a shard counter, read alike.+ assert.equal(+ ggufQuantChipLabel("minimax_h3_ref2va_pruned-Q4_K_M.gguf"),+ "Q4_K_M",+ );+ assert.equal(+ ggufQuantChipLabel("minimax_h3_fl2va_pruned-Q4_K_M-00001-of-00002"),+ "Q4_K_M",+ );+});++test("the tooltip keeps the workflow the chip has no room for", () => {+ assert.equal(+ ggufQuantDetailLabel("minimax_h3_fl2va_pruned-Q4_K_M"),+ "Text & frames · Q4_K_M · Pruned",+ );+ assert.equal(+ ggufQuantDetailLabel("minimax_h3_ref2va-UD-Q3_K_XL"),+ "References · UD-Q3_K_XL · Full",+ );+});++test("an ordinary quant key is left exactly as it is", () => {+ for (const label of [ggufQuantChipLabel, ggufQuantDetailLabel]) {+ assert.equal(label("Q4_K_M"), "Q4_K_M");+ assert.equal(label("UD-Q2_K_XL"), "UD-Q2_K_XL");+ assert.equal(label("distilled-1.1/Q4_K_M"), "distilled-1.1/Q4_K_M");+ assert.equal(+ label("qwen3vl_32b_minimax_h3-Q4_K_M"),+ "qwen3vl_32b_minimax_h3-Q4_K_M",+ );+ }+});++test("the picker label is unchanged by the key-shaped parse", () => {+ // The optional suffix must not change what a ROW reads under its heading.+ const pruned = variant("minimax_h3_fl2va_pruned-UD-Q3_K_XL.gguf", 9);+ assert.equal(+ ggufVariantPickerLabel(pruned, {+ h3Grouped: true,+ hideH3PrunedBuild: true,+ }),+ "UD-Q3_K_XL",+ );+ assert.equal(groupGgufVariantsForPicker([pruned])[0]?.key, "text-frames");+});