From 3371e126cd2a1d1020991d8eba44883d4be0de99 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 19 Jul 2024 09:01:18 -0700 Subject: [PATCH] gpt-4o-mini --- core/config/types.ts | 1 + core/index.d.ts | 1 + core/llm/autodetect.ts | 1 + core/llm/constants.ts | 1 + extensions/vscode/config_schema.json | 3 +++ gui/src/pages/AddNewModel/configs/models.ts | 15 +++++++++++++++ packages/llm-info/src/models/openai.ts | 15 ++++++++++----- 7 files changed, 32 insertions(+), 5 deletions(-) diff --git a/core/config/types.ts b/core/config/types.ts index 00af67836..d950c15f7 100644 --- a/core/config/types.ts +++ b/core/config/types.ts @@ -523,6 +523,7 @@ declare global { | "gpt-4-32k" | "gpt-4-turbo" | "gpt-4o" + | "gpt-4o-mini" | "gpt-4-turbo-preview" | "gpt-4-vision-preview" // Mistral diff --git a/core/index.d.ts b/core/index.d.ts index 32c703737..89b4f0656 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -598,6 +598,7 @@ export type ModelName = | "gpt-3.5-turbo-0613" | "gpt-4-32k" | "gpt-4o" + | "gpt-4o-mini" | "gpt-4-turbo" | "gpt-4-turbo-preview" | "gpt-4-vision-preview" diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts index 6f09839c2..32ef68a3a 100644 --- a/core/llm/autodetect.ts +++ b/core/llm/autodetect.ts @@ -61,6 +61,7 @@ const MODEL_SUPPORTS_IMAGES: string[] = [ "llava", "gpt-4-turbo", "gpt-4o", + "gpt-4o-mini", "gpt-4-vision", "claude-3", "gemini-ultra", diff --git a/core/llm/constants.ts b/core/llm/constants.ts index 0d63c6f6a..a31dbbe3d 100644 --- a/core/llm/constants.ts +++ b/core/llm/constants.ts @@ -20,6 +20,7 @@ const CONTEXT_LENGTH_FOR_MODEL: { [name: string]: number } = { "gpt-4-32k": GPT_4_CTX_LEN, "gpt-4-turbo-preview": GPT_4_CTX_LEN, "gpt-4o": GPT_4_CTX_LEN, + "gpt-4o-mini": GPT_4_CTX_LEN, "gpt-4-vision": GPT_4_CTX_LEN, "gpt-4-0125-preview": GPT_4_CTX_LEN, "gpt-4-1106-preview": GPT_4_CTX_LEN, diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index a93e891ae..92d70609b 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -481,6 +481,7 @@ "gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4o", + "gpt-4o-mini", "gpt-4", "gpt-3.5-turbo-0613", "gpt-4-32k", @@ -581,6 +582,7 @@ "gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4o", + "gpt-4o-mini", "gpt-4", "gpt-3.5-turbo-0613", "gpt-4-32k", @@ -1095,6 +1097,7 @@ "gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-4o", + "gpt-4o-mini", "gpt-4", "gpt-3.5-turbo-0613", "gpt-4-32k", diff --git a/gui/src/pages/AddNewModel/configs/models.ts b/gui/src/pages/AddNewModel/configs/models.ts index c0105f241..62fa6bb9e 100644 --- a/gui/src/pages/AddNewModel/configs/models.ts +++ b/gui/src/pages/AddNewModel/configs/models.ts @@ -484,6 +484,21 @@ export const models: { [key: string]: ModelPackage } = { icon: "openai.png", isOpenSource: false, }, + gpt4omini: { + title: "GPT-4o Mini", + description: + "A model at less than half the price of gpt-3.5-turbo, but near gpt-4 in capabilities.", + params: { + model: "gpt-4o-mini", + contextLength: 128_000, + title: "GPT-4o mini", + systemMessage: + "You are an expert software developer. You give helpful and concise responses.", + }, + providerOptions: ["openai"], + icon: "openai.png", + isOpenSource: false, + }, gpt35turbo: { title: "GPT-3.5-Turbo", description: diff --git a/packages/llm-info/src/models/openai.ts b/packages/llm-info/src/models/openai.ts index 2c7b70e1e..c7b0cd778 100644 --- a/packages/llm-info/src/models/openai.ts +++ b/packages/llm-info/src/models/openai.ts @@ -44,26 +44,31 @@ export const OpenAiLlms: LlmInfo[] = [ { model: "gpt-4-turbo-preview", displayName: "GPT-4 Turbo Preview", - contextLength: 4096, + contextLength: 128_000, }, { model: "gpt-4o", displayName: "GPT-4o", - contextLength: 4096, + contextLength: 128_000, + }, + { + model: "gpt-4o-mini", + displayName: "GPT-4o Mini", + contextLength: 128_000, }, { model: "gpt-4-vision", displayName: "GPT-4 Vision", - contextLength: 4096, + contextLength: 128_000, }, { model: "gpt-4-0125-preview", displayName: "GPT-4 (0125 Preview)", - contextLength: 4096, + contextLength: 128_000, }, { model: "gpt-4-1106-preview", displayName: "GPT-4 (1106 Preview)", - contextLength: 4096, + contextLength: 128_000, }, ];