From ee5c7b709651de10e0cca6cf23a2cc8baad7eb50 Mon Sep 17 00:00:00 2001 From: Jack Williams Date: Mon, 18 May 2026 14:17:47 +0200 Subject: [PATCH] Use gpt-5.4-nano as default chat model Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- README.md | 11 +++++------ apps/promptions-chat/.env.example | 5 ++--- apps/promptions-chat/README.md | 4 ++-- apps/promptions-chat/src/services/ChatService.ts | 8 +++----- apps/promptions-image/.env.example | 4 ++-- apps/promptions-image/src/services/ImageService.ts | 5 ++--- 6 files changed, 16 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 60768b2..40c902b 100644 --- a/README.md +++ b/README.md @@ -107,9 +107,8 @@ Option A — .env files (recommended for local development): ```dotenv VITE_OPENAI_API_KEY=your_openai_api_key_here - # Optional: override the chat model (defaults to gpt-4.1). - # The chat app supports GPT-4* and below; GPT-5* and later are NOT supported. - # VITE_OPENAI_MODEL=gpt-4.1 + # Optional: override the chat model (defaults to gpt-5.4-nano). + # VITE_OPENAI_MODEL=gpt-5.4-nano ``` **Azure OpenAI** (using your own hosted deployment) @@ -124,7 +123,7 @@ Option A — .env files (recommended for local development): # Required for Azure OpenAI VITE_OPENAI_API_VERSION=2024-12-01-preview # On Azure, this is your DEPLOYMENT NAME (not the underlying model id). - # The chat app supports GPT-4* family deployments and below; GPT-5* and later are NOT supported. + # Ensure this deployment targets a chat-completions-compatible model. VITE_OPENAI_MODEL=your_chat_deployment_name ``` @@ -152,13 +151,13 @@ Both apps read these `VITE_*` variables from their respective `.env` files. | Variable | Description | Default | | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------- | | `VITE_OPENAI_API_KEY` | **Required.** Your OpenAI API key, or your Azure OpenAI resource key when `VITE_OPENAI_BASE_URL` is set. | _(unset)_ | -| `VITE_OPENAI_MODEL` | Chat model used for completions. On Azure OpenAI this is the **deployment name**. The image-generation model is selected in the UI. | `gpt-4.1` | +| `VITE_OPENAI_MODEL` | Chat model used for completions. On Azure OpenAI this is the **deployment name**. The image-generation model is selected in the UI. | `gpt-5.4-nano` | | `VITE_OPENAI_BASE_URL` | Custom endpoint. Set this to use Azure OpenAI (e.g. `https://your-resource.openai.azure.com`) or another OpenAI-compatible service. | _(unset)_ | | `VITE_OPENAI_API_VERSION` | API version. **Required** when `VITE_OPENAI_BASE_URL` points at Azure OpenAI (e.g. `2024-12-01-preview`). | _(unset)_ | When `VITE_OPENAI_BASE_URL` is set, the apps use the Azure OpenAI client; otherwise they use the standard OpenAI client. -> **Model compatibility:** The chat reference app supports **GPT-4\* family models and below** (e.g. `gpt-4`, `gpt-4.1`, `gpt-4o`). **GPT-5\* and later are not supported.** On Azure OpenAI, make sure the deployment named in `VITE_OPENAI_MODEL` targets a supported model. +> **Model compatibility:** The chat reference app uses `VITE_OPENAI_MODEL`, defaulting to `gpt-5.4-nano`. On Azure OpenAI, make sure the deployment named in `VITE_OPENAI_MODEL` targets a chat-completions-compatible model. Start the dev servers: diff --git a/apps/promptions-chat/.env.example b/apps/promptions-chat/.env.example index ec2b089..9a073a8 100644 --- a/apps/promptions-chat/.env.example +++ b/apps/promptions-chat/.env.example @@ -11,6 +11,5 @@ VITE_OPENAI_API_KEY=your_openai_api_key_here # Required when VITE_OPENAI_BASE_URL points at Azure OpenAI. # VITE_OPENAI_API_VERSION=2024-12-01-preview -# Optional: override the chat model (defaults to gpt-4.1). -# Note that the Promptions Chat App does not support GPT-5* or later -# VITE_OPENAI_MODEL=gpt-4.1 +# Optional: override the chat model (defaults to gpt-5.4-nano). +# VITE_OPENAI_MODEL=gpt-5.4-nano diff --git a/apps/promptions-chat/README.md b/apps/promptions-chat/README.md index 4841cf7..da9f2f7 100644 --- a/apps/promptions-chat/README.md +++ b/apps/promptions-chat/README.md @@ -87,12 +87,12 @@ yarn typecheck - **React 18** - Modern React with hooks - **Vite** - Fast build tool and dev server - **Fluent UI** - Microsoft's design system -- **OpenAI / Azure OpenAI API** - Streaming chat completions (defaults to `gpt-4.1`) +- **OpenAI / Azure OpenAI API** - Streaming chat completions (defaults to `gpt-5.4-nano`) - **TypeScript** - Full type safety ## Model compatibility -The chat app supports **GPT-4\* family models and below** (e.g. `gpt-4`, `gpt-4.1`, `gpt-4o`). **GPT-5\* and later are not supported.** When using Azure OpenAI, ensure the deployment named in `VITE_OPENAI_MODEL` targets a supported model. +The chat app uses the model configured in `VITE_OPENAI_MODEL`, defaulting to `gpt-5.4-nano`. When using Azure OpenAI, ensure the deployment named in `VITE_OPENAI_MODEL` targets a chat-completions-compatible model. ## Security Notes diff --git a/apps/promptions-chat/src/services/ChatService.ts b/apps/promptions-chat/src/services/ChatService.ts index e0bcc43..7d87841 100644 --- a/apps/promptions-chat/src/services/ChatService.ts +++ b/apps/promptions-chat/src/services/ChatService.ts @@ -22,7 +22,7 @@ export class ChatService { const baseURL = import.meta.env.VITE_OPENAI_BASE_URL; const apiVersion = import.meta.env.VITE_OPENAI_API_VERSION; - this.model = import.meta.env.VITE_OPENAI_MODEL || "gpt-4.1"; + this.model = import.meta.env.VITE_OPENAI_MODEL || "gpt-5.4-nano"; this.client = baseURL ? new AzureOpenAI({ @@ -50,8 +50,7 @@ export class ChatService { model: this.model, messages: messages as OpenAI.Chat.Completions.ChatCompletionMessageParam[], stream: true, - temperature: 0.7, - max_tokens: 1000, + max_completion_tokens: 1000, }, { signal: options?.signal, @@ -78,8 +77,7 @@ export class ChatService { const response = await this.client.chat.completions.create({ model: this.model, messages: messages as OpenAI.Chat.Completions.ChatCompletionMessageParam[], - temperature: 0.7, - max_tokens: 1000, + max_completion_tokens: 1000, }); return response.choices[0]?.message?.content || "No response received"; diff --git a/apps/promptions-image/.env.example b/apps/promptions-image/.env.example index be74099..9ee2de3 100644 --- a/apps/promptions-image/.env.example +++ b/apps/promptions-image/.env.example @@ -11,6 +11,6 @@ VITE_OPENAI_API_KEY=your_openai_api_key_here # Required when VITE_OPENAI_BASE_URL points at Azure OpenAI. # VITE_OPENAI_API_VERSION=2024-12-01-preview -# Optional: override the chat model used for prompt-related completions (defaults to gpt-4.1). +# Optional: override the chat model used for prompt-related completions (defaults to gpt-5.4-nano). # The image-generation model is selected in the UI. -# VITE_OPENAI_MODEL=gpt-4.1 +# VITE_OPENAI_MODEL=gpt-5.4-nano diff --git a/apps/promptions-image/src/services/ImageService.ts b/apps/promptions-image/src/services/ImageService.ts index 142958e..f332ee1 100644 --- a/apps/promptions-image/src/services/ImageService.ts +++ b/apps/promptions-image/src/services/ImageService.ts @@ -16,7 +16,7 @@ export class ImageService { const baseURL = import.meta.env.VITE_OPENAI_BASE_URL; const apiVersion = import.meta.env.VITE_OPENAI_API_VERSION; - this.chatModel = import.meta.env.VITE_OPENAI_MODEL || "gpt-4.1"; + this.chatModel = import.meta.env.VITE_OPENAI_MODEL || "gpt-5.4-nano"; this.client = baseURL ? new AzureOpenAI({ @@ -76,8 +76,7 @@ export class ImageService { model: this.chatModel, messages: messages as OpenAI.Chat.Completions.ChatCompletionMessageParam[], stream: true, - temperature: 0.7, - max_tokens: 1000, + max_completion_tokens: 1000, }, { signal: options?.signal,