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: label GPU totals GiB, the unit they are actually in (#9570)
Daniel Han064ff16e68aa
diff --git a/studio/frontend/src/features/images/images-page.tsx b/studio/frontend/src/features/images/images-page.tsxindex fd9998fd49d..61404c6d9de 100644--- a/studio/frontend/src/features/images/images-page.tsx+++ b/studio/frontend/src/features/images/images-page.tsx@@ -3570,7 +3570,7 @@ export function ImagesPage({(d) =>[String(d.index),- `GPU ${d.index}${d.memoryTotalGb ? ` · ${Math.round(d.memoryTotalGb)} GB` : ""}`,+ `GPU ${d.index}${d.memoryTotalGb ? ` · ${Math.round(d.memoryTotalGb)} GiB` : ""}`,] as [string, string],),]}diff --git a/studio/frontend/src/features/model-picker/components/model-config-page.tsx b/studio/frontend/src/features/model-picker/components/model-config-page.tsxindex 104bd698a6f..4860345cb47 100644--- a/studio/frontend/src/features/model-picker/components/model-config-page.tsx+++ b/studio/frontend/src/features/model-picker/components/model-config-page.tsx@@ -842,7 +842,7 @@ function GpuMemorySettings({<span className="min-w-0 truncate text-ui-12 text-nav-fg/80">GPU {d.index}: {d.name}{d.memoryTotalGb- ? ` · ${Math.round(d.memoryTotalGb)} GB`+ ? ` · ${Math.round(d.memoryTotalGb)} GiB`: ""}</span><Switchdiff --git a/studio/frontend/src/features/studio/wizard/run-preview-card.tsx b/studio/frontend/src/features/studio/wizard/run-preview-card.tsxindex 1f14df459ae..41781c5d506 100644--- a/studio/frontend/src/features/studio/wizard/run-preview-card.tsx+++ b/studio/frontend/src/features/studio/wizard/run-preview-card.tsx@@ -512,7 +512,7 @@ export function RunPreviewCard({label={t("studio.preview.hardware")}value={gpu.available- ? `${gpu.name} · ${gpu.memoryTotalGb} GB`+ ? `${gpu.name} · ${gpu.memoryTotalGb} GiB`: t("studio.preview.noGpu")}/>diff --git a/studio/frontend/src/features/video/video-page.tsx b/studio/frontend/src/features/video/video-page.tsxindex 006be6b6f2c..0ffd6ac0803 100644--- a/studio/frontend/src/features/video/video-page.tsx+++ b/studio/frontend/src/features/video/video-page.tsx@@ -3261,7 +3261,7 @@ function VideoGenerator({(d) =>[String(d.index),- `GPU ${d.index}${d.memoryTotalGb ? ` · ${Math.round(d.memoryTotalGb)} GB` : ""}`,+ `GPU ${d.index}${d.memoryTotalGb ? ` · ${Math.round(d.memoryTotalGb)} GiB` : ""}`,] as [string, string],),]}diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.tsindex 9b635177ec1..c0d5352c235 100644--- a/studio/frontend/src/i18n/locales/ar.ts+++ b/studio/frontend/src/i18n/locales/ar.ts@@ -1587,8 +1587,8 @@ export const ar = {"لا يمكن استخدام مخرجات المهايئ كنماذج أساسية للتدريب.",reasonNotTrainable: "هذا النموذج الموجود على الجهاز غير قابل للتدريب.",reasonUnsupportedFormat: "تنسيق هذا النموذج غير مدعوم للتدريب.",- vramNeeds: "يحتاج إلى نحو {est}GB من VRAM (GPU: {total}GB)",- vramTight: "نحو {est}GB من VRAM (المساحة ضيقة على {total}GB)",+ vramNeeds: "يحتاج إلى نحو {est}GB من VRAM (GPU: {total}GiB)",+ vramTight: "نحو {est}GB من VRAM (المساحة ضيقة على {total}GiB)",vramApprox: "نحو {est}GB من VRAM",sourceModelsFolder: "مجلد النماذج",sourceHfCache: "ذاكرة HF المؤقتة",diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.tsindex e37d2c505f6..7db19c11799 100644--- a/studio/frontend/src/i18n/locales/de.ts+++ b/studio/frontend/src/i18n/locales/de.ts@@ -1636,8 +1636,8 @@ export const de = {"Dieses Modell auf dem Gerät kann nicht trainiert werden.",reasonUnsupportedFormat:"Dieses Modellformat wird für das Training nicht unterstützt.",- vramNeeds: "Benötigt ~{est} GB VRAM (GPU: {total} GB)",- vramTight: "~{est} GB VRAM (knapp bei {total} GB)",+ vramNeeds: "Benötigt ~{est} GB VRAM (GPU: {total} GiB)",+ vramTight: "~{est} GB VRAM (knapp bei {total} GiB)",vramApprox: "~{est} GB VRAM",sourceModelsFolder: "Modellordner",sourceHfCache: "HF-Cache",diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.tsindex cfefe32ec83..0f55767546e 100644--- a/studio/frontend/src/i18n/locales/en.ts+++ b/studio/frontend/src/i18n/locales/en.ts@@ -1582,8 +1582,8 @@ export const en = {sourceLocalModel: "Local model",vramOomBadge: "OOM",vramTightBadge: "Tight",- vramNeeds: "Needs ~{est}GB VRAM (GPU: {total}GB)",- vramTight: "~{est}GB VRAM (tight on {total}GB)",+ vramNeeds: "Needs ~{est}GB VRAM (GPU: {total}GiB)",+ vramTight: "~{est}GB VRAM (tight on {total}GiB)",vramApprox: "~{est}GB VRAM",},methods: {diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.tsindex 8a502cf05e3..9e18929ba04 100644--- a/studio/frontend/src/i18n/locales/es.ts+++ b/studio/frontend/src/i18n/locales/es.ts@@ -1627,8 +1627,8 @@ export const es = {"Este modelo del dispositivo no se puede usar para entrenar.",reasonUnsupportedFormat:"Este formato de modelo no es compatible con el entrenamiento.",- vramNeeds: "Necesita ~{est} GB de VRAM (GPU: {total} GB)",- vramTight: "~{est} GB de VRAM (ajustado para {total} GB)",+ vramNeeds: "Necesita ~{est} GB de VRAM (GPU: {total} GiB)",+ vramTight: "~{est} GB de VRAM (ajustado para {total} GiB)",vramApprox: "~{est} GB de VRAM",sourceModelsFolder: "Carpeta de modelos",sourceHfCache: "Caché de HF",diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.tsindex e92dd658a5d..7f27bd259c8 100644--- a/studio/frontend/src/i18n/locales/fr.ts+++ b/studio/frontend/src/i18n/locales/fr.ts@@ -1638,8 +1638,8 @@ export const fr = {"Ce modèle présent sur l'appareil ne peut pas être entraîné.",reasonUnsupportedFormat:"Ce format de modèle n'est pas pris en charge pour l'entraînement.",- vramNeeds: "Nécessite environ {est} Go de VRAM (GPU : {total} Go)",- vramTight: "Environ {est} Go de VRAM (limite sur {total} Go)",+ vramNeeds: "Nécessite environ {est} Go de VRAM (GPU : {total} Gio)",+ vramTight: "Environ {est} Go de VRAM (limite sur {total} Gio)",vramApprox: "Environ {est} Go de VRAM",sourceModelsFolder: "Dossier des modèles",sourceHfCache: "Cache HF",diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.tsindex 9a56c62f43e..f0e5c35ce10 100644--- a/studio/frontend/src/i18n/locales/hi.ts+++ b/studio/frontend/src/i18n/locales/hi.ts@@ -1596,8 +1596,8 @@ export const hi = {"इस डिवाइस पर मौजूद मॉडल को ट्रेन नहीं किया जा सकता।",reasonUnsupportedFormat:"यह मॉडल फ़ॉर्मेट ट्रेनिंग के लिए समर्थित नहीं है।",- vramNeeds: "लगभग {est}GB VRAM चाहिए (GPU: {total}GB)",- vramTight: "लगभग {est}GB VRAM ({total}GB पर बमुश्किल फिट)",+ vramNeeds: "लगभग {est}GB VRAM चाहिए (GPU: {total}GiB)",+ vramTight: "लगभग {est}GB VRAM ({total}GiB पर बमुश्किल फिट)",vramApprox: "लगभग {est}GB VRAM",sourceModelsFolder: "मॉडल फ़ोल्डर",sourceHfCache: "HF कैश",diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.tsindex e66a273a485..937b4e8e1f5 100644--- a/studio/frontend/src/i18n/locales/it.ts+++ b/studio/frontend/src/i18n/locales/it.ts@@ -1645,8 +1645,8 @@ export const it = {sourceLocalModel: "Modello locale",vramOomBadge: "OOM",vramTightBadge: "Al limite",- vramNeeds: "Richiede ~{est} GB di VRAM (GPU: {total} GB)",- vramTight: "~{est} GB di VRAM (al limite su {total} GB)",+ vramNeeds: "Richiede ~{est} GB di VRAM (GPU: {total} GiB)",+ vramTight: "~{est} GB di VRAM (al limite su {total} GiB)",vramApprox: "~{est} GB di VRAM",},methods: {diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.tsindex 2319f446bd3..f3bd926cfc6 100644--- a/studio/frontend/src/i18n/locales/ja.ts+++ b/studio/frontend/src/i18n/locales/ja.ts@@ -1568,8 +1568,8 @@ export const ja = {"このデバイス上のモデルはトレーニングできません。",reasonUnsupportedFormat:"このモデル形式はトレーニングでサポートされていません。",- vramNeeds: "約 {est}GB VRAM が必要 (GPU: {total}GB)",- vramTight: "約 {est}GB VRAM (GPU {total}GB ではギリギリです)",+ vramNeeds: "約 {est}GB VRAM が必要 (GPU: {total}GiB)",+ vramTight: "約 {est}GB VRAM (GPU {total}GiB ではギリギリです)",vramApprox: "約 {est}GB VRAM",vramOomBadge: "OOM",vramTightBadge: "ギリギリ",diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.tsindex c6c1100c712..e035a0cd4dd 100644--- a/studio/frontend/src/i18n/locales/ko.ts+++ b/studio/frontend/src/i18n/locales/ko.ts@@ -1592,8 +1592,8 @@ export const ko = {reasonNotTrainable: "기기에 있는 이 모델은 학습할 수 없습니다.",reasonUnsupportedFormat:"이 모델 형식은 학습에서 지원되지 않습니다.",- vramNeeds: "약 {est}GB VRAM 필요 (GPU: {total}GB)",- vramTight: "약 {est}GB VRAM ({total}GB에서 빠듯함)",+ vramNeeds: "약 {est}GB VRAM 필요 (GPU: {total}GiB)",+ vramTight: "약 {est}GB VRAM ({total}GiB에서 빠듯함)",vramApprox: "약 {est}GB VRAM",vramOomBadge: "OOM",vramTightBadge: "빠듯함",diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.tsindex f34e85f4838..4aa19ea74ea 100644--- a/studio/frontend/src/i18n/locales/pt-br.ts+++ b/studio/frontend/src/i18n/locales/pt-br.ts@@ -1609,8 +1609,8 @@ export const ptBR = {"Este modelo no dispositivo não pode ser treinado.",reasonUnsupportedFormat:"Este formato de modelo não é compatível com treinamento.",- vramNeeds: "Precisa de ~{est} GB de VRAM (GPU: {total} GB)",- vramTight: "~{est} GB de VRAM (no limite de {total} GB)",+ vramNeeds: "Precisa de ~{est} GB de VRAM (GPU: {total} GiB)",+ vramTight: "~{est} GB de VRAM (no limite de {total} GiB)",vramApprox: "~{est} GB de VRAM",sourceModelsFolder: "Pasta de modelos",sourceHfCache: "Cache do HF",diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.tsindex c545d354d7c..dc677f05e41 100644--- a/studio/frontend/src/i18n/locales/ru.ts+++ b/studio/frontend/src/i18n/locales/ru.ts@@ -1613,8 +1613,8 @@ export const ru = {reasonNotTrainable: "Эта модель на устройстве не поддерживает обучение.",reasonUnsupportedFormat:"Этот формат модели не поддерживается для обучения.",- vramNeeds: "Требуется ~{est} ГБ VRAM (GPU: {total} ГБ)",- vramTight: "~{est} ГБ VRAM (впритык для {total} ГБ)",+ vramNeeds: "Требуется ~{est} ГБ VRAM (GPU: {total} ГиБ)",+ vramTight: "~{est} ГБ VRAM (впритык для {total} ГиБ)",vramApprox: "~{est} ГБ VRAM",vramOomBadge: "OOM",vramTightBadge: "Впритык",diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.tsindex d088b29db0c..5ba2c3dba1f 100644--- a/studio/frontend/src/i18n/locales/zh-CN.ts+++ b/studio/frontend/src/i18n/locales/zh-CN.ts@@ -1543,8 +1543,8 @@ export const zhCN = {reasonAdapter: "适配器输出不能作为基础训练模型。",reasonNotTrainable: "此设备上的模型无法用于训练。",reasonUnsupportedFormat: "训练不支持此模型格式。",- vramNeeds: "约需 {est}GB VRAM(GPU:{total}GB)",- vramTight: "约 {est}GB VRAM(在 {total}GB 上偏紧)",+ vramNeeds: "约需 {est}GB VRAM(GPU:{total}GiB)",+ vramTight: "约 {est}GB VRAM(在 {total}GiB 上偏紧)",vramApprox: "约 {est}GB VRAM",vramOomBadge: "OOM",vramTightBadge: "显存吃紧",diff --git a/studio/frontend/tests/vram-total-gib-suffix.test.ts b/studio/frontend/tests/vram-total-gib-suffix.test.tsnew file mode 100644index 00000000000..8d1da75dc0b--- /dev/null+++ b/studio/frontend/tests/vram-total-gib-suffix.test.ts@@ -0,0 +1,103 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++/**+ * `memoryTotalGb` is binary, so its label must say GiB.+ *+ * The backend builds it as `props.total_memory / 1024**3` and subtracts no+ * budget or reserve, so a 48 GB card printed "45 GB" and was reported as broken+ * VRAM detection (#9551). The field name cannot change without churning the+ * API, so the suffix is pinned here: it reads like a typo fix, and it kept+ * turning up on surfaces the previous pass had missed.+ */++import assert from "node:assert/strict";+import { readdirSync, readFileSync } from "node:fs";+import test from "node:test";++const SRC = new URL("../src/", import.meta.url);++// Files that interpolate the total and name the unit inline.+const RENDERERS = [+ "features/model-picker/components/model-config-page.tsx",+ "features/images/images-page.tsx",+ "features/video/video-page.tsx",+ "features/studio/wizard/run-preview-card.tsx",+ "features/hub/hub-page.tsx",+ "features/settings/tabs/about-tab.tsx",+];++// `[^`$]*` keeps the match inside one literal segment, so an unrelated "GB"+// later in the file cannot be paired with an earlier total.+const SUFFIXED = /\$\{[^}]*(?:memoryTotalGb|vramTotalGb|systemRamTotalGb)[^}]*\}[^`$]*?\b(GiB|GB)\b/g;++test("VRAM and RAM totals are labelled GiB, not GB", () => {+ const offenders: string[] = [];++ for (const relative of RENDERERS) {+ const source = readFileSync(new URL(relative, SRC), "utf8");+ const matches = [...source.matchAll(SUFFIXED)];++ // Per file, not summed: hub-page.tsx matches twice, so an aggregate floor+ // would let one renderer drop to zero matches and still pass.+ assert.ok(matches.length > 0, `${relative}: no labelled total found`);++ for (const match of matches) {+ if (match[1] !== "GiB") {+ offenders.push(`${relative}: ${match[0].trim()}`);+ }+ }+ }++ assert.deepEqual(+ offenders,+ [],+ `these render a GiB value with a GB suffix:\n${offenders.join("\n")}`,+ );+});++// These format through a helper, so the unit choice moves to the call site.+const HELPER_RENDERERS = [+ "components/floating-monitor.tsx",+ "features/settings/tabs/resources-tab.tsx",+];++// The training picker names its unit in the translation, so pin it per locale.+// `{est}` stays decimal GB: estimateLoadingVram divides by 1e9.+const LOCALES = new URL("../src/i18n/locales/", import.meta.url);+// Binary first: GiB has to win the alternation before GB can match its tail.+const UNIT = /\{total\}\s*(GiB|Gio|ГиБ|GB|Go|ГБ)/;+const BINARY_UNITS = ["GiB", "Gio", "ГиБ"];++test("localized GPU totals name a binary unit", () => {+ const files = readdirSync(LOCALES).filter((f) => f.endsWith(".ts"));+ assert.ok(files.length > 0, "no locales found");++ for (const file of files) {+ const source = readFileSync(new URL(file, LOCALES), "utf8");+ for (const line of source.split("\n")) {+ if (!/\b(vramNeeds|vramTight):/.test(line)) continue;+ const unit = line.match(UNIT);+ assert.ok(unit, `${file}: no unit after {total} in ${line.trim()}`);+ assert.ok(+ BINARY_UNITS.includes(unit[1]),+ `${file}: {total} is binary but is labelled ${unit[1]}`,+ );+ }+ }+});++test("helper-formatted totals pick the GiB helper, not the disk one", () => {+ for (const relative of HELPER_RENDERERS) {+ const source = readFileSync(new URL(relative, SRC), "utf8");++ const helper = source.match(/function formatGiB[\s\S]*?\n}/);+ assert.ok(helper, `${relative}: no formatGiB helper`);+ assert.match(helper[0], /`.*GiB`/, `${relative}: formatGiB does not suffix GiB`);++ // formatGb is the decimal disk one, so no memory value may reach it.+ for (const call of source.matchAll(/(?<!function )formatGb\(([^)]*)\)/g)) {+ assert.match(call[1], /disk/i, `${relative}: ${call[0]} formats memory as decimal GB`);+ }+ }+});