Skip to content

Commit 169e598

Browse files
sxjeruarvinxx
andauthored
💄 style: Enable deploymentName for Aliyun Bailian (lobehub#7576)
* Adds Qwen deployment name support Enables deploymentName flag for Qwen in global config Includes Qwen in chat service’s deployment-name providers * update * Update qwen.ts * Update qwen.ts * Update qwen.ts * Update xai.ts * Update qwen.ts --------- Co-authored-by: Arvin Xu <[email protected]>
1 parent 5237b34 commit 169e598

File tree

6 files changed

+72
-48
lines changed

6 files changed

+72
-48
lines changed

src/config/aiModels/qwen.ts

Lines changed: 64 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,15 @@ const qwenChatModels: AIChatModelCard[] = [
196196
reasoning: true,
197197
search: true,
198198
},
199+
config: {
200+
deploymentName: 'qwq-plus-latest', // expired on 2025-09-02
201+
},
199202
contextWindowTokens: 131_072,
200203
description:
201204
'基于 Qwen2.5 模型训练的 QwQ 推理模型,通过强化学习大幅度提升了模型推理能力。模型数学代码等核心指标(AIME 24/25、LiveCodeBench)以及部分通用指标(IFEval、LiveBench等)达到DeepSeek-R1 满血版水平。',
202205
displayName: 'QwQ Plus',
203206
enabled: true,
204-
id: 'qwq-plus-latest',
207+
id: 'qwq-plus',
205208
maxOutput: 8192,
206209
organization: 'Qwen',
207210
pricing: {
@@ -221,11 +224,14 @@ const qwenChatModels: AIChatModelCard[] = [
221224
reasoning: true,
222225
search: true,
223226
},
227+
config: {
228+
deploymentName: 'qwen-turbo-2025-04-28', // expired on 2025-10-26
229+
},
224230
contextWindowTokens: 1_000_000,
225231
description: '通义千问超大规模语言模型,支持中文、英文等不同语言输入。',
226232
displayName: 'Qwen Turbo',
227233
enabled: true,
228-
id: 'qwen-turbo-latest',
234+
id: 'qwen-turbo',
229235
maxOutput: 8192,
230236
organization: 'Qwen',
231237
pricing: {
@@ -246,11 +252,14 @@ const qwenChatModels: AIChatModelCard[] = [
246252
reasoning: true,
247253
search: true,
248254
},
255+
config: {
256+
deploymentName: 'qwen-plus-2025-04-28', // expired on 2025-10-26
257+
},
249258
contextWindowTokens: 131_072,
250259
description: '通义千问超大规模语言模型增强版,支持中文、英文等不同语言输入。',
251260
displayName: 'Qwen Plus',
252261
enabled: true,
253-
id: 'qwen-plus-latest',
262+
id: 'qwen-plus',
254263
maxOutput: 8192,
255264
organization: 'Qwen',
256265
pricing: {
@@ -270,12 +279,15 @@ const qwenChatModels: AIChatModelCard[] = [
270279
functionCall: true,
271280
search: true,
272281
},
282+
config: {
283+
deploymentName: 'qwen-max-2025-01-25',
284+
},
273285
contextWindowTokens: 131_072,
274286
description:
275287
'通义千问千亿级别超大规模语言模型,支持中文、英文等不同语言输入,当前通义千问2.5产品版本背后的API模型。',
276288
displayName: 'Qwen Max',
277289
enabled: true,
278-
id: 'qwen-max-latest',
290+
id: 'qwen-max',
279291
maxOutput: 8192,
280292
organization: 'Qwen',
281293
pricing: {
@@ -292,6 +304,9 @@ const qwenChatModels: AIChatModelCard[] = [
292304
abilities: {
293305
functionCall: true,
294306
},
307+
config: {
308+
deploymentName: 'qwen-long-latest',
309+
},
295310
contextWindowTokens: 10_000_000,
296311
description:
297312
'通义千问超大规模语言模型,支持长文本上下文,以及基于长文档、多文档等多个场景的对话功能。',
@@ -311,12 +326,15 @@ const qwenChatModels: AIChatModelCard[] = [
311326
abilities: {
312327
vision: true,
313328
},
329+
config: {
330+
deploymentName: 'qwen-omni-turbo-latest',
331+
},
314332
contextWindowTokens: 32_768,
315333
description:
316334
'Qwen-Omni 系列模型支持输入多种模态的数据,包括视频、音频、图片、文本,并输出音频与文本。',
317335
displayName: 'Qwen Omni Turbo',
318336
enabled: true,
319-
id: 'qwen-omni-turbo-latest',
337+
id: 'qwen-omni-turbo',
320338
maxOutput: 2048,
321339
organization: 'Qwen',
322340
pricing: {
@@ -348,11 +366,14 @@ const qwenChatModels: AIChatModelCard[] = [
348366
abilities: {
349367
vision: true,
350368
},
369+
config: {
370+
deploymentName: 'qwen-vl-plus-2025-01-25',
371+
},
351372
contextWindowTokens: 131_072,
352373
description:
353374
'通义千问大规模视觉语言模型增强版。大幅提升细节识别能力和文字识别能力,支持超百万像素分辨率和任意长宽比规格的图像。',
354375
displayName: 'Qwen VL Plus',
355-
id: 'qwen-vl-plus-latest',
376+
id: 'qwen-vl-plus',
356377
maxOutput: 8192,
357378
organization: 'Qwen',
358379
pricing: {
@@ -366,12 +387,15 @@ const qwenChatModels: AIChatModelCard[] = [
366387
abilities: {
367388
vision: true,
368389
},
390+
config: {
391+
deploymentName: 'qwen-vl-max-2025-04-08',
392+
},
369393
contextWindowTokens: 131_072,
370394
description:
371395
'通义千问超大规模视觉语言模型。相比增强版,再次提升视觉推理能力和指令遵循能力,提供更高的视觉感知和认知水平。',
372396
displayName: 'Qwen VL Max',
373397
enabled: true,
374-
id: 'qwen-vl-max-latest',
398+
id: 'qwen-vl-max',
375399
maxOutput: 8192,
376400
organization: 'Qwen',
377401
pricing: {
@@ -385,11 +409,14 @@ const qwenChatModels: AIChatModelCard[] = [
385409
abilities: {
386410
vision: true,
387411
},
412+
config: {
413+
deploymentName: 'qwen-vl-ocr-2025-04-13',
414+
},
388415
contextWindowTokens: 34_096,
389416
description:
390417
'通义千问OCR是文字提取专有模型,专注于文档、表格、试题、手写体文字等类型图像的文字提取能力。它能够识别多种文字,目前支持的语言有:汉语、英语、法语、日语、韩语、德语、俄语、意大利语、越南语、阿拉伯语。',
391418
displayName: 'Qwen VL OCR',
392-
id: 'qwen-vl-ocr-latest',
419+
id: 'qwen-vl-ocr',
393420
maxOutput: 4096,
394421
organization: 'Qwen',
395422
pricing: {
@@ -400,10 +427,13 @@ const qwenChatModels: AIChatModelCard[] = [
400427
type: 'chat',
401428
},
402429
{
430+
config: {
431+
deploymentName: 'qwen-math-turbo-latest',
432+
},
403433
contextWindowTokens: 4096,
404434
description: '通义千问数学模型是专门用于数学解题的语言模型。',
405435
displayName: 'Qwen Math Turbo',
406-
id: 'qwen-math-turbo-latest',
436+
id: 'qwen-math-turbo',
407437
maxOutput: 3072,
408438
organization: 'Qwen',
409439
pricing: {
@@ -414,10 +444,13 @@ const qwenChatModels: AIChatModelCard[] = [
414444
type: 'chat',
415445
},
416446
{
447+
config: {
448+
deploymentName: 'qwen-math-plus-latest',
449+
},
417450
contextWindowTokens: 4096,
418451
description: '通义千问数学模型是专门用于数学解题的语言模型。',
419452
displayName: 'Qwen Math Plus',
420-
id: 'qwen-math-plus-latest',
453+
id: 'qwen-math-plus',
421454
maxOutput: 3072,
422455
organization: 'Qwen',
423456
pricing: {
@@ -428,10 +461,13 @@ const qwenChatModels: AIChatModelCard[] = [
428461
type: 'chat',
429462
},
430463
{
464+
config: {
465+
deploymentName: 'qwen-coder-turbo-latest',
466+
},
431467
contextWindowTokens: 131_072,
432468
description: '通义千问代码模型。',
433469
displayName: 'Qwen Coder Turbo',
434-
id: 'qwen-coder-turbo-latest',
470+
id: 'qwen-coder-turbo',
435471
maxOutput: 8192,
436472
organization: 'Qwen',
437473
pricing: {
@@ -442,10 +478,13 @@ const qwenChatModels: AIChatModelCard[] = [
442478
type: 'chat',
443479
},
444480
{
481+
config: {
482+
deploymentName: 'qwen-coder-plus-latest',
483+
},
445484
contextWindowTokens: 131_072,
446485
description: '通义千问代码模型。',
447486
displayName: 'Qwen Coder Plus',
448-
id: 'qwen-coder-plus-latest',
487+
id: 'qwen-coder-plus',
449488
maxOutput: 8192,
450489
organization: 'Qwen',
451490
pricing: {
@@ -501,11 +540,14 @@ const qwenChatModels: AIChatModelCard[] = [
501540
reasoning: true,
502541
vision: true,
503542
},
543+
config: {
544+
deploymentName: 'qvq-max-latest',
545+
},
504546
contextWindowTokens: 122_880,
505547
description:
506548
'通义千问QVQ视觉推理模型,支持视觉输入及思维链输出,在数学、编程、视觉分析、创作以及通用任务上都表现了更强的能力。',
507549
displayName: 'QVQ Max',
508-
id: 'qvq-max-latest',
550+
id: 'qvq-max',
509551
maxOutput: 8192,
510552
organization: 'Qwen',
511553
pricing: {
@@ -667,8 +709,8 @@ const qwenChatModels: AIChatModelCard[] = [
667709
{
668710
contextWindowTokens: 131_072,
669711
description: '通义千问代码模型开源版。',
670-
displayName: 'Qwen2.5 Coder 32B',
671-
id: 'qwen2.5-coder-32b-instruct',
712+
displayName: 'Qwen2.5 Coder 14B',
713+
id: 'qwen2.5-coder-14b-instruct',
672714
maxOutput: 8192,
673715
organization: 'Qwen',
674716
pricing: {
@@ -679,36 +721,16 @@ const qwenChatModels: AIChatModelCard[] = [
679721
type: 'chat',
680722
},
681723
{
682-
abilities: {
683-
vision: true,
684-
},
685-
contextWindowTokens: 8000,
686-
description: '以 Qwen-7B 语言模型初始化,添加图像模型,图像输入分辨率为448的预训练模型。',
687-
displayName: 'Qwen VL',
688-
id: 'qwen-vl-v1',
689-
maxOutput: 1500,
690-
organization: 'Qwen',
691-
pricing: {
692-
currency: 'CNY',
693-
input: 0,
694-
output: 0,
695-
},
696-
type: 'chat',
697-
},
698-
{
699-
abilities: {
700-
vision: true,
701-
},
702-
contextWindowTokens: 8000,
703-
description: '通义千问VL支持灵活的交互方式,包括多图、多轮问答、创作等能力的模型。',
704-
displayName: 'Qwen VL Chat',
705-
id: 'qwen-vl-chat-v1',
706-
maxOutput: 1500,
724+
contextWindowTokens: 131_072,
725+
description: '通义千问代码模型开源版。',
726+
displayName: 'Qwen2.5 Coder 32B',
727+
id: 'qwen2.5-coder-32b-instruct',
728+
maxOutput: 8192,
707729
organization: 'Qwen',
708730
pricing: {
709731
currency: 'CNY',
710-
input: 0,
711-
output: 0,
732+
input: 2,
733+
output: 6,
712734
},
713735
type: 'chat',
714736
},

src/config/modelProviders/qwen.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ const Qwen: ModelProviderCard = {
419419
id: 'qwen',
420420
modelList: { showModelFetcher: true },
421421
modelsUrl: 'https://help.aliyun.com/zh/dashscope/developer-reference/api-details',
422-
name: 'Qwen',
422+
name: 'Aliyun Bailian',
423423
proxyUrl: {
424424
placeholder: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
425425
},
@@ -429,16 +429,13 @@ const Qwen: ModelProviderCard = {
429429
placeholder: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
430430
},
431431
sdkType: 'openai',
432+
showDeployName: true,
432433
showModelFetcher: true,
433434
smoothing: {
434435
speed: 2,
435436
text: true,
436437
},
437438
},
438-
smoothing: {
439-
speed: 2,
440-
text: true,
441-
},
442439
url: 'https://www.aliyun.com/product/bailian',
443440
};
444441

src/config/modelProviders/xai.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const XAI: ModelProviderCard = {
6262
id: 'xai',
6363
modelList: { showModelFetcher: true },
6464
modelsUrl: 'https://docs.x.ai/docs#models',
65-
name: 'xAI',
65+
name: 'xAI (Grok)',
6666
proxyUrl: {
6767
placeholder: 'https://api.x.ai/v1',
6868
},

src/server/globalConfig/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ export const getServerGlobalConfig = async () => {
4040
enabled: isDesktop ? true : undefined,
4141
fetchOnClient: isDesktop ? false : !process.env.OLLAMA_PROXY_URL,
4242
},
43+
qwen: {
44+
withDeploymentName: true,
45+
},
4346
tencentcloud: {
4447
enabledKey: 'ENABLED_TENCENT_CLOUD',
4548
modelListKey: 'TENCENT_CLOUD_MODEL_LIST',

src/services/chat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ class ChatService {
300300
ModelProvider.Azure,
301301
ModelProvider.Volcengine,
302302
ModelProvider.AzureAI,
303+
ModelProvider.Qwen,
303304
] as string[];
304305

305306
if (providersWithDeploymentName.includes(provider)) {

src/types/aiProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const AiProviderSDKEnum = {
2323
Huggingface: 'huggingface',
2424
Ollama: 'ollama',
2525
Openai: 'openai',
26+
Qwen: 'qwen',
2627
Volcengine: 'volcengine',
2728
} as const;
2829

0 commit comments

Comments
 (0)