Skip to content

Commit 317be00

Browse files
committed
feat(assistant): upgrade default models to gpt-5.4-nano and gpt-5.3-codex
1 parent 25036af commit 317be00

9 files changed

Lines changed: 35 additions & 35 deletions

File tree

apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ export const AIAssistant = ({ className }: AIAssistantProps) => {
7272
const selectedModel = useMemo<AssistantModel>(() => {
7373
// While entitlements are loading, use the stored model without enforcing access
7474
if (isLoadingEntitlements) {
75-
return snap.model ?? 'gpt-5-mini'
75+
return snap.model ?? 'gpt-5.4-nano'
7676
}
7777

78-
const defaultModel: AssistantModel = hasAccessToAdvanceModel ? 'gpt-5' : 'gpt-5-mini'
78+
const defaultModel: AssistantModel = hasAccessToAdvanceModel ? 'gpt-5.3-codex' : 'gpt-5.4-nano'
7979
const model = snap.model ?? defaultModel
8080

81-
if (!hasAccessToAdvanceModel && model === 'gpt-5') {
82-
return 'gpt-5-mini'
81+
if (!hasAccessToAdvanceModel && model === 'gpt-5.3-codex') {
82+
return 'gpt-5.4-nano'
8383
}
8484

8585
return model

apps/studio/components/ui/AIAssistantPanel/AssistantChatForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ export interface FormProps {
4545
/* If currently editing an existing message */
4646
isEditing?: boolean
4747
/* The currently selected AI model */
48-
selectedModel: 'gpt-5' | 'gpt-5-mini'
48+
selectedModel: 'gpt-5.3-codex' | 'gpt-5.4-nano'
4949
/* Callback when a model is chosen */
50-
onSelectModel: (model: 'gpt-5' | 'gpt-5-mini') => void
50+
onSelectModel: (model: 'gpt-5.3-codex' | 'gpt-5.4-nano') => void
5151
}
5252

5353
const AssistantChatFormComponent = forwardRef<HTMLFormElement, FormProps>(

apps/studio/components/ui/AIAssistantPanel/ModelSelector.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import {
1919
import { useCheckEntitlements } from '@/hooks/misc/useCheckEntitlements'
2020

2121
interface ModelSelectorProps {
22-
selectedModel: 'gpt-5' | 'gpt-5-mini'
23-
onSelectModel: (model: 'gpt-5' | 'gpt-5-mini') => void
22+
selectedModel: 'gpt-5.3-codex' | 'gpt-5.4-nano'
23+
onSelectModel: (model: 'gpt-5.3-codex' | 'gpt-5.4-nano') => void
2424
}
2525

2626
export const ModelSelector = ({ selectedModel, onSelectModel }: ModelSelectorProps) => {
@@ -35,8 +35,8 @@ export const ModelSelector = ({ selectedModel, onSelectModel }: ModelSelectorPro
3535

3636
const upgradeHref = `/org/${slug ?? '_'}/billing?panel=subscriptionPlan&source=ai-assistant-model`
3737

38-
const handleSelectModel = (model: 'gpt-5' | 'gpt-5-mini') => {
39-
if (model === 'gpt-5' && !hasAccessToAdvanceModel) {
38+
const handleSelectModel = (model: 'gpt-5.3-codex' | 'gpt-5.4-nano') => {
39+
if (model === 'gpt-5.3-codex' && !hasAccessToAdvanceModel) {
4040
setOpen(false)
4141
void router.push(upgradeHref)
4242
return
@@ -62,21 +62,21 @@ export const ModelSelector = ({ selectedModel, onSelectModel }: ModelSelectorPro
6262
<CommandList_Shadcn_>
6363
<CommandGroup_Shadcn_>
6464
<CommandItem_Shadcn_
65-
value="gpt-5-mini"
66-
onSelect={() => handleSelectModel('gpt-5-mini')}
65+
value="gpt-5.4-nano"
66+
onSelect={() => handleSelectModel('gpt-5.4-nano')}
6767
className="flex justify-between"
6868
>
69-
<span>gpt-5-mini</span>
70-
{selectedModel === 'gpt-5-mini' && <Check className="h-3.5 w-3.5" />}
69+
<span>gpt-5.4-nano</span>
70+
{selectedModel === 'gpt-5.4-nano' && <Check className="h-3.5 w-3.5" />}
7171
</CommandItem_Shadcn_>
7272
<CommandItem_Shadcn_
73-
value="gpt-5"
74-
onSelect={() => handleSelectModel('gpt-5')}
73+
value="gpt-5.3-codex"
74+
onSelect={() => handleSelectModel('gpt-5.3-codex')}
7575
className="flex justify-between"
7676
>
77-
<span>gpt-5</span>
77+
<span>gpt-5.3-codex</span>
7878
{hasAccessToAdvanceModel ? (
79-
selectedModel === 'gpt-5' ? (
79+
selectedModel === 'gpt-5.3-codex' ? (
8080
<Check className="h-3.5 w-3.5" />
8181
) : null
8282
) : (
@@ -89,7 +89,7 @@ export const ModelSelector = ({ selectedModel, onSelectModel }: ModelSelectorPro
8989
</div>
9090
</TooltipTrigger>
9191
<TooltipContent side="right">
92-
gpt-5 is available on Pro plans and above
92+
gpt-5.3-codex is available on Pro plans and above
9393
</TooltipContent>
9494
</Tooltip>
9595
)}

apps/studio/evals/assistant.eval.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Eval('Assistant', {
2626
data: () => dataset,
2727
task: async (input) => {
2828
const result = await generateAssistantResponse({
29-
model: openai('gpt-5-mini'),
29+
model: openai('gpt-5.4-nano'),
3030
messages: [{ id: '1', role: 'user', parts: [{ type: 'text', text: input.prompt }] }],
3131
tools: await getMockTools(input.mockTables ? { list_tables: input.mockTables } : undefined),
3232
})

apps/studio/lib/ai/model.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ describe('getModel', () => {
6767
})
6868

6969
expect(model).toEqual('openai-model')
70-
// Default openai model in registry is gpt-5-mini
71-
expect(openai).toHaveBeenCalledWith('gpt-5-mini')
70+
// Default openai model in registry is gpt-5.4-nano
71+
expect(openai).toHaveBeenCalledWith('gpt-5.4-nano')
7272
expect(promptProviderOptions).toBeUndefined()
7373
})
7474

@@ -80,20 +80,20 @@ describe('getModel', () => {
8080
expect(error).toEqual(new Error(ModelErrorMessage))
8181
})
8282

83-
it('returns specified provider and model when provided (openai gpt-5)', async () => {
83+
it('returns specified provider and model when provided (openai gpt-5.3-codex)', async () => {
8484
vi.mocked(bedrockModule.checkAwsCredentials).mockResolvedValue(false)
8585
process.env.OPENAI_API_KEY = 'test-key'
8686
process.env.IS_THROTTLED = 'false'
8787

8888
const { model, error } = await getModel({
8989
provider: 'openai',
90-
model: 'gpt-5',
90+
model: 'gpt-5.3-codex',
9191
routingKey: 'rk',
9292
isLimited: false,
9393
})
9494

9595
expect(error).toBeUndefined()
9696
expect(model).toEqual('openai-model')
97-
expect(openai).toHaveBeenCalledWith('gpt-5')
97+
expect(openai).toHaveBeenCalledWith('gpt-5.3-codex')
9898
})
9999
})

apps/studio/lib/ai/model.utils.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('model.utils', () => {
1212

1313
it('should return correct default for openai provider', () => {
1414
const result = getDefaultModelForProvider('openai')
15-
expect(result).toBe('gpt-5-mini')
15+
expect(result).toBe('gpt-5.4-nano')
1616
})
1717

1818
it('should return correct default for anthropic provider', () => {
@@ -39,8 +39,8 @@ describe('model.utils', () => {
3939
it('should have openai provider with models', () => {
4040
expect(PROVIDERS.openai).toBeDefined()
4141
expect(PROVIDERS.openai.models).toBeDefined()
42-
expect(Object.keys(PROVIDERS.openai.models)).toContain('gpt-5')
43-
expect(Object.keys(PROVIDERS.openai.models)).toContain('gpt-5-mini')
42+
expect(Object.keys(PROVIDERS.openai.models)).toContain('gpt-5.3-codex')
43+
expect(Object.keys(PROVIDERS.openai.models)).toContain('gpt-5.4-nano')
4444
})
4545

4646
it('should have anthropic provider with models', () => {

apps/studio/lib/ai/model.utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export type ProviderName = 'bedrock' | 'openai' | 'anthropic'
22

33
export type BedrockModel = 'anthropic.claude-3-7-sonnet-20250219-v1:0' | 'openai.gpt-oss-120b-1:0'
44

5-
export type OpenAIModel = 'gpt-5' | 'gpt-5-mini'
5+
export type OpenAIModel = 'gpt-5.3-codex' | 'gpt-5.4-nano'
66

77
export type AnthropicModel = 'claude-sonnet-4-20250514' | 'claude-3-5-haiku-20241022'
88

@@ -49,8 +49,8 @@ export const PROVIDERS: ProviderRegistry = {
4949
},
5050
openai: {
5151
models: {
52-
'gpt-5': { default: false },
53-
'gpt-5-mini': { default: true },
52+
'gpt-5.3-codex': { default: false },
53+
'gpt-5.4-nano': { default: true },
5454
},
5555
providerOptions: {
5656
openai: {

apps/studio/pages/api/ai/sql/generate-v4.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const requestBodySchema = z.object({
5353
chatId: z.string().optional(),
5454
chatName: z.string().optional(),
5555
orgSlug: z.string().optional(),
56-
model: z.enum(['gpt-5', 'gpt-5-mini']).optional(),
56+
model: z.enum(['gpt-5.3-codex', 'gpt-5.4-nano']).optional(),
5757
})
5858

5959
async function handlePost(req: NextApiRequest, res: NextApiResponse, claims?: JwtPayload) {
@@ -135,7 +135,7 @@ async function handlePost(req: NextApiRequest, res: NextApiResponse, claims?: Jw
135135
providerOptions,
136136
} = await getModel({
137137
provider: 'openai',
138-
model: requestedModel ?? 'gpt-5',
138+
model: requestedModel ?? 'gpt-5.3-codex',
139139
routingKey: projectRef,
140140
isLimited,
141141
})

apps/studio/state/ai-assistant-state.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export type AssistantMessageType = MessageType
2222

2323
export type SqlSnippet = string | { label: string; content: string }
2424

25-
export type AssistantModel = 'gpt-5' | 'gpt-5-mini'
25+
export type AssistantModel = 'gpt-5.3-codex' | 'gpt-5.4-nano'
2626

2727
type ChatSession = {
2828
id: string
@@ -64,7 +64,7 @@ const INITIAL_AI_ASSISTANT: AiAssistantData = {
6464
tables: [],
6565
chats: {},
6666
activeChatId: undefined,
67-
model: 'gpt-5',
67+
model: 'gpt-5.3-codex',
6868
context: {},
6969
}
7070

0 commit comments

Comments
 (0)