Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added openai gpt4o mini model #1814

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/api/chat/openai/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
})

Expand Down
6 changes: 6 additions & 0 deletions lib/chat-setting-limits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ export const CHAT_SETTING_LIMITS: Record<LLMID, ChatSettingLimits> = {
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": {
Expand Down
17 changes: 17 additions & 0 deletions lib/models/llm/openai-llm-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -82,6 +98,7 @@ const GPT3_5Turbo: LLM = {
}

export const OPENAI_LLM_LIST: LLM[] = [
GPT4oMini,
GPT4o,
GPT4Turbo,
GPT4Vision,
Expand Down
1 change: 1 addition & 0 deletions types/llms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down