@@ -40,28 +40,187 @@ import {
4040 PopoverTrigger ,
4141} from '@/components/ui/popover' ;
4242import { cn } from '@/lib/utils' ;
43- import { aiChatPlugin } from '@/registry/components/editor/plugins/ai-kit' ;
43+
44+ import { aiChatPlugin } from './plugins/ai-kit' ;
4445
4546interface Model {
4647 label : string ;
4748 value : string ;
4849}
4950
5051export const models : Model [ ] = [
51- { label : 'gpt-4o-mini' , value : 'gpt-4o-mini' } ,
52- { label : 'gpt-4o' , value : 'gpt-4o' } ,
53- { label : 'gpt-4-turbo' , value : 'gpt-4-turbo' } ,
54- { label : 'gpt-4' , value : 'gpt-4' } ,
55- { label : 'gpt-3.5-turbo' , value : 'gpt-3.5-turbo' } ,
56- { label : 'gpt-3.5-turbo-instruct' , value : 'gpt-3.5-turbo-instruct' } ,
52+ // OpenAI Models
53+ { label : 'GPT-3.5 Turbo' , value : 'openai/gpt-3.5-turbo' } ,
54+ { label : 'GPT-3.5 Turbo Instruct' , value : 'openai/gpt-3.5-turbo-instruct' } ,
55+ { label : 'GPT-4 Turbo' , value : 'openai/gpt-4-turbo' } ,
56+ { label : 'GPT-4.1' , value : 'openai/gpt-4.1' } ,
57+ { label : 'GPT-4.1 Mini' , value : 'openai/gpt-4.1-mini' } ,
58+ { label : 'GPT-4.1 Nano' , value : 'openai/gpt-4.1-nano' } ,
59+ { label : 'GPT-4o' , value : 'openai/gpt-4o' } ,
60+ { label : 'GPT-4o Mini' , value : 'openai/gpt-4o-mini' } ,
61+ { label : 'GPT-5' , value : 'openai/gpt-5' } ,
62+ { label : 'GPT-5 Codex' , value : 'openai/gpt-5-codex' } ,
63+ { label : 'GPT-5 Mini' , value : 'openai/gpt-5-mini' } ,
64+ { label : 'GPT-5 Nano' , value : 'openai/gpt-5-nano' } ,
65+ { label : 'GPT-OSS 120B' , value : 'openai/gpt-oss-120b' } ,
66+ { label : 'GPT-OSS 20B' , value : 'openai/gpt-oss-20b' } ,
67+ { label : 'O1' , value : 'openai/o1' } ,
68+ { label : 'O3' , value : 'openai/o3' } ,
69+ { label : 'O3 Mini' , value : 'openai/o3-mini' } ,
70+ { label : 'O4 Mini' , value : 'openai/o4-mini' } ,
71+
72+ // Google Models
73+ { label : 'Gemini 2.0 Flash' , value : 'google/gemini-2.0-flash' } ,
74+ { label : 'Gemini 2.0 Flash Lite' , value : 'google/gemini-2.0-flash-lite' } ,
75+ { label : 'Gemini 2.5 Flash' , value : 'google/gemini-2.5-flash' } ,
76+ {
77+ label : 'Gemini 2.5 Flash Image Preview' ,
78+ value : 'google/gemini-2.5-flash-image-preview' ,
79+ } ,
80+ { label : 'Gemini 2.5 Flash Lite' , value : 'google/gemini-2.5-flash-lite' } ,
81+ { label : 'Gemini 2.5 Pro' , value : 'google/gemini-2.5-pro' } ,
82+ { label : 'Gemma 2 9B' , value : 'google/gemma-2-9b' } ,
83+
84+ // Alibaba Models
85+ { label : 'Qwen 3 14B' , value : 'alibaba/qwen-3-14b' } ,
86+ { label : 'Qwen 3 235B' , value : 'alibaba/qwen-3-235b' } ,
87+ { label : 'Qwen 3 30B' , value : 'alibaba/qwen-3-30b' } ,
88+ { label : 'Qwen 3 32B' , value : 'alibaba/qwen-3-32b' } ,
89+ { label : 'Qwen3 Coder' , value : 'alibaba/qwen3-coder' } ,
90+ { label : 'Qwen3 Coder Plus' , value : 'alibaba/qwen3-coder-plus' } ,
91+ { label : 'Qwen3 Max' , value : 'alibaba/qwen3-max' } ,
92+ { label : 'Qwen3 Max Preview' , value : 'alibaba/qwen3-max-preview' } ,
93+ {
94+ label : 'Qwen3 Next 80B A3B Instruct' ,
95+ value : 'alibaba/qwen3-next-80b-a3b-instruct' ,
96+ } ,
97+ {
98+ label : 'Qwen3 Next 80B A3B Thinking' ,
99+ value : 'alibaba/qwen3-next-80b-a3b-thinking' ,
100+ } ,
101+ { label : 'Qwen3 VL Instruct' , value : 'alibaba/qwen3-vl-instruct' } ,
102+ { label : 'Qwen3 VL Thinking' , value : 'alibaba/qwen3-vl-thinking' } ,
103+
104+ // Amazon Models
105+ { label : 'Nova Lite' , value : 'amazon/nova-lite' } ,
106+ { label : 'Nova Micro' , value : 'amazon/nova-micro' } ,
107+ { label : 'Nova Pro' , value : 'amazon/nova-pro' } ,
108+
109+ // Anthropic Models
110+ { label : 'Claude 3 Haiku' , value : 'anthropic/claude-3-haiku' } ,
111+ { label : 'Claude 3 Opus' , value : 'anthropic/claude-3-opus' } ,
112+ { label : 'Claude 3.5 Haiku' , value : 'anthropic/claude-3.5-haiku' } ,
113+ { label : 'Claude 3.5 Sonnet' , value : 'anthropic/claude-3.5-sonnet' } ,
114+ { label : 'Claude 3.7 Sonnet' , value : 'anthropic/claude-3.7-sonnet' } ,
115+ { label : 'Claude Opus 4' , value : 'anthropic/claude-opus-4' } ,
116+ { label : 'Claude Opus 4.1' , value : 'anthropic/claude-opus-4.1' } ,
117+ { label : 'Claude Sonnet 4' , value : 'anthropic/claude-sonnet-4' } ,
118+
119+ // Cohere Models
120+ { label : 'Command A' , value : 'cohere/command-a' } ,
121+ { label : 'Command R' , value : 'cohere/command-r' } ,
122+ { label : 'Command R Plus' , value : 'cohere/command-r-plus' } ,
123+
124+ // DeepSeek Models
125+ { label : 'DeepSeek R1' , value : 'deepseek/deepseek-r1' } ,
126+ {
127+ label : 'DeepSeek R1 Distill Llama 70B' ,
128+ value : 'deepseek/deepseek-r1-distill-llama-70b' ,
129+ } ,
130+ { label : 'DeepSeek V3' , value : 'deepseek/deepseek-v3' } ,
131+ { label : 'DeepSeek V3.1' , value : 'deepseek/deepseek-v3.1' } ,
132+ { label : 'DeepSeek V3.1 Base' , value : 'deepseek/deepseek-v3.1-base' } ,
133+ { label : 'DeepSeek V3.1 Terminus' , value : 'deepseek/deepseek-v3.1-terminus' } ,
134+ { label : 'DeepSeek V3.2 Exp' , value : 'deepseek/deepseek-v3.2-exp' } ,
135+ {
136+ label : 'DeepSeek V3.2 Exp Thinking' ,
137+ value : 'deepseek/deepseek-v3.2-exp-thinking' ,
138+ } ,
139+
140+ // Inception Models
141+ { label : 'Mercury Coder Small' , value : 'inception/mercury-coder-small' } ,
142+
143+ // Meituan Models
144+ { label : 'LongCat Flash Chat' , value : 'meituan/longcat-flash-chat' } ,
145+ { label : 'LongCat Flash Thinking' , value : 'meituan/longcat-flash-thinking' } ,
146+
147+ // Meta Models
148+ { label : 'Llama 3 70B' , value : 'meta/llama-3-70b' } ,
149+ { label : 'Llama 3 8B' , value : 'meta/llama-3-8b' } ,
150+ { label : 'Llama 3.1 70B' , value : 'meta/llama-3.1-70b' } ,
151+ { label : 'Llama 3.1 8B' , value : 'meta/llama-3.1-8b' } ,
152+ { label : 'Llama 3.2 11B' , value : 'meta/llama-3.2-11b' } ,
153+ { label : 'Llama 3.2 1B' , value : 'meta/llama-3.2-1b' } ,
154+ { label : 'Llama 3.2 3B' , value : 'meta/llama-3.2-3b' } ,
155+ { label : 'Llama 3.2 90B' , value : 'meta/llama-3.2-90b' } ,
156+ { label : 'Llama 3.3 70B' , value : 'meta/llama-3.3-70b' } ,
157+ { label : 'Llama 4 Maverick' , value : 'meta/llama-4-maverick' } ,
158+ { label : 'Llama 4 Scout' , value : 'meta/llama-4-scout' } ,
159+
160+ // Mistral Models
161+ { label : 'Codestral' , value : 'mistral/codestral' } ,
162+ { label : 'Devstral Small' , value : 'mistral/devstral-small' } ,
163+ { label : 'Magistral Medium' , value : 'mistral/magistral-medium' } ,
164+ { label : 'Magistral Small' , value : 'mistral/magistral-small' } ,
165+ { label : 'Ministral 3B' , value : 'mistral/ministral-3b' } ,
166+ { label : 'Ministral 8B' , value : 'mistral/ministral-8b' } ,
167+ { label : 'Mistral Large' , value : 'mistral/mistral-large' } ,
168+ { label : 'Mistral Medium' , value : 'mistral/mistral-medium' } ,
169+ { label : 'Mistral Small' , value : 'mistral/mistral-small' } ,
170+ { label : 'Mixtral 8x22B Instruct' , value : 'mistral/mixtral-8x22b-instruct' } ,
171+ { label : 'Pixtral 12B' , value : 'mistral/pixtral-12b' } ,
172+ { label : 'Pixtral Large' , value : 'mistral/pixtral-large' } ,
173+
174+ // MoonshotAI Models
175+ { label : 'Kimi K2' , value : 'moonshotai/kimi-k2' } ,
176+ { label : 'Kimi K2 0905' , value : 'moonshotai/kimi-k2-0905' } ,
177+ { label : 'Kimi K2 Turbo' , value : 'moonshotai/kimi-k2-turbo' } ,
178+
179+ // Morph Models
180+ { label : 'Morph V3 Fast' , value : 'morph/morph-v3-fast' } ,
181+ { label : 'Morph V3 Large' , value : 'morph/morph-v3-large' } ,
182+
183+ // Perplexity Models
184+ { label : 'Sonar' , value : 'perplexity/sonar' } ,
185+ { label : 'Sonar Pro' , value : 'perplexity/sonar-pro' } ,
186+ { label : 'Sonar Reasoning' , value : 'perplexity/sonar-reasoning' } ,
187+ { label : 'Sonar Reasoning Pro' , value : 'perplexity/sonar-reasoning-pro' } ,
188+
189+ // Stealth Models
190+ { label : 'Sonoma Dusk Alpha' , value : 'stealth/sonoma-dusk-alpha' } ,
191+ { label : 'Sonoma Sky Alpha' , value : 'stealth/sonoma-sky-alpha' } ,
192+
193+ // Vercel Models
194+ { label : 'v0 1.0 MD' , value : 'vercel/v0-1.0-md' } ,
195+ { label : 'v0 1.5 MD' , value : 'vercel/v0-1.5-md' } ,
196+
197+ // xAI Models
198+ { label : 'Grok 2' , value : 'xai/grok-2' } ,
199+ { label : 'Grok 2 Vision' , value : 'xai/grok-2-vision' } ,
200+ { label : 'Grok 3' , value : 'xai/grok-3' } ,
201+ { label : 'Grok 3 Fast' , value : 'xai/grok-3-fast' } ,
202+ { label : 'Grok 3 Mini' , value : 'xai/grok-3-mini' } ,
203+ { label : 'Grok 3 Mini Fast' , value : 'xai/grok-3-mini-fast' } ,
204+ { label : 'Grok 4' , value : 'xai/grok-4' } ,
205+ { label : 'Grok Code Fast 1' , value : 'xai/grok-code-fast-1' } ,
206+ {
207+ label : 'Grok 4 Fast Non-Reasoning' ,
208+ value : 'xai/grok-4-fast-non-reasoning' ,
209+ } ,
210+ { label : 'Grok 4 Fast Reasoning' , value : 'xai/grok-4-fast-reasoning' } ,
211+
212+ // ZAI Models
213+ { label : 'GLM 4.5' , value : 'zai/glm-4.5' } ,
214+ { label : 'GLM 4.5 Air' , value : 'zai/glm-4.5-air' } ,
215+ { label : 'GLM 4.5V' , value : 'zai/glm-4.5v' } ,
57216] ;
58217
59218export function SettingsDialog ( ) {
60219 const editor = useEditorRef ( ) ;
61220
62- const [ tempModel , setTempModel ] = React . useState ( models [ 0 ] ) ;
221+ const [ tempModel , setTempModel ] = React . useState ( models [ 7 ] ) ;
63222 const [ tempKeys , setTempKeys ] = React . useState < Record < string , string > > ( {
64- openai : '' ,
223+ aiGatewayApiKey : '' ,
65224 uploadthing : '' ,
66225 } ) ;
67226 const [ showKey , setShowKey ] = React . useState < Record < string , boolean > > ( { } ) ;
@@ -78,7 +237,7 @@ export function SettingsDialog() {
78237 ...chatOptions ,
79238 body : {
80239 ...chatOptions . body ,
81- apiKey : tempKeys . openai ,
240+ apiKey : tempKeys . aiGatewayApiKey ,
82241 model : tempModel . value ,
83242 } ,
84243 } ) ;
@@ -92,7 +251,7 @@ export function SettingsDialog() {
92251 ...completeOptions ,
93252 body : {
94253 ...completeOptions . body ,
95- apiKey : tempKeys . openai ,
254+ apiKey : tempKeys . aiGatewayApiKey ,
96255 model : tempModel . value ,
97256 } ,
98257 } ) ;
@@ -120,8 +279,8 @@ export function SettingsDialog() {
120279 < a
121280 className = "flex items-center"
122281 href = {
123- service === 'openai '
124- ? 'https://platform.openai. com/api-keys '
282+ service === 'aiGatewayApiKey '
283+ ? 'https://vercel. com/docs/ai-gateway '
125284 : 'https://uploadthing.com/dashboard'
126285 }
127286 rel = "noopener noreferrer"
@@ -197,7 +356,7 @@ export function SettingsDialog() {
197356 </ div >
198357
199358 < div className = "space-y-4" >
200- { renderApiKeyInput ( 'openai ' , 'OpenAI API key ' ) }
359+ { renderApiKeyInput ( 'aiGatewayApiKey ' , 'AI Gateway API Key ' ) }
201360
202361 < div className = "group relative" >
203362 < label
0 commit comments