diff --git a/README.md b/README.md index f8225121c9..5f9947b0a7 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用 + [x] [DeepL](https://www.deepl.com/) + [x] [together.ai](https://www.together.ai/) + [x] [novita.ai](https://www.novita.ai/) + + [x] [硅基流动 SiliconCloud](https://siliconflow.cn/siliconcloud) 2. 支持配置镜像以及众多[第三方代理服务](https://iamazing.cn/page/openai-api-third-party-services)。 3. 支持通过**负载均衡**的方式访问多个渠道。 4. 支持 **stream 模式**,可以通过流式传输实现打字机效果。 diff --git a/relay/adaptor/openai/compatible.go b/relay/adaptor/openai/compatible.go index 3445249c2d..0512f05ca7 100644 --- a/relay/adaptor/openai/compatible.go +++ b/relay/adaptor/openai/compatible.go @@ -13,6 +13,7 @@ import ( "github.com/songquanpeng/one-api/relay/adaptor/novita" "github.com/songquanpeng/one-api/relay/adaptor/stepfun" "github.com/songquanpeng/one-api/relay/adaptor/togetherai" + "github.com/songquanpeng/one-api/relay/adaptor/siliconflow" "github.com/songquanpeng/one-api/relay/channeltype" ) @@ -30,6 +31,7 @@ var CompatibleChannels = []int{ channeltype.DeepSeek, channeltype.TogetherAI, channeltype.Novita, + channeltype.SiliconFlow, } func GetCompatibleChannelMeta(channelType int) (string, []string) { @@ -60,6 +62,8 @@ func GetCompatibleChannelMeta(channelType int) (string, []string) { return "doubao", doubao.ModelList case channeltype.Novita: return "novita", novita.ModelList + case channeltype.SiliconFlow: + return "siliconflow", siliconflow.ModelList default: return "openai", ModelList } diff --git a/relay/adaptor/siliconflow/constants.go b/relay/adaptor/siliconflow/constants.go new file mode 100644 index 0000000000..0bf547611a --- /dev/null +++ b/relay/adaptor/siliconflow/constants.go @@ -0,0 +1,36 @@ +package siliconflow + +// https://docs.siliconflow.cn/docs/getting-started + +var ModelList = []string{ + "deepseek-ai/deepseek-llm-67b-chat", + "Qwen/Qwen1.5-14B-Chat", + "Qwen/Qwen1.5-7B-Chat", + "Qwen/Qwen1.5-110B-Chat", + "Qwen/Qwen1.5-32B-Chat", + "01-ai/Yi-1.5-6B-Chat", + "01-ai/Yi-1.5-9B-Chat-16K", + "01-ai/Yi-1.5-34B-Chat-16K", + "THUDM/chatglm3-6b", + "deepseek-ai/DeepSeek-V2-Chat", + "THUDM/glm-4-9b-chat", + "Qwen/Qwen2-72B-Instruct", + "Qwen/Qwen2-7B-Instruct", + "Qwen/Qwen2-57B-A14B-Instruct", + "deepseek-ai/DeepSeek-Coder-V2-Instruct", + "Qwen/Qwen2-1.5B-Instruct", + "internlm/internlm2_5-7b-chat", + "BAAI/bge-large-en-v1.5", + "BAAI/bge-large-zh-v1.5", + "Pro/Qwen/Qwen2-7B-Instruct", + "Pro/Qwen/Qwen2-1.5B-Instruct", + "Pro/Qwen/Qwen1.5-7B-Chat", + "Pro/THUDM/glm-4-9b-chat", + "Pro/THUDM/chatglm3-6b", + "Pro/01-ai/Yi-1.5-9B-Chat-16K", + "Pro/01-ai/Yi-1.5-6B-Chat", + "Pro/google/gemma-2-9b-it", + "Pro/internlm/internlm2_5-7b-chat", + "Pro/meta-llama/Meta-Llama-3-8B-Instruct", + "Pro/mistralai/Mistral-7B-Instruct-v0.2", +} diff --git a/relay/channeltype/define.go b/relay/channeltype/define.go index e3b0c98ef0..a261cff85d 100644 --- a/relay/channeltype/define.go +++ b/relay/channeltype/define.go @@ -45,5 +45,6 @@ const ( Novita VertextAI Proxy + SiliconFlow Dummy ) diff --git a/relay/channeltype/url.go b/relay/channeltype/url.go index b5026713b9..8727faea15 100644 --- a/relay/channeltype/url.go +++ b/relay/channeltype/url.go @@ -45,6 +45,7 @@ var ChannelBaseURLs = []string{ "https://api.novita.ai/v3/openai", // 41 "", // 42 "", // 43 + "https://api.siliconflow.cn", // 44 } func init() { diff --git a/web/air/src/constants/channel.constants.js b/web/air/src/constants/channel.constants.js index 18293f5f67..04fe94f17a 100644 --- a/web/air/src/constants/channel.constants.js +++ b/web/air/src/constants/channel.constants.js @@ -29,6 +29,7 @@ export const CHANNEL_OPTIONS = [ { key: 39, text: 'together.ai', value: 39, color: 'blue' }, { key: 42, text: 'VertexAI', value: 42, color: 'blue' }, { key: 43, text: 'Proxy', value: 43, color: 'blue' }, + { key: 44, text: 'SiliconFlow', value: 44, color: 'blue' }, { key: 8, text: '自定义渠道', value: 8, color: 'pink' }, { key: 22, text: '知识库:FastGPT', value: 22, color: 'blue' }, { key: 21, text: '知识库:AI Proxy', value: 21, color: 'purple' }, diff --git a/web/berry/src/constants/ChannelConstants.js b/web/berry/src/constants/ChannelConstants.js index acfda37b4b..98ea7ca57f 100644 --- a/web/berry/src/constants/ChannelConstants.js +++ b/web/berry/src/constants/ChannelConstants.js @@ -173,6 +173,12 @@ export const CHANNEL_OPTIONS = { value: 43, color: 'primary' }, + 44: { + key: 44, + text: 'SiliconFlow', + value: 44, + color: 'primary' + }, 41: { key: 41, text: 'Novita', diff --git a/web/default/src/constants/channel.constants.js b/web/default/src/constants/channel.constants.js index b2a7101654..04e361a1f4 100644 --- a/web/default/src/constants/channel.constants.js +++ b/web/default/src/constants/channel.constants.js @@ -29,6 +29,7 @@ export const CHANNEL_OPTIONS = [ { key: 39, text: 'together.ai', value: 39, color: 'blue' }, { key: 42, text: 'VertexAI', value: 42, color: 'blue' }, { key: 43, text: 'Proxy', value: 43, color: 'blue' }, + { key: 44, text: 'SiliconFlow', value: 44, color: 'blue' }, { key: 8, text: '自定义渠道', value: 8, color: 'pink' }, { key: 22, text: '知识库:FastGPT', value: 22, color: 'blue' }, { key: 21, text: '知识库:AI Proxy', value: 21, color: 'purple' },