add new 0125 chat models and embedding-3 models

This commit is contained in:
Benny 2024-01-26 01:44:40 +00:00
parent 4f214c48c6
commit 45be9b9064
2 changed files with 45 additions and 0 deletions

View File

@ -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
}

View File

@ -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",