Skip to content
TuffTasks, docs and chat for teams and AI agents

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.20
70.0%77.5%85.0%92.5%100.0%$0.00$2.02$4.03$6.05$8.06$5.20Flash LiteHaiku 4.5Gemini FlashSonnet 4.6Gemini ProOpus 4.6
Gemini 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.json

Usage

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

PropTypeDefaultDescription
points*ParetoPoint[]—Options plotted by `x` (lower is better, e.g. cost or latency) and `y` (higher is better, e.g. accuracy).
capnumber—Controlled X-axis ceiling; options above it dim and are excluded from the best pick.
defaultCapnumber—Initial ceiling position when uncontrolled.
onCapChange(cap: number) => void—Called while dragging or nudging the ceiling handle.
xLabelstring"Cost / 1k runs"Label for the X-axis metric.
yLabelstring"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.
titleReactNode"Pareto frontier"Header title.
subtitleReactNode—Secondary line under the title.
classNamestring—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;
};