diff --git a/README.en.md b/README.en.md index e7f254f7..eec0047b 100644 --- a/README.en.md +++ b/README.en.md @@ -134,12 +134,12 @@ The initial account username is `root` and password is `123456`. git clone https://github.com/songquanpeng/one-api.git # Build the frontend - cd one-api/web + cd one-api/web/default npm install npm run build # Build the backend - cd .. + cd ../.. go mod download go build -ldflags "-s -w" -o one-api ``` diff --git a/README.ja.md b/README.ja.md index edfd2a28..e9149d71 100644 --- a/README.ja.md +++ b/README.ja.md @@ -135,12 +135,12 @@ sudo service nginx restart git clone https://github.com/songquanpeng/one-api.git # フロントエンドのビルド - cd one-api/web + cd one-api/web/default npm install npm run build # バックエンドのビルド - cd .. + cd ../.. go mod download go build -ldflags "-s -w" -o one-api ``` diff --git a/README.md b/README.md index 02a62387..ff5e07d4 100644 --- a/README.md +++ b/README.md @@ -174,12 +174,12 @@ docker-compose ps git clone https://github.com/songquanpeng/one-api.git # 构建前端 - cd one-api/web + cd one-api/web/default npm install npm run build # 构建后端 - cd .. + cd ../.. go mod download go build -ldflags "-s -w" -o one-api ```` diff --git a/common/model-ratio.go b/common/model-ratio.go index 9f31e0d7..6b2bc6a9 100644 --- a/common/model-ratio.go +++ b/common/model-ratio.go @@ -45,6 +45,8 @@ 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-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-0301": 0.75, @@ -53,6 +55,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 +75,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 +137,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..19425466 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,24 @@ 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-turbo-preview", + Object: "model", + Created: 1706232090, + OwnedBy: "openai", + Permission: permission, + Root: "gpt-4-turbo-preview", + Parent: nil, + }, { Id: "gpt-4-vision-preview", Object: "model", @@ -261,6 +288,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",