uimaxxer

Model picker

Every model streams the same answer at once, at its own real speed. The bars are time, so the race reads at a glance, and the answer streams in full beneath them for the model you point at, with what one task costs.

npx shadcn@latest add https://uimaxxer.com/r/model-picker.json
PasskeysFix the duplicate Stripe charge

Which model should take this one?

Captain

Why does the Stripe webhook charge twice on retry?

Every model streams this answer: The retry handler charges again because it keys on the request, not the Stripe event. Store event.id before charging and return 200 if you have seen it. I would also move the email send after the commit, so a rollback never mails a receipt.

Usage

import { ModelPicker } from "@/components/ui/model-picker"

<ModelPicker
  models={[{ id: "fast", name: "Fast", tps: 160, ttft: 250, input: 0.8, output: 4 }]}
  sample="Store event.id before charging and return 200 if you have seen it."
  task={{ label: "review", input: 18000, output: 1200 }}
/>

Props

PropTypeDefaultWhat it does
models{ id; name; tps; ttft; input; output }[]tps is output tokens a second, ttft the wait for the first token in ms, input and output are $ per million tokens.
samplestringThe answer every model streams, so only the speed differs.
task{ label: string; input: number; output: number }The job the cost is quoted for, in tokens, e.g. one review.
promptstringWhat was asked, shown above the race.
valuestringControlled model id.
defaultValuestringmodels[0].idInitial model when uncontrolled.
onValueChange(id: string) => voidCalled when a model is picked.

Keyboard

↑ ↓
Move between models
Enter / Space
Pick the focused model

Accessibility

  • role=listbox with role=option and aria-selected; arrows move focus, Enter picks.
  • Each option is named by its model, speed and cost; the streamed text is hidden from screen readers and the full answer is linked once with aria-describedby, so the race never talks over the user.
  • Race again is a real button with visible text.
  • Reduced motion shows every lane finished at once, with the time each would take.