💄 style: update Aliyun Bailian models (#8612)

* Update qwen.ts

*  feat: 添加 Qwen3-30B-A3B-Instruct-2507 聊天模型

*  feat: 更新 Qwen 模型配置,添加新能力和调整参数

*  feat: 更新推理预算令牌的处理逻辑,支持在未启用推理时使用
This commit is contained in:
sxjeru
2025-07-31 10:28:06 +08:00
committed by GitHub
parent fe7062f796
commit 433e679844
5 changed files with 104 additions and 21 deletions
+68 -15
View File
@@ -5,7 +5,7 @@ import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
const qwenChatModels: AIChatModelCard[] = [
{
abilities: {
functionCall: true,
search: true,
},
contextWindowTokens: 131_072,
description:
@@ -21,6 +21,9 @@ const qwenChatModels: AIChatModelCard[] = [
output: 16,
},
releasedAt: '2025-07-17',
settings: {
searchImpl: 'params',
},
type: 'chat',
},
{
@@ -45,6 +48,23 @@ const qwenChatModels: AIChatModelCard[] = [
releasedAt: '2025-07-23',
type: 'chat',
},
{
abilities: {
functionCall: true,
},
contextWindowTokens: 262_144,
description: '通义千问代码模型开源版。最新的 qwen3-coder-480b-a35b-instruct 是基于 Qwen3 的代码生成模型,具有强大的Coding Agent能力,擅长工具调用和环境交互,能够实现自主编程、代码能力卓越的同时兼具通用能力。',
displayName: 'Qwen3 Coder 480B A35B',
id: 'qwen3-coder-480b-a35b-instruct',
maxOutput: 65_536,
organization: 'Qwen',
pricing: {
currency: 'CNY',
input: 9, // tokens 32K ~ 128K
output: 36,
},
type: 'chat',
},
{
abilities: {
functionCall: true,
@@ -64,6 +84,9 @@ const qwenChatModels: AIChatModelCard[] = [
output: 20,
},
releasedAt: '2025-07-25',
settings: {
extendParams: ['reasoningBudgetToken'],
},
type: 'chat',
},
{
@@ -86,6 +109,50 @@ const qwenChatModels: AIChatModelCard[] = [
releasedAt: '2025-07-22',
type: 'chat',
},
{
abilities: {
functionCall: true,
reasoning: true,
},
contextWindowTokens: 131_072,
description:
'基于Qwen3的思考模式开源模型,相较上一版本(通义千问3-30B-A3B)逻辑能力、通用能力、知识增强及创作能力均有大幅提升,适用于高难度强推理场景。',
displayName: 'Qwen3 30B A3B Thinking 2507',
enabled: true,
id: 'qwen3-30b-a3b-thinking-2507',
maxOutput: 32_768,
organization: 'Qwen',
pricing: {
currency: 'CNY',
input: 0.75,
output: 7.5,
},
releasedAt: '2025-07-30',
settings: {
extendParams: ['reasoningBudgetToken'],
},
type: 'chat',
},
{
abilities: {
functionCall: true,
},
contextWindowTokens: 131_072,
description:
'相较上一版本(Qwen3-30B-A3B)中英文和多语言整体通用能力有大幅提升。主观开放类任务专项优化,显著更加符合用户偏好,能够提供更有帮助性的回复。',
displayName: 'Qwen3 30B A3B Instruct 2507',
enabled: true,
id: 'qwen3-30b-a3b-instruct-2507',
maxOutput: 32_768,
organization: 'Qwen',
pricing: {
currency: 'CNY',
input: 0.75,
output: 3,
},
releasedAt: '2025-07-29',
type: 'chat',
},
{
abilities: {
functionCall: true,
@@ -797,20 +864,6 @@ const qwenChatModels: AIChatModelCard[] = [
releasedAt: '2025-07-23',
type: 'chat',
},
{
contextWindowTokens: 262_144,
description: '通义千问代码模型开源版。最新的 qwen3-coder-480b-a35b-instruct 是基于 Qwen3 的代码生成模型,具有强大的Coding Agent能力,擅长工具调用和环境交互,能够实现自主编程、代码能力卓越的同时兼具通用能力。',
displayName: 'Qwen3 Coder 480B A35B',
id: 'qwen3-coder-480b-a35b-instruct',
maxOutput: 65_536,
organization: 'Qwen',
pricing: {
currency: 'CNY',
input: 9, // tokens 32K ~ 128K
output: 36,
},
type: 'chat',
},
{
contextWindowTokens: 131_072,
description: '通义千问代码模型开源版。',
+18
View File
@@ -202,6 +202,24 @@ const siliconcloudChatModels: AIChatModelCard[] = [
releasedAt: '2025-07-21',
type: 'chat',
},
{
abilities: {
functionCall: true,
},
contextWindowTokens: 262_144,
description:
'Qwen3-30B-A3B-Instruct-2507 是 Qwen3-30B-A3B 非思考模式的更新版本。这是一个拥有 305 亿总参数和 33 亿激活参数的混合专家(MoE)模型。该模型在多个方面进行了关键增强,包括显著提升了指令遵循、逻辑推理、文本理解、数学、科学、编码和工具使用等通用能力。同时,它在多语言的长尾知识覆盖范围上取得了实质性进展,并能更好地与用户在主观和开放式任务中的偏好对齐,从而能够生成更有帮助的回复和更高质量的文本。此外,该模型的长文本理解能力也增强到了 256K。此模型仅支持非思考模式,其输出中不会生成 `<think></think>` 标签。',
displayName: 'Qwen3 30B A3B Instruct 2507',
id: 'Qwen/Qwen3-30B-A3B-Instruct-2507',
organization: 'Qwen',
pricing: {
currency: 'CNY',
input: 0.7,
output: 2.8,
},
releasedAt: '2025-07-29',
type: 'chat',
},
{
abilities: {
functionCall: true,
@@ -74,7 +74,7 @@ const ControlsForm = memo(() => {
minWidth: undefined,
name: 'enableReasoning',
},
enableReasoning && {
(enableReasoning || modelExtendParams?.includes('reasoningBudgetToken')) && {
children: <ReasoningTokenSlider />,
label: t('extendParams.reasoningBudgetToken.title'),
layout: 'vertical',
+11 -5
View File
@@ -29,15 +29,21 @@ export const LobeQwenAI = createOpenAICompatibleRuntime({
return {
...rest,
...(['qwen3', 'qwen-turbo', 'qwen-plus'].some((keyword) =>
model.toLowerCase().includes(keyword),
)
...(model.includes('-thinking')
? {
enable_thinking: thinking !== undefined ? thinking.type === 'enabled' : false,
enable_thinking: true,
thinking_budget:
thinking?.budget_tokens === 0 ? 0 : thinking?.budget_tokens || undefined,
}
: {}),
: ['qwen3', 'qwen-turbo', 'qwen-plus'].some((keyword) =>
model.toLowerCase().includes(keyword),
)
? {
enable_thinking: thinking !== undefined ? thinking.type === 'enabled' : false,
thinking_budget:
thinking?.budget_tokens === 0 ? 0 : thinking?.budget_tokens || undefined,
}
: {}),
frequency_penalty: undefined,
model,
presence_penalty: QwenLegacyModels.has(model)
+6
View File
@@ -263,6 +263,12 @@ class ChatService {
type: 'disabled',
};
}
} else if (modelExtendParams!.includes('reasoningBudgetToken')) {
// For models that only have reasoningBudgetToken without enableReasoning
extendParams.thinking = {
budget_tokens: chatConfig.reasoningBudgetToken || 1024,
type: 'enabled',
};
}
if (