"use client"; import { cn } from "@/lib/utils"; import { Badge } from "@/components/ui/primitives"; import { perM, pct, providerTone, usd, type ModelRow } from "@/components/ai/models/format"; export const MIN_MODELS = 2, MAX_MODELS = 6; export function ModelPicker({ models, selected, onChange, disabled }: { models: ModelRow[]; selected: string[]; onChange: (ids: string[]) => void; disabled?: boolean }) { const toggle = (id: string) => { if (selected.includes(id)) onChange(selected.filter((x) => x !== id)); else if (selected.length < MAX_MODELS) onChange([...selected, id]); }; const groups = ["openai", "anthropic"].map((p) => ({ p, items: models.filter((m) => m.provider === p && m.available && m.category !== "embedding" && m.probes?.text?.status === "ok").sort((a, b) => (b.benchmark?.mean_score ?? -1) - (a.benchmark?.mean_score ?? -1) || a.id.localeCompare(b.id)) })); const presets: [string, string[]][] = [["Cheap duo", ["claude-haiku-5-5", "gpt-5.4-mini"]], ["Routing primaries", ["gpt-6-sol", "claude-sonnet-5-5", "claude-haiku-5-5", "gpt-5.4-mini"]], ["Frontier", ["claude-fable-5-1", "gpt-6-astra", "claude-opus-5-5"]]]; return (