- Benchmarks: BetterBench 0.6.1 (pinned by checksum) runs against a running deployment, one at a time; quick/full/custom passes, phase selection, live step and output, cancel, run again, compare runs side by side. - Report page after launch80's bench.betterbench.v1: headline tiles, "Read these first" caveats (quick, sample gate, max_tokens truncation, batched streams, failures, skipped depths, prefix-cache hits), charts, full tables with daggered under-sampled cells, method text. All figures come from BetterBench's own report functions. - Publish to launch80 as a double opt-in: L80 dry run builds the exact payload for inspection, an explicit confirmation publishes that file (L80 CLI 0.4.0 pinned by checksum, L80_TOKEN worker-only). Endpoint and host never leave. - GPUs: runtime accelerator (CPU, NVIDIA, /dev/dri, ROCm) with presets for the official CUDA/Vulkan/Intel/ROCm builds; NVIDIA GPUs probed via nvidia-smi in a short-lived container; per-deployment GPU picking, -ngl, split mode, tensor split, MoE offload, vLLM tensor parallel and GPU memory share. - llama.cpp --cache-ram option (1 GiB for new deployments) and a memory estimate that counts it and the KV cache: the 8 GiB default made containers thrash at their memory limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
152 lines
6.8 KiB
TypeScript
152 lines
6.8 KiB
TypeScript
"use client";
|
||
|
||
import { GaugeIcon, GitCompareIcon } from "lucide-react";
|
||
import Link from "next/link";
|
||
import { useEffect, useState } from "react";
|
||
import { BenchmarkStateBadge } from "@/components/benchmark-state";
|
||
import { LocalTime } from "@/components/local-time";
|
||
import { buttonVariants } from "@/components/ui/button";
|
||
import { Card } from "@/components/ui/card";
|
||
import { Checkbox } from "@/components/ui/checkbox";
|
||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
||
import type { BenchmarkRow } from "@/lib/benchmarks";
|
||
import { configChips, describeSettings, headline } from "@/lib/benchmark-view";
|
||
import { cn } from "@/lib/utils";
|
||
|
||
export type ListRow = Omit<BenchmarkRow, "createdAt" | "startedAt" | "finishedAt" | "cancelRequestedAt"> & {
|
||
createdAt: string;
|
||
startedAt: string | null;
|
||
finishedAt: string | null;
|
||
cancelRequestedAt: string | null;
|
||
};
|
||
|
||
const MAX_COMPARE = 6;
|
||
const fmt = (v: number | null | undefined, digits = 1) => (v == null ? "–" : v.toFixed(digits));
|
||
|
||
/** All runs with their headline numbers; polls while something is queued or running. */
|
||
export function BenchmarkList({ rows: initial, compact }: { rows: ListRow[]; compact?: boolean }) {
|
||
const [rows, setRows] = useState(initial);
|
||
const [selected, setSelected] = useState<string[]>([]);
|
||
const busy = rows.some((r) => r.state === "queued" || r.state === "running");
|
||
|
||
useEffect(() => {
|
||
if (!busy || compact) return;
|
||
const t = setInterval(async () => {
|
||
const res = await fetch("/api/benchmarks", { cache: "no-store" }).catch(() => null);
|
||
if (res?.ok) setRows(await res.json());
|
||
}, 3_000);
|
||
return () => clearInterval(t);
|
||
}, [busy, compact]);
|
||
|
||
if (rows.length === 0) {
|
||
return (
|
||
<Card className="items-center gap-3 py-10 text-center">
|
||
<GaugeIcon className="size-8 text-muted-foreground" />
|
||
<p className="text-sm text-muted-foreground">
|
||
No benchmarks yet. Open a running{" "}
|
||
<Link href="/deployments" className="underline">
|
||
deployment
|
||
</Link>{" "}
|
||
and start one there.
|
||
</p>
|
||
</Card>
|
||
);
|
||
}
|
||
|
||
const toggle = (id: string) => setSelected((s) => (s.includes(id) ? s.filter((x) => x !== id) : s.length < MAX_COMPARE ? [...s, id] : s));
|
||
const comparable = rows.filter((r) => r.state === "completed");
|
||
|
||
return (
|
||
<div className="flex flex-col gap-3">
|
||
{!compact && comparable.length > 1 && (
|
||
<div className="flex items-center justify-between gap-2 text-sm">
|
||
<span className="text-muted-foreground">{selected.length === 0 ? "Select completed runs to compare them." : `${selected.length} selected (up to ${MAX_COMPARE}).`}</span>
|
||
<Link
|
||
href={`/benchmarks/compare?ids=${selected.join(",")}`}
|
||
className={cn(buttonVariants({ size: "sm" }), selected.length < 2 && "pointer-events-none opacity-50")}
|
||
aria-disabled={selected.length < 2}
|
||
>
|
||
<GitCompareIcon />
|
||
Compare
|
||
</Link>
|
||
</div>
|
||
)}
|
||
<Card className="py-0">
|
||
<Table>
|
||
<TableHeader>
|
||
<TableRow>
|
||
{!compact && <TableHead className="w-8" />}
|
||
<TableHead>Run</TableHead>
|
||
<TableHead className="hidden lg:table-cell">Settings</TableHead>
|
||
<TableHead className="text-right" title="Weighted single-stream decode speed">
|
||
Decode t/s
|
||
</TableHead>
|
||
<TableHead className="text-right" title="Median time to first token">
|
||
TTFT
|
||
</TableHead>
|
||
<TableHead className="hidden text-right md:table-cell" title="Prompt processing at the deepest measured input">
|
||
Prefill t/s
|
||
</TableHead>
|
||
<TableHead className="hidden text-right md:table-cell" title="Best aggregate throughput under parallel load">
|
||
Peak t/s
|
||
</TableHead>
|
||
<TableHead className="w-28">State</TableHead>
|
||
</TableRow>
|
||
</TableHeader>
|
||
<TableBody>
|
||
{rows.map((r) => {
|
||
const h = headline(r.summary);
|
||
const s = r.snapshot;
|
||
return (
|
||
<TableRow key={r.id} data-state={selected.includes(r.id) ? "selected" : undefined}>
|
||
{!compact && (
|
||
<TableCell>
|
||
<Checkbox
|
||
checked={selected.includes(r.id)}
|
||
disabled={r.state !== "completed"}
|
||
onCheckedChange={() => toggle(r.id)}
|
||
aria-label={`Select ${r.label ?? s.deploymentName} for comparison`}
|
||
/>
|
||
</TableCell>
|
||
)}
|
||
<TableCell className="whitespace-normal">
|
||
<Link href={`/benchmarks/${r.id}`} className="font-medium hover:underline">
|
||
{r.label ?? s.deploymentName}
|
||
</Link>
|
||
<div className="text-xs text-muted-foreground">
|
||
{r.label && `${s.deploymentName} · `}
|
||
{s.repoId} · <LocalTime value={r.createdAt} />
|
||
</div>
|
||
</TableCell>
|
||
<TableCell className="hidden max-w-md whitespace-normal lg:table-cell">
|
||
<div className="flex flex-wrap gap-1">
|
||
<span className="rounded-4xl border border-foreground/15 px-1.5 text-[11px] leading-4">{s.runtimeName}</span>
|
||
{configChips(s).map((c) => (
|
||
<span key={c} className="rounded-4xl bg-muted px-1.5 text-[11px] leading-4 text-muted-foreground">
|
||
{c}
|
||
</span>
|
||
))}
|
||
</div>
|
||
<div className="mt-0.5 text-[11px] text-muted-foreground">{describeSettings(r.settings)}</div>
|
||
</TableCell>
|
||
<TableCell className="text-right font-medium tabular-nums">{fmt(h.decode)}</TableCell>
|
||
<TableCell className="text-right tabular-nums">{h.ttftMs != null ? `${Math.round(h.ttftMs)} ms` : "–"}</TableCell>
|
||
<TableCell className="hidden text-right tabular-nums md:table-cell" title={h.prefill ? `at ${h.prefill.depth} tokens` : undefined}>
|
||
{fmt(h.prefill?.tps, 0)}
|
||
</TableCell>
|
||
<TableCell className="hidden text-right tabular-nums md:table-cell" title={h.peak ? `at ${h.peak.level} parallel` : undefined}>
|
||
{fmt(h.peak?.tps)}
|
||
</TableCell>
|
||
<TableCell>
|
||
<BenchmarkStateBadge state={r.state} cancelling={!!r.cancelRequestedAt} />
|
||
</TableCell>
|
||
</TableRow>
|
||
);
|
||
})}
|
||
</TableBody>
|
||
</Table>
|
||
</Card>
|
||
</div>
|
||
);
|
||
}
|