From 4998d583191ea751d74c491bb62ca234a3fdc9f0 Mon Sep 17 00:00:00 2001 From: Benny Date: Sat, 16 Mar 2024 13:26:11 +0800 Subject: [PATCH] fix: fix ratio of gpt-3.5-turbo (close #1011) (#1163) --- common/model-ratio.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/common/model-ratio.go b/common/model-ratio.go index 4a1a0013..7513a8f3 100644 --- a/common/model-ratio.go +++ b/common/model-ratio.go @@ -31,7 +31,7 @@ var ModelRatio = map[string]float64{ "gpt-4-0125-preview": 5, // $0.01 / 1K tokens "gpt-4-turbo-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": 0.25, // $0.0005 / 1K tokens "gpt-3.5-turbo-0301": 0.75, "gpt-3.5-turbo-0613": 0.75, "gpt-3.5-turbo-16k": 1.5, // $0.003 / 1K tokens @@ -224,7 +224,7 @@ func GetCompletionRatio(name string) float64 { return ratio } if strings.HasPrefix(name, "gpt-3.5") { - if strings.HasSuffix(name, "0125") { + if name == "gpt-3.5-turbo" || 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 @@ -232,15 +232,6 @@ func GetCompletionRatio(name string) float64 { if strings.HasSuffix(name, "1106") { return 2 } - if name == "gpt-3.5-turbo" || name == "gpt-3.5-turbo-16k" { - // TODO: clear this after 2023-12-11 - now := time.Now() - // https://platform.openai.com/docs/models/continuous-model-upgrades - // if after 2023-12-11, use 2 - if now.After(time.Date(2023, 12, 11, 0, 0, 0, 0, time.UTC)) { - return 2 - } - } return 4.0 / 3.0 } if strings.HasPrefix(name, "gpt-4") {