mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-15 07:14:51 +00:00
feat: support deepseek now
This commit is contained in:
6
relay/adaptor/deepseek/constants.go
Normal file
6
relay/adaptor/deepseek/constants.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package deepseek
|
||||
|
||||
var ModelList = []string{
|
||||
"deepseek-chat",
|
||||
"deepseek-coder",
|
||||
}
|
@@ -3,6 +3,7 @@ package openai
|
||||
import (
|
||||
"github.com/songquanpeng/one-api/relay/adaptor/ai360"
|
||||
"github.com/songquanpeng/one-api/relay/adaptor/baichuan"
|
||||
"github.com/songquanpeng/one-api/relay/adaptor/deepseek"
|
||||
"github.com/songquanpeng/one-api/relay/adaptor/groq"
|
||||
"github.com/songquanpeng/one-api/relay/adaptor/lingyiwanwu"
|
||||
"github.com/songquanpeng/one-api/relay/adaptor/minimax"
|
||||
@@ -22,6 +23,7 @@ var CompatibleChannels = []int{
|
||||
channeltype.Groq,
|
||||
channeltype.LingYiWanWu,
|
||||
channeltype.StepFun,
|
||||
channeltype.DeepSeek,
|
||||
}
|
||||
|
||||
func GetCompatibleChannelMeta(channelType int) (string, []string) {
|
||||
@@ -44,6 +46,8 @@ func GetCompatibleChannelMeta(channelType int) (string, []string) {
|
||||
return "lingyiwanwu", lingyiwanwu.ModelList
|
||||
case channeltype.StepFun:
|
||||
return "stepfun", stepfun.ModelList
|
||||
case channeltype.DeepSeek:
|
||||
return "deepseek", deepseek.ModelList
|
||||
default:
|
||||
return "openai", ModelList
|
||||
}
|
||||
|
@@ -170,6 +170,9 @@ var ModelRatio = map[string]float64{
|
||||
"command-light-nightly": 0.5,
|
||||
"command-r": 0.5 / 1000 * USD,
|
||||
"command-r-plus ": 3.0 / 1000 * USD,
|
||||
// https://platform.deepseek.com/api-docs/pricing/
|
||||
"deepseek-chat": 1.0 / 1000 * RMB,
|
||||
"deepseek-coder": 1.0 / 1000 * RMB,
|
||||
}
|
||||
|
||||
var CompletionRatio = map[string]float64{}
|
||||
@@ -285,6 +288,9 @@ func GetCompletionRatio(name string) float64 {
|
||||
if strings.HasPrefix(name, "gemini-") {
|
||||
return 3
|
||||
}
|
||||
if strings.HasPrefix(name, "deepseek-") {
|
||||
return 2
|
||||
}
|
||||
switch name {
|
||||
case "llama2-70b-4096":
|
||||
return 0.8 / 0.64
|
||||
|
@@ -37,6 +37,7 @@ const (
|
||||
AwsClaude
|
||||
Coze
|
||||
Cohere
|
||||
DeepSeek
|
||||
|
||||
Dummy
|
||||
)
|
||||
|
@@ -36,7 +36,8 @@ var ChannelBaseURLs = []string{
|
||||
"https://api.stepfun.com", // 32
|
||||
"", // 33
|
||||
"https://api.coze.com", // 34
|
||||
"https://api.cohere.ai", //35
|
||||
"https://api.cohere.ai", // 35
|
||||
"https://api.deepseek.com", // 36
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
Reference in New Issue
Block a user