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: optional detailed Live monitor with GPU load, temperature and power (#13351)
Daniel Han2e387701402c
diff --git a/studio/backend/main.py b/studio/backend/main.pyindex 28693d8949a..a1d7c0bd77a 100644--- a/studio/backend/main.py+++ b/studio/backend/main.py@@ -2308,6 +2308,7 @@ def _get_cached_system_gpu_info("""Return training and inference GPU info with bounded live-probe churn."""import timefrom utils.hardware import (+ LIVE_GPU_TELEMETRY_KEYS,amd_driver_warning_report,get_backend_visible_gpu_info,get_cross_vendor_inference_gpu_info,@@ -2382,6 +2383,7 @@ def _get_cached_system_gpu_info(enriched_dev["vram_utilization_pct"] = util.get("vram_utilization_pct", dev.get("vram_utilization_pct"))+ enriched_dev.update({k: util[k] for k in LIVE_GPU_TELEMETRY_KEYS if k in util})enriched_devices.append(enriched_dev)# The tile divides the aggregate by the SUMMED per-device totals, so both must describe the same cards. Thediff --git a/studio/backend/tests/test_system_gpu_live_telemetry.py b/studio/backend/tests/test_system_gpu_live_telemetry.pynew file mode 100644index 00000000000..e4f35ba34d4--- /dev/null+++ b/studio/backend/tests/test_system_gpu_live_telemetry.py@@ -0,0 +1,133 @@+# SPDX-License-Identifier: AGPL-3.0-only+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++from types import SimpleNamespace++import main++_LOGGER = SimpleNamespace(debug = lambda *args: None)+++def _patch(+ monkeypatch,+ util_device,+ util_backend = "cuda",+):+ import utils.hardware as hardware+ from core.inference.llama_cpp import LlamaCppBackend++ monkeypatch.setattr(main, "_system_gpu_cache", None)+ monkeypatch.setattr(LlamaCppBackend, "_is_vulkan_backend", staticmethod(lambda: False))+ monkeypatch.setattr(LlamaCppBackend, "_backend_lacks_gpu_lib", staticmethod(lambda: False))+ monkeypatch.setattr(hardware, "get_vulkan_inference_gpu_info", lambda: None)+ monkeypatch.setattr(hardware, "get_cross_vendor_inference_gpu_info", lambda: None)+ monkeypatch.setattr(+ hardware,+ "get_backend_visible_gpu_info",+ lambda: {+ "available": True,+ "backend": "cuda",+ "index_kind": "physical",+ "devices": [{"index": 0, "name": "NVIDIA B200", "memory_total_gb": 179.0}],+ },+ )+ calls = []++ def utilization():+ calls.append(1)+ return {"available": True, "backend": util_backend, "devices": [util_device]}++ monkeypatch.setattr(hardware, "get_visible_gpu_utilization", utilization)+ return calls+++def test_system_gpu_devices_carry_the_live_telemetry_the_probe_already_read(monkeypatch):+ calls = _patch(+ monkeypatch,+ {+ "index": 0,+ "vram_used_gb": 10.0,+ "vram_total_gb": 179.0,+ "vram_utilization_pct": 5.6,+ "gpu_utilization_pct": 42.0,+ "temperature_c": 61.0,+ "power_draw_w": 312.5,+ "power_limit_w": 1000.0,+ "power_utilization_pct": 31.2,+ },+ )++ gpu, _ = main._get_cached_system_gpu_info(_LOGGER)++ (device,) = gpu["devices"]+ assert device["gpu_utilization_pct"] == 42.0+ assert device["temperature_c"] == 61.0+ assert device["power_draw_w"] == 312.5+ assert device["power_limit_w"] == 1000.0+ assert device["vram_used_gb"] == 10.0+ # No extra probe: one utilization read per cache window, as before.+ main._get_cached_system_gpu_info(_LOGGER)+ assert len(calls) == 1+++def test_system_gpu_devices_omit_telemetry_the_probe_did_not_report(monkeypatch):+ _patch(monkeypatch, {"index": 0, "vram_used_gb": 1.0, "vram_total_gb": 179.0})++ gpu, _ = main._get_cached_system_gpu_info(_LOGGER)++ (device,) = gpu["devices"]+ for key in ("gpu_utilization_pct", "temperature_c", "power_draw_w", "power_limit_w"):+ assert key not in device+++def test_system_gpu_devices_never_take_telemetry_from_another_backend(monkeypatch):+ _patch(+ monkeypatch,+ {"index": 0, "temperature_c": 70.0, "power_draw_w": 100.0},+ util_backend = "vulkan",+ )++ gpu, _ = main._get_cached_system_gpu_info(_LOGGER)++ (device,) = gpu["devices"]+ assert "temperature_c" not in device+ assert "power_draw_w" not in device+++def test_cuda_inference_inventory_carries_the_same_telemetry(monkeypatch):+ """No-torch / CPU-torch host with a CUDA llama.cpp: the monitor shows inference_gpu."""+ import utils.hardware.hardware as hw+ import utils.hardware.nvidia as nvidia+ from core.inference.llama_cpp import LlamaCppBackend++ monkeypatch.delenv("CUDA_VISIBLE_DEVICES", raising = False)+ monkeypatch.setattr(LlamaCppBackend, "_visible_devices_mask", staticmethod(lambda _name: None))+ monkeypatch.setattr(+ nvidia,+ "get_physical_gpu_inventory",+ lambda: {"devices": [{"index": 0, "name": "RTX 4090", "memory_total_gb": 24.0}]},+ )+ monkeypatch.setattr(+ nvidia,+ "get_visible_gpu_utilization",+ lambda _ids: {+ "devices": [+ {+ "index": 0,+ "vram_used_gb": 2.0,+ "gpu_utilization_pct": 7.0,+ "temperature_c": 44.0,+ "power_draw_w": 35.0,+ "power_limit_w": 450.0,+ }+ ]+ },+ )++ (device,) = hw._nvidia_inference_devices()++ assert device["vram_used_gb"] == 2.0+ assert device["gpu_utilization_pct"] == 7.0+ assert device["temperature_c"] == 44.0+ assert device["power_draw_w"] == 35.0+ assert device["power_limit_w"] == 450.0diff --git a/studio/backend/utils/hardware/__init__.py b/studio/backend/utils/hardware/__init__.pyindex a8b179eca9c..e31a71960a4 100644--- a/studio/backend/utils/hardware/__init__.py+++ b/studio/backend/utils/hardware/__init__.py@@ -7,6 +7,7 @@ from typing import Optionalfrom . import hardware as _hardwarefrom .hardware import (+ LIVE_GPU_TELEMETRY_KEYS,DeviceType,DEVICE,CHAT_ONLY,@@ -89,6 +90,7 @@ def get_torch_device_str() -> str:__all__ = [+ "LIVE_GPU_TELEMETRY_KEYS","DeviceType","DEVICE","CHAT_ONLY",diff --git a/studio/backend/utils/hardware/hardware.py b/studio/backend/utils/hardware/hardware.pyindex b1958397b7b..4b3de1f21ed 100644--- a/studio/backend/utils/hardware/hardware.py+++ b/studio/backend/utils/hardware/hardware.py@@ -6287,6 +6287,10 @@ def _installed_llama_backend() -> Optional[str]:return marker_backend(read_install_marker(LlamaCppBackend._find_llama_server_binary()))+# Readings the utilization probes already return, passed through for the Live monitor's detailed view.+LIVE_GPU_TELEMETRY_KEYS = ("gpu_utilization_pct", "temperature_c", "power_draw_w", "power_limit_w")++def _smi_inference_device(index: int,ordinal: int,@@ -6346,15 +6350,15 @@ def _nvidia_inference_devices() -> list[Dict[str, Any]]:devices = []for ordinal, row in enumerate(rows):util = usage_by_index.get(row["index"], {})- devices.append(- _smi_inference_device(- row["index"],- ordinal,- row.get("name"),- row.get("memory_total_gb") or util.get("vram_total_gb"),- util.get("vram_used_gb"),- )+ device = _smi_inference_device(+ row["index"],+ ordinal,+ row.get("name"),+ row.get("memory_total_gb") or util.get("vram_total_gb"),+ util.get("vram_used_gb"),)+ device.update({k: util[k] for k in LIVE_GPU_TELEMETRY_KEYS if k in util})+ devices.append(device)return devicesdiff --git a/studio/frontend/src/components/floating-monitor.tsx b/studio/frontend/src/components/floating-monitor.tsxindex 00171993674..406e7ab9e3e 100644--- a/studio/frontend/src/components/floating-monitor.tsx+++ b/studio/frontend/src/components/floating-monitor.tsx@@ -26,6 +26,13 @@ import { CpuIcon, GripVerticalIcon, XIcon } from "lucide-react";import { AnimatePresence, motion } from "motion/react";import { useEffect, useRef, useState, useSyncExternalStore } from "react";+import {+ formatPower,+ formatTemperature,+ gpuTelemetryRows,+ selectedDetailMetrics,+ temperatureLevel,+} from "./monitor-details";import {FLOATING_MONITOR_WIDTH,floatingMonitorConstraintStyle,@@ -57,6 +64,48 @@ function usageTextClass(percent: number): string {return "text-primary";}+const LEVEL_INDICATOR_CLASS = {+ ok: "bg-control-accent",+ warm: "bg-amber-500",+ hot: "bg-destructive",+} as const;++const LEVEL_TEXT_CLASS = {+ ok: "text-primary",+ warm: "text-amber-600 dark:text-amber-400",+ hot: "text-destructive",+} as const;++function DetailBar({+ label,+ value,+ percent,+ indicatorClassName,+ textClassName,+}: {+ label: string;+ value: string;+ percent: number;+ indicatorClassName: string;+ textClassName: string;+}) {+ return (+ <div className="space-y-0.5">+ <div className="flex justify-between gap-2 text-xs font-mono text-muted-foreground">+ <span className="truncate">{label}</span>+ <span className={cn("shrink-0 tabular-nums", textClassName)}>+ {value}+ </span>+ </div>+ <Progress+ value={clampPercent(percent)}+ className="h-1 rounded-full bg-muted"+ indicatorClassName={indicatorClassName}+ />+ </div>+ );+}+function formatGiB(value: number): string {// RAM/VRAM come from the backend in binary units (bytes / 1024**3), matching// nvidia-smi and PyTorch, so label the readout GiB rather than GB.@@ -156,6 +205,20 @@ function FloatingMonitorPanel({);const unknownLabel = t("settings.resources.environment.unknown");+ const showDetails = useMonitorOverlayStore((state) => state.showDetails);+ const storedDetailMetrics = useMonitorOverlayStore(+ (state) => state.detailMetrics,+ );+ const detailMetrics = selectedDetailMetrics(storedDetailMetrics);+ const cpuPercent =+ showDetails && detailMetrics.has("cpuLoad") && systemInfo.status === "ready"+ ? clampPercent(systemInfo.cpu?.usage_percent ?? 0)+ : null;+ const telemetryRows =+ showDetails && displayedGpu?.available+ ? gpuTelemetryRows(displayedGpu.devices, detailMetrics)+ : [];+const hasGpu =(displayedGpu?.available ?? false) &&(displayedGpu?.devices.length ?? 0) > 0;@@ -355,6 +418,72 @@ function FloatingMonitorPanel({</span></div>)}+ {cpuPercent !== null && (+ <div+ className="border-t border-border/60 pt-2"+ data-testid="floating-monitor-cpu"+ >+ <DetailBar+ label={t("settings.resources.liveMonitor.cpuLoad")}+ value={`${Math.round(cpuPercent)}%`}+ percent={cpuPercent}+ indicatorClassName={usageIndicatorClass(cpuPercent)}+ textClassName={usageTextClass(cpuPercent)}+ />+ </div>+ )}+ {telemetryRows.map((row) => (+ <div+ key={row.key}+ className="space-y-1.5 border-t border-border/60 pt-2"+ data-testid="floating-monitor-gpu-details"+ >+ <div className="truncate text-ui-11 font-medium font-mono">+ {row.name}+ </div>+ {row.loadPct !== null && (+ <DetailBar+ label={t("settings.resources.liveMonitor.gpuLoad")}+ value={`${Math.round(row.loadPct)}%`}+ percent={row.loadPct}+ indicatorClassName={usageIndicatorClass(row.loadPct)}+ textClassName={usageTextClass(row.loadPct)}+ />+ )}+ {row.temperatureC !== null && (+ <DetailBar+ label={t("settings.resources.liveMonitor.temperature")}+ value={formatTemperature(row.temperatureC)}+ percent={row.temperatureC}+ indicatorClassName={+ LEVEL_INDICATOR_CLASS[temperatureLevel(row.temperatureC)]+ }+ textClassName={+ LEVEL_TEXT_CLASS[temperatureLevel(row.temperatureC)]+ }+ />+ )}+ {row.powerDrawW !== null &&+ (row.powerPct !== null ? (+ <DetailBar+ label={t("settings.resources.liveMonitor.power")}+ value={formatPower(row.powerDrawW, row.powerLimitW)}+ percent={row.powerPct}+ indicatorClassName={usageIndicatorClass(row.powerPct)}+ textClassName={usageTextClass(row.powerPct)}+ />+ ) : (+ <div className="flex justify-between gap-2 text-xs font-mono text-muted-foreground">+ <span className="truncate">+ {t("settings.resources.liveMonitor.power")}+ </span>+ <span className="shrink-0 tabular-nums text-primary">+ {formatPower(row.powerDrawW, null)}+ </span>+ </div>+ ))}+ </div>+ ))}</div></div></motion.div>diff --git a/studio/frontend/src/components/monitor-details.ts b/studio/frontend/src/components/monitor-details.tsnew file mode 100644index 00000000000..937c563aaea--- /dev/null+++ b/studio/frontend/src/components/monitor-details.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++import type { GpuDevice } from "../hooks/use-system.ts";++export const MONITOR_DETAIL_METRICS = [+ "cpuLoad",+ "gpuLoad",+ "temperature",+ "power",+] as const;++export type MonitorDetailMetric = (typeof MONITOR_DETAIL_METRICS)[number];++/** An empty list is a choice; anything else with no known metric (older state, hand edits) means all. */+export function selectedDetailMetrics(+ stored: unknown,+): ReadonlySet<MonitorDetailMetric> {+ const known = Array.isArray(stored)+ ? MONITOR_DETAIL_METRICS.filter((metric) => stored.includes(metric))+ : [];+ return new Set(+ known.length > 0 || (Array.isArray(stored) && stored.length === 0)+ ? known+ : MONITOR_DETAIL_METRICS,+ );+}++export interface GpuTelemetryRow {+ key: string;+ name: string;+ loadPct: number | null;+ temperatureC: number | null;+ powerDrawW: number | null;+ powerLimitW: number | null;+ powerPct: number | null;+}++function finite(value: number | null | undefined): number | null {+ return typeof value === "number" && Number.isFinite(value) ? value : null;+}++/** One row per device that reported at least one selected reading; nothing is fabricated. */+export function gpuTelemetryRows(+ devices: readonly GpuDevice[],+ metrics: ReadonlySet<MonitorDetailMetric>,+): GpuTelemetryRow[] {+ const rows: GpuTelemetryRow[] = [];+ devices.forEach((device, position) => {+ const ordinal = device.visible_ordinal ?? device.index ?? position;+ const loadPct = metrics.has("gpuLoad")+ ? finite(device.gpu_utilization_pct)+ : null;+ const temperatureC = metrics.has("temperature")+ ? finite(device.temperature_c)+ : null;+ const powerDrawW = metrics.has("power")+ ? finite(device.power_draw_w)+ : null;+ const powerLimitW =+ powerDrawW !== null ? finite(device.power_limit_w) : null;+ if (loadPct === null && temperatureC === null && powerDrawW === null) {+ return;+ }+ rows.push({+ key: `${ordinal}`,+ name:+ devices.length > 1+ ? `GPU ${ordinal}${device.name ? `: ${device.name}` : ""}`+ : (device.name ?? `GPU ${ordinal}`),+ loadPct,+ temperatureC,+ powerDrawW,+ powerLimitW,+ powerPct:+ powerDrawW !== null && powerLimitW !== null && powerLimitW > 0+ ? (powerDrawW / powerLimitW) * 100+ : null,+ });+ });+ return rows;+}++/** Most cards throttle in the high 80s, so the bar warns before that. */+export function temperatureLevel(celsius: number): "ok" | "warm" | "hot" {+ if (celsius >= 90) {+ return "hot";+ }+ if (celsius >= 80) {+ return "warm";+ }+ return "ok";+}++export function formatTemperature(celsius: number): string {+ return `${Math.round(celsius)}°C`;+}++export function formatPower(drawW: number, limitW: number | null): string {+ return limitW !== null && limitW > 0+ ? `${Math.round(drawW)} / ${Math.round(limitW)} W`+ : `${Math.round(drawW)} W`;+}diff --git a/studio/frontend/src/features/settings/stores/monitor-overlay-store.ts b/studio/frontend/src/features/settings/stores/monitor-overlay-store.tsindex 1af804a19e8..e89452c5ff0 100644--- a/studio/frontend/src/features/settings/stores/monitor-overlay-store.ts+++ b/studio/frontend/src/features/settings/stores/monitor-overlay-store.ts@@ -4,11 +4,22 @@import { create } from "zustand";import { persist } from "zustand/middleware";+import {+ MONITOR_DETAIL_METRICS,+ type MonitorDetailMetric,+ selectedDetailMetrics,+} from "@/components/monitor-details";+interface MonitorOverlayState {isOpen: boolean;isMinimized: boolean;+ /** Off by default: the monitor looks as it always has until a user opts in. */+ showDetails: boolean;+ detailMetrics: MonitorDetailMetric[];setIsOpen: (open: boolean) => void;toggleMinimized: () => void;+ setShowDetails: (show: boolean) => void;+ setDetailMetric: (metric: MonitorDetailMetric, on: boolean) => void;}export const useMonitorOverlayStore = create<MonitorOverlayState>()(@@ -16,9 +27,21 @@ export const useMonitorOverlayStore = create<MonitorOverlayState>()((set) => ({isOpen: false,isMinimized: false,+ showDetails: false,+ detailMetrics: [...MONITOR_DETAIL_METRICS],setIsOpen: (isOpen) => set({ isOpen }),toggleMinimized: () => set((state) => ({ isMinimized: !state.isMinimized })),+ setShowDetails: (showDetails) => set({ showDetails }),+ setDetailMetric: (metric, on) =>+ set((state) => {+ const current = selectedDetailMetrics(state.detailMetrics);+ return {+ detailMetrics: MONITOR_DETAIL_METRICS.filter((m) =>+ m === metric ? on : current.has(m),+ ),+ };+ }),}),{ name: "unsloth_monitor_overlay" })-);\ No newline at end of file+);diff --git a/studio/frontend/src/features/settings/tabs/resources-tab.tsx b/studio/frontend/src/features/settings/tabs/resources-tab.tsxindex ea5c0f86509..a5c9ce3bbbb 100644--- a/studio/frontend/src/features/settings/tabs/resources-tab.tsx+++ b/studio/frontend/src/features/settings/tabs/resources-tab.tsx@@ -1,7 +1,15 @@// 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 {+ MONITOR_DETAIL_METRICS,+ formatPower,+ formatTemperature,+ gpuTelemetryRows,+ selectedDetailMetrics,+} from "@/components/monitor-details";import { Button } from "@/components/ui/button";+import { Checkbox } from "@/components/ui/checkbox";import { Input } from "@/components/ui/input";import { Progress } from "@/components/ui/progress";import { Switch } from "@/components/ui/switch";@@ -264,7 +272,15 @@ export function ResourcesTab() {const dismissDriverWarning = useSettingsPanelPrefsStore((s) => s.dismissDriverWarning,);- const { isOpen, setIsOpen } = useMonitorOverlayStore();+ const {+ isOpen,+ setIsOpen,+ showDetails,+ setShowDetails,+ detailMetrics: storedDetailMetrics,+ setDetailMetric,+ } = useMonitorOverlayStore();+ const detailMetrics = selectedDetailMetrics(storedDetailMetrics);// always fetch once: the switch is persisted now, so gating the hook on it// would leave a session that opens with it off reading zeros forever.const systemInfo = useSystemInfo({@@ -294,6 +310,10 @@ export function ResourcesTab() {const inferenceVramTotal = separateInferenceGpu? aggregateGpuMemoryTotalGb(inferenceDisplay.usageDevices): 0;+ const telemetryRows =+ showDetails && displayedGpu?.available+ ? gpuTelemetryRows(displayedGpu.devices, detailMetrics)+ : [];useEffect(() => {let cancelled = false;@@ -575,6 +595,7 @@ export function ResourcesTab() {: t("settings.resources.liveMonitor.currentLoad")}percent={hostUnread ? null : (systemInfo.cpu?.usage_percent ?? 0)}+ showUsage={!showDetails || detailMetrics.has("cpuLoad")}/><MetricTilelabel={t("settings.resources.liveMonitor.ram")}@@ -668,7 +689,73 @@ export function ResourcesTab() {}percent={metrics.vramUsageKnown ? metrics.vramPercent : null}/>+ {telemetryRows.map((row) => (+ <MetricTile+ key={row.key}+ label={row.name}+ value={+ [+ row.temperatureC !== null+ ? formatTemperature(row.temperatureC)+ : null,+ row.powerDrawW !== null+ ? formatPower(row.powerDrawW, row.powerLimitW)+ : null,+ ]+ .filter(Boolean)+ .join(" · ") ||+ (row.loadPct !== null ? `${Math.round(row.loadPct)}%` : "--")+ }+ detail={[+ row.temperatureC !== null &&+ t("settings.resources.liveMonitor.temperature"),+ row.powerDrawW !== null &&+ t("settings.resources.liveMonitor.power"),+ row.loadPct !== null &&+ t("settings.resources.liveMonitor.gpuLoad"),+ ]+ .filter(Boolean)+ .join(" · ")}+ showUsage={row.loadPct !== null}+ percent={hostUnread ? null : row.loadPct}+ />+ ))}</div>+ <SettingsRow+ label={t("settings.resources.liveMonitor.detailedView")}+ description={t(+ "settings.resources.liveMonitor.detailedViewDescription",+ )}+ className="border-t border-border/60"+ >+ <Switch+ aria-label={t("settings.resources.liveMonitor.detailedView")}+ checked={showDetails}+ onCheckedChange={setShowDetails}+ />+ </SettingsRow>+ {showDetails && (+ <div className="flex flex-wrap gap-x-5 gap-y-2 pb-3">+ {MONITOR_DETAIL_METRICS.map((metric) => {+ const label = t(`settings.resources.liveMonitor.${metric}`);+ return (+ <label+ key={metric}+ className="flex cursor-pointer items-center gap-2 text-xs font-medium text-foreground"+ >+ <Checkbox+ checked={detailMetrics.has(metric)}+ onCheckedChange={(checked) =>+ setDetailMetric(metric, checked === true)+ }+ aria-label={label}+ />+ {label}+ </label>+ );+ })}+ </div>+ )}</SettingsSection><SettingsSection title={t("settings.resources.gpu.title")}>diff --git a/studio/frontend/src/hooks/use-system.ts b/studio/frontend/src/hooks/use-system.tsindex 6de9c606112..ce06fc4945a 100644--- a/studio/frontend/src/hooks/use-system.ts+++ b/studio/frontend/src/hooks/use-system.ts@@ -24,6 +24,11 @@ export interface GpuDevice {unified_memory?: boolean;/** host-backed portion of the shared pool; the rest is reserved GPU memory. */shared_memory_host_backed_gb?: number | null;+ /** Live readings from the same probe as vram_used_gb; absent where the backend has none. */+ gpu_utilization_pct?: number | null;+ temperature_c?: number | null;+ power_draw_w?: number | null;+ power_limit_w?: number | null;}export interface SystemGpuInfo {diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.tsindex d12517d89f1..4f12d915cb2 100644--- a/studio/frontend/src/i18n/locales/ar.ts+++ b/studio/frontend/src/i18n/locales/ar.ts@@ -2106,6 +2106,13 @@ export const ar = {noGpu: "لا يوجد GPU مرئي",gpuUnusable: "GPU غير قابل للاستخدام",gpuUnusableDetail: "تم اكتشافه، لكن PyTorch لا يستطيع استخدامه",+ detailedView: "عرض مفصل",+ detailedViewDescription:+ "اعرض حمل المعالج وحمل كل وحدة GPU وحرارتها واستهلاكها للطاقة في النافذة العائمة وهنا.",+ cpuLoad: "حمل المعالج",+ gpuLoad: "حمل GPU",+ temperature: "الحرارة",+ power: "الطاقة",},gpu: {title: "أجهزة GPU",diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.tsindex 6719b7eb322..09455e0fbe2 100644--- a/studio/frontend/src/i18n/locales/de.ts+++ b/studio/frontend/src/i18n/locales/de.ts@@ -2134,6 +2134,13 @@ export const de = {noGpu: "Keine sichtbare GPU",gpuUnusable: "GPU nicht nutzbar",gpuUnusableDetail: "Erkannt, aber PyTorch kann sie nicht nutzen",+ detailedView: "Detailansicht",+ detailedViewDescription:+ "Zeigt CPU-Last sowie Last, Temperatur und Leistungsaufnahme jeder GPU im schwebenden Fenster und hier.",+ cpuLoad: "CPU-Last",+ gpuLoad: "GPU-Last",+ temperature: "Temperatur",+ power: "Leistung",},gpu: {title: "GPU-Geräte",diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.tsindex 9591f991c11..f009a1b70ac 100644--- a/studio/frontend/src/i18n/locales/en.ts+++ b/studio/frontend/src/i18n/locales/en.ts@@ -2146,6 +2146,13 @@ export const en = {noGpu: "No visible GPU",gpuUnusable: "GPU unusable",gpuUnusableDetail: "Detected, but PyTorch cannot use it",+ detailedView: "Detailed view",+ detailedViewDescription:+ "Show CPU load and each GPU's load, temperature and power in the floating window and here.",+ cpuLoad: "CPU load",+ gpuLoad: "GPU load",+ temperature: "Temperature",+ power: "Power",},gpu: {title: "GPU devices",diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.tsindex edf42039945..fd59561187d 100644--- a/studio/frontend/src/i18n/locales/es.ts+++ b/studio/frontend/src/i18n/locales/es.ts@@ -2129,6 +2129,13 @@ export const es = {noGpu: "No hay GPU visible",gpuUnusable: "GPU no utilizable",gpuUnusableDetail: "Detectada, pero PyTorch no puede usarla",+ detailedView: "Vista detallada",+ detailedViewDescription:+ "Muestra la carga de la CPU y la carga, temperatura y consumo de cada GPU en la ventana flotante y aquí.",+ cpuLoad: "Carga de CPU",+ gpuLoad: "Carga de GPU",+ temperature: "Temperatura",+ power: "Consumo",},gpu: {title: "Dispositivos GPU",diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.tsindex c07db5a6658..e42b6f5a584 100644--- a/studio/frontend/src/i18n/locales/fr.ts+++ b/studio/frontend/src/i18n/locales/fr.ts@@ -2133,6 +2133,13 @@ export const fr = {noGpu: "Aucun GPU visible",gpuUnusable: "GPU inutilisable",gpuUnusableDetail: "Détecté, mais PyTorch ne peut pas l'utiliser",+ detailedView: "Vue détaillée",+ detailedViewDescription:+ "Affiche la charge du CPU ainsi que la charge, la température et la consommation de chaque GPU dans la fenêtre flottante et ici.",+ cpuLoad: "Charge CPU",+ gpuLoad: "Charge GPU",+ temperature: "Température",+ power: "Puissance",},gpu: {title: "Périphériques GPU",diff --git a/studio/frontend/src/i18n/locales/he.ts b/studio/frontend/src/i18n/locales/he.tsindex b86a7ffd62f..01feca41746 100644--- a/studio/frontend/src/i18n/locales/he.ts+++ b/studio/frontend/src/i18n/locales/he.ts@@ -2187,6 +2187,13 @@ export const he = {noGpu: "לא זוהה GPU",gpuUnusable: "GPU אינו שמיש",gpuUnusableDetail: "זוהה, אך PyTorch אינו יכול להשתמש בו",+ detailedView: "תצוגה מפורטת",+ detailedViewDescription:+ "הצגת עומס המעבד ועומס, טמפרטורה וצריכת חשמל של כל GPU בחלון הצף וכאן.",+ cpuLoad: "עומס מעבד",+ gpuLoad: "עומס GPU",+ temperature: "טמפרטורה",+ power: "הספק",},gpu: {title: "התקני GPU",diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.tsindex a0bbbd42021..478a38faaed 100644--- a/studio/frontend/src/i18n/locales/hi.ts+++ b/studio/frontend/src/i18n/locales/hi.ts@@ -2109,6 +2109,13 @@ export const hi = {noGpu: "कोई दृश्यमान GPU नहीं",gpuUnusable: "GPU अनुपयोगी",gpuUnusableDetail: "पहचाना गया, लेकिन PyTorch इसका उपयोग नहीं कर सकता",+ detailedView: "विस्तृत दृश्य",+ detailedViewDescription:+ "फ़्लोटिंग विंडो में और यहाँ CPU लोड तथा हर GPU का लोड, तापमान और पावर दिखाएँ।",+ cpuLoad: "CPU लोड",+ gpuLoad: "GPU लोड",+ temperature: "तापमान",+ power: "पावर",},gpu: {title: "GPU डिवाइस",diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.tsindex 4dd30e3294c..dca424ba4bc 100644--- a/studio/frontend/src/i18n/locales/it.ts+++ b/studio/frontend/src/i18n/locales/it.ts@@ -2093,6 +2093,13 @@ export const it = {noGpu: "Nessuna GPU visibile",gpuUnusable: "GPU non utilizzabile",gpuUnusableDetail: "Rilevata, ma PyTorch non può usarla",+ detailedView: "Vista dettagliata",+ detailedViewDescription:+ "Mostra il carico della CPU e carico, temperatura e consumo di ogni GPU nella finestra mobile e qui.",+ cpuLoad: "Carico CPU",+ gpuLoad: "Carico GPU",+ temperature: "Temperatura",+ power: "Consumo",},gpu: {title: "Dispositivi GPU",diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.tsindex ee345118a7e..65ce1ea44c0 100644--- a/studio/frontend/src/i18n/locales/ja.ts+++ b/studio/frontend/src/i18n/locales/ja.ts@@ -2085,6 +2085,13 @@ export const ja = {noGpu: "認識できる GPU がありません",gpuUnusable: "GPU を利用できません",gpuUnusableDetail: "検出されましたが、PyTorch から利用できません",+ detailedView: "詳細表示",+ detailedViewDescription:+ "フローティングウィンドウとここに、CPU 負荷と各 GPU の負荷、温度、消費電力を表示します。",+ cpuLoad: "CPU 負荷",+ gpuLoad: "GPU 負荷",+ temperature: "温度",+ power: "消費電力",},gpu: {title: "GPU デバイス",diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.tsindex 974837cd9b5..1a1fa4d9fcc 100644--- a/studio/frontend/src/i18n/locales/ko.ts+++ b/studio/frontend/src/i18n/locales/ko.ts@@ -2102,6 +2102,13 @@ export const ko = {noGpu: "인식되는 GPU 없음",gpuUnusable: "GPU 사용 불가",gpuUnusableDetail: "감지되었지만 PyTorch에서 사용할 수 없습니다",+ detailedView: "자세히 보기",+ detailedViewDescription:+ "플로팅 창과 여기에 CPU 부하와 각 GPU의 부하, 온도, 전력을 표시합니다.",+ cpuLoad: "CPU 부하",+ gpuLoad: "GPU 부하",+ temperature: "온도",+ power: "전력",},gpu: {title: "GPU 장치",diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.tsindex dba47a7e755..62066f37ff1 100644--- a/studio/frontend/src/i18n/locales/pt-br.ts+++ b/studio/frontend/src/i18n/locales/pt-br.ts@@ -2118,6 +2118,13 @@ export const ptBR = {noGpu: "Nenhuma GPU visível",gpuUnusable: "GPU inutilizável",gpuUnusableDetail: "Detectada, mas o PyTorch não consegue usá-la",+ detailedView: "Visualização detalhada",+ detailedViewDescription:+ "Mostra a carga da CPU e a carga, temperatura e consumo de cada GPU na janela flutuante e aqui.",+ cpuLoad: "Carga da CPU",+ gpuLoad: "Carga da GPU",+ temperature: "Temperatura",+ power: "Consumo",},gpu: {title: "Dispositivos de GPU",diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.tsindex a0cb37d6f29..eeb2c263ce0 100644--- a/studio/frontend/src/i18n/locales/ru.ts+++ b/studio/frontend/src/i18n/locales/ru.ts@@ -2112,6 +2112,13 @@ export const ru = {noGpu: "GPU не обнаружен",gpuUnusable: "GPU недоступен",gpuUnusableDetail: "Обнаружен, но PyTorch не может его использовать",+ detailedView: "Подробный вид",+ detailedViewDescription:+ "Показывать загрузку CPU, а также загрузку, температуру и мощность каждой GPU в плавающем окне и здесь.",+ cpuLoad: "Загрузка CPU",+ gpuLoad: "Загрузка GPU",+ temperature: "Температура",+ power: "Мощность",},gpu: {title: "Устройства GPU",diff --git a/studio/frontend/src/i18n/locales/sv.ts b/studio/frontend/src/i18n/locales/sv.tsindex 4e52051d430..37bb726cd8f 100644--- a/studio/frontend/src/i18n/locales/sv.ts+++ b/studio/frontend/src/i18n/locales/sv.ts@@ -2257,6 +2257,13 @@ export const sv = {noGpu: "Ingen synlig GPU",gpuUnusable: "GPU oanvändbar",gpuUnusableDetail: "Identifierad, men PyTorch kan inte använda den",+ detailedView: "Detaljerad vy",+ detailedViewDescription:+ "Visa CPU-belastning samt belastning, temperatur och effekt för varje GPU i det flytande fönstret och här.",+ cpuLoad: "CPU-belastning",+ gpuLoad: "GPU-belastning",+ temperature: "Temperatur",+ power: "Effekt",},gpu: {title: "GPU-enheter",diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.tsindex c14df4bce5e..db2929b3ebe 100644--- a/studio/frontend/src/i18n/locales/zh-CN.ts+++ b/studio/frontend/src/i18n/locales/zh-CN.ts@@ -2079,6 +2079,13 @@ export const zhCN = {noGpu: "无可见 GPU",gpuUnusable: "GPU 不可用",gpuUnusableDetail: "已检测到,但 PyTorch 无法使用",+ detailedView: "详细视图",+ detailedViewDescription:+ "在浮动窗口和此处显示 CPU 负载以及每个 GPU 的负载、温度和功耗。",+ cpuLoad: "CPU 负载",+ gpuLoad: "GPU 负载",+ temperature: "温度",+ power: "功耗",},gpu: {title: "GPU 设备",diff --git a/studio/frontend/tests/monitor-details.test.ts b/studio/frontend/tests/monitor-details.test.tsnew file mode 100644index 00000000000..a90b2e4851b--- /dev/null+++ b/studio/frontend/tests/monitor-details.test.ts@@ -0,0 +1,124 @@+// 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 { readFileSync } from "node:fs";+import test from "node:test";++import {+ MONITOR_DETAIL_METRICS,+ formatPower,+ formatTemperature,+ gpuTelemetryRows,+ selectedDetailMetrics,+ temperatureLevel,+} from "../src/components/monitor-details.ts";++const ALL = selectedDetailMetrics(undefined);++test("stored metric selections survive and garbage falls back to every metric", () => {+ assert.deepEqual([...ALL], [...MONITOR_DETAIL_METRICS]);+ assert.deepEqual(+ [...selectedDetailMetrics("power")],+ [...MONITOR_DETAIL_METRICS],+ );+ assert.deepEqual(+ [...selectedDetailMetrics(["power", "bogus", "temperature"])],+ ["temperature", "power"],+ );+ assert.deepEqual([...selectedDetailMetrics([])], []);+ assert.deepEqual(+ [...selectedDetailMetrics(["bogus", 1])],+ [...MONITOR_DETAIL_METRICS],+ );+});++test("rows carry only readings the backend reported", () => {+ const rows = gpuTelemetryRows(+ [+ {+ index: 0,+ name: "NVIDIA B200",+ gpu_utilization_pct: 42,+ temperature_c: 61,+ power_draw_w: 312.5,+ power_limit_w: 1000,+ },+ { index: 1, name: "NVIDIA B200" },+ { index: 2, name: "NVIDIA B200", temperature_c: 55, power_draw_w: 80 },+ ],+ ALL,+ );+ assert.deepEqual(rows, [+ {+ key: "0",+ name: "GPU 0: NVIDIA B200",+ loadPct: 42,+ temperatureC: 61,+ powerDrawW: 312.5,+ powerLimitW: 1000,+ powerPct: 31.25,+ },+ {+ key: "2",+ name: "GPU 2: NVIDIA B200",+ loadPct: null,+ temperatureC: 55,+ powerDrawW: 80,+ powerLimitW: null,+ powerPct: null,+ },+ ]);+});++test("a deselected metric is dropped, and a device left with nothing is skipped", () => {+ const device = {+ index: 0,+ name: "RTX 4090",+ temperature_c: 70,+ gpu_utilization_pct: 10,+ };+ const rows = gpuTelemetryRows(+ [device],+ selectedDetailMetrics(["temperature"]),+ );+ assert.equal(rows.length, 1);+ assert.equal(rows[0].name, "RTX 4090");+ assert.equal(rows[0].loadPct, null);+ assert.equal(rows[0].temperatureC, 70);+ assert.deepEqual(+ gpuTelemetryRows([device], selectedDetailMetrics(["power"])),+ [],+ );+ assert.deepEqual(+ gpuTelemetryRows([{ index: 0, temperature_c: Number.NaN }], ALL),+ [],+ );+});++test("temperature turns amber at 80 C and red at 90 C", () => {+ assert.equal(temperatureLevel(79.9), "ok");+ assert.equal(temperatureLevel(80), "warm");+ assert.equal(temperatureLevel(90), "hot");+ assert.equal(formatTemperature(61.4), "61°C");+ assert.equal(formatPower(312.5, 1000), "313 / 1000 W");+ assert.equal(formatPower(80, null), "80 W");+});++test("the detailed view is opt-in and adds no request of its own", () => {+ const store = readFileSync(+ new URL(+ "../src/features/settings/stores/monitor-overlay-store.ts",+ import.meta.url,+ ),+ "utf8",+ );+ assert.match(store, /showDetails: false,/);+ const monitor = readFileSync(+ new URL("../src/components/floating-monitor.tsx", import.meta.url),+ "utf8",+ );+ // Rows render from the /api/system poll the monitor already runs.+ assert.doesNotMatch(monitor, /useGpuUtilization|api\/train\/hardware/);+ assert.match(monitor, /showDetails && displayedGpu\?\.available/);+});