diff --git a/public/index.html b/public/index.html index b08dd971a..7b028e409 100644 --- a/public/index.html +++ b/public/index.html @@ -3066,6 +3066,9 @@

OpenAI Model

+ diff --git a/public/scripts/extensions/caption/settings.html b/public/scripts/extensions/caption/settings.html index be1c102ba..eabe9eab5 100644 --- a/public/scripts/extensions/caption/settings.html +++ b/public/scripts/extensions/caption/settings.html @@ -54,6 +54,7 @@ + @@ -96,6 +97,7 @@ + diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 7ce3d8708..bab82eec5 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -2631,6 +2631,10 @@ function getReasoningEffort(settings = null, model = null) { return reasoning_effort_types.low; case reasoning_effort_types.max: + if ([chat_completion_sources.OPENAI, chat_completion_sources.AZURE_OPENAI].includes(settings.chat_completion_source) + && /^gpt-6-astra/.test(model)) { + return reasoning_effort_types.max; + } if ([chat_completion_sources.OPENAI, chat_completion_sources.AZURE_OPENAI].includes(settings.chat_completion_source) && /^gpt-5\.6/.test(model)) { // GPT-5.6 reserves "max" effort for the Responses API. @@ -3090,6 +3094,15 @@ export async function createGenerationParameters(settings, model, type, messages } } + if (gptSources.includes(settings.chat_completion_source) && /gpt-6-astra/.test(model)) { + generate_data.max_completion_tokens = generate_data.max_tokens; + delete generate_data.max_tokens; + delete generate_data.temperature; + delete generate_data.top_p; + delete generate_data.logprobs; + delete generate_data.top_logprobs; + } + // Claude Fable / Claude 5 models removed sampling parameters and reject them with HTTP 400, // including via OpenAI-compatible proxies. Unanchored to also match prefixed ids // like 'anthropic/claude-fable-5' or 'anthropic/claude-opus-5'. @@ -5079,6 +5092,7 @@ function getMaxContextOpenAI(value) { /** @type {[RegExp, number][]} */ const contextMap = [ + [/^gpt-6-astra/, max_1050k], [/^gpt-5\.6/, max_1050k], [/^gpt-5\.[45]/, max_1mil], [/^gpt-5/, max_400k], @@ -6227,6 +6241,7 @@ export function isImageInliningSupported() { 'gpt-4.1', 'gpt-4.5-preview', 'gpt-4o', + 'gpt-6-astra', 'gpt-5', 'o1', 'o3', diff --git a/public/scripts/tokenizers.js b/public/scripts/tokenizers.js index 0efe4c59c..5e445ec07 100644 --- a/public/scripts/tokenizers.js +++ b/public/scripts/tokenizers.js @@ -639,7 +639,7 @@ export function getTokenizerModel() { } if (oai_settings.chat_completion_source == chat_completion_sources.ELECTRONHUB && oai_settings.electronhub_model) { - if (oai_settings.electronhub_model.includes('gpt-4o') || oai_settings.electronhub_model.includes('gpt-5')) { + if (oai_settings.electronhub_model.includes('gpt-4o') || oai_settings.electronhub_model.includes('gpt-5') || oai_settings.electronhub_model.includes('gpt-6-astra')) { return gpt4oTokenizer; } else if (oai_settings.electronhub_model.includes('gpt-4.1') || oai_settings.electronhub_model.includes('gpt-4.5')) { return gpt4oTokenizer; diff --git a/public/scripts/tool-calling.js b/public/scripts/tool-calling.js index 6db438087..41a3b78ce 100644 --- a/public/scripts/tool-calling.js +++ b/public/scripts/tool-calling.js @@ -619,6 +619,12 @@ export class ToolManager { return false; } + // GPT-6 Astra supports tool calling only through the Responses API. + if ([chat_completion_sources.OPENAI, chat_completion_sources.AZURE_OPENAI].includes(settings.chat_completion_source) + && /^gpt-6-astra/.test(model)) { + return false; + } + // Post-processing will forcefully remove past tool calls from the prompt, making them useless const { NONE, MERGE_TOOLS, SEMI_TOOLS, STRICT_TOOLS } = custom_prompt_post_processing_types; const allowedPromptPostProcessing = [NONE, MERGE_TOOLS, SEMI_TOOLS, STRICT_TOOLS]; diff --git a/src/constants.js b/src/constants.js index 6447375db..06f42fb5a 100644 --- a/src/constants.js +++ b/src/constants.js @@ -456,7 +456,7 @@ export const AZURE_OPENAI_KEYS = [ 'reasoning_effort', ]; -export const OPENAI_VERBOSITY_MODELS = /^gpt-5/; +export const OPENAI_VERBOSITY_MODELS = /^(?:gpt-5|gpt-6-astra)/; export const OPENAI_REASONING_EFFORT_MODELS = [ 'o1', @@ -491,6 +491,7 @@ export const OPENAI_REASONING_EFFORT_MODELS = [ 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna', + 'gpt-6-astra', ]; export const OPENAI_REASONING_EFFORT_MAP = { diff --git a/src/endpoints/backends/chat-completions.js b/src/endpoints/backends/chat-completions.js index 19e1362d9..0d98c77f7 100644 --- a/src/endpoints/backends/chat-completions.js +++ b/src/endpoints/backends/chat-completions.js @@ -250,6 +250,7 @@ async function sendClaudeRequest(request, response) { const convertedPrompt = convertClaudeMessages(request.body.messages, request.body.assistant_prefill, useSystemPrompt, useTools, getPromptNames(request)); // Unanchored to also match prefixed ids passed through proxies, e.g. 'anthropic/claude-fable-5' const isFableModel = /claude-fable/.test(request.body.model); + const isFable51Model = /claude-fable-5-1/.test(request.body.model); const isClaude5Model = /claude-(opus-5|sonnet-5)/.test(request.body.model); const useThinking = /^claude-(3-7|opus-4|sonnet-4|haiku-4-5|opus-4-5|opus-4-6|sonnet-4-6|opus-4-7)/.test(request.body.model) || isFableModel || isClaude5Model; const useWebSearch = (/^claude-(3-5|3-7|opus-4|sonnet-4|haiku-4-5|opus-4-5|opus-4-6|sonnet-4-6|opus-4-7)/.test(request.body.model) || isFableModel || isClaude5Model) && Boolean(request.body.enable_web_search); @@ -298,15 +299,24 @@ async function sendClaudeRequest(request, response) { } } - // Structured output is a forced tool + // Fable 5.1 rejects forced tools, but supports native JSON outputs. if (request.body.json_schema) { - const jsonTool = { - name: request.body.json_schema.name, - description: request.body.json_schema.description || 'Well-formed JSON object', - input_schema: request.body.json_schema.value, - }; - requestBody.tools = [...(requestBody.tools || []), jsonTool]; - requestBody.tool_choice = { type: 'tool', name: request.body.json_schema.name }; + if (isFable51Model) { + requestBody.output_config = { + format: { + type: 'json_schema', + schema: request.body.json_schema.value, + }, + }; + } else { + const jsonTool = { + name: request.body.json_schema.name, + description: request.body.json_schema.description || 'Well-formed JSON object', + input_schema: request.body.json_schema.value, + }; + requestBody.tools = [...(requestBody.tools || []), jsonTool]; + requestBody.tool_choice = { type: 'tool', name: request.body.json_schema.name }; + } } if (useWebSearch) { diff --git a/src/endpoints/tokenizers.js b/src/endpoints/tokenizers.js index 02bb97c47..00a5f03bf 100644 --- a/src/endpoints/tokenizers.js +++ b/src/endpoints/tokenizers.js @@ -442,7 +442,7 @@ export function getTokenizerModel(requestModel) { return 'o1'; } - if (requestModel.includes('gpt-5') || requestModel.includes('o3') || requestModel.includes('o4-mini')) { + if (requestModel.includes('gpt-5') || requestModel.includes('gpt-6-astra') || requestModel.includes('o3') || requestModel.includes('o4-mini')) { return 'o1'; }