AI model picker
Shown as Lathe, a made-up product
The field you give an agent a task in, with the model it runs and how hard it thinks: each choice shows its speed, price and an estimate for this request, Auto sets the effort from what you asked, and a large change suggests the deeper model.
Installation
pnpm dlx shadcn@latest add "https://propui.dev/r/lathe-models.json?token=…"Adds the piece to components/propui/11-lathe-models/ and installs motion. Needs a free account: sign in and the command includes your token. Fonts load from Prop UI; download the zip to self-host them.
When to use
Reach for it when
- The field where people give an agent a task and choose how it should work.
- Any product that offers several models or reasoning levels and wants people to see the trade-off.
- Showing time and cost before a run, not after.
Something else fits when
- A product with one model: leave the picker out and keep the field simple.
- Settings people change once: put model defaults on a settings page.
- Exact billing: the estimates here are guides, worked out from list prices.
Usage
Fills a full window: give it a container with a definite height.
import Piece from "@/components/propui/11-lathe-models/Section";
export default function Page() {
return (
<main className="h-dvh w-full overflow-hidden">
<Piece />
</main>
);
}Replace MODELS, EFFORTS, OUTPUT_TOKENS and BIG in data.ts. Speed is tokens a second and price is dollars per million tokens; every estimate is worked out from them and the length of the request.
Your data
Replace these and everything on screen follows.
MODELS{ id; name; tier; tps; price; context; best; locked? }[]- The model menu: what each is for, its speed, price, context and estimate; locked names the plan it needs.
EFFORTS{ id; label; think; note }[]- The effort menu and the thinking budget each level spends.
BIGRegExp- Words that mark a large change: Auto turns effort up and the field suggests the deeper model.
Interactions
- Pick a model from a searchable menu; each shows what it is best for, its speed, price, context and an estimate.
- Pick an effort, or Auto, which reads the request and shows what it chose.
- Watch the time and cost estimate change as you type.
- Switch to the deeper model from the suggestion, or dismiss it.
- Make the chosen model your default.
- Send, and see each task logged with the model, effort, time and cost it ran with.
Keyboard
- Alt+M
- Open or close the model menu.
- Alt+E
- Open or close the effort menu.
- ↑or↓
- In a menu, move between options.
- HomeorEnd
- In a menu, jump to the first or last option.
- Enter
- Pick the option, or send the task from the field.
- Esc
- Close the menu and return to its button.
Behaviour
Read from the code: roles, motion, breakpoints and what runs.
Accessibility
- Each picker is a button with aria-haspopup and aria-expanded; its options are a listbox.
- The model search is a combobox; the active option is announced with aria-activedescendant.
- Locked models are aria-disabled and say which plan they need.
- Speed bars are images with a label in tokens a second; the estimate and the task log are polite live regions.
Motion
- Menus open with a short fade and scale; the chevron turns.
- The suggestion opens and closes with a height ease; new tasks slide into the log.
- Reduced motion stops the running dot and the chevron turn.
Responsive
- The card is at most 680px wide and grows with its content; menus open below their button.
- At 640px and below the menus span the field's width.
- At 480px and below the estimate moves under the pickers.
- At 400px and below the estimate shows only the time and the pickers drop their icons.
Performance
- Estimates are a few multiplications on each change; there are no timers.
- One local font file; no images.
Notes for AI
Give your coding assistant the Markdown, not a screenshot.
- The model names here are made up; put your own models and prices in MODELS.
- Send the chosen model and effort with each request, and map them to your provider on the server.
- Every class is prefixed ls- and scoped under .ls; keep colours in the tokens at the top of post.css.
/p/lathe-models/markdownThe whole library for assistants: llms.txt, or the MCP server in AI tools and MCP.