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.

1.1 KB
Raw Blame
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0

/** The Hardware row truncates, so VRAM gets its own row rather than trailing the GPU name. */

import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import test from "node:test";

const source = readFileSync(
  new URL("../src/features/studio/wizard/run-preview-card.tsx", import.meta.url),
  "utf8",
);

function metaRow(labelKey: string): string {
  const start = source.indexOf(`label={t("${labelKey}")}`);
  assert.ok(start >= 0, `no MetaRow labelled ${labelKey}`);
  return source.slice(start, source.indexOf("/>", start));
}

test("Hardware row carries the GPU name only, and wraps", () => {
  const row = metaRow("studio.preview.hardware");
  assert.doesNotMatch(row, /memoryTotalGb/);
  assert.match(row, /\bwrap\b/);
});

test("VRAM has its own rounded row with the exact value on hover", () => {
  const row = metaRow("studio.preview.vram");
  assert.match(row, /Math\.round\(gpu\.memoryTotalGb\)\} GiB/);
  assert.match(row, /title=\{`\$\{gpu\.memoryTotalGb\} GiB`\}/);
});