From 45be9b906433449445eebde52cceb3205748b188 Mon Sep 17 00:00:00 2001 From: Benny Date: Fri, 26 Jan 2024 01:44:40 +0000 Subject: [PATCH] add new 0125 chat models and embedding-3 models --- common/model-ratio.go | 9 +++++++++ controller/model.go | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/common/model-ratio.go b/common/model-ratio.go index 9f31e0d7..c0bccd46 100644 --- a/common/model-ratio.go +++ b/common/model-ratio.go @@ -45,6 +45,7 @@ var ModelRatio = map[string]float64{ "gpt-4-32k-0314": 30, "gpt-4-32k-0613": 30, "gpt-4-1106-preview": 5, // $0.01 / 1K tokens + "gpt-4-0125-preview": 5, // $0.01 / 1K tokens "gpt-4-vision-preview": 5, // $0.01 / 1K tokens "gpt-3.5-turbo": 0.75, // $0.0015 / 1K tokens "gpt-3.5-turbo-0301": 0.75, @@ -53,6 +54,7 @@ var ModelRatio = map[string]float64{ "gpt-3.5-turbo-16k-0613": 1.5, "gpt-3.5-turbo-instruct": 0.75, // $0.0015 / 1K tokens "gpt-3.5-turbo-1106": 0.5, // $0.001 / 1K tokens + "gpt-3.5-turbo-0125": 0.25, // $0.0005 / 1K tokens "davinci-002": 1, // $0.002 / 1K tokens "babbage-002": 0.2, // $0.0004 / 1K tokens "text-ada-001": 0.2, @@ -72,6 +74,8 @@ var ModelRatio = map[string]float64{ "babbage": 10, "ada": 10, "text-embedding-ada-002": 0.05, + "text-embedding-3-small": 0.01, + "text-embedding-3-large": 0.065, "text-search-ada-doc-001": 10, "text-moderation-stable": 0.1, "text-moderation-latest": 0.1, @@ -132,6 +136,11 @@ func GetModelRatio(name string) float64 { func GetCompletionRatio(name string) float64 { if strings.HasPrefix(name, "gpt-3.5") { + if strings.HasSuffix(name, "0125") { + // https://openai.com/blog/new-embedding-models-and-api-updates + // Updated GPT-3.5 Turbo model and lower pricing + return 3 + } if strings.HasSuffix(name, "1106") { return 2 } diff --git a/controller/model.go b/controller/model.go index b7ec1b6a..ece0fc0d 100644 --- a/controller/model.go +++ b/controller/model.go @@ -171,6 +171,15 @@ func init() { Root: "gpt-3.5-turbo-1106", Parent: nil, }, + { + Id: "gpt-3.5-turbo-0125", + Object: "model", + Created: 1706232090, + OwnedBy: "openai", + Permission: permission, + Root: "gpt-3.5-turbo-0125", + Parent: nil, + }, { Id: "gpt-3.5-turbo-instruct", Object: "model", @@ -243,6 +252,15 @@ func init() { Root: "gpt-4-1106-preview", Parent: nil, }, + { + Id: "gpt-4-0125-preview", + Object: "model", + Created: 1706232090, + OwnedBy: "openai", + Permission: permission, + Root: "gpt-4-0125-preview", + Parent: nil, + }, { Id: "gpt-4-vision-preview", Object: "model", @@ -261,6 +279,24 @@ func init() { Root: "text-embedding-ada-002", Parent: nil, }, + { + Id: "text-embedding-3-small", + Object: "model", + Created: 1706232090, + OwnedBy: "openai", + Permission: permission, + Root: "text-embedding-3-small", + Parent: nil, + }, + { + Id: "text-embedding-3-large", + Object: "model", + Created: 1706232090, + OwnedBy: "openai", + Permission: permission, + Root: "text-embedding-3-large", + Parent: nil, + }, { Id: "text-davinci-003", Object: "model",