Add gpt-5.3-chat-latest model support (#5241) * Add gpt-5.3-chat-latest model support - Add to OpenAI model dropdown (index.html) - Add to captioning multimodal model list (caption/settings.html) - Add to OPENAI_REASONING_EFFORT_MODELS (constants.js) - Add OPENAI_FIXED_REASONING_EFFORT map to clamp effort to 'medium' (the only value this model accepts) - Apply fixed effort override in both Azure and general OpenAI request paths (chat-completions.js) - Update frontend gpt-5.x regex for parameter handling (openai.js) * Update public/scripts/openai.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed| @@ -3028,6 +3028,9 @@ | ||
| 3028 | 3028 | <div> |
| 3029 | 3029 | <h4 data-i18n="OpenAI Model">OpenAI Model</h4> |
| 3030 | 3030 | <select id="model_openai_select"> |
| 3031 | + <optgroup label="GPT-5.3"> | |
| 3032 | + <option value="gpt-5.3-chat-latest">gpt-5.3-chat-latest</option> | |
| 3033 | + </optgroup> | |
| 3031 | 3034 | <optgroup label="GPT-5.2"> |
| 3032 | 3035 | <option value="gpt-5.2">gpt-5.2</option> |
| 3033 | 3036 | <option value="gpt-5.2-2025-12-11">gpt-5.2-2025-12-11</option> |
| @@ -53,6 +53,7 @@ | ||
| 53 | 53 | <option data-type="cohere" value="c4ai-aya-vision-8b">c4ai-aya-vision-8b</option> |
| 54 | 54 | <option data-type="cohere" value="c4ai-aya-vision-32b">c4ai-aya-vision-32b</option> |
| 55 | 55 | <option data-type="cohere" value="command-a-vision-07-2025">command-a-vision-07-2025</option> |
| 56 | + <option data-type="openai" value="gpt-5.3-chat-latest">gpt-5.3-chat-latest</option> | |
| 56 | 57 | <option data-type="openai" value="gpt-5.2">gpt-5.2</option> |
| 57 | 58 | <option data-type="openai" value="gpt-5.2-2025-12-11">gpt-5.2-2025-12-11</option> |
| 58 | 59 | <option data-type="openai" value="gpt-5.2-chat-latest">gpt-5.2-chat-latest</option> |
| @@ -2859,7 +2859,7 @@ export async function createGenerationParameters(settings, model, type, messages | ||
| 2859 | 2859 | if (/gpt-5-chat-latest/.test(model)) { |
| 2860 | 2860 | delete generate_data.tools; |
| 2861 | 2861 | delete generate_data.tool_choice; |
| 2862 | 2862 | } else if (/gpt-5\.(1|2|3)/.test(model) && !/chat-latest/.test(model)) { |
| 2863 | 2863 | delete generate_data.frequency_penalty; |
| 2864 | 2864 | delete generate_data.presence_penalty; |
| 2865 | 2865 | delete generate_data.logit_bias; |
| @@ -476,12 +476,21 @@ export const OPENAI_REASONING_EFFORT_MODELS = [ | ||
| 476 | 476 | 'gpt-5.2', |
| 477 | 477 | 'gpt-5.2-2025-12-11', |
| 478 | 478 | 'gpt-5.2-chat-latest', |
| 479 | + 'gpt-5.3-chat-latest', | |
| 479 | 480 | ]; |
| 480 | 481 | |
| 481 | 482 | export const OPENAI_REASONING_EFFORT_MAP = { |
| 482 | 483 | min: 'minimal', |
| 483 | 484 | }; |
| 484 | 485 | |
| 486 | +/** | |
| 487 | + * Models that only accept a single fixed reasoning effort value. | |
| 488 | + * @type {Record<string, string>} | |
| 489 | + */ | |
| 490 | +export const OPENAI_FIXED_REASONING_EFFORT = { | |
| 491 | + 'gpt-5.3-chat-latest': 'medium', | |
| 492 | +}; | |
| 493 | + | |
| 485 | 494 | export const NANOGPT_REASONING_EFFORT_MAP = { |
| 486 | 495 | min: 'none', |
| 487 | 496 | low: 'minimal', |
| @@ -11,6 +11,7 @@ import { | ||
| 11 | 11 | CHAT_COMPLETION_SOURCES, |
| 12 | 12 | GEMINI_SAFETY, |
| 13 | 13 | NANOGPT_REASONING_EFFORT_MAP, |
| 14 | + OPENAI_FIXED_REASONING_EFFORT, | |
| 14 | 15 | OPENAI_REASONING_EFFORT_MAP, |
| 15 | 16 | OPENAI_REASONING_EFFORT_MODELS, |
| 16 | 17 | OPENAI_VERBOSITY_MODELS, |
| @@ -1597,7 +1598,7 @@ async function sendAzureOpenAIRequest(request, response) { | ||
| 1597 | 1598 | |
| 1598 | 1599 | // Do not send reasoning effort to models which do not support it |
| 1599 | 1600 | apiRequestBody['reasoning_effort'] = OPENAI_REASONING_EFFORT_MODELS.includes(request.body.model) |
| 1600 | 1601 | ? OPENAI_FIXED_REASONING_EFFORT[request.body.model] ?? OPENAI_REASONING_EFFORT_MAP[request.body.reasoning_effort] ?? request.body.reasoning_effort |
| 1601 | 1602 | : undefined; |
| 1602 | 1603 | |
| 1603 | 1604 | const controller = new AbortController(); |
| @@ -2326,7 +2327,7 @@ router.post('/generate', async function (request, response) { | ||
| 2326 | 2327 | // A few of OpenAIs reasoning models support reasoning effort |
| 2327 | 2328 | if (request.body.reasoning_effort && [CHAT_COMPLETION_SOURCES.CUSTOM, CHAT_COMPLETION_SOURCES.OPENAI].includes(request.body.chat_completion_source)) { |
| 2328 | 2329 | if (OPENAI_REASONING_EFFORT_MODELS.includes(request.body.model)) { |
| 2329 | 2330 | bodyParams['reasoning_effort'] = OPENAI_FIXED_REASONING_EFFORT[request.body.model] ?? OPENAI_REASONING_EFFORT_MAP[request.body.reasoning_effort] ?? request.body.reasoning_effort; |
| 2330 | 2331 | } |
| 2331 | 2332 | } |
| 2332 | 2333 | |