mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-10 02:23:43 +08:00
Merge commit '1c2654320e5b6268b13b6efca40ce37a523d032b'
This commit is contained in:
@@ -2,7 +2,7 @@ package ratio
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/Laisky/one-api/common/logger"
|
||||
"github.com/songquanpeng/one-api/common/logger"
|
||||
)
|
||||
|
||||
var GroupRatio = map[string]float64{
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"strings"
|
||||
|
||||
"github.com/Laisky/one-api/common/logger"
|
||||
"github.com/songquanpeng/one-api/common/logger"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -173,6 +173,10 @@ var ModelRatio = map[string]float64{
|
||||
// https://platform.deepseek.com/api-docs/pricing/
|
||||
"deepseek-chat": 1.0 / 1000 * RMB,
|
||||
"deepseek-coder": 1.0 / 1000 * RMB,
|
||||
// https://www.deepl.com/pro?cta=header-prices
|
||||
"deepl-zh": 25.0 / 1000 * USD,
|
||||
"deepl-en": 25.0 / 1000 * USD,
|
||||
"deepl-ja": 25.0 / 1000 * USD,
|
||||
}
|
||||
|
||||
var CompletionRatio = map[string]float64{}
|
||||
@@ -228,6 +232,9 @@ func GetModelRatio(name string) float64 {
|
||||
if strings.HasPrefix(name, "qwen-") && strings.HasSuffix(name, "-internet") {
|
||||
name = strings.TrimSuffix(name, "-internet")
|
||||
}
|
||||
if strings.HasPrefix(name, "command-") && strings.HasSuffix(name, "-internet") {
|
||||
name = strings.TrimSuffix(name, "-internet")
|
||||
}
|
||||
ratio, ok := ModelRatio[name]
|
||||
if !ok {
|
||||
ratio, ok = DefaultModelRatio[name]
|
||||
|
||||
Reference in New Issue
Block a user