Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style: migrate Hunyuan to TokenHub for Hy3 Preview (#14108)

Zhijie He04775f66ffd9
diff --git a/locales/en-US/modelProvider.json b/locales/en-US/modelProvider.json
index 6d36e24fd1a..352c7455751 100644
--- a/locales/en-US/modelProvider.json
+++ b/locales/en-US/modelProvider.json
@@ -226,6 +226,7 @@
"providerModels.item.modelConfig.extendParams.options.gpt5_2ProReasoningEffort.hint": "For GPT-5.2 Pro series; controls reasoning intensity.",
"providerModels.item.modelConfig.extendParams.options.gpt5_2ReasoningEffort.hint": "For GPT-5.2 series; controls reasoning intensity.",
"providerModels.item.modelConfig.extendParams.options.grok4_20ReasoningEffort.hint": "For Grok 4.20 series; controls reasoning intensity. Low/Medium uses 4 agents, High/XHigh uses 16 agents.",
+ "providerModels.item.modelConfig.extendParams.options.hy3ReasoningEffort.hint": "For Hy3 models; controls reasoning intensity. no_think (ultra-fast response), low (quick reasoning), and high (deep reasoning)—to accommodate varying latency and depth requirements, from high-frequency interactions to complex engineering tasks.",
"providerModels.item.modelConfig.extendParams.options.imageAspectRatio.hint": "For Gemini image generation models; controls aspect ratio of generated images.",
"providerModels.item.modelConfig.extendParams.options.imageAspectRatio2.hint": "For Nano Banana 2; controls aspect ratio of generated images (supports extra-wide 1:4, 4:1, 1:8, 8:1).",
"providerModels.item.modelConfig.extendParams.options.imageResolution.hint": "For Gemini 3 image generation models; controls resolution of generated images.",
diff --git a/locales/zh-CN/modelProvider.json b/locales/zh-CN/modelProvider.json
index abe5d7d1032..d6ce8ec7fe9 100644
--- a/locales/zh-CN/modelProvider.json
+++ b/locales/zh-CN/modelProvider.json
@@ -226,6 +226,7 @@
"providerModels.item.modelConfig.extendParams.options.gpt5_2ProReasoningEffort.hint": "适用于 GPT-5.2 Pro 系列;控制推理强度。",
"providerModels.item.modelConfig.extendParams.options.gpt5_2ReasoningEffort.hint": "适用于 GPT-5.2 系列;控制推理强度。",
"providerModels.item.modelConfig.extendParams.options.grok4_20ReasoningEffort.hint": "适用于 Grok 4.20 系列;控制推理强度。低/中档使用 4 个代理,高/超高使用 16 个代理。",
+ "providerModels.item.modelConfig.extendParams.options.hy3ReasoningEffort.hint": "适用于 Hy3 模型;控制推理强度。no_think(超快响应)、low(快速推理)和 high(深度推理)三档,以适应从高频交互到复杂工程任务的不同延迟和深度需求。",
"providerModels.item.modelConfig.extendParams.options.imageAspectRatio.hint": "适用于 Gemini 图像生成模型;控制生成图像的宽高比。",
"providerModels.item.modelConfig.extendParams.options.imageAspectRatio2.hint": "适用于 Nano Banana 2;控制生成图像的宽高比(支持超宽 1:4、4:1、1:8、8:1)。",
"providerModels.item.modelConfig.extendParams.options.imageResolution.hint": "适用于 Gemini 3 图像生成模型;控制生成图像的分辨率。",
diff --git a/packages/model-bank/src/aiModels/hunyuan.ts b/packages/model-bank/src/aiModels/hunyuan.ts
index 46f36323f24..91873b1039c 100644
--- a/packages/model-bank/src/aiModels/hunyuan.ts
+++ b/packages/model-bank/src/aiModels/hunyuan.ts
@@ -1,17 +1,80 @@
-import type { AIChatModelCard, AIImageModelCard } from '../types/aiModel';
+import type { AIChatModelCard, AIImageModelCard, AIVideoModelCard } from '../types/aiModel';
-// https://cloud.tencent.com/document/product/1729/104753
+// https://cloud.tencent.com/document/product/1823/130051
const hunyuanChatModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ structuredOutput: true,
+ },
+ contextWindowTokens: 256_000,
+ description:
+ 'Hunyuan Hy3 Preview is designed for agent workloads, adopting a Mixture-of-Experts (MoE) architecture with 295B total parameters and 21B activated parameters. It offers three modes within a single model—**no_think** (ultra-fast response), **think_low** (quick reasoning), and **think_high** (deep reasoning)—to accommodate varying latency and depth requirements, from high-frequency interactions to complex engineering tasks. It achieves near state-of-the-art performance on coding benchmarks such as SWE-bench Verified, and supports a 256K context window for cross-file code refactoring and long-document analysis. This model is well-suited for developers who require reliable task completion while remaining sensitive to inference cost.',
+ displayName: 'Hy3 preview',
+ enabled: true,
+ id: 'hy3-preview',
+ maxOutput: 128_000,
+ pricing: {
+ currency: 'CNY',
+ units: [
+ {
+ lookup: {
+ prices: {
+ '[0, 0.016]': 0.4,
+ '[0.016, 0.032]': 0.6,
+ '[0.032, infinity]': 0.8,
+ },
+ pricingParams: ['textInputRange'],
+ },
+ name: 'textInput_cacheRead',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.016]': 1.2,
+ '[0.016, 0.032]': 1.6,
+ '[0.032, infinity]': 2,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.016]': 4,
+ '[0.016, 0.032]': 6.4,
+ '[0.032, infinity]': 8,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ ],
+ },
+ releasedAt: '2026-04-23',
+ settings: {
+ extendParams: ['hy3ReasoningEffort'],
+ },
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
reasoning: true,
search: true,
},
- contextWindowTokens: 128_000,
+ contextWindowTokens: 192_000,
description:
- 'Release Features: The model base has been upgraded from TurboS to **Hunyuan 2.0**, resulting in comprehensive capability improvements. It significantly enhances the model’s ability to follow complex instructions, understand multi-turn and long-form text, handle code, operate as an agent, and perform reasoning tasks.',
- displayName: 'Tencent HY 2.0 Think',
+ 'Specialized in creative content, multi-turn interactions, and practical instruction-following scenarios. Significantly enhanced capabilities in mathematics, coding, and agent-based tasks.',
+ displayName: 'HY 2.0 Think',
enabled: true,
id: 'hunyuan-2.0-thinking-20251109',
maxOutput: 64_000,
@@ -57,11 +120,11 @@ const hunyuanChatModels: AIChatModelCard[] = [
},
contextWindowTokens: 128_000,
description:
- 'Release Features: The model base has been upgraded from TurboS to **Hunyuan 2.0**, resulting in comprehensive capability improvements. It significantly enhances instruction-following, multi-turn and long-form text understanding, literary creation, knowledge accuracy, coding, and reasoning abilities.',
- displayName: 'Tencent HY 2.0 Instruct',
+ 'The model foundation has been comprehensively upgraded, with more robust core capabilities. It achieves top-tier performance in knowledge, mathematics, writing, and reasoning. It also demonstrates excellent performance in instruction following, multi-turn interactions, and long-context comprehension.',
+ displayName: 'HY 2.0 Instruct',
enabled: true,
id: 'hunyuan-2.0-instruct-20251111',
- maxOutput: 16_000,
+ maxOutput: 32_000,
pricing: {
currency: 'CNY',
units: [
@@ -98,417 +161,522 @@ const hunyuanChatModels: AIChatModelCard[] = [
type: 'chat',
},
{
- abilities: {
- reasoning: true,
- search: true,
- },
- contextWindowTokens: 256_000,
+ contextWindowTokens: 128_000,
description:
- 'The first hybrid reasoning model from Hunyuan, upgraded from hunyuan-standard-256K (80B total, 13B active). It defaults to slow thinking and supports fast/slow switching via params or prefixing /no_think. Overall capability is improved over the previous generation, especially in math, science, long-text understanding, and agent tasks.',
- displayName: 'Hunyuan A13B',
- enabled: true,
- id: 'hunyuan-a13b',
+ 'For role-playing scenarios, it delivers highly consistent character alignment and exceptionally natural, human-like conversational style. It offers engaging narrative development and progression, along with emotional companionship and fulfillment.',
+ displayName: 'Hunyuan-role',
+ id: 'hunyuan-role-latest',
maxOutput: 32_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 2.4, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 9.6, strategy: 'fixed', unit: 'millionTokens' },
],
},
- releasedAt: '2025-06-25',
- settings: {
- extendParams: ['enableReasoning'],
- searchImpl: 'params',
- },
+ releasedAt: '2026-03-04',
type: 'chat',
},
{
abilities: {
+ functionCall: true,
reasoning: true,
- search: true,
+ structuredOutput: true,
},
- contextWindowTokens: 96_000,
+ contextWindowTokens: 200_000,
description:
- 'Significantly improves the slow-thinking model on hard math, complex reasoning, difficult coding, instruction following, and creative writing quality.',
- displayName: 'Hunyuan T1',
- id: 'hunyuan-t1-latest',
- maxOutput: 64_000,
+ 'GLM-5.1 is Zhipu’s latest flagship model, with significantly enhanced coding capabilities and substantial improvements in long-horizon tasks. It can operate continuously and autonomously for up to 8 hours within a single task, completing a full closed loop from planning and execution to iterative optimization, delivering engineering-grade results. In terms of overall capabilities and coding performance, GLM-5.1 is aligned with Claude Opus 4.6. It demonstrates stronger sustained execution in long-running tasks, complex engineering optimization, and real-world development scenarios, making it an ideal foundation for building autonomous agents and long-horizon coding agents.',
+ displayName: 'GLM-5.1',
+ id: 'glm-5.1',
+ maxOutput: 128_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 1.3,
+ '[0.032, infinity]': 2,
+ },
+ pricingParams: ['textInputRange'],
+ },
+ name: 'textInput_cacheRead',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 6,
+ '[0.032, infinity]': 8,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 24,
+ '[0.032, infinity]': 28,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
],
},
- releasedAt: '2025-08-22',
+ releasedAt: '2026-04-08',
settings: {
- searchImpl: 'params',
+ extendParams: ['enableReasoning'],
},
type: 'chat',
},
{
abilities: {
+ functionCall: true,
reasoning: true,
- search: true,
+ structuredOutput: true,
},
- contextWindowTokens: 92_000,
+ contextWindowTokens: 200_000,
description:
- 'Greatly improves hard math, logic, and coding, boosts output stability, and enhances long-text capability.',
- displayName: 'Hunyuan T1 20250711',
- id: 'hunyuan-t1-20250711',
- maxOutput: 64_000,
+ 'A model deeply optimized for real-world, long-chain agent tasks, with a focus on improving complex instruction decomposition, tool usage, scheduled continuous execution, and long-task stability.',
+ displayName: 'GLM-5-Turbo',
+ id: 'glm-5-turbo',
+ maxOutput: 128_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 1.2,
+ '[0.032, infinity]': 1.8,
+ },
+ pricingParams: ['textInputRange'],
+ },
+ name: 'textInput_cacheRead',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 5,
+ '[0.032, infinity]': 7,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 22,
+ '[0.032, infinity]': 26,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
],
},
- releasedAt: '2025-07-11',
+ releasedAt: '2026-03-16',
settings: {
- searchImpl: 'params',
+ extendParams: ['enableReasoning'],
},
type: 'chat',
},
{
abilities: {
+ functionCall: true,
reasoning: true,
- search: true,
},
- contextWindowTokens: 92_000,
+ contextWindowTokens: 200_000,
description:
- 'Improves creative writing and composition, strengthens frontend coding, math, and logic reasoning, and enhances instruction following.',
- displayName: 'Hunyuan T1 20250529',
- id: 'hunyuan-t1-20250529',
- maxOutput: 64_000,
+ 'GLM-5 is Zhipu’s new-generation flagship foundation model, designed for agentic engineering. It excels at complex systems engineering, long-horizon agent tasks, and programming, achieving state-of-the-art (SOTA) performance among open-source models in both coding and agent capabilities.',
+ displayName: 'GLM-5',
+ id: 'glm-5',
+ maxOutput: 128_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 1,
+ '[0.032, infinity]': 1.5,
+ },
+ pricingParams: ['textInputRange'],
+ },
+ name: 'textInput_cacheRead',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 4,
+ '[0.032, infinity]': 6,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 18,
+ '[0.032, infinity]': 22,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
],
},
- releasedAt: '2025-05-29',
+ releasedAt: '2026-02-11',
settings: {
- searchImpl: 'params',
+ extendParams: ['enableReasoning'],
},
type: 'chat',
},
{
abilities: {
+ functionCall: true,
reasoning: true,
- search: true,
+ structuredOutput: true,
+ vision: true,
+ video: true,
},
- contextWindowTokens: 92_000,
+ contextWindowTokens: 200_000,
description:
- 'Improves project-level code generation and writing quality, strengthens multi-turn topic understanding and ToB instruction following, improves word-level understanding, and reduces mixed simplified/traditional and Chinese/English output issues.',
- displayName: 'Hunyuan T1 20250403',
- id: 'hunyuan-t1-20250403',
- maxOutput: 64_000,
+ 'GLM-5V-Turbo is Zhipu’s first multimodal coding foundation model, designed for vision-based programming tasks. It natively handles multimodal inputs such as images, videos, and text, while excelling in long-horizon planning, complex programming, and action execution. Deeply optimized for agent workflows, it can collaborate seamlessly with agents like Claude Code and OpenClaw.',
+ displayName: 'GLM-5V-Turbo',
+ id: 'glm-5v-turbo',
+ maxOutput: 128_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 1.2,
+ '[0.032, infinity]': 1.8,
+ },
+ pricingParams: ['textInputRange'],
+ },
+ name: 'textInput_cacheRead',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 5,
+ '[0.032, infinity]': 7,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 22,
+ '[0.032, infinity]': 26,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
],
},
- releasedAt: '2025-04-03',
+ releasedAt: '2026-04-02',
settings: {
- searchImpl: 'params',
+ extendParams: ['enableReasoning'],
},
type: 'chat',
},
{
abilities: {
+ functionCall: true,
reasoning: true,
- search: true,
- },
- contextWindowTokens: 92_000,
- description:
- 'Builds balanced arts and STEM capabilities with strong long-text information capture. Supports reasoning answers for math, logic, science, and code problems across difficulty levels.',
- displayName: 'Hunyuan T1 20250321',
- id: 'hunyuan-t1-20250321',
- maxOutput: 64_000,
- pricing: {
- currency: 'CNY',
- units: [
- { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- releasedAt: '2025-03-21',
- settings: {
- searchImpl: 'params',
+ structuredOutput: true,
+ vision: true,
+ video: true,
},
- type: 'chat',
- },
- {
contextWindowTokens: 256_000,
description:
- 'Upgraded to an MoE architecture with a 256k context window, leading many open models across NLP, code, math, and industry benchmarks.',
- displayName: 'Hunyuan Lite',
- enabled: true,
- id: 'hunyuan-lite',
- maxOutput: 6000,
+ 'Kimi K2.6, as Kimi’s latest open-source model, delivers industry-leading (state-of-the-art) capabilities in coding, long-horizon task execution, and agent orchestration. K2.6 achieves breakthroughs in long-range coding tasks, demonstrating more reliable generalization across different programming languages (such as Rust, Go, and Python) and diverse task scenarios (including frontend development, DevOps, and performance optimization).',
+ displayName: 'Kimi K2.6',
+ id: 'kimi-k2.6',
+ maxOutput: 256_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput_cacheRead', rate: 1.1, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 6.5, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 27, strategy: 'fixed', unit: 'millionTokens' },
],
},
- releasedAt: '2024-10-30',
- type: 'chat',
- },
- {
- abilities: {
- search: true,
- },
- contextWindowTokens: 32_000,
- description:
- 'Uses improved routing to mitigate load balancing and expert collapse. Achieves 99.9% needle-in-a-haystack on long context. MOE-32K offers strong value while handling long inputs.',
- displayName: 'Hunyuan Standard',
- id: 'hunyuan-standard',
- maxOutput: 2000,
- pricing: {
- currency: 'CNY',
- units: [
- { name: 'textInput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- releasedAt: '2025-02-10',
+ releasedAt: '2026-04-20',
settings: {
- searchImpl: 'params',
+ extendParams: ['enableReasoning'],
},
type: 'chat',
},
{
abilities: {
- search: true,
+ functionCall: true,
+ reasoning: true,
+ structuredOutput: true,
+ vision: true,
+ video: true,
},
contextWindowTokens: 256_000,
description:
- 'Uses improved routing to mitigate load balancing and expert collapse. Achieves 99.9% needle-in-a-haystack on long context. MOE-256K further expands context length and quality.',
- displayName: 'Hunyuan Standard 256K',
- id: 'hunyuan-standard-256K',
- maxOutput: 6000,
+ 'Kimi K2.5 is Kimi’s most versatile model to date, featuring a natively multimodal architecture. It supports both visual and text inputs, thinking and non-thinking modes, as well as conversational and agent-based tasks.',
+ displayName: 'Kimi K2.5',
+ id: 'kimi-k2.5',
+ maxOutput: 256_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput_cacheRead', rate: 0.7, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 21, strategy: 'fixed', unit: 'millionTokens' },
],
},
- releasedAt: '2025-02-10',
+ releasedAt: '2026-01-27',
settings: {
- searchImpl: 'params',
+ extendParams: ['enableReasoning'],
},
type: 'chat',
},
{
abilities: {
- search: true,
+ functionCall: true,
+ reasoning: true,
},
- contextWindowTokens: 32_000,
+ contextWindowTokens: 200_000,
description:
- 'Hunyuan-large has ~389B total parameters and ~52B activated, the largest and strongest open MoE model in a Transformer architecture.',
- displayName: 'Hunyuan Large',
- id: 'hunyuan-large',
- maxOutput: 4000,
+ 'A self-evolving large language model developed by MiniMax, featuring strong software engineering capabilities and professional office productivity skills. It supports complex agent interactions and end-to-end project delivery.',
+ displayName: 'MiniMax-M2.7',
+ id: 'minimax-m2.7',
+ maxOutput: 128_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput_cacheRead', rate: 0.42, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 2.1, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 8.4, strategy: 'fixed', unit: 'millionTokens' },
],
},
- releasedAt: '2025-02-10',
- settings: {
- searchImpl: 'params',
- },
+ releasedAt: '2026-03-18',
type: 'chat',
},
{
abilities: {
- search: true,
+ functionCall: true,
+ reasoning: true,
},
- contextWindowTokens: 134_000,
+ contextWindowTokens: 200_000,
description:
- 'Excels at long-document tasks like summarization and QA while also handling general generation. Strong at long-text analysis and generation for complex, detailed content.',
- displayName: 'Hunyuan Large Longcontext',
- id: 'hunyuan-large-longcontext',
- maxOutput: 6000,
+ 'MiniMax-M2.5 achieves or sets new state-of-the-art performance across productivity scenarios such as programming, tool use and search, and office-related tasks.',
+ displayName: 'MiniMax-M2.5',
+ id: 'minimax-m2.5',
+ maxOutput: 128_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 18, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput_cacheRead', rate: 0.21, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 2.1, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 8.4, strategy: 'fixed', unit: 'millionTokens' },
],
},
- releasedAt: '2024-12-18',
- settings: {
- searchImpl: 'params',
- },
+ releasedAt: '2026-02-12',
type: 'chat',
},
{
abilities: {
functionCall: true,
- search: true,
+ reasoning: true,
+ structuredOutput: true,
},
- contextWindowTokens: 32_000,
+ contextWindowTokens: 1_000_000,
description:
- 'General experience improvements across NLP understanding, writing, chat, QA, translation, and domains; more human-like responses, better clarification on ambiguous intent, improved word parsing, higher creative quality and interactivity, and stronger multi-turn conversations.',
- displayName: 'Hunyuan Turbo',
- id: 'hunyuan-turbo-latest',
- maxOutput: 4000,
+ 'DeepSeek-V4-Flash is a production-grade model purpose-built for high concurrency and low latency. It features a standard 1M context window across the lineup, delivering near-flagship reasoning performance and outstanding agent response efficiency at extremely low cost.',
+ displayName: 'DeepSeek-V4-Flash',
+ id: 'deepseek-v4-flash',
+ maxOutput: 384_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 2.4, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 9.6, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput_cacheRead', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
],
},
- releasedAt: '2025-01-10',
+ releasedAt: '2026-04-24',
settings: {
- searchImpl: 'params',
+ extendParams: ['enableReasoning', 'deepseekV4ReasoningEffort'],
},
type: 'chat',
},
{
abilities: {
functionCall: true,
- search: true,
+ reasoning: true,
+ structuredOutput: true,
},
- contextWindowTokens: 32_000,
+ contextWindowTokens: 1_000_000,
description:
- 'This version boosts instruction scaling for better generalization, significantly improves math/code/logic reasoning, enhances word-level understanding, and improves writing quality.',
- displayName: 'Hunyuan Turbo 20241223',
- id: 'hunyuan-turbo-20241223',
- maxOutput: 4000,
+ 'DeepSeek-V4-Pro is a native multimodal flagship model with 1.6 trillion parameters. Powered by a novel CSA+HCA hybrid attention architecture, it represents the industry’s cutting edge in complex mathematical reasoning, long-horizon code engineering, and advanced agent collaboration.',
+ displayName: 'DeepSeek-V4-Pro',
+ id: 'deepseek-v4-pro',
+ maxOutput: 384_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 2.4, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 9.6, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput_cacheRead', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 24, strategy: 'fixed', unit: 'millionTokens' },
],
},
- releasedAt: '2025-01-10',
+ releasedAt: '2026-04-24',
settings: {
- searchImpl: 'params',
+ extendParams: ['enableReasoning', 'deepseekV4ReasoningEffort'],
},
type: 'chat',
},
{
abilities: {
functionCall: true,
- search: true,
+ reasoning: true,
+ structuredOutput: true,
},
- contextWindowTokens: 134_000,
+ contextWindowTokens: 128_000,
description:
- 'Excels at long-document tasks like summarization and QA while also handling general generation. Strong at long-text analysis and generation for complex, detailed content.',
- displayName: 'Hunyuan TurboS LongText 128K',
- id: 'hunyuan-turbos-longtext-128k-20250325',
- maxOutput: 6000,
+ 'DeepSeek-V3.2 is a 685B-parameter MoE (Mixture-of-Experts) model. It introduces a sparse attention architecture that improves efficiency in long-context processing and achieves GPT-5-level performance on reasoning benchmarks.',
+ displayName: 'Deepseek-v3.2',
+ id: 'deepseek-v3.2',
+ maxOutput: 32_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
],
},
- releasedAt: '2025-03-25',
+ releasedAt: '2025-12-02',
settings: {
- searchImpl: 'params',
+ extendParams: ['enableReasoning'],
},
type: 'chat',
},
{
abilities: {
functionCall: true,
- search: true,
+ reasoning: true,
+ structuredOutput: true,
},
- contextWindowTokens: 44_000,
+ contextWindowTokens: 128_000,
description:
- 'The latest Hunyuan TurboS flagship model with stronger reasoning and a better overall experience.',
- displayName: 'Hunyuan TurboS',
- id: 'hunyuan-turbos-latest',
- maxOutput: 16_000,
+ 'DeepSeek-V3.1-Terminus is a 685B-parameter MoE (Mixture-of-Experts) model. While retaining the core capabilities of its predecessor, it improves language consistency and agent-related performance, delivering more stable outputs compared to the previous version.',
+ displayName: 'Deepseek-v3.1',
+ id: 'deepseek-v3.1',
+ maxOutput: 32_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 0.8, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
],
},
- releasedAt: '2025-07-16',
+ releasedAt: '2025-09-23',
settings: {
- searchImpl: 'params',
+ extendParams: ['enableReasoning'],
},
type: 'chat',
},
{
abilities: {
- vision: true,
+ functionCall: true,
+ reasoning: true,
+ structuredOutput: true,
},
- contextWindowTokens: 40_000,
+ contextWindowTokens: 128_000,
description:
- 'A fast-thinking image-to-text model built on the TurboS text base, showing notable improvements over the previous version in fundamental image recognition and image analysis reasoning.',
- displayName: 'Hunyuan Vision 1.5 Instruct',
- id: 'hunyuan-vision-1.5-instruct',
+ 'DeepSeek-R1-0528 is a 671B-parameter model. With architectural optimizations and upgraded training strategies, it delivers significant improvements over the previous version in code generation, long-context processing, and complex reasoning tasks.',
+ displayName: 'Deepseek-r1-0528',
+ id: 'deepseek-r1-0528',
maxOutput: 16_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 9, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 16, strategy: 'fixed', unit: 'millionTokens' },
],
},
- releasedAt: '2025-12-17',
+ releasedAt: '2025-05-28',
type: 'chat',
},
{
abilities: {
- reasoning: true,
- vision: true,
+ functionCall: true,
},
- contextWindowTokens: 48_000,
+ contextWindowTokens: 128_000,
description:
- 'Latest t1-vision deep reasoning model with major improvements in VQA, visual grounding, OCR, charts, solving photographed problems, and image-based creation, plus stronger English and low-resource languages.',
- displayName: 'Hunyuan T1 Vision 20250916',
- id: 'hunyuan-t1-vision-20250916',
- maxOutput: 20_000,
+ 'DeepSeek-V3-0324 is a 671B-parameter MoE (Mixture-of-Experts) model. It demonstrates strong advantages in programming and technical capabilities, as well as in contextual understanding and long-form text processing.',
+ displayName: 'Deepseek-v3-0324',
+ id: 'deepseek-v3-0324',
+ maxOutput: 16_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 9, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
],
},
- releasedAt: '2025-09-16',
+ releasedAt: '2025-03-25',
type: 'chat',
},
{
abilities: {
- video: true,
vision: true,
+ video: true,
},
- contextWindowTokens: 32_000,
+ contextWindowTokens: 256_000,
description:
- 'Applicable to video understanding scenarios. Release features: Based on the **Hunyuan Turbos-Vision** video understanding model, supporting fundamental video understanding capabilities such as video description and video content question answering.',
- displayName: 'Hunyuan Turbos Vision Video',
- id: 'hunyuan-turbos-vision-video',
- maxOutput: 8_000,
+ 'VITA is a multimodal understanding model that supports analysis of video and image content. It can be used for tasks such as video structure parsing and image object detection.',
+ displayName: 'YT-VITA',
+ id: 'youtu-vita',
+ maxOutput: 256_000,
pricing: {
currency: 'CNY',
units: [
- { name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 9, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textInput', rate: 1.2, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 3.5, strategy: 'fixed', unit: 'millionTokens' },
],
},
- releasedAt: '2025-07-28',
+ releasedAt: '2026-01-10',
type: 'chat',
},
];
@@ -516,10 +684,10 @@ const hunyuanChatModels: AIChatModelCard[] = [
const hunyuanImageModels: AIImageModelCard[] = [
{
description:
- 'Powerful original-image feature extraction and detail preservation capabilities, delivering richer visual texture and producing high-accuracy, well-composed, production-grade visuals.',
+ 'Based on the Hunyuan large model, it is capable of reasoning about image layout, composition, and brushwork, using world knowledge to infer commonsense visual scenes. It can also interpret complex semantics at the scale of thousands of characters, generate long-form textual content, complex comics, memes, and produce vivid and engaging educational illustrations.',
displayName: 'HY-Image-V3.0',
enabled: true,
- id: 'HY-Image-V3.0',
+ id: 'hy-image-v3.0',
parameters: {
height: { default: 1024, max: 2048, min: 512, step: 1 },
imageUrls: { default: [], maxCount: 3 },
@@ -535,11 +703,84 @@ const hunyuanImageModels: AIImageModelCard[] = [
currency: 'CNY',
units: [{ name: 'imageGeneration', rate: 0.2, strategy: 'fixed', unit: 'image' }],
},
- releasedAt: '2026-01-26',
+ releasedAt: '2026-03-10',
type: 'image',
},
+ {
+ description:
+ 'It adopts an ultra-high compression codec to enable fast image generation while maintaining high-quality output. It supports use cases such as e-commerce product image enhancement, design asset generation for creative tools, and iterative game scene development.',
+ displayName: 'HY-Image-Lite',
+ enabled: true,
+ id: 'hy-image-lite',
+ parameters: {
+ height: { default: 1024, max: 4096, min: 160, step: 1 },
+ prompt: {
+ default: '',
+ },
+ seed: { default: null },
+ width: { default: 1024, max: 4096, min: 160, step: 1 },
+ watermark: { default: false },
+ },
+ pricing: {
+ currency: 'CNY',
+ units: [{ name: 'imageGeneration', rate: 0.099, strategy: 'fixed', unit: 'image' }],
+ },
+ releasedAt: '2025-09-12',
+ type: 'image',
+ },
+];
+
+const hunyuanVideoModels: AIVideoModelCard[] = [
+ {
+ description:
+ 'It supports multimodal inputs including text and images to generate high-quality videos, enabling scene transitions and multi-character interactions. It streamlines production workflows and reduces costs, making it suitable for enterprise advertising, marketing, and individual creative applications.',
+ displayName: 'HY-Video-1.5',
+ enabled: true,
+ id: 'hy-video-1.5',
+ parameters: {
+ imageUrl: {
+ default: null,
+ },
+ prompt: { default: '' },
+ resolution: {
+ default: '720p',
+ enum: ['720p', '1080p'],
+ },
+ watermark: { default: false },
+ },
+ pricing: {
+ currency: 'CNY',
+ units: [{ name: 'videoGeneration', rate: 1.5, strategy: 'fixed', unit: 'second' }],
+ },
+ releasedAt: '2026-01-06',
+ type: 'video',
+ },
+ {
+ description:
+ 'It generates highly temporally consistent videos from images, suitable for demanding applications such as advertising, film clips, and product showcase videos.',
+ displayName: 'YT-Video-2.0',
+ enabled: true,
+ id: 'yt-video-2.0',
+ parameters: {
+ imageUrl: {
+ default: null,
+ },
+ prompt: { default: '' },
+ resolution: {
+ default: '720p',
+ enum: ['480p', '720p', '1080p'],
+ },
+ watermark: { default: false },
+ },
+ pricing: {
+ currency: 'CNY',
+ units: [{ name: 'videoGeneration', rate: 5, strategy: 'fixed', unit: 'second' }],
+ },
+ releasedAt: '2025-11-27',
+ type: 'video',
+ },
];
-export const allModels = [...hunyuanChatModels, ...hunyuanImageModels];
+export const allModels = [...hunyuanChatModels, ...hunyuanImageModels, ...hunyuanVideoModels];
export default allModels;
diff --git a/packages/model-bank/src/modelProviders/hunyuan.ts b/packages/model-bank/src/modelProviders/hunyuan.ts
index 6f65dac3c16..7dbfe70ab50 100644
--- a/packages/model-bank/src/modelProviders/hunyuan.ts
+++ b/packages/model-bank/src/modelProviders/hunyuan.ts
@@ -3,21 +3,21 @@ import type { ModelProviderCard } from '@/types/llm';
// ref https://cloud.tencent.com/document/product/1729/104753
const Hunyuan: ModelProviderCard = {
chatModels: [],
- checkModel: 'hunyuan-t1-latest',
+ checkModel: 'hunyuan-role-latest',
description:
'A Tencent-developed LLM with strong Chinese writing, solid reasoning in complex contexts, and reliable task execution.',
disableBrowserRequest: true,
id: 'hunyuan',
- modelList: { showModelFetcher: true },
- modelsUrl: 'https://cloud.tencent.com/document/product/1729/104753',
+ modelList: { showModelFetcher: false },
+ modelsUrl: 'https://console.cloud.tencent.com/tokenhub/models',
name: 'Hunyuan',
settings: {
disableBrowserRequest: true,
proxyUrl: {
- placeholder: 'https://api.hunyuan.cloud.tencent.com/v1',
+ placeholder: 'https://tokenhub.tencentmaas.com/v1',
},
sdkType: 'openai',
- showModelFetcher: true,
+ showModelFetcher: false,
},
url: 'https://hunyuan.tencent.com',
};
diff --git a/packages/model-bank/src/types/aiModel.ts b/packages/model-bank/src/types/aiModel.ts
index 98593fbf15a..ee8424d82a9 100644
--- a/packages/model-bank/src/types/aiModel.ts
+++ b/packages/model-bank/src/types/aiModel.ts
@@ -254,6 +254,7 @@ export type ExtendParamsType =
| 'gpt5_2ReasoningEffort'
| 'gpt5_2ProReasoningEffort'
| 'grok4_20ReasoningEffort'
+ | 'hy3ReasoningEffort'
| 'deepseekV4ReasoningEffort'
| 'codexMaxReasoningEffort'
| 'opus47Effort'
@@ -312,6 +313,7 @@ export const ExtendParamsTypeSchema = z.enum([
'gpt5_2ReasoningEffort',
'gpt5_2ProReasoningEffort',
'grok4_20ReasoningEffort',
+ 'hy3ReasoningEffort',
'deepseekV4ReasoningEffort',
'codexMaxReasoningEffort',
'opus47Effort',
diff --git a/packages/model-runtime/src/providers/hunyuan/createImage.test.ts b/packages/model-runtime/src/providers/hunyuan/createImage.test.ts
index d671694dfd2..301eb2f127e 100644
--- a/packages/model-runtime/src/providers/hunyuan/createImage.test.ts
+++ b/packages/model-runtime/src/providers/hunyuan/createImage.test.ts
@@ -25,24 +25,60 @@ afterEach(() => {
describe('createHunyuanImage', () => {
describe('Success scenarios', () => {
+ it('should successfully generate image with lite model', async () => {
+ const mockImageUrl = 'https://hyimg.tencentmaas.com/test/lite.png';
+
+ global.fetch = vi.fn().mockResolvedValueOnce({
+ ok: true,
+ json: async () => ({
+ created: 1774806537,
+ request_id: 'req-lite-123',
+ data: [{ url: mockImageUrl }],
+ }),
+ });
+
+ const payload: CreateImagePayload = {
+ model: 'HY-Image-Lite',
+ params: {
+ prompt: '雨中, 竹林, 小路',
+ },
+ };
+
+ const result = await createHunyuanImage(payload, mockOptions);
+
+ const submitCall = (fetch as any).mock.calls[0];
+ expect(submitCall[0]).toBe('https://api.cloudai.tencent.com/v1/api/image/lite');
+ const submitBody = JSON.parse(submitCall[1].body);
+ expect(submitBody).toEqual({
+ model: 'HY-Image-Lite',
+ prompt: '雨中, 竹林, 小路',
+ resolution: '1024:1024',
+ rsp_img_type: 'url',
+ });
+
+ expect(result).toEqual({
+ imageUrl: mockImageUrl,
+ });
+ });
+
it('should successfully generate image with basic prompt', async () => {
- const mockJobId = '1301052320-1774048771-3ff52e2c-24b3-11f1-aca3-525400cc0b9a-0';
- const mockImageUrl = 'https://aiart-1258344699.cos.ap-guangzhou.myqcloud.com/test/image.png';
+ const mockJobId = '251*************0';
+ const mockImageUrl = 'https://****965e';
global.fetch = vi
.fn()
.mockResolvedValueOnce({
ok: true,
json: async () => ({
+ id: mockJobId,
request_id: 'req-123',
- job_id: mockJobId,
}),
})
.mockResolvedValueOnce({
ok: true,
json: async () => ({
request_id: 'req-456',
- status: '5',
+ status: 'completed',
data: [{ url: mockImageUrl }],
}),
});
@@ -50,7 +86,7 @@ describe('createHunyuanImage', () => {
const payload: CreateImagePayload = {
model: 'HY-Image-V3.0',
params: {
- prompt: '生成一个可爱猫猫',
+ prompt: '在图片中增加一个橘猫',
},
};
@@ -59,22 +95,18 @@ describe('createHunyuanImage', () => {
const result = await resultPromise;
const submitCall = (fetch as any).mock.calls[0];
- expect(submitCall[0]).toBe('https://api.cloudai.tencent.com/v1/aiart/submit');
+ expect(submitCall[0]).toBe('https://api.cloudai.tencent.com/v1/api/image/submit');
const submitBody = JSON.parse(submitCall[1].body);
expect(submitBody).toEqual({
model: 'HY-Image-V3.0',
- prompt: '生成一个可爱猫猫',
- size: '1024:1024',
- extra_body: {
- logo_add: 0,
- revise: 0,
- },
+ prompt: '在图片中增加一个橘猫',
+ resolution: '1024:1024',
});
const queryCall = (fetch as any).mock.calls[1];
- expect(queryCall[0]).toBe('https://api.cloudai.tencent.com/v1/aiart/query');
+ expect(queryCall[0]).toBe('https://api.cloudai.tencent.com/v1/api/image/query');
const queryBody = JSON.parse(queryCall[1].body);
- expect(queryBody).toEqual({ job_id: mockJobId });
+ expect(queryBody).toEqual({ model: 'HY-Image-V3.0', id: mockJobId });
expect(result).toEqual({
imageUrl: mockImageUrl,
@@ -89,12 +121,12 @@ describe('createHunyuanImage', () => {
.fn()
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ job_id: mockJobId }),
+ json: async () => ({ id: mockJobId }),
})
.mockResolvedValueOnce({
ok: true,
json: async () => ({
- status: '5',
+ status: 'completed',
data: [{ url: mockImageUrl }],
}),
});
@@ -112,7 +144,7 @@ describe('createHunyuanImage', () => {
const result = await resultPromise;
const submitBody = JSON.parse((fetch as any).mock.calls[0][1].body);
- expect(submitBody.size).toBe('1024:1024');
+ expect(submitBody.resolution).toBe('1024:1024');
expect(result.imageUrl).toBe(mockImageUrl);
});
@@ -124,12 +156,12 @@ describe('createHunyuanImage', () => {
.fn()
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ job_id: mockJobId }),
+ json: async () => ({ id: mockJobId }),
})
.mockResolvedValueOnce({
ok: true,
json: async () => ({
- status: '5',
+ status: 'completed',
data: [{ url: mockImageUrl }],
}),
});
@@ -148,7 +180,7 @@ describe('createHunyuanImage', () => {
const result = await resultPromise;
const submitBody = JSON.parse((fetch as any).mock.calls[0][1].body);
- expect(submitBody.size).toBe('1024:768');
+ expect(submitBody.resolution).toBe('1024:768');
expect(result.imageUrl).toBe(mockImageUrl);
});
@@ -160,12 +192,12 @@ describe('createHunyuanImage', () => {
.fn()
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ job_id: mockJobId }),
+ json: async () => ({ id: mockJobId }),
})
.mockResolvedValueOnce({
ok: true,
json: async () => ({
- status: '5',
+ status: 'completed',
data: [{ url: mockImageUrl }],
}),
});
@@ -183,7 +215,7 @@ describe('createHunyuanImage', () => {
await resultPromise;
const submitBody = JSON.parse((fetch as any).mock.calls[0][1].body);
- expect(submitBody.extra_body.seed).toBe(84445);
+ expect(submitBody.seed).toBe(84445);
});
it('should handle imageUrls for image-to-image', async () => {
@@ -194,12 +226,12 @@ describe('createHunyuanImage', () => {
.fn()
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ job_id: mockJobId }),
+ json: async () => ({ id: mockJobId }),
})
.mockResolvedValueOnce({
ok: true,
json: async () => ({
- status: '5',
+ status: 'completed',
data: [{ url: mockImageUrl }],
}),
});
@@ -229,20 +261,20 @@ describe('createHunyuanImage', () => {
.fn()
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ job_id: mockJobId }),
+ json: async () => ({ id: mockJobId }),
})
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ status: '1' }),
+ json: async () => ({ status: 'queued' }),
})
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ status: '2' }),
+ json: async () => ({ status: 'processing' }),
})
.mockResolvedValueOnce({
ok: true,
json: async () => ({
- status: '5',
+ status: 'completed',
data: [{ url: mockImageUrl }],
}),
});
@@ -294,7 +326,7 @@ describe('createHunyuanImage', () => {
ok: true,
json: async () => ({
request_id: 'req-123',
- job_id: '',
+ id: '',
error: {
message: '图片下载错误。',
type: 'api_error',
@@ -316,7 +348,7 @@ describe('createHunyuanImage', () => {
);
});
- it('should handle missing job_id', async () => {
+ it('should handle missing job id', async () => {
global.fetch = vi.fn().mockResolvedValueOnce({
ok: true,
json: async () => ({ request_id: 'req-123' }),
@@ -339,9 +371,7 @@ describe('createHunyuanImage', () => {
global.fetch = vi.fn().mockResolvedValueOnce({
ok: false,
status: 400,
- json: async () => ({
- message: 'Invalid prompt',
- }),
+ json: async () => ({ message: 'Invalid prompt' }),
});
const payload: CreateImagePayload = {
@@ -366,7 +396,7 @@ describe('createHunyuanImage', () => {
.fn()
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ job_id: mockJobId }),
+ json: async () => ({ id: mockJobId }),
})
.mockResolvedValueOnce({
ok: true,
@@ -404,7 +434,7 @@ describe('createHunyuanImage', () => {
.fn()
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ job_id: mockJobId }),
+ json: async () => ({ id: mockJobId }),
})
.mockResolvedValueOnce({
ok: true,
@@ -436,11 +466,11 @@ describe('createHunyuanImage', () => {
.fn()
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ job_id: mockJobId }),
+ json: async () => ({ id: mockJobId }),
})
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ status: '4' }),
+ json: async () => ({ status: 'failed' }),
});
const payload: CreateImagePayload = {
@@ -468,11 +498,11 @@ describe('createHunyuanImage', () => {
.fn()
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ job_id: mockJobId }),
+ json: async () => ({ id: mockJobId }),
})
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ status: '5', data: null }),
+ json: async () => ({ status: 'completed', data: null }),
});
const payload: CreateImagePayload = {
@@ -500,11 +530,11 @@ describe('createHunyuanImage', () => {
.fn()
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ job_id: mockJobId }),
+ json: async () => ({ id: mockJobId }),
})
.mockResolvedValueOnce({
ok: true,
- json: async () => ({ status: '5', data: [] }),
+ json: async () => ({ status: 'completed', data: [] }),
});
const payload: CreateImagePayload = {
diff --git a/packages/model-runtime/src/providers/hunyuan/createImage.ts b/packages/model-runtime/src/providers/hunyuan/createImage.ts
index f73f1e13f13..d9550b1c7dc 100644
--- a/packages/model-runtime/src/providers/hunyuan/createImage.ts
+++ b/packages/model-runtime/src/providers/hunyuan/createImage.ts
@@ -13,6 +13,7 @@ interface HunyuanImageSubmitResponse {
message?: string;
type?: string;
};
+ id?: string;
job_id?: string;
request_id?: string;
}
@@ -20,27 +21,21 @@ interface HunyuanImageSubmitResponse {
interface HunyuanImageQueryResponse {
data?: Array<{
url: string;
+ revised_prompt?: string;
}> | null;
error?: {
code?: string;
message?: string;
type?: string;
};
+ object?: string;
request_id?: string;
status?: string;
}
-// Hunyuan3.0 ImageGen Status Code
-// https://cloud.tencent.com/document/product/1668/124633
-const getStatusName = (status: string): string => {
- const statusMap: Record<string, string> = {
- '1': 'PENDING',
- '2': 'PROCESSING',
- '4': 'FAILED',
- '5': 'COMPLETED',
- };
- return statusMap[status] || `UNKNOWN(${status})`;
-};
+const normalizeModel = (model: string): string => model?.toLowerCase() ?? '';
+
+const isLiteModel = (model: string): boolean => normalizeModel(model).includes('hy-image-lite');
export async function createHunyuanImage(
payload: CreateImagePayload,
@@ -49,39 +44,90 @@ export async function createHunyuanImage(
const { apiKey, provider } = options;
const { model, params } = payload;
- // Hunyuan3.0 ImageGen BaseURL
- // https://cloud.tencent.com/document/product/1668/129429
- const baseURL = options.baseURL || 'https://api.cloudai.tencent.com/v1';
+ const baseURL = options.baseURL || 'https://tokenhub.tencentmaas.com/v1';
try {
log('Starting Hunyuan image generation with model: %s and params: %O', model, params);
- const submitUrl = `${baseURL}/aiart/submit`;
- const submitBody: Record<string, any> = {
+ const requestBody: Record<string, any> = {
model,
prompt: params.prompt,
...(params.width && params.height
- ? { size: `${params.width}:${params.height}` }
+ ? { resolution: `${params.width}:${params.height}` }
: params.size
- ? { size: params.size.replace('x', ':') }
- : { size: '1024:1024' }),
+ ? { resolution: params.size.replace(/x/i, ':') }
+ : { resolution: '1024:1024' }),
...(params.imageUrls && params.imageUrls.length > 0
? { images: params.imageUrls }
: params.imageUrl
? { images: [params.imageUrl] }
: {}),
- extra_body: {
- revise: params.promptExtend === true ? 1 : 0, // Prompt optimization switch, default is 0 (no optimization)
- logo_add: params.watermark === true ? 1 : 0, // Watermark switch, default is 0 (no watermark)
- ...(typeof params.seed === 'number' ? { seed: params.seed } : {}),
- },
+ ...(params.promptExtend && { revise: params.promptExtend === true ? 1 : 0 }),
+ ...(params.watermark && { logo_add: params.watermark === true ? 1 : 0 }),
+ ...(typeof params.seed === 'number' ? { seed: params.seed } : {}),
+ ...(isLiteModel(model) ? { rsp_img_type: 'url' } : {}),
};
+ if (isLiteModel(model)) {
+ const submitUrl = `${baseURL}/api/image/lite`;
+ log('Submitting lite image task to: %s', submitUrl);
+ log('Submit body: %O', requestBody);
+
+ const submitResponse = await fetch(submitUrl, {
+ body: JSON.stringify(requestBody),
+ headers: {
+ 'Authorization': `Bearer ${apiKey}`,
+ 'Content-Type': 'application/json',
+ },
+ method: 'POST',
+ });
+
+ if (!submitResponse.ok) {
+ let errorData;
+ try {
+ errorData = await submitResponse.json();
+ } catch (error) {
+ void error;
+ }
+
+ const errorMessage =
+ typeof errorData?.error?.message === 'string'
+ ? errorData.error.message
+ : typeof errorData?.message === 'string'
+ ? errorData.message
+ : JSON.stringify(errorData || submitResponse.statusText);
+
+ throw new Error(
+ `Hunyuan API lite submit error (${submitResponse.status}): ${errorMessage}`,
+ );
+ }
+
+ const submitData: HunyuanImageQueryResponse = await submitResponse.json();
+ log('Lite submit response: %O', submitData);
+
+ if (submitData.error?.message) {
+ throw new Error(`Hunyuan API error: ${submitData.error.message}`);
+ }
+
+ if (!submitData.data || !Array.isArray(submitData.data) || submitData.data.length === 0) {
+ throw new Error('Lite image task returned no images');
+ }
+
+ const imageUrl = submitData.data[0].url;
+ if (!imageUrl) {
+ throw new Error('No valid image URL in lite response');
+ }
+
+ log('Lite image generation completed successfully: %s', imageUrl);
+ return { imageUrl };
+ }
+
+ const submitUrl = `${baseURL}/api/image/submit`;
log('Submitting task to: %s', submitUrl);
- log('Submit body: %O', submitBody);
+ log('Submit body: %O', requestBody);
const submitResponse = await fetch(submitUrl, {
- body: JSON.stringify(submitBody),
+ body: JSON.stringify(requestBody),
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
@@ -114,16 +160,16 @@ export async function createHunyuanImage(
throw new Error(`Hunyuan API error: ${submitData.error.message}`);
}
- if (!submitData.job_id) {
+ const jobId = submitData.id || submitData.job_id;
+ if (!jobId) {
throw new Error(
- `No job_id returned from submit endpoint. Response: ${JSON.stringify(submitData)}`,
+ `No job id returned from submit endpoint. Response: ${JSON.stringify(submitData)}`,
);
}
- const jobId = submitData.job_id;
- log('Task submitted successfully, job_id: %s', jobId);
+ log('Task submitted successfully, job id: %s', jobId);
- const queryUrl = `${baseURL}/aiart/query`;
+ const queryUrl = `${baseURL}/api/image/query`;
const result = await asyncifyPolling<HunyuanImageQueryResponse, CreateImageResponse>({
checkStatus: (taskStatus: HunyuanImageQueryResponse): any => {
@@ -139,7 +185,6 @@ export async function createHunyuanImage(
const status = taskStatus.status;
- // Status return an empty string if query got an error
if (!status) {
return {
error: new Error('Invalid query response: missing status'),
@@ -147,10 +192,9 @@ export async function createHunyuanImage(
};
}
- log('Task status: %s', getStatusName(status));
+ log('Task status: %s', status);
- // Task completed
- if (status === '5') {
+ if (status === 'completed') {
if (!taskStatus.data || !Array.isArray(taskStatus.data) || taskStatus.data.length === 0) {
return {
error: new Error('Task completed but no images generated'),
@@ -173,8 +217,7 @@ export async function createHunyuanImage(
};
}
- // Task failed
- if (status === '4') {
+ if (status === 'failed') {
return {
error: new Error('Task failed'),
status: 'failed',
@@ -190,10 +233,10 @@ export async function createHunyuanImage(
maxConsecutiveFailures: 5,
maxRetries: 60,
pollingQuery: async () => {
- log('Polling task status for job_id: %s', jobId);
+ log('Polling task status for job id: %s', jobId);
const queryResponse = await fetch(queryUrl, {
- body: JSON.stringify({ job_id: jobId }),
+ body: JSON.stringify({ model, id: jobId }),
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json',
diff --git a/packages/model-runtime/src/providers/hunyuan/createVideo.test.ts b/packages/model-runtime/src/providers/hunyuan/createVideo.test.ts
new file mode 100644
index 00000000000..fe0607a420d
--- /dev/null
+++ b/packages/model-runtime/src/providers/hunyuan/createVideo.test.ts
@@ -0,0 +1,117 @@
+// @vitest-environment node
+import { beforeEach, describe, expect, it, vi } from 'vitest';
+
+import type { CreateVideoOptions } from '../../core/openaiCompatibleFactory';
+import type { CreateVideoPayload } from '../../types/video';
+import { createHunyuanVideo, pollHunyuanVideoStatus, queryHunyuanVideoStatus } from './createVideo';
+
+vi.mock('debug', () => ({
+ default: vi.fn(() => vi.fn()),
+}));
+
+describe('createHunyuanVideo', () => {
+ const mockOptions: CreateVideoOptions = {
+ apiKey: 'test-api-key',
+ baseURL: 'https://tokenhub.tencentmaas.com/v1',
+ provider: 'hunyuan',
+ };
+
+ beforeEach(() => {
+ vi.clearAllMocks();
+ });
+
+ it('should create a text-to-video task', async () => {
+ global.fetch = vi.fn().mockResolvedValueOnce({
+ ok: true,
+ json: async () => ({ id: 'video-task-1', request_id: 'req-1' }),
+ });
+
+ const payload: CreateVideoPayload = {
+ model: 'hy-video-1.5',
+ params: {
+ prompt: '一只小狗',
+ },
+ };
+
+ const result = await createHunyuanVideo(payload, mockOptions);
+
+ expect(result.inferenceId).toBe('hy-video-1.5::video-task-1');
+ expect((global.fetch as any).mock.calls[0][0]).toBe(
+ 'https://tokenhub.tencentmaas.com/v1/api/video/submit',
+ );
+ expect(JSON.parse((global.fetch as any).mock.calls[0][1].body)).toEqual({
+ model: 'hy-video-1.5',
+ prompt: '一只小狗',
+ });
+ });
+});
+
+describe('Hunyuan video status helpers', () => {
+ const apiKey = 'test-api-key';
+ const baseURL = 'https://tokenhub.tencentmaas.com/v1';
+
+ it('should query status with model and id from inferenceId', async () => {
+ global.fetch = vi.fn().mockResolvedValueOnce({
+ ok: true,
+ json: async () => ({
+ request_id: 'req-2',
+ object: 'video',
+ status: 'queued',
+ }),
+ });
+
+ const result = await queryHunyuanVideoStatus('hy-video-1.5::video-task-4', apiKey, baseURL);
+
+ expect((global.fetch as any).mock.calls[0][0]).toBe(
+ 'https://tokenhub.tencentmaas.com/v1/api/video/query',
+ );
+ expect(JSON.parse((global.fetch as any).mock.calls[0][1].body)).toEqual({
+ model: 'hy-video-1.5',
+ id: 'video-task-4',
+ });
+ expect(result).toEqual({ request_id: 'req-2', object: 'video', status: 'queued' });
+ });
+
+ it('should return success when query completes', async () => {
+ global.fetch = vi.fn().mockResolvedValueOnce({
+ ok: true,
+ json: async () => ({
+ request_id: 'req-3',
+ status: 'completed',
+ data: { url: 'https://example.com/video.mp4' },
+ }),
+ });
+
+ const result = await pollHunyuanVideoStatus('hy-video-1.5::video-task-5', apiKey, baseURL);
+
+ expect(result).toEqual({ status: 'success', videoUrl: 'https://example.com/video.mp4' });
+ });
+
+ it('should return pending for queued status', async () => {
+ global.fetch = vi.fn().mockResolvedValueOnce({
+ ok: true,
+ json: async () => ({
+ request_id: 'req-4',
+ status: 'queued',
+ }),
+ });
+
+ const result = await pollHunyuanVideoStatus('hy-video-1.5::video-task-6', apiKey, baseURL);
+
+ expect(result).toEqual({ status: 'pending' });
+ });
+
+ it('should return failed when query returns failed', async () => {
+ global.fetch = vi.fn().mockResolvedValueOnce({
+ ok: true,
+ json: async () => ({
+ request_id: 'req-5',
+ status: 'failed',
+ }),
+ });
+
+ const result = await pollHunyuanVideoStatus('hy-video-1.5::video-task-7', apiKey, baseURL);
+
+ expect(result).toEqual({ status: 'failed', error: 'Video generation failed' });
+ });
+});
diff --git a/packages/model-runtime/src/providers/hunyuan/createVideo.ts b/packages/model-runtime/src/providers/hunyuan/createVideo.ts
new file mode 100644
index 00000000000..884b1e0c6aa
--- /dev/null
+++ b/packages/model-runtime/src/providers/hunyuan/createVideo.ts
@@ -0,0 +1,200 @@
+import createDebug from 'debug';
+
+import type { CreateVideoOptions } from '../../core/openaiCompatibleFactory';
+import type {
+ CreateVideoPayload,
+ CreateVideoResponse,
+ PollVideoStatusResult,
+} from '../../types/video';
+
+const log = createDebug('lobe-video:hunyuan');
+const INFERENCE_ID_SEPARATOR = '::';
+
+interface HunyuanVideoSubmitResponse {
+ created_at?: number;
+ error?: {
+ code?: string;
+ message?: string;
+ type?: string;
+ };
+ id?: string;
+ object?: string;
+ request_id?: string;
+ status?: string;
+}
+
+interface HunyuanVideoQueryResponse {
+ completed_at?: number;
+ created_at?: number;
+ data?: {
+ url?: string;
+ } | null;
+ error?: {
+ code?: string;
+ message?: string;
+ type?: string;
+ };
+ object?: string;
+ progress?: number;
+ request_id?: string;
+ status?: string;
+ url?: string;
+}
+
+const buildInferenceId = (model: string, taskId: string) =>
+ `${model}${INFERENCE_ID_SEPARATOR}${taskId}`;
+
+const parseInferenceId = (inferenceId: string) => {
+ const [model, id] = inferenceId.split(INFERENCE_ID_SEPARATOR);
+ if (!id) {
+ return { model: undefined, id: inferenceId };
+ }
+ return { model, id };
+};
+
+export async function createHunyuanVideo(
+ payload: CreateVideoPayload,
+ options: CreateVideoOptions,
+): Promise<CreateVideoResponse> {
+ const { apiKey } = options;
+ const { model, params } = payload;
+ const { prompt, imageUrl, resolution, watermark } = params;
+
+ const baseURL = options.baseURL || 'https://tokenhub.tencentmaas.com/v1';
+
+ log('Starting Hunyuan video generation with model: %s and params: %O', model, params);
+
+ const requestBody: Record<string, unknown> = {
+ model,
+ prompt,
+ ...(imageUrl ? { image: { url: imageUrl } } : {}),
+ ...(resolution && { resolution }),
+ ...(watermark && { logo_add: watermark === true ? 1 : 0 }),
+ };
+
+ const submitUrl = `${baseURL}/api/video/submit`;
+ log('Submitting Hunyuan video task to: %s', submitUrl);
+ log('Submit body: %O', requestBody);
+
+ const submitResponse = await fetch(submitUrl, {
+ body: JSON.stringify(requestBody),
+ headers: {
+ 'Authorization': `Bearer ${apiKey}`,
+ 'Content-Type': 'application/json',
+ },
+ method: 'POST',
+ });
+
+ if (!submitResponse.ok) {
+ let errorData;
+ try {
+ errorData = await submitResponse.json();
+ } catch (error) {
+ void error;
+ }
+
+ const errorMessage =
+ typeof errorData?.error?.message === 'string'
+ ? errorData.error.message
+ : typeof errorData?.message === 'string'
+ ? errorData.message
+ : JSON.stringify(errorData || submitResponse.statusText);
+
+ throw new Error(`Hunyuan API video submit error (${submitResponse.status}): ${errorMessage}`);
+ }
+
+ const submitData: HunyuanVideoSubmitResponse = await submitResponse.json();
+ log('Submit response: %O', submitData);
+
+ if (submitData.error?.message) {
+ throw new Error(`Hunyuan API error: ${submitData.error.message}`);
+ }
+
+ const taskId = submitData.id;
+ if (!taskId) {
+ throw new Error(
+ `No task id returned from submit endpoint. Response: ${JSON.stringify(submitData)}`,
+ );
+ }
+
+ const inferenceId = buildInferenceId(model, taskId);
+ log('Video task submitted successfully, inferenceId: %s', inferenceId);
+ return { inferenceId };
+}
+
+export async function queryHunyuanVideoStatus(
+ inferenceId: string,
+ apiKey: string,
+ baseUrl: string,
+): Promise<HunyuanVideoQueryResponse> {
+ const { model, id } = parseInferenceId(inferenceId);
+ const queryUrl = `${baseUrl || 'https://tokenhub.tencentmaas.com/v1'}/api/video/query`;
+
+ log('Querying Hunyuan video status for inferenceId: %s', inferenceId);
+
+ const queryBody: Record<string, unknown> = { id };
+ if (model) {
+ queryBody.model = model;
+ }
+
+ const response = await fetch(queryUrl, {
+ body: JSON.stringify(queryBody),
+ headers: {
+ 'Authorization': `Bearer ${apiKey}`,
+ 'Content-Type': 'application/json',
+ },
+ method: 'POST',
+ });
+
+ if (!response.ok) {
+ let errorData;
+ try {
+ errorData = await response.json();
+ } catch (error) {
+ void error;
+ }
+
+ const errorMessage =
+ typeof errorData?.error?.message === 'string'
+ ? errorData.error.message
+ : typeof errorData?.message === 'string'
+ ? errorData.message
+ : JSON.stringify(errorData || response.statusText);
+
+ throw new Error(`Hunyuan API video query error (${response.status}): ${errorMessage}`);
+ }
+
+ return response.json();
+}
+
+export async function pollHunyuanVideoStatus(
+ inferenceId: string,
+ apiKey: string,
+ baseUrl: string,
+): Promise<PollVideoStatusResult> {
+ const response = await queryHunyuanVideoStatus(inferenceId, apiKey, baseUrl);
+
+ if (response.error?.message) {
+ return { status: 'failed', error: response.error.message };
+ }
+
+ const status = response.status;
+ if (!status) {
+ return { status: 'pending' };
+ }
+
+ if (status === 'completed') {
+ const videoUrl = response.data?.url || response.url;
+ if (!videoUrl) {
+ return { status: 'failed', error: 'Video task completed but no URL was returned' };
+ }
+
+ return { status: 'success', videoUrl };
+ }
+
+ if (status === 'failed') {
+ return { status: 'failed', error: 'Video generation failed' };
+ }
+
+ return { status: 'pending' };
+}
diff --git a/packages/model-runtime/src/providers/hunyuan/index.test.ts b/packages/model-runtime/src/providers/hunyuan/index.test.ts
index ee86455d106..4f5df5ee27e 100644
--- a/packages/model-runtime/src/providers/hunyuan/index.test.ts
+++ b/packages/model-runtime/src/providers/hunyuan/index.test.ts
@@ -9,9 +9,9 @@ import { LobeHunyuanAI, params } from './index';
testProvider({
Runtime: LobeHunyuanAI,
provider: ModelProvider.Hunyuan,
- defaultBaseURL: 'https://api.hunyuan.cloud.tencent.com/v1',
+ defaultBaseURL: 'https://tokenhub.tencentmaas.com/v1',
chatDebugEnv: 'DEBUG_HUNYUAN_CHAT_COMPLETION',
- chatModel: 'hunyuan-lite',
+ chatModel: 'hunyuan-role-latest',
});
// Mock the console.error to avoid polluting test output
@@ -30,119 +30,17 @@ beforeEach(() => {
describe('LobeHunyuanAI', () => {
describe('chat', () => {
- it('should with search citations', async () => {
- const data = [
- {
- id: '939fbdb8dbb9b4c5944cbbe687c977c2',
- object: 'chat.completion.chunk',
- created: 1741000456,
- model: 'hunyuan-turbo',
- system_fingerprint: '',
- choices: [
- {
- index: 0,
- delta: { role: 'assistant', content: '为您' },
- finish_reason: null,
- },
- ],
- note: '以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记',
- search_info: {
- search_results: [
- {
- index: 1,
- title: '公务员考试时政热点【2025年3月3日】_公务员考试网_华图教育',
- url: 'http://www.huatu.com/2025/0303/2803685.html',
- icon: 'https://hunyuan-img-1251316161.cos.ap-guangzhou.myqcloud.com/%2Fpublic/img/63ce96deffe0119827f12deaa5ffe7ef.jpg',
- text: '华图教育官网',
- },
- {
- index: 2,
- title: '外交部新闻(2025年3月3日)',
- url: 'https://view.inews.qq.com/a/20250303A02NLC00?scene=qqsearch',
- icon: 'https://hunyuan-img-1251316161.cos.ap-guangzhou.myqcloud.com/%2Fpublic/img/00ce40298870d1accb7920d641152722.jpg',
- text: '腾讯网',
- },
- ],
- },
- },
- {
- id: '939fbdb8dbb9b4c5944cbbe687c977c2',
- object: 'chat.completion.chunk',
- created: 1741000456,
- model: 'hunyuan-turbo',
- system_fingerprint: '',
- choices: [
- {
- index: 0,
- delta: { role: 'assistant', content: '找到' },
- finish_reason: null,
- },
- ],
- note: '以上内容为AI生成,不代表开发者立场,请勿删除或修改本标记',
- search_info: {
- search_results: [
- {
- index: 1,
- title: '公务员考试时政热点【2025年3月3日】_公务员考试网_华图教育',
- url: 'http://www.huatu.com/2025/0303/2803685.html',
- icon: 'https://hunyuan-img-1251316161.cos.ap-guangzhou.myqcloud.com/%2Fpublic/img/63ce96deffe0119827f12deaa5ffe7ef.jpg',
- text: '华图教育官网',
- },
- {
- index: 2,
- title: '外交部新闻(2025年3月3日)',
- url: 'https://view.inews.qq.com/a/20250303A02NLC00?scene=qqsearch',
- icon: 'https://hunyuan-img-1251316161.cos.ap-guangzhou.myqcloud.com/%2Fpublic/img/00ce40298870d1accb7920d641152722.jpg',
- text: '腾讯网',
- },
- ],
- },
- },
- ];
-
- const mockStream = new ReadableStream({
- start(controller) {
- data.forEach((chunk) => {
- controller.enqueue(chunk);
- });
-
- controller.close();
- },
- });
-
+ it('should return a StreamingTextResponse on a Hunyuan chat call', async () => {
+ const mockStream = new ReadableStream();
vi.spyOn(instance['client'].chat.completions, 'create').mockResolvedValue(mockStream as any);
const result = await instance.chat({
messages: [{ content: 'Hello', role: 'user' }],
- model: 'mistralai/mistral-7b-instruct:free',
+ model: 'hunyuan-role-latest',
temperature: 0,
});
- const decoder = new TextDecoder();
- const reader = result.body!.getReader();
- const stream: string[] = [];
-
- while (true) {
- const { value, done } = await reader.read();
- if (done) break;
- stream.push(decoder.decode(value));
- }
-
- expect(stream).toEqual(
- [
- 'id: 939fbdb8dbb9b4c5944cbbe687c977c2',
- 'event: grounding',
- 'data: {"citations":[{"title":"公务员考试时政热点【2025年3月3日】_公务员考试网_华图教育","url":"http://www.huatu.com/2025/0303/2803685.html"},{"title":"外交部新闻(2025年3月3日)","url":"https://view.inews.qq.com/a/20250303A02NLC00?scene=qqsearch"}]}\n',
- 'id: 939fbdb8dbb9b4c5944cbbe687c977c2',
- 'event: text',
- 'data: "为您"\n',
- 'id: 939fbdb8dbb9b4c5944cbbe687c977c2',
- 'event: text',
- 'data: "找到"\n',
- ].map((line) => `${line}\n`),
- );
-
- expect((await reader.read()).done).toBe(true);
+ expect(result).toBeInstanceOf(Response);
});
});
});
@@ -168,7 +66,7 @@ describe('LobeHunyuanAI - custom features', () => {
it('should remove frequency_penalty and presence_penalty from payload', () => {
const payload = {
- model: 'hunyuan-lite',
+ model: 'hunyuan-role-latest',
messages: [{ role: 'user', content: 'test' }],
frequency_penalty: 0.5,
presence_penalty: 0.3,
@@ -179,334 +77,98 @@ describe('LobeHunyuanAI - custom features', () => {
expect(result.frequency_penalty).toBeUndefined();
expect(result.presence_penalty).toBeUndefined();
- expect(result.model).toBe('hunyuan-lite');
+ expect(result.model).toBe('hunyuan-role-latest');
expect(result.temperature).toBe(0.7);
- expect(result.stream).toBe(true);
});
- it('should add search fields when enabledSearch is true', () => {
+ it('should preserve thinking type in payload', () => {
const payload = {
- model: 'hunyuan-turbo',
+ model: 'deepseek-v3.2',
messages: [{ role: 'user', content: 'test' }],
- enabledSearch: true,
+ thinking: { type: 'enabled' },
} as any;
const result = handlePayload(payload);
- expect(result.citation).toBe(true);
- expect(result.enable_enhancement).toBe(true);
- expect(result.search_info).toBe(true);
- expect(result.enabledSearch).toBeUndefined();
+ expect(result.thinking).toEqual({ type: 'enabled' });
});
- it('should respect HUNYUAN_ENABLE_SPEED_SEARCH env when search is enabled', () => {
- process.env.HUNYUAN_ENABLE_SPEED_SEARCH = '1';
-
+ it('should transform reasoning to reasoning_content for hy3-preview assistant messages', () => {
const payload = {
- model: 'hunyuan-turbo',
- messages: [{ role: 'user', content: 'test' }],
- enabledSearch: true,
+ model: 'hy3-preview',
+ messages: [
+ {
+ role: 'assistant',
+ content: 'answer',
+ reasoning: { content: 'reasoning text' },
+ },
+ {
+ role: 'user',
+ content: 'prompt',
+ },
+ ],
} as any;
const result = handlePayload(payload);
- expect(result.enable_speed_search).toBe(true);
-
- delete process.env.HUNYUAN_ENABLE_SPEED_SEARCH;
+ expect(result.messages).toEqual([
+ {
+ role: 'assistant',
+ content: 'answer',
+ reasoning_content: 'reasoning text',
+ },
+ {
+ role: 'user',
+ content: 'prompt',
+ },
+ ]);
});
- it('should not enable speed search by default', () => {
- delete process.env.HUNYUAN_ENABLE_SPEED_SEARCH;
-
+ it('should add search fields when enabledSearch is true', () => {
const payload = {
- model: 'hunyuan-turbo',
+ model: 'hunyuan-2.0-thinking-20251109',
messages: [{ role: 'user', content: 'test' }],
enabledSearch: true,
} as any;
const result = handlePayload(payload);
+ expect(result.citation).toBe(true);
+ expect(result.enable_enhancement).toBe(true);
+ expect(result.search_info).toBe(true);
expect(result.enable_speed_search).toBe(false);
+ expect(result.enabledSearch).toBeUndefined();
});
- it('should not add search fields when enabledSearch is false', () => {
- const payload = {
- model: 'hunyuan-lite',
- messages: [{ role: 'user', content: 'test' }],
- enabledSearch: false,
- } as any;
-
- const result = handlePayload(payload);
-
- expect(result.citation).toBeUndefined();
- expect(result.enable_enhancement).toBeUndefined();
- expect(result.search_info).toBeUndefined();
- expect(result.enable_speed_search).toBeUndefined();
- });
-
- it('should enable thinking for hunyuan-a13b when thinking.type is enabled', () => {
- const payload = {
- model: 'hunyuan-a13b',
- messages: [{ role: 'user', content: 'test' }],
- thinking: { type: 'enabled' },
- } as any;
-
- const result = handlePayload(payload);
-
- expect(result.enable_thinking).toBe(true);
- expect(result.thinking).toBeUndefined();
- });
-
- it('should disable thinking for hunyuan-a13b when thinking.type is disabled', () => {
- const payload = {
- model: 'hunyuan-a13b',
- messages: [{ role: 'user', content: 'test' }],
- thinking: { type: 'disabled' },
- } as any;
-
- const result = handlePayload(payload);
-
- expect(result.enable_thinking).toBe(false);
- });
-
- it('should set thinking to undefined for hunyuan-a13b when thinking.type is undefined', () => {
- const payload = {
- model: 'hunyuan-a13b',
- messages: [{ role: 'user', content: 'test' }],
- thinking: { type: undefined },
- } as any;
-
- const result = handlePayload(payload);
-
- expect(result.enable_thinking).toBeUndefined();
- });
-
- it('should not add enable_thinking for non-hunyuan-a13b models', () => {
- const payload = {
- model: 'hunyuan-lite',
- messages: [{ role: 'user', content: 'test' }],
- thinking: { type: 'enabled' },
- } as any;
-
- const result = handlePayload(payload);
-
- expect(result.enable_thinking).toBeUndefined();
- });
-
- it('should handle combined enabledSearch and thinking for hunyuan-a13b', () => {
+ it('should respect HUNYUAN_ENABLE_SPEED_SEARCH env when search is enabled', () => {
process.env.HUNYUAN_ENABLE_SPEED_SEARCH = '1';
const payload = {
- model: 'hunyuan-a13b',
+ model: 'hunyuan-2.0-thinking-20251109',
messages: [{ role: 'user', content: 'test' }],
enabledSearch: true,
- thinking: { type: 'enabled' },
- temperature: 0.5,
} as any;
const result = handlePayload(payload);
- expect(result.citation).toBe(true);
- expect(result.enable_enhancement).toBe(true);
- expect(result.search_info).toBe(true);
expect(result.enable_speed_search).toBe(true);
- expect(result.enable_thinking).toBe(true);
- expect(result.temperature).toBe(0.5);
- expect(result.stream).toBe(true);
delete process.env.HUNYUAN_ENABLE_SPEED_SEARCH;
});
- });
-
- describe('models', () => {
- const mockClient = {
- models: {
- list: vi.fn(),
- },
- } as any;
-
- beforeEach(() => {
- vi.clearAllMocks();
- });
-
- it('should fetch and process models with function call detection', async () => {
- mockClient.models.list.mockResolvedValue({
- data: [
- { id: 'hunyuan-functioncall' },
- { id: 'hunyuan-turbo' },
- { id: 'hunyuan-pro' },
- { id: 'hunyuan-lite' },
- ],
- });
-
- const models = await params.models({ client: mockClient });
-
- expect(mockClient.models.list).toHaveBeenCalledTimes(1);
- expect(models).toHaveLength(4);
-
- const functionCallModel = models.find((m) => m.id === 'hunyuan-functioncall');
- expect(functionCallModel?.functionCall).toBe(true);
-
- const turboModel = models.find((m) => m.id === 'hunyuan-turbo');
- expect(turboModel?.functionCall).toBe(true);
-
- const proModel = models.find((m) => m.id === 'hunyuan-pro');
- expect(proModel?.functionCall).toBe(true);
-
- const liteModel = models.find((m) => m.id === 'hunyuan-lite');
- expect(liteModel?.functionCall).toBe(false);
- });
-
- it('should not enable function call for vision models even with keywords', async () => {
- mockClient.models.list.mockResolvedValue({
- data: [{ id: 'hunyuan-turbo-vision' }, { id: 'hunyuan-functioncall-vision' }],
- });
-
- const models = await params.models({ client: mockClient });
-
- expect(models).toHaveLength(2);
-
- const visionModel1 = models.find((m) => m.id === 'hunyuan-turbo-vision');
- expect(visionModel1?.functionCall).toBe(false);
- expect(visionModel1?.vision).toBe(true);
-
- const visionModel2 = models.find((m) => m.id === 'hunyuan-functioncall-vision');
- expect(visionModel2?.functionCall).toBe(false);
- expect(visionModel2?.vision).toBe(true);
- });
-
- it('should detect reasoning models', async () => {
- mockClient.models.list.mockResolvedValue({
- data: [{ id: 'hunyuan-t1' }, { id: 'hunyuan-lite' }],
- });
-
- const models = await params.models({ client: mockClient });
-
- expect(models).toHaveLength(2);
-
- const reasoningModel = models.find((m) => m.id === 'hunyuan-t1');
- expect(reasoningModel?.reasoning).toBe(true);
-
- const normalModel = models.find((m) => m.id === 'hunyuan-lite');
- expect(normalModel?.reasoning).toBe(false);
- });
-
- it('should detect vision models', async () => {
- mockClient.models.list.mockResolvedValue({
- data: [{ id: 'hunyuan-vision' }, { id: 'hunyuan-lite-vision' }, { id: 'hunyuan-lite' }],
- });
-
- const models = await params.models({ client: mockClient });
-
- expect(models).toHaveLength(3);
-
- const visionModel1 = models.find((m) => m.id === 'hunyuan-vision');
- expect(visionModel1?.vision).toBe(true);
-
- const visionModel2 = models.find((m) => m.id === 'hunyuan-lite-vision');
- expect(visionModel2?.vision).toBe(true);
-
- const normalModel = models.find((m) => m.id === 'hunyuan-lite');
- expect(normalModel?.vision).toBe(false);
- });
- it('should merge with LOBE_DEFAULT_MODEL_LIST for known models', async () => {
- mockClient.models.list.mockResolvedValue({
- data: [{ id: 'hunyuan-lite' }],
- });
-
- const models = await params.models({ client: mockClient });
-
- expect(models).toHaveLength(1);
-
- const model = models[0];
- // LOBE_DEFAULT_MODEL_LIST should provide these values
- expect(model.id).toBe('hunyuan-lite');
- expect(model.enabled).toBeDefined();
- });
-
- it('should handle unknown models with defaults', async () => {
- mockClient.models.list.mockResolvedValue({
- data: [{ id: 'hunyuan-unknown-model' }],
- });
-
- const models = await params.models({ client: mockClient });
-
- expect(models).toHaveLength(1);
-
- const model = models[0];
- expect(model.id).toBe('hunyuan-unknown-model');
- expect(model.enabled).toBe(false);
- expect(model.contextWindowTokens).toBeUndefined();
- expect(model.displayName).toBeUndefined();
- });
-
- it('should handle case-insensitive model matching', async () => {
- mockClient.models.list.mockResolvedValue({
- data: [{ id: 'HUNYUAN-LITE' }],
- });
-
- const models = await params.models({ client: mockClient });
-
- expect(models).toHaveLength(1);
- expect(models[0].id).toBe('HUNYUAN-LITE');
- });
-
- it('should combine multiple abilities correctly', async () => {
- mockClient.models.list.mockResolvedValue({
- data: [
- { id: 'hunyuan-turbo' },
- { id: 'hunyuan-t1' },
- { id: 'hunyuan-vision' },
- { id: 'hunyuan-turbo-vision' },
- ],
- });
-
- const models = await params.models({ client: mockClient });
-
- expect(models).toHaveLength(4);
-
- const turboModel = models.find((m) => m.id === 'hunyuan-turbo');
- expect(turboModel?.functionCall).toBe(true);
- expect(turboModel?.reasoning).toBe(false);
- expect(turboModel?.vision).toBe(false);
-
- const reasoningModel = models.find((m) => m.id === 'hunyuan-t1');
- expect(reasoningModel?.functionCall).toBe(false);
- expect(reasoningModel?.reasoning).toBe(true);
- expect(reasoningModel?.vision).toBe(false);
-
- const visionModel = models.find((m) => m.id === 'hunyuan-vision');
- expect(visionModel?.functionCall).toBe(false);
- expect(visionModel?.reasoning).toBe(false);
- expect(visionModel?.vision).toBe(true);
-
- const turboVisionModel = models.find((m) => m.id === 'hunyuan-turbo-vision');
- expect(turboVisionModel?.functionCall).toBe(false);
- expect(turboVisionModel?.reasoning).toBe(false);
- expect(turboVisionModel?.vision).toBe(true);
- });
-
- it('should handle empty model list', async () => {
- mockClient.models.list.mockResolvedValue({
- data: [],
- });
-
- const models = await params.models({ client: mockClient });
-
- expect(models).toHaveLength(0);
- });
-
- it('should filter out falsy values', async () => {
- mockClient.models.list.mockResolvedValue({
- data: [{ id: 'hunyuan-lite' }, null, undefined],
- });
+ it('should not add search fields when enabledSearch is false', () => {
+ const payload = {
+ model: 'hunyuan-2.0-thinking-20251109',
+ messages: [{ role: 'user', content: 'test' }],
+ enabledSearch: false,
+ } as any;
- const models = await params.models({ client: mockClient });
+ const result = handlePayload(payload);
- // Only valid models should be included
- expect(models.length).toBeGreaterThan(0);
- expect(models.every((m) => m !== null && m !== undefined)).toBe(true);
+ expect(result.citation).toBeUndefined();
+ expect(result.enable_enhancement).toBeUndefined();
+ expect(result.search_info).toBeUndefined();
+ expect(result.enable_speed_search).toBeUndefined();
});
});
});
diff --git a/packages/model-runtime/src/providers/hunyuan/index.ts b/packages/model-runtime/src/providers/hunyuan/index.ts
index 20658476477..95919458367 100644
--- a/packages/model-runtime/src/providers/hunyuan/index.ts
+++ b/packages/model-runtime/src/providers/hunyuan/index.ts
@@ -1,28 +1,52 @@
-import type { ChatModelCard } from '@lobechat/types';
import { ModelProvider } from 'model-bank';
import type { OpenAICompatibleFactoryOptions } from '../../core/openaiCompatibleFactory';
import { createOpenAICompatibleRuntime } from '../../core/openaiCompatibleFactory';
import { createHunyuanImage } from './createImage';
-
-export interface HunyuanModelCard {
- id: string;
-}
+import { createHunyuanVideo } from './createVideo';
export const params = {
- baseURL: 'https://api.hunyuan.cloud.tencent.com/v1',
+ baseURL: 'https://tokenhub.tencentmaas.com/v1',
chatCompletion: {
handlePayload: (payload) => {
- // eslint-disable-next-line unused-imports/no-unused-vars
- const { enabledSearch, frequency_penalty, model, presence_penalty, thinking, ...rest } =
- payload;
+ const { enabledSearch, model, thinking, ...rest } = payload;
+
+ // Transform reasoning object to reasoning_content string for multi-turn conversations
+ const messages = payload.messages.map((message: any) => {
+ const { reasoning, ...rest } = message;
+
+ const reasoningContent =
+ typeof rest.reasoning_content === 'string'
+ ? rest.reasoning_content
+ : typeof reasoning?.content === 'string'
+ ? reasoning.content
+ : undefined;
+
+ if (message.role === 'assistant' && model === 'hy3-preview') {
+ return {
+ ...rest,
+ reasoning_content: reasoningContent ?? '',
+ };
+ }
+
+ if (reasoningContent !== undefined) {
+ return {
+ ...rest,
+ reasoning_content: reasoningContent,
+ };
+ }
+
+ return rest;
+ });
return {
...rest,
frequency_penalty: undefined,
+ stream: rest.stream ?? true,
+ thinking: thinking ? { type: thinking.type } : undefined,
+ messages,
model,
presence_penalty: undefined,
- stream: true,
...(enabledSearch && {
citation: true,
enable_enhancement: true,
@@ -32,54 +56,18 @@ export const params = {
enable_speed_search: process.env.HUNYUAN_ENABLE_SPEED_SEARCH === '1',
search_info: true,
}),
- ...(model === 'hunyuan-a13b' && {
- enable_thinking:
- thinking?.type === 'enabled' ? true : thinking?.type === 'disabled' ? false : undefined,
- }),
} as any;
},
},
createImage: createHunyuanImage,
+ createVideo: createHunyuanVideo,
+ handlePollVideoStatus: async (inferenceId, options) => {
+ const { pollHunyuanVideoStatus } = await import('./createVideo');
+ return pollHunyuanVideoStatus(inferenceId, options.apiKey || '', options.baseURL || '');
+ },
debug: {
chatCompletion: () => process.env.DEBUG_HUNYUAN_CHAT_COMPLETION === '1',
},
- models: async ({ client }) => {
- const { LOBE_DEFAULT_MODEL_LIST } = await import('model-bank');
-
- const functionCallKeywords = ['hunyuan-functioncall', 'hunyuan-turbo', 'hunyuan-pro'];
-
- const reasoningKeywords = ['hunyuan-t1'];
-
- const modelsPage = (await client.models.list()) as any;
- const modelList: HunyuanModelCard[] = modelsPage.data;
-
- return modelList
- .filter(Boolean)
- .map((model) => {
- const knownModel = LOBE_DEFAULT_MODEL_LIST.find(
- (m) => model.id.toLowerCase() === m.id.toLowerCase(),
- );
-
- return {
- contextWindowTokens: knownModel?.contextWindowTokens ?? undefined,
- displayName: knownModel?.displayName ?? undefined,
- enabled: knownModel?.enabled || false,
- functionCall:
- (functionCallKeywords.some((keyword) => model.id.toLowerCase().includes(keyword)) &&
- !model.id.toLowerCase().includes('vision')) ||
- knownModel?.abilities?.functionCall ||
- false,
- id: model.id,
- reasoning:
- reasoningKeywords.some((keyword) => model.id.toLowerCase().includes(keyword)) ||
- knownModel?.abilities?.reasoning ||
- false,
- vision:
- model.id.toLowerCase().includes('vision') || knownModel?.abilities?.vision || false,
- };
- })
- .filter(Boolean) as ChatModelCard[];
- },
provider: ModelProvider.Hunyuan,
} satisfies OpenAICompatibleFactoryOptions;
diff --git a/packages/types/src/agent/chatConfig.ts b/packages/types/src/agent/chatConfig.ts
index 35704dd16bc..3f6d2b77773 100644
--- a/packages/types/src/agent/chatConfig.ts
+++ b/packages/types/src/agent/chatConfig.ts
@@ -80,6 +80,7 @@ export interface LobeAgentChatConfig extends AgentMemoryChatConfig {
* Number of historical messages
*/
historyCount?: number;
+ hy3ReasoningEffort?: 'no_think' | 'low' | 'high';
/**
* Image aspect ratio for image generation models
*/
@@ -198,6 +199,7 @@ export const AgentChatConfigSchema = z
gpt5_2ProReasoningEffort: z.enum(['medium', 'high', 'xhigh']).optional(),
gpt5_2ReasoningEffort: z.enum(['none', 'low', 'medium', 'high', 'xhigh']).optional(),
grok4_20ReasoningEffort: z.enum(['low', 'medium', 'high', 'xhigh']).optional(),
+ hy3ReasoningEffort: z.enum(['no_think', 'low', 'high']).optional(),
deepseekV4ReasoningEffort: z.enum(['high', 'max']).optional(),
historyCount: z.number().optional(),
imageAspectRatio: z.string().optional(),
diff --git a/src/features/ModelSwitchPanel/components/ControlsForm/ControlsForm.tsx b/src/features/ModelSwitchPanel/components/ControlsForm/ControlsForm.tsx
index b4a1542e0ae..38037270ff1 100644
--- a/src/features/ModelSwitchPanel/components/ControlsForm/ControlsForm.tsx
+++ b/src/features/ModelSwitchPanel/components/ControlsForm/ControlsForm.tsx
@@ -21,6 +21,7 @@ import GPT51ReasoningEffortSlider from './GPT51ReasoningEffortSlider';
import GPT52ProReasoningEffortSlider from './GPT52ProReasoningEffortSlider';
import GPT52ReasoningEffortSlider from './GPT52ReasoningEffortSlider';
import Grok420ReasoningEffortSlider from './Grok420ReasoningEffortSlider';
+import Hy3ReasoningEffortSlider from './Hy3ReasoningEffortSlider';
import ImageAspectRatio2Select from './ImageAspectRatio2Select';
import ImageAspectRatioSelect from './ImageAspectRatioSelect';
import ImageResolution2Slider from './ImageResolution2Slider';
@@ -289,6 +290,28 @@ const ControlsForm = memo<ControlsFormProps>(({ model: modelProp, provider: prov
paddingBottom: 0,
},
},
+ {
+ children: <Hy3ReasoningEffortSlider />,
+ desc: 'reasoning_effort',
+ label: t('extendParams.reasoningEffort.title'),
+ layout: 'horizontal',
+ minWidth: undefined,
+ name: 'hy3ReasoningEffort',
+ style: {
+ paddingBottom: 0,
+ },
+ },
+ {
+ children: <DeepseekV4ReasoningEffortSlider />,
+ desc: 'reasoning_effort',
+ label: t('extendParams.reasoningEffort.title'),
+ layout: 'horizontal',
+ minWidth: undefined,
+ name: 'deepseekV4ReasoningEffort',
+ style: {
+ paddingBottom: 0,
+ },
+ },
{
children: <DeepseekV4ReasoningEffortSlider />,
desc: 'reasoning_effort',
diff --git a/src/features/ModelSwitchPanel/components/ControlsForm/Hy3ReasoningEffortSlider.tsx b/src/features/ModelSwitchPanel/components/ControlsForm/Hy3ReasoningEffortSlider.tsx
new file mode 100644
index 00000000000..b853c813b2a
--- /dev/null
+++ b/src/features/ModelSwitchPanel/components/ControlsForm/Hy3ReasoningEffortSlider.tsx
@@ -0,0 +1,16 @@
+import { type CreatedLevelSliderProps } from './createLevelSlider';
+import { createLevelSliderComponent } from './createLevelSlider';
+
+const HY3_REASONING_EFFORT_LEVELS = ['no_think', 'low', 'high'] as const;
+type Hy3ReasoningEffort = (typeof HY3_REASONING_EFFORT_LEVELS)[number];
+
+export type Hy3ReasoningEffortSliderProps = CreatedLevelSliderProps<Hy3ReasoningEffort>;
+
+const Hy3ReasoningEffortSlider = createLevelSliderComponent<Hy3ReasoningEffort>({
+ configKey: 'hy3ReasoningEffort',
+ defaultValue: 'high',
+ levels: HY3_REASONING_EFFORT_LEVELS,
+ style: { minWidth: 200 },
+});
+
+export default Hy3ReasoningEffortSlider;
diff --git a/src/locales/default/modelProvider.ts b/src/locales/default/modelProvider.ts
index 2f334b2d00b..6892d410eba 100644
--- a/src/locales/default/modelProvider.ts
+++ b/src/locales/default/modelProvider.ts
@@ -267,6 +267,8 @@ export default {
'For GPT-5.2 series; controls reasoning intensity.',
'providerModels.item.modelConfig.extendParams.options.grok4_20ReasoningEffort.hint':
'For Grok 4.20 series; controls reasoning intensity. Low/Medium uses 4 agents, High/XHigh uses 16 agents.',
+ 'providerModels.item.modelConfig.extendParams.options.hy3ReasoningEffort.hint':
+ 'For Hy3 models; controls reasoning intensity. no_think (ultra-fast response), low (quick reasoning), and high (deep reasoning)—to accommodate varying latency and depth requirements, from high-frequency interactions to complex engineering tasks.',
'providerModels.item.modelConfig.extendParams.options.deepseekV4ReasoningEffort.hint':
'For DeepSeek V4 thinking mode; controls reasoning intensity. `high` is the default, `max` unlocks the deepest reasoning used by complex agent workflows.',
'providerModels.item.modelConfig.extendParams.options.imageAspectRatio.hint':
diff --git a/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsx b/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsx
index 0645725fd95..75e49d46a8a 100644
--- a/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsx
+++ b/src/routes/(main)/settings/provider/features/ModelList/CreateNewModelModal/ExtendParamsSelect.tsx
@@ -13,6 +13,7 @@ import GPT51ReasoningEffortSlider from '@/features/ModelSwitchPanel/components/C
import GPT52ProReasoningEffortSlider from '@/features/ModelSwitchPanel/components/ControlsForm/GPT52ProReasoningEffortSlider';
import GPT52ReasoningEffortSlider from '@/features/ModelSwitchPanel/components/ControlsForm/GPT52ReasoningEffortSlider';
import Grok420ReasoningEffortSlider from '@/features/ModelSwitchPanel/components/ControlsForm/Grok420ReasoningEffortSlider';
+import Hy3ReasoningEffortSlider from '@/features/ModelSwitchPanel/components/ControlsForm/Hy3ReasoningEffortSlider';
import ImageAspectRatio2Select from '@/features/ModelSwitchPanel/components/ControlsForm/ImageAspectRatio2Select';
import ImageAspectRatioSelect from '@/features/ModelSwitchPanel/components/ControlsForm/ImageAspectRatioSelect';
import ImageResolution2Slider from '@/features/ModelSwitchPanel/components/ControlsForm/ImageResolution2Slider';
@@ -93,6 +94,10 @@ const EXTEND_PARAMS_OPTIONS: ExtendParamsOption[] = [
hintKey: 'providerModels.item.modelConfig.extendParams.options.grok4_20ReasoningEffort.hint',
key: 'grok4_20ReasoningEffort',
},
+ {
+ hintKey: 'providerModels.item.modelConfig.extendParams.options.hy3ReasoningEffort.hint',
+ key: 'hy3ReasoningEffort',
+ },
{
hintKey: 'providerModels.item.modelConfig.extendParams.options.deepseekV4ReasoningEffort.hint',
key: 'deepseekV4ReasoningEffort',
@@ -165,6 +170,7 @@ const TITLE_KEY_ALIASES: Partial<Record<ExtendParamsType, ExtendParamsType>> = {
gpt5_2ProReasoningEffort: 'reasoningEffort',
gpt5_2ReasoningEffort: 'reasoningEffort',
grok4_20ReasoningEffort: 'reasoningEffort',
+ hy3ReasoningEffort: 'reasoningEffort',
imageAspectRatio2: 'imageAspectRatio',
opus47Effort: 'effort',
reasoningBudgetToken32k: 'reasoningBudgetToken',
@@ -209,6 +215,11 @@ const PREVIEW_META: Partial<Record<ExtendParamsType, PreviewMeta>> = {
previewWidth: 300,
tag: 'reasoning_effort',
},
+ hy3ReasoningEffort: {
+ labelSuffix: ' (Hy3 preview)',
+ previewWidth: 300,
+ tag: 'reasoning_effort',
+ },
deepseekV4ReasoningEffort: {
labelSuffix: ' (DeepSeek V4)',
previewWidth: 220,
@@ -343,6 +354,7 @@ const ExtendParamsSelect = memo<ExtendParamsSelectProps>(({ value, onChange }) =
gpt5_2ProReasoningEffort: <GPT52ProReasoningEffortSlider value="medium" />,
gpt5_2ReasoningEffort: <GPT52ReasoningEffortSlider value="none" />,
grok4_20ReasoningEffort: <Grok420ReasoningEffortSlider value="medium" />,
+ hy3ReasoningEffort: <Hy3ReasoningEffortSlider value="high" />,
deepseekV4ReasoningEffort: <DeepseekV4ReasoningEffortSlider value="high" />,
imageAspectRatio: <ImageAspectRatioSelect value="1:1" />,
imageAspectRatio2: <ImageAspectRatio2Select value="1:1" />,
diff --git a/src/services/chat/mecha/modelParamsResolver.ts b/src/services/chat/mecha/modelParamsResolver.ts
index b6af69c9e5e..6fff4d4fe89 100644
--- a/src/services/chat/mecha/modelParamsResolver.ts
+++ b/src/services/chat/mecha/modelParamsResolver.ts
@@ -203,6 +203,10 @@ export const resolveModelExtendParams = (ctx: ModelParamsContext): ModelExtendPa
extendParams.reasoning_effort = chatConfig.grok4_20ReasoningEffort;
}
+ if (modelExtendParams.includes('hy3ReasoningEffort') && chatConfig.hy3ReasoningEffort) {
+ extendParams.reasoning_effort = chatConfig.hy3ReasoningEffort;
+ }
+
if (
modelExtendParams.includes('deepseekV4ReasoningEffort') &&
chatConfig.deepseekV4ReasoningEffort