mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-07 01:03:41 +08:00
Merge commit 'c3178720975ee0b2767bc3b0ad98cfc533f22b6d'
This commit is contained in:
@@ -8,3 +8,4 @@ docker image: `ppcelery/one-api:latest`
|
|||||||
- support gpt-vision
|
- support gpt-vision
|
||||||
- support update user's remained quota
|
- support update user's remained quota
|
||||||
- support aws claude
|
- support aws claude
|
||||||
|
- support openai images edits
|
||||||
|
|||||||
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 (
|
import (
|
||||||
"github.com/Laisky/one-api/relay/adaptor/ai360"
|
"github.com/Laisky/one-api/relay/adaptor/ai360"
|
||||||
"github.com/Laisky/one-api/relay/adaptor/baichuan"
|
"github.com/Laisky/one-api/relay/adaptor/baichuan"
|
||||||
|
"github.com/Laisky/one-api/relay/adaptor/deepseek"
|
||||||
"github.com/Laisky/one-api/relay/adaptor/groq"
|
"github.com/Laisky/one-api/relay/adaptor/groq"
|
||||||
"github.com/Laisky/one-api/relay/adaptor/lingyiwanwu"
|
"github.com/Laisky/one-api/relay/adaptor/lingyiwanwu"
|
||||||
"github.com/Laisky/one-api/relay/adaptor/minimax"
|
"github.com/Laisky/one-api/relay/adaptor/minimax"
|
||||||
@@ -22,6 +23,7 @@ var CompatibleChannels = []int{
|
|||||||
channeltype.Groq,
|
channeltype.Groq,
|
||||||
channeltype.LingYiWanWu,
|
channeltype.LingYiWanWu,
|
||||||
channeltype.StepFun,
|
channeltype.StepFun,
|
||||||
|
channeltype.DeepSeek,
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetCompatibleChannelMeta(channelType int) (string, []string) {
|
func GetCompatibleChannelMeta(channelType int) (string, []string) {
|
||||||
@@ -44,6 +46,8 @@ func GetCompatibleChannelMeta(channelType int) (string, []string) {
|
|||||||
return "lingyiwanwu", lingyiwanwu.ModelList
|
return "lingyiwanwu", lingyiwanwu.ModelList
|
||||||
case channeltype.StepFun:
|
case channeltype.StepFun:
|
||||||
return "stepfun", stepfun.ModelList
|
return "stepfun", stepfun.ModelList
|
||||||
|
case channeltype.DeepSeek:
|
||||||
|
return "deepseek", deepseek.ModelList
|
||||||
default:
|
default:
|
||||||
return "openai", ModelList
|
return "openai", ModelList
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,6 +170,9 @@ var ModelRatio = map[string]float64{
|
|||||||
"command-light-nightly": 0.5,
|
"command-light-nightly": 0.5,
|
||||||
"command-r": 0.5 / 1000 * USD,
|
"command-r": 0.5 / 1000 * USD,
|
||||||
"command-r-plus ": 3.0 / 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{}
|
var CompletionRatio = map[string]float64{}
|
||||||
@@ -288,6 +291,9 @@ func GetCompletionRatio(name string) float64 {
|
|||||||
if strings.HasPrefix(name, "gemini-") {
|
if strings.HasPrefix(name, "gemini-") {
|
||||||
return 3
|
return 3
|
||||||
}
|
}
|
||||||
|
if strings.HasPrefix(name, "deepseek-") {
|
||||||
|
return 2
|
||||||
|
}
|
||||||
switch name {
|
switch name {
|
||||||
case "llama2-70b-4096":
|
case "llama2-70b-4096":
|
||||||
return 0.8 / 0.64
|
return 0.8 / 0.64
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ const (
|
|||||||
AwsClaude
|
AwsClaude
|
||||||
Coze
|
Coze
|
||||||
Cohere
|
Cohere
|
||||||
|
DeepSeek
|
||||||
|
|
||||||
Dummy
|
Dummy
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ var ChannelBaseURLs = []string{
|
|||||||
"https://api.stepfun.com", // 32
|
"https://api.stepfun.com", // 32
|
||||||
"", // 33
|
"", // 33
|
||||||
"https://api.coze.com", // 34
|
"https://api.coze.com", // 34
|
||||||
"https://api.cohere.ai", //35
|
"https://api.cohere.ai", // 35
|
||||||
|
"https://api.deepseek.com", // 36
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|||||||
@@ -131,6 +131,12 @@ export const CHANNEL_OPTIONS = {
|
|||||||
value: 35,
|
value: 35,
|
||||||
color: 'primary'
|
color: 'primary'
|
||||||
},
|
},
|
||||||
|
36: {
|
||||||
|
key: 36,
|
||||||
|
text: 'DeepSeek',
|
||||||
|
value: 36,
|
||||||
|
color: 'primary'
|
||||||
|
},
|
||||||
8: {
|
8: {
|
||||||
key: 8,
|
key: 8,
|
||||||
text: '自定义渠道',
|
text: '自定义渠道',
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export const CHANNEL_OPTIONS = [
|
|||||||
{ key: 32, text: '阶跃星辰', value: 32, color: 'blue' },
|
{ key: 32, text: '阶跃星辰', value: 32, color: 'blue' },
|
||||||
{ key: 34, text: 'Coze', value: 34, color: 'blue' },
|
{ key: 34, text: 'Coze', value: 34, color: 'blue' },
|
||||||
{ key: 35, text: 'Cohere', value: 35, color: 'blue' },
|
{ key: 35, text: 'Cohere', value: 35, color: 'blue' },
|
||||||
|
{ key: 36, text: 'DeepSeek', value: 36, color: 'black' },
|
||||||
{ key: 8, text: '自定义渠道', value: 8, color: 'pink' },
|
{ key: 8, text: '自定义渠道', value: 8, color: 'pink' },
|
||||||
{ key: 22, text: '知识库:FastGPT', value: 22, color: 'blue' },
|
{ key: 22, text: '知识库:FastGPT', value: 22, color: 'blue' },
|
||||||
{ key: 21, text: '知识库:AI Proxy', value: 21, color: 'purple' },
|
{ key: 21, text: '知识库:AI Proxy', value: 21, color: 'purple' },
|
||||||
|
|||||||
Reference in New Issue
Block a user