Model Picker

A chat-style model switcher. Provider icons on a side rail filter the list to models available from that provider.

Installation

Model Picker is published as a shadcn registry item. The CLI drops the file into your project, installs its dependencies, and adds any primitives it relies on.

$npx shadcn@latest add https://akoder.xyz/r/model-picker.json

Install directly from the URL above. To configure the registry once and install components by name, use the setup snippet on the components page.

"registries": { "@akoder": "https://akoder.xyz/r/{name}.json" }

Usage

import { useState } from "react";
import {
  ModelPicker,
  defaultModelProviders,
} from "@/components/ui/model-picker";
 
export function ChatComposer() {
  const [model, setModel] = useState("grok-4.6");
 
  return (
    <ModelPicker
      providers={defaultModelProviders}
      value={model}
      onValueChange={setModel}
      side="top"
    />
  );
}

Picking a row keeps the popover open so the thinking track in the footer can be dialled in for the model that was just chosen. Pass closeOnSelect when the popover should dismiss on the first click instead.

Pass your own providers to swap the catalog. Each provider is an id, a name, an optional icon, and a models array. Set available: false on a model to hide it from that provider's list. Providers with no available models are omitted from the rail.

<ModelPicker
  providers={[
    {
      id: "openai",
      name: "OpenAI",
      models: [
        { id: "gpt-5.6-sol", name: "GPT-5.6 Sol", capabilities: ["reasoning", "image"], thinking: ["low", "medium", "high", "max"] },
        { id: "gpt-5.6-luna", name: "GPT-5.6 Luna", capabilities: ["image"] },
      ],
    },
  ]}
  placeholder="Select a model"
/>

Unknown provider ids without an icon fall back to the first letter of the provider name. Built-in marks use the brand files in public/ai/ for openai, anthropic, and google. xai uses the Grok mark already in ask-ai.

Props

PropTypeDefaultNotes
providersreadonly ModelPickerProvider[]requiredProvider catalog. Models with available: false are omitted.
valuestring-Controlled selected model id.
defaultValuestring-Initial model id when uncontrolled.
onValueChange(modelId: string, providerId: string, thinking?: ThinkingEffort) => void-Fires when a model row or a thinking level is committed.
thinkingThinkingEffort-Controlled thinking effort for the selected model.
defaultThinkingThinkingEffort-Initial thinking effort when uncontrolled.
closeOnSelectbooleanfalseClose the popover as soon as a model row is picked. Off by default so the thinking track stays reachable.
openboolean-Controlled open state for the popover.
defaultOpenbooleanfalseInitial open state when uncontrolled.
onOpenChange(open: boolean) => void-Callback fired when the open state changes.
side"top" | "bottom" | "left" | "right""top"Placement side for the popover relative to the trigger.
align"start" | "center" | "end""start"Alignment of the popover along the trigger edge.
placeholderstring"Select a model"Trigger text when nothing is selected.
classNamestring-Extra class names forwarded to the trigger.

Notes & Features

Manual installation

Copy components/ui/model-picker.tsx and components/ui/popover.tsx into your project, then install the required dependencies:

npm i radix-ui lucide-react

Ensure your project includes the standard shadcn tooltip primitive (or copy components/ui/tooltip.tsx).

examples

Explore different presets, palettes, and configurations.

xAI

Default selection on Grok 4. The rail starts on that provider.

Example 1 of 3: xAI