{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "model-picker",
  "type": "registry:ui",
  "title": "Model picker",
  "description": "A dropdown for choosing an AI model, built on the Select component with an accessible trigger and a placeholder. Pass an array of models and read the chosen id.",
  "dependencies": [],
  "registryDependencies": [
    "https://ui.minidev.pro/r/select.json"
  ],
  "files": [
    {
      "path": "registry/ui/model-picker.tsx",
      "type": "registry:ui",
      "target": "components/ui/model-picker.tsx",
      "content": "\"use client\"\nimport * as React from \"react\"\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"@/components/ui/select\"\n\n/** ModelPicker — a select for choosing an AI model, controlled or uncontrolled. */\n\ntype Model = { id: string; label: string }\n\n// Models available to the Lumen assistant.\nconst SAMPLE_MODELS: Model[] = [\n  { id: \"lumen-mini\", label: \"Lumen Mini\" },\n  { id: \"lumen-pro\", label: \"Lumen Pro\" },\n  { id: \"lumen-ultra\", label: \"Lumen Ultra\" },\n  { id: \"atlas-8b\", label: \"Atlas 8B (self-hosted)\" },\n]\n\ntype ModelPickerProps = {\n  /** Controlled model id. */\n  value?: string\n  /** Initial model id when uncontrolled; pass null to start on the placeholder. */\n  defaultValue?: string | null\n  onChange?: (v: string) => void\n  models?: Model[]\n  className?: string\n}\n\nfunction ModelPicker({ models = SAMPLE_MODELS, value, defaultValue = models[0]?.id, onChange, className }: ModelPickerProps) {\n  const items = models.map((m) => ({ value: m.id, label: m.label }))\n  return (\n    <div data-slot=\"model-picker\">\n      <Select\n        items={items}\n        value={value}\n        defaultValue={value === undefined ? defaultValue : undefined}\n        onValueChange={(v) => onChange?.(v as string)}\n      >\n      <SelectTrigger className={className ?? \"w-56\"} aria-label=\"Model\">\n        <SelectValue placeholder=\"Select model\" />\n      </SelectTrigger>\n      <SelectContent>\n        {models.map(m => <SelectItem key={m.id} value={m.id}>{m.label}</SelectItem>)}\n      </SelectContent>\n    </Select>\n    </div>\n  )\n}\nexport { ModelPicker }\nexport type { ModelPickerProps, Model }\n"
    }
  ]
}
