diff --git a/app/api/chat/openai/route.ts b/app/api/chat/openai/route.ts index a0f8ad0c93..3a77f3601a 100644 --- a/app/api/chat/openai/route.ts +++ b/app/api/chat/openai/route.ts @@ -32,7 +32,9 @@ export async function POST(request: Request) { chatSettings.model === "gpt-4-vision-preview" || chatSettings.model === "gpt-4o" ? 4096 - : null, // TODO: Fix + : chatSettings.model === "gpt-4o-mini" + ? 16383 + : null, stream: true }) diff --git a/lib/chat-setting-limits.ts b/lib/chat-setting-limits.ts index c802bd657b..698630f925 100644 --- a/lib/chat-setting-limits.ts +++ b/lib/chat-setting-limits.ts @@ -157,6 +157,12 @@ export const CHAT_SETTING_LIMITS: Record = { MAX_TOKEN_OUTPUT_LENGTH: 4096, MAX_CONTEXT_LENGTH: 128000 }, + "gpt-4o-mini": { + MIN_TEMPERATURE: 0.0, + MAX_TEMPERATURE: 2.0, + MAX_TOKEN_OUTPUT_LENGTH: 16383, + MAX_CONTEXT_LENGTH: 128000 + }, // PERPLEXITY MODELS "pplx-7b-online": { diff --git a/lib/models/llm/openai-llm-list.ts b/lib/models/llm/openai-llm-list.ts index 48823ab981..f0dc0f76d1 100644 --- a/lib/models/llm/openai-llm-list.ts +++ b/lib/models/llm/openai-llm-list.ts @@ -3,6 +3,22 @@ import { LLM } from "@/types" const OPENAI_PLATORM_LINK = "https://platform.openai.com/docs/overview" // OpenAI Models (UPDATED 1/25/24) ----------------------------- + +const GPT4oMini: LLM = { + modelId: "gpt-4o-mini", + modelName: "GPT-4o Mini", + provider: "openai", + hostedId: "gpt-4o-mini", + platformLink: OPENAI_PLATORM_LINK, + imageInput: true, + pricing: { + currency: "USD", + unit: "1M tokens", + inputCost: 0.15, + outputCost: 0.6 + } +} + const GPT4o: LLM = { modelId: "gpt-4o", modelName: "GPT-4o", @@ -82,6 +98,7 @@ const GPT3_5Turbo: LLM = { } export const OPENAI_LLM_LIST: LLM[] = [ + GPT4oMini, GPT4o, GPT4Turbo, GPT4Vision, diff --git a/types/llms.ts b/types/llms.ts index 6f89acf612..116da93db5 100644 --- a/types/llms.ts +++ b/types/llms.ts @@ -10,6 +10,7 @@ export type LLMID = // OpenAI Models (UPDATED 5/13/24) export type OpenAILLMID = + | "gpt-4o-mini" // GPT-4o Mini | "gpt-4o" // GPT-4o | "gpt-4-turbo-preview" // GPT-4 Turbo | "gpt-4-vision-preview" // GPT-4 Vision