diff --git a/README.md b/README.md index 987fde7d..b2fba81b 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用 + [x] [Cloudflare Workers AI](https://developers.cloudflare.com/workers-ai/) + [x] [DeepL](https://www.deepl.com/) + [x] [together.ai](https://www.together.ai/) + + [x] [硅基流动 SiliconFlow](https://siliconflow.cn/siliconcloud) + [x] [novita.ai](https://www.novita.ai/) 2. 支持配置镜像以及众多[第三方代理服务](https://iamazing.cn/page/openai-api-third-party-services)。 3. 支持通过**负载均衡**的方式访问多个渠道。 @@ -370,7 +371,7 @@ graph LR + 例子:`NODE_TYPE=slave` 9. `CHANNEL_UPDATE_FREQUENCY`:设置之后将定期更新渠道余额,单位为分钟,未设置则不进行更新。 + 例子:`CHANNEL_UPDATE_FREQUENCY=1440` -10. `CHANNEL_TEST_FREQUENCY`:设置之后将定期检查渠道,单位为分钟,未设置则不进行检查。 +10. `CHANNEL_TEST_FREQUENCY`:设置之后将定期检查渠道,单位为分钟,未设置则不进行检查。 +例子:`CHANNEL_TEST_FREQUENCY=1440` 11. `POLLING_INTERVAL`:批量更新渠道余额以及测试可用性时的请求间隔,单位为秒,默认无间隔。 + 例子:`POLLING_INTERVAL=5` diff --git a/relay/adaptor/openai/compatible.go b/relay/adaptor/openai/compatible.go index 3445249c..1eb35662 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) { @@ -56,6 +58,8 @@ func GetCompatibleChannelMeta(channelType int) (string, []string) { return "deepseek", deepseek.ModelList case channeltype.TogetherAI: return "together.ai", togetherai.ModelList + case channeltype.SiliconFlow: + return "siliconflow", siliconflow.ModelList case channeltype.Doubao: return "doubao", doubao.ModelList case channeltype.Novita: diff --git a/relay/adaptor/siliconflow/constants.go b/relay/adaptor/siliconflow/constants.go new file mode 100644 index 00000000..0bf54761 --- /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 e3b0c98e..a261cff8 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 b5026713..8727faea 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 18293f5f..2154cd2f 100644 --- a/web/air/src/constants/channel.constants.js +++ b/web/air/src/constants/channel.constants.js @@ -27,6 +27,7 @@ export const CHANNEL_OPTIONS = [ { key: 37, text: 'Cloudflare', value: 37, color: 'orange' }, { key: 38, text: 'DeepL', value: 38, color: 'black' }, { key: 39, text: 'together.ai', value: 39, color: 'blue' }, + { key: 44, text: 'SiliconFlow', value: 44, color: 'blue' }, { key: 42, text: 'VertexAI', value: 42, color: 'blue' }, { key: 43, text: 'Proxy', value: 43, color: 'blue' }, { key: 8, text: '自定义渠道', value: 8, color: 'pink' }, diff --git a/web/berry/src/constants/ChannelConstants.js b/web/berry/src/constants/ChannelConstants.js index acfda37b..5ba2f615 100644 --- a/web/berry/src/constants/ChannelConstants.js +++ b/web/berry/src/constants/ChannelConstants.js @@ -161,6 +161,12 @@ export const CHANNEL_OPTIONS = { value: 39, color: 'primary' }, + 44: { + key: 44, + text: 'SiliconFlow', + value: 44, + color: 'primary' + }, 42: { key: 42, text: 'VertexAI', diff --git a/web/default/src/constants/channel.constants.js b/web/default/src/constants/channel.constants.js index b2a71016..7fdf76d2 100644 --- a/web/default/src/constants/channel.constants.js +++ b/web/default/src/constants/channel.constants.js @@ -27,6 +27,7 @@ export const CHANNEL_OPTIONS = [ { key: 37, text: 'Cloudflare', value: 37, color: 'orange' }, { key: 38, text: 'DeepL', value: 38, color: 'black' }, { key: 39, text: 'together.ai', value: 39, color: 'blue' }, + { key: 44, text: 'SiliconFlow', value: 44, color: 'blue' }, { key: 42, text: 'VertexAI', value: 42, color: 'blue' }, { key: 43, text: 'Proxy', value: 43, color: 'blue' }, { key: 8, text: '自定义渠道', value: 8, color: 'pink' },