diff --git a/README.md b/README.md index 2f81c10d..01236a43 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用 + [x] [阶跃星辰](https://platform.stepfun.com/) + [x] [Coze](https://www.coze.com/) + [x] [Cohere](https://cohere.com/) + + [x] [DeepSeek](https://www.deepseek.com/) 2. 支持配置镜像以及众多[第三方代理服务](https://iamazing.cn/page/openai-api-third-party-services)。 3. 支持通过**负载均衡**的方式访问多个渠道。 4. 支持 **stream 模式**,可以通过流式传输实现打字机效果。 diff --git a/relay/adaptor/deepseek/constants.go b/relay/adaptor/deepseek/constants.go new file mode 100644 index 00000000..ad840bc2 --- /dev/null +++ b/relay/adaptor/deepseek/constants.go @@ -0,0 +1,6 @@ +package deepseek + +var ModelList = []string{ + "deepseek-chat", + "deepseek-coder", +} diff --git a/relay/adaptor/openai/compatible.go b/relay/adaptor/openai/compatible.go index 200eac44..ae8449db 100644 --- a/relay/adaptor/openai/compatible.go +++ b/relay/adaptor/openai/compatible.go @@ -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 } diff --git a/relay/billing/ratio/model.go b/relay/billing/ratio/model.go index 923d9c4f..c6fdf4b4 100644 --- a/relay/billing/ratio/model.go +++ b/relay/billing/ratio/model.go @@ -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 diff --git a/relay/channeltype/define.go b/relay/channeltype/define.go index 4b37e566..7f29afb3 100644 --- a/relay/channeltype/define.go +++ b/relay/channeltype/define.go @@ -37,6 +37,7 @@ const ( AwsClaude Coze Cohere + DeepSeek Dummy ) diff --git a/relay/channeltype/url.go b/relay/channeltype/url.go index 64fdcd0a..ea4dfb95 100644 --- a/relay/channeltype/url.go +++ b/relay/channeltype/url.go @@ -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() { diff --git a/web/berry/src/constants/ChannelConstants.js b/web/berry/src/constants/ChannelConstants.js index 7a96aa42..0ad94f04 100644 --- a/web/berry/src/constants/ChannelConstants.js +++ b/web/berry/src/constants/ChannelConstants.js @@ -131,6 +131,12 @@ export const CHANNEL_OPTIONS = { value: 35, color: 'primary' }, + 36: { + key: 36, + text: 'DeepSeek', + value: 36, + color: 'primary' + }, 8: { key: 8, text: '自定义渠道', diff --git a/web/default/src/constants/channel.constants.js b/web/default/src/constants/channel.constants.js index c21e19ed..ff124501 100644 --- a/web/default/src/constants/channel.constants.js +++ b/web/default/src/constants/channel.constants.js @@ -21,6 +21,7 @@ export const CHANNEL_OPTIONS = [ { key: 32, text: '阶跃星辰', value: 32, color: 'blue' }, { key: 34, text: 'Coze', value: 34, 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: 22, text: '知识库:FastGPT', value: 22, color: 'blue' }, { key: 21, text: '知识库:AI Proxy', value: 21, color: 'purple' },