Interactive Answers
Pareto Frontier
Cost vs. quality scatter with the Pareto-optimal envelope drawn in — drag the ceiling line to filter options and pick the best model under budget.
2 variantsMIT
Preview
Model Pareto frontier
Cost per 1k agent runs vs. SWE-bench pass rate
Gemini Pro
Frontier (6)Dominated (2)
Cost / 1k runs ≤ $5.20Gemini ProFlagshipFrontier
94.1%·$4.90·790ms
Drag the ceiling pill to filter by cost / 1k runs7 of 8 eligible
Installation
Copies the component into components/ui and installs its dependencies and theme tokens.
pnpm dlx shadcn@latest add https://tuffui.com/r/pareto-frontier.jsonUsage
Pass your own data and wire the callbacks to your agent runtime.
import { ParetoFrontier } from "@/components/ui/pareto-frontier";
export function ModelTradeoffs({ evals }: Props) {
return (
<ParetoFrontier
title="Model Pareto frontier"
subtitle="Cost per 1k runs vs. eval pass rate"
points={evals}
defaultCap={5}
onSelect={(model) => console.log("Picked", model.label)}
/>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| points* | ParetoPoint[] | — | Options plotted by `x` (lower is better, e.g. cost or latency) and `y` (higher is better, e.g. accuracy). |
| cap | number | — | Controlled X-axis ceiling; options above it dim and are excluded from the best pick. |
| defaultCap | number | — | Initial ceiling position when uncontrolled. |
| onCapChange | (cap: number) => void | — | Called while dragging or nudging the ceiling handle. |
| xLabel | string | "Cost / 1k runs" | Label for the X-axis metric. |
| yLabel | string | "Eval score" | Label for the Y-axis metric. |
| formatX | (value: number) => string | — | Formatter for X-axis ticks, the ceiling pill and inspector readout. |
| formatY | (value: number) => string | — | Formatter for Y-axis ticks and inspector readout. |
| onSelect | (point: ParetoPoint) => void | — | Called when a plotted point is clicked. |
| title | ReactNode | "Pareto frontier" | Header title. |
| subtitle | ReactNode | — | Secondary line under the title. |
| className | string | — | Extra classes for the outer Shell. |
type ParetoPoint = {
id: string;
label: string;
group?: string;
x: number; // lower is better (cost, latency)
y: number; // higher is better (score, accuracy)
meta?: string;
};