MCPcopy Create free account
hub / github.com/codeaashu/claude-code / ModelSettings

Function ModelSettings

web/components/settings/ModelSettings.tsx:10–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8import { cn } from "@/lib/utils";
9
10export function ModelSettings() {
11 const { settings, updateSettings, resetSettings } = useChatStore();
12 const [showAdvanced, setShowAdvanced] = useState(false);
13
14 const selectedModel = MODELS.find((m) => m.id === settings.model);
15
16 return (
17 <div>
18 <SectionHeader title="Model" onReset={() => resetSettings("model")} />
19
20 <SettingRow
21 label="Default model"
22 description="The AI model used for new conversations."
23 >
24 <select
25 value={settings.model}
26 onChange={(e) => updateSettings({ model: e.target.value })}
27 className={cn(
28 "bg-surface-800 border border-surface-700 rounded-md px-3 py-1.5 text-sm",
29 "text-surface-200 focus:outline-none focus:ring-1 focus:ring-brand-500"
30 )}
31 >
32 {MODELS.map((m) => (
33 <option key={m.id} value={m.id}>
34 {m.label} — {m.description}
35 </option>
36 ))}
37 </select>
38 </SettingRow>
39
40 {selectedModel && (
41 <div className="mb-4 px-3 py-2 rounded-md bg-surface-800/50 border border-surface-800 text-xs text-surface-400">
42 <span className="font-medium text-surface-300">{selectedModel.label}</span>
43 {" — "}{selectedModel.description}
44 </div>
45 )}
46
47 <SettingRow
48 label="Max tokens"
49 description="Maximum number of tokens in the model's response."
50 stack
51 >
52 <div className="flex items-center gap-3">
53 <Slider
54 value={settings.maxTokens}
55 min={1000}
56 max={200000}
57 step={1000}
58 onChange={(v) => updateSettings({ maxTokens: v })}
59 showValue={false}
60 className="flex-1"
61 />
62 <input
63 type="number"
64 value={settings.maxTokens}
65 min={1000}
66 max={200000}
67 step={1000}

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected