From 2a4d4f659b4c5d9bf3c2c53f814445d798690570 Mon Sep 17 00:00:00 2001 From: Glebov Pavel Date: Thu, 23 Oct 2025 14:39:20 +0200 Subject: [PATCH] Add gpt-5 and gpt-5-mini models --- packages/core/src/encoders.ts | 1 + packages/core/src/llms.json | 32 ++++++++++++++++++++ packages/core/src/types/prompt_template.d.ts | 4 +++ 3 files changed, 37 insertions(+) diff --git a/packages/core/src/encoders.ts b/packages/core/src/encoders.ts index 682e8ad2fa..e8f1c3fd76 100644 --- a/packages/core/src/encoders.ts +++ b/packages/core/src/encoders.ts @@ -31,6 +31,7 @@ export async function resolveTokenEncoder( } let { model } = parseModelIdentifier(modelId) if (/^gpt-4.1/i.test(model)) model = "gpt-4o" // same encoding + if (/^gpt-5/i.test(model)) model = "gpt-4o" // same encoding for GPT-5 const module = model.toLowerCase() // Assign model to module for dynamic import path const { modelEncodings } = runtimeHost?.config || {} diff --git a/packages/core/src/llms.json b/packages/core/src/llms.json index 5498deed69..4e330913de 100644 --- a/packages/core/src/llms.json +++ b/packages/core/src/llms.json @@ -27,6 +27,12 @@ "intent": "gpt-4.1-mini" }, "models": { + "gpt-5": { + "tools": true + }, + "gpt-5-mini": { + "tools": true + }, "o1-preview": { "tools": false }, @@ -235,6 +241,12 @@ "reasoning_small": "openai/o3-mini" }, "models": { + "openai/gpt-5": { + "tools": true + }, + "openai/gpt-5-mini": { + "tools": true + }, "o1-preview": { "tools": false }, @@ -732,6 +744,16 @@ "price_per_million_output_tokens": 0.4, "input_cache_token_rebate": 0.25 }, + "github:gpt-5": { + "price_per_million_input_tokens": 10, + "price_per_million_output_tokens": 30, + "input_cache_token_rebate": 0.5 + }, + "github:gpt-5-mini": { + "price_per_million_input_tokens": 1, + "price_per_million_output_tokens": 4, + "input_cache_token_rebate": 0.5 + }, "github:gpt-4o": { "price_per_million_input_tokens": 2.5, "price_per_million_output_tokens": 10 @@ -803,6 +825,16 @@ "price_per_million_output_tokens": 0.4, "input_cache_token_rebate": 0.25 }, + "openai:gpt-5": { + "price_per_million_input_tokens": 10, + "price_per_million_output_tokens": 30, + "input_cache_token_rebate": 0.5 + }, + "openai:gpt-5-mini": { + "price_per_million_input_tokens": 1, + "price_per_million_output_tokens": 4, + "input_cache_token_rebate": 0.5 + }, "openai:gpt-4o": { "price_per_million_input_tokens": 2.5, "price_per_million_output_tokens": 10 diff --git a/packages/core/src/types/prompt_template.d.ts b/packages/core/src/types/prompt_template.d.ts index c00a4d709d..4eeacdc41a 100644 --- a/packages/core/src/types/prompt_template.d.ts +++ b/packages/core/src/types/prompt_template.d.ts @@ -161,6 +161,8 @@ type ModelType = OptionsOrString< | "openai:gpt-4.1" | "openai:gpt-4.1-mini" | "openai:gpt-4.1-nano" + | "openai:gpt-5" + | "openai:gpt-5-mini" | "openai:gpt-4o" | "openai:gpt-4o-mini" | "openai:gpt-3.5-turbo" @@ -172,6 +174,8 @@ type ModelType = OptionsOrString< | "openai:o1-mini" | "openai:o1-preview" | "github:openai/gpt-4.1" + | "github:openai/gpt-5" + | "github:openai/gpt-5-mini" | "github:openai/gpt-4o" | "github:openai/gpt-4o-mini" | "github:openai/o1"