import { CartesianGrid, ErrorBar, LabelList, ResponsiveContainer, Scatter, ScatterChart, Tooltip, XAxis, YAxis } from 'recharts' import { INK, ORDER, SERIES } from '@/lib/chart' import { percent, seconds } from '@/lib/format' import type { EvalsFile } from '@/lib/types' /** What accuracy costs in time: each system as one dot at (median seconds, accuracy), * a whisker out to its 95th-percentile time, labelled directly (three dots: a legend * would only repeat the labels). */ export function TradeoffChart({ data }: { data: EvalsFile }) { const points = ORDER.map((s) => { const x = data.systems[s] return { s, label: `${s.toUpperCase()} · ${percent(x.accuracy)}`, seconds: x.latency_p50_ms / 1000, p95: x.latency_p95_ms / 1000, err: [0, (x.latency_p95_ms - x.latency_p50_ms) / 1000], accuracy: x.accuracy, tokens: x.tokens_mean, } }) return (
System {p.s.toUpperCase()}
{percent(p.accuracy)} correct · {seconds(p.seconds * 1000)} median, {seconds(p.p95 * 1000)} at the 95th percentile
{(p.tokens / 1000).toFixed(1)}k tokens per question