Skip to content
GitHub (opens in a new tab)

ModelPicker

Choose which model an agent or chat uses: grouped by vendor, with context window and cost tier, recommended models, and disabled models that keep their reason. Built on kit DropdownMenu.

stableMoleculecontracts/modelpicker.json

Preview

ModelPicker

Choose the model an agent uses. Not Select. Not Combobox.

Master

Open the menu: models are grouped by vendor with context window and cost tier; disabled ones keep their reason.

Usage

ModelPicker is built on the kit DropdownMenu, so keyboard and overlay motion match. Keep unavailable models visible with their reason instead of hiding them.

Do's

  • pick a model for an agent, chat or run
  • compare context window and cost at a glance
  • show models the plan does not include, with the reason

Don'ts

  • a plain list of strings — Select
  • free search over many values — Combobox
<ModelPicker models={models} value={modelId} onValueChange={setModelId} />

When to use

  • pick a model for an agent, chat or run
  • compare context window and cost at a glance
  • show models the plan does not include, with the reason

When not to use

  • a plain list of strings — Select
  • free search over many values — Combobox

What an agent reads

import { ModelPicker } from "agentic-ds-kit";
must
  • a visible label (or hideLabel) names the field trigger
  • the menu is the kit DropdownMenu: groups with headings, arrow keys, Escape
  • disabled models stay in the list with their reason and a lock
  • context window and cost tier are plain text in the item description (e.g. "Deepest reasoning · 200K · High"), read with the item, not key chips or aria-keyshortcuts
  • error is role=alert and described by the trigger
  • the spinner stops under prefers-reduced-motion
defaults
  • label Model
  • hideLabel false
  • size md
  • loading false
stops if
  • Do not invent a local ModelSelect or ModelMenu
  • Do not hide unavailable models; disable them with a reason
  • Do not use raw hex

From contracts/modelpicker.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
modelsarrayYes—{ id, name, vendor?, description?, contextWindow?, costTier?, tagline?, disabled?, disabledReason?, recommended? }[] costTier is a word: "Low", "Standard" or "High" ("$" marks are optional and show as those words).
valuestringNo——
onValueChangefunctionNo—(id) => void
labelstringNoModel—
hideLabelbooleanNofalse—
sizesm | mdNomd—
loadingbooleanNofalse—
errorstringNo—The last choice stays selected.
onRetryfunctionNo——
emptyTextstringNo——
  • Component
    →

    Select

    Choose one or several options from a list.

  • Component
    →

    Combobox

    Type to filter one value, including a list the parent loads asynchronously.

  • Component
    →

    DropdownMenu

    Actions or value menu from a button, field, or nav trigger.

  • Component
    →

    Chat

    Assistant panel with a header, a thread, and a composer.