feat: add modelscope provider (#1563)

Co-authored-by: 亢奋猫 <kangfenmao@qq.com>
This commit is contained in:
Col0ring 2025-02-14 13:12:46 +08:00 committed by GitHub
parent b6825a6ea2
commit caa473639c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 63 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -142,6 +142,7 @@ const visionAllowedModels = [
'glm-4v',
'qwen-vl',
'qwen2-vl',
'qwen2.5-vl',
'internvl2',
'grok-vision-beta',
'pixtral',
@ -933,6 +934,38 @@ export const SYSTEM_MODELS: Record<string, Model[]> = {
group: 'Baichuan3'
}
],
modelscope: [
{
id: 'Qwen/Qwen2.5-72B-Instruct',
name: 'Qwen/Qwen2.5-72B-Instruct',
provider: 'modelscope',
group: 'Qwen'
},
{
id: 'Qwen/Qwen2.5-VL-72B-Instruct',
name: 'Qwen/Qwen2.5-VL-72B-Instruct',
provider: 'modelscope',
group: 'Qwen'
},
{
id: 'Qwen/Qwen2.5-Coder-32B-Instruct',
name: 'Qwen/Qwen2.5-Coder-32B-Instruct',
provider: 'modelscope',
group: 'Qwen'
},
{
id: 'deepseek-ai/DeepSeek-R1',
name: 'deepseek-ai/DeepSeek-R1',
provider: 'modelscope',
group: 'deepseek-ai'
},
{
id: 'deepseek-ai/DeepSeek-V3',
name: 'deepseek-ai/DeepSeek-V3',
provider: 'modelscope',
group: 'deepseek-ai'
}
],
bailian: [
{ id: 'qwen-vl-plus', name: 'qwen-vl-plus', provider: 'dashscope', group: 'qwen-vl', owned_by: 'system' },
{ id: 'qwen-coder-plus', name: 'qwen-coder-plus', provider: 'dashscope', group: 'qwen-coder', owned_by: 'system' },

View File

@ -6,6 +6,8 @@ import AnthropicProviderLogo from '@renderer/assets/images/providers/anthropic.p
import BaichuanProviderLogo from '@renderer/assets/images/providers/baichuan.png'
import BaiduCloudProviderLogo from '@renderer/assets/images/providers/baidu-cloud.svg'
import BailianProviderLogo from '@renderer/assets/images/providers/bailian.png'
import ModelScopeProviderLogo from '@renderer/assets/images/providers/modelscope.png'
import BytedanceProviderLogo from '@renderer/assets/images/providers/bytedance.png'
import DeepSeekProviderLogo from '@renderer/assets/images/providers/deepseek.png'
import DmxapiProviderLogo from '@renderer/assets/images/providers/DMXAPI.png'
import FireworksProviderLogo from '@renderer/assets/images/providers/fireworks.png'
@ -63,6 +65,8 @@ export function getProviderLogo(providerId: string) {
return BaichuanProviderLogo
case 'dashscope':
return BailianProviderLogo
case 'modelscope':
return ModelScopeProviderLogo
case 'anthropic':
return AnthropicProviderLogo
case 'aihubmix':
@ -295,6 +299,17 @@ export const PROVIDER_CONFIG = {
models: 'https://platform.baichuan-ai.com/price'
}
},
modelscope: {
api: {
url: 'https://api-inference.modelscope.cn/v1/'
},
websites: {
official: 'https://modelscope.cn',
apiKey: 'https://modelscope.cn/my/myaccesstoken',
docs: 'https://modelscope.cn/docs/model-service/API-Inference/intro',
models: 'https://modelscope.cn/models'
}
},
dashscope: {
api: {
url: 'https://dashscope.aliyuncs.com/compatible-mode/v1/'

View File

@ -481,6 +481,7 @@
"baichuan": "Baichuan",
"baidu-cloud": "Baidu Cloud",
"dashscope": "Alibaba Cloud",
"modelscope": "ModelScope",
"deepseek": "DeepSeek",
"doubao": "Volcengine",
"fireworks": "Fireworks",

View File

@ -481,6 +481,7 @@
"baichuan": "百川",
"baidu-cloud": "Baidu Cloud",
"dashscope": "Alibaba Cloud",
"modelscope": "ModelScope",
"deepseek": "DeepSeek",
"doubao": "Volcengine",
"fireworks": "Fireworks",

View File

@ -481,6 +481,7 @@
"baichuan": "Baichuan",
"baidu-cloud": "Baidu Cloud",
"dashscope": "Alibaba Cloud",
"modelscope": "ModelScope",
"deepseek": "DeepSeek",
"doubao": "Volcengine",
"fireworks": "Fireworks",

View File

@ -481,6 +481,7 @@
"baichuan": "百川",
"baidu-cloud": "百度云千帆",
"dashscope": "阿里云百炼",
"modelscope": "ModelScope 魔搭",
"deepseek": "深度求索",
"doubao": "火山引擎",
"fireworks": "Fireworks",

View File

@ -481,6 +481,7 @@
"baichuan": "百川",
"baidu-cloud": "百度云千帆",
"dashscope": "阿里雲百鍊",
"modelscope": "ModelScope 魔搭",
"deepseek": "深度求索",
"doubao": "火山引擎",
"fireworks": "Fireworks",

View File

@ -424,6 +424,16 @@ const getIntegratedInitialState = () => {
models: [model],
isSystem: true,
enabled: true
},
{
id: 'modelscope',
name: 'ModelScope',
type: 'openai',
apiKey: '',
apiHost: 'https://api-inference.modelscope.cn/v1/',
models: SYSTEM_MODELS.modelscope,
isSystem: true,
enabled: false
}
],
settings: {