);
}
// ── Plain-language summary ────────────────────────────────────────────────────
function gpuSummary(gpus: GPUInfo[], totalVram: number): string {
if (gpus.length === 0) return "no GPU";
const first = gpus[0].name.replace(/NVIDIA GeForce |NVIDIA /i, "");
const prefix = gpus.length > 1 ? `${gpus.length}× ${first}` : first;
return `${prefix} (${totalVram} GB VRAM)`;
}
function buildSummary(hardware: DiscoverHardware, entry: DiscoverEntry): string {
const re = entry.resource_estimate;
const name = (entry.model_meta.display_name || entry.model_id).replace(/^(ollama:|hf:|local:)/, "");
const hw = hardware.total_vram_gb > 0 ? gpuSummary(hardware.gpus, hardware.total_vram_gb) : `${hardware.ram_gb} GB RAM (CPU)`;
if (!re) return `${name} is the best match for your ${hw}.`;
const v = re.verdict;
const use = `~${re.estimated_vram_gb} GB at ${entry.best_quantization}`;
if (v === "runs_great") return `Your ${hw} runs ${name} comfortably — ${use}, ${re.headroom_gb} GB to spare.`;
if (v === "runs_ok") return `Your ${hw} runs ${name} — ${use}, a tight but workable fit.`;
if (v === "runs_offload")
return `${name} needs ${use} — more than your ${hw}. It runs by offloading layers to system RAM (slower). A smaller model or lower quant would run fully on the GPU.`;
if (v === "runs_cpu") return `${name} runs on your CPU — ${use} in RAM, ${re.headroom_gb} GB to spare.`;
if (v === "runs_cpu_tight") return `${name} runs on your CPU but leaves little RAM headroom (${use}).`;
return `${name} needs ${use} — too large for this machine. Pick a smaller model below.`;
}
// ── Main report ───────────────────────────────────────────────────────────────
export function SystemReport({
result,
onPull,
onRefresh,
loading,
hosted = false,
}: {
result: DiscoverResult;
onPull: (entry: DiscoverEntry) => void;
onRefresh: () => void;
loading: boolean;
/** True on a hosted demo (HF Space): the probe reads the SERVER, not the visitor's device. */
hosted?: boolean;
}) {
const hw = result.hardware;
const top = result.recommendations[0] as DiscoverEntry | undefined;
const onGpu = hw.total_vram_gb > 0;
const meta = top?.resource_estimate ? verdictMeta(top.resource_estimate.verdict) : null;
return (
{/* Header */}
Your System Report
Detected hardware and the best-fitting model, ranked for {result.task ?? "your tasks"}.
{/* Hosted-demo notice: the probe reads the Space's server, not the visitor's device. */}
{hosted && (
You're on the hosted demo.{" "}
This report profiles the Space's server{" "}
({hw.os}
{hw.arch ? ` · ${hw.arch}` : ""}) — not your own device. Models shown here would run on the
server, not on your machine. To profile your Mac/PC and pull models onto it, run Auralynq
locally (
one command
).