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: add new Kimi K2.6 model (#14004)

sxjerua15d962ae870
diff --git a/packages/model-bank/src/aiModels/anthropic.ts b/packages/model-bank/src/aiModels/anthropic.ts
index 9ecb3645091..698567bddc4 100644
--- a/packages/model-bank/src/aiModels/anthropic.ts
+++ b/packages/model-bank/src/aiModels/anthropic.ts
@@ -272,36 +272,6 @@ const anthropicChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- vision: true,
- },
- contextWindowTokens: 200_000,
- description:
- 'Claude 3 Haiku is Anthropic’s fastest and most compact model, designed for near-instant responses with fast, accurate performance.',
- displayName: 'Claude 3 Haiku',
- id: 'claude-3-haiku-20240307',
- maxOutput: 4096,
- pricing: {
- units: [
- { name: 'textInput_cacheRead', rate: 0.03, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textInput', rate: 0.25, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
- {
- lookup: { prices: { '1h': 0.5, '5m': 0.3 }, pricingParams: ['ttl'] },
- name: 'textInput_cacheWrite',
- strategy: 'lookup',
- unit: 'millionTokens',
- },
- ],
- },
- releasedAt: '2024-03-07',
- settings: {
- extendParams: ['disableContextCaching'],
- },
- type: 'chat',
- },
];
export const allModels = [...anthropicChatModels];
diff --git a/packages/model-bank/src/aiModels/moonshot.ts b/packages/model-bank/src/aiModels/moonshot.ts
index d9195c68fcb..e578c27493e 100644
--- a/packages/model-bank/src/aiModels/moonshot.ts
+++ b/packages/model-bank/src/aiModels/moonshot.ts
@@ -1,7 +1,36 @@
import type { AIChatModelCard } from '../types/aiModel';
-// https://platform.moonshot.cn/docs/pricing/chat
+// https://platform.kimi.com/docs/pricing/chat
const moonshotChatModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ structuredOutput: true,
+ video: true,
+ vision: true,
+ },
+ contextWindowTokens: 262_144,
+ description:
+ "Kimi K2.6 is Kimi's latest and most capable model, delivering stronger long-horizon coding, instruction following, and self-correction while supporting text, image, and video inputs plus chat and agent tasks.",
+ displayName: 'Kimi K2.6',
+ enabled: true,
+ id: 'kimi-k2.6',
+ maxOutput: 32_768,
+ pricing: {
+ currency: 'CNY',
+ units: [
+ { 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: '2026-04-20',
+ settings: {
+ extendParams: ['enableReasoning'],
+ },
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
@@ -14,7 +43,6 @@ const moonshotChatModels: AIChatModelCard[] = [
description:
'Kimi K2.5 is Kimi\'s most versatile model to date, featuring a native multimodal architecture that supports both vision and text inputs, "thinking" and "non-thinking" modes, and both conversational and agent tasks.',
displayName: 'Kimi K2.5',
- enabled: true,
id: 'kimi-k2.5',
maxOutput: 32_768,
pricing: {
@@ -127,7 +155,6 @@ const moonshotChatModels: AIChatModelCard[] = [
description:
'kimi-k2 is an MoE foundation model with strong coding and agent capabilities (1T total params, 32B active), outperforming other mainstream open models across reasoning, programming, math, and agent benchmarks.',
displayName: 'Kimi K2 Turbo Preview',
- enabled: true,
id: 'kimi-k2-turbo-preview',
pricing: {
currency: 'CNY',
diff --git a/packages/model-bank/src/aiModels/ollamacloud.ts b/packages/model-bank/src/aiModels/ollamacloud.ts
index 78d03c7a2e8..0e5be596848 100644
--- a/packages/model-bank/src/aiModels/ollamacloud.ts
+++ b/packages/model-bank/src/aiModels/ollamacloud.ts
@@ -1,6 +1,33 @@
import { type AIChatModelCard } from '../types/aiModel';
const ollamaCloudModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ vision: true,
+ },
+ contextWindowTokens: 262_144,
+ description:
+ 'Kimi K2.6 is an open-source, native multimodal agentic model that advances practical capabilities in long-horizon coding, coding-driven design, proactive autonomous execution, and swarm-based task orchestration.',
+ displayName: 'Kimi K2.6',
+ enabled: true,
+ id: 'kimi-k2.6',
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ },
+ contextWindowTokens: 200_000,
+ description:
+ 'GLM-5.1 is our next-generation flagship model for agentic engineering, with significantly stronger coding capabilities than its predecessor. It achieves state-of-the-art performance on SWE-Bench Pro and leads GLM-5 by a wide margin.',
+ displayName: 'GLM-5.1',
+ enabled: true,
+ id: 'glm-5.1',
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
@@ -71,7 +98,6 @@ const ollamaCloudModels: AIChatModelCard[] = [
description:
'A strong reasoning and agentic model from Z.ai with 744B total parameters (40B active), built for complex systems engineering and long-horizon tasks.',
displayName: 'GLM-5',
- enabled: true,
id: 'glm-5',
type: 'chat',
},
@@ -85,7 +111,6 @@ const ollamaCloudModels: AIChatModelCard[] = [
description:
'Kimi K2.5 is an open-source, native multimodal agentic model that seamlessly integrates vision and language understanding with advanced agentic capabilities, instant and thinking modes, as well as conversational and agentic paradigms.',
displayName: 'Kimi K2.5',
- enabled: true,
id: 'kimi-k2.5',
type: 'chat',
},
diff --git a/packages/model-bank/src/aiModels/qwen.ts b/packages/model-bank/src/aiModels/qwen.ts
index 783134798bd..3de9937c668 100644
--- a/packages/model-bank/src/aiModels/qwen.ts
+++ b/packages/model-bank/src/aiModels/qwen.ts
@@ -1838,6 +1838,70 @@ const qwenChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ search: true,
+ },
+ config: {
+ deploymentName: 'qwen3.6-max-preview', // Supports context caching
+ },
+ contextWindowTokens: 262_144,
+ description:
+ 'The largest closed-source model in the Qwen3.6 series. It delivers stronger world knowledge, instruction following, and agentic coding performance for complex tasks. It is text-only, supports thinking mode by default, explicit caching, and function calling.',
+ displayName: 'Qwen3.6 Max Preview',
+ id: 'qwen3.6-max-preview',
+ maxOutput: 65_536,
+ organization: 'Qwen',
+ pricing: {
+ currency: 'CNY',
+ units: [
+ {
+ lookup: {
+ prices: {
+ '[0, 0.128]': 9 * 0.2,
+ '[0.128, infinity]': 15 * 0.2,
+ },
+ pricingParams: ['textInputRange'],
+ },
+ name: 'textInput_cacheRead',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.128]': 9,
+ '[0.128, infinity]': 15,
+ },
+ pricingParams: ['textInputRange'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.128]': 54,
+ '[0.128, infinity]': 90,
+ },
+ pricingParams: ['textInputRange'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ ],
+ },
+ releasedAt: '2026-04-18',
+ settings: {
+ extendParams: ['enableReasoning', 'reasoningBudgetToken'],
+ searchImpl: 'params',
+ },
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
diff --git a/packages/model-bank/src/aiModels/siliconcloud.ts b/packages/model-bank/src/aiModels/siliconcloud.ts
index d500e82955c..88c65b24adf 100644
--- a/packages/model-bank/src/aiModels/siliconcloud.ts
+++ b/packages/model-bank/src/aiModels/siliconcloud.ts
@@ -6,6 +6,53 @@ import {
// https://siliconflow.cn/zh-cn/models
const siliconcloudChatModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ vision: true,
+ },
+ contextWindowTokens: 262_144,
+ description:
+ 'Qwen3.6-35B-A3B is a large language model from the Qwen team in the Qwen3.6 series, using a Mixture-of-Experts (MoE) architecture with 35B total parameters and 3B active parameters. It balances efficient inference with excellent performance and supports both thinking and non-thinking modes, allowing flexible switching between fast response and deep reasoning.',
+ displayName: 'Qwen3.6 35B A3B',
+ id: 'Qwen/Qwen3.6-35B-A3B',
+ organization: 'Qwen',
+ pricing: {
+ currency: 'CNY',
+ units: [
+ {
+ lookup: {
+ prices: {
+ '[0, 0.128]': 0.4,
+ '[0.128, infinity]': 1.6,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.128]': 3.2,
+ '[0.128, infinity]': 12.8,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ ],
+ },
+ releasedAt: '2026-04-17',
+ settings: {
+ extendParams: ['enableReasoning', 'reasoningBudgetToken'],
+ },
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
@@ -18,6 +65,7 @@ const siliconcloudChatModels: AIChatModelCard[] = [
displayName: 'Qwen3.5 397B A17B',
id: 'Qwen/Qwen3.5-397B-A17B',
organization: 'Qwen',
+
pricing: {
currency: 'CNY',
units: [
@@ -48,6 +96,9 @@ const siliconcloudChatModels: AIChatModelCard[] = [
],
},
releasedAt: '2026-02-16',
+ settings: {
+ extendParams: ['enableReasoning', 'reasoningBudgetToken'],
+ },
type: 'chat',
},
{
@@ -92,6 +143,9 @@ const siliconcloudChatModels: AIChatModelCard[] = [
],
},
releasedAt: '2026-02-26',
+ settings: {
+ extendParams: ['enableReasoning', 'reasoningBudgetToken'],
+ },
type: 'chat',
},
{
@@ -136,6 +190,9 @@ const siliconcloudChatModels: AIChatModelCard[] = [
],
},
releasedAt: '2026-02-25',
+ settings: {
+ extendParams: ['enableReasoning', 'reasoningBudgetToken'],
+ },
type: 'chat',
},
{
@@ -180,6 +237,9 @@ const siliconcloudChatModels: AIChatModelCard[] = [
],
},
releasedAt: '2026-02-25',
+ settings: {
+ extendParams: ['enableReasoning', 'reasoningBudgetToken'],
+ },
type: 'chat',
},
{
@@ -224,6 +284,9 @@ const siliconcloudChatModels: AIChatModelCard[] = [
],
},
releasedAt: '2026-03-03',
+ settings: {
+ extendParams: ['enableReasoning', 'reasoningBudgetToken'],
+ },
type: 'chat',
},
{
@@ -246,6 +309,9 @@ const siliconcloudChatModels: AIChatModelCard[] = [
],
},
releasedAt: '2026-03-03',
+ settings: {
+ extendParams: ['enableReasoning', 'reasoningBudgetToken'],
+ },
type: 'chat',
},
{
diff --git a/packages/model-runtime/src/core/openaiCompatibleFactory/index.test.ts b/packages/model-runtime/src/core/openaiCompatibleFactory/index.test.ts
index bf627447659..18e81fb3433 100644
--- a/packages/model-runtime/src/core/openaiCompatibleFactory/index.test.ts
+++ b/packages/model-runtime/src/core/openaiCompatibleFactory/index.test.ts
@@ -2845,7 +2845,7 @@ describe('LobeOpenAICompatibleFactory', () => {
vi.spyOn(instance['client'].models, 'list').mockResolvedValue({
data: [
{ created: 1_698_218_177, id: 'gpt-4o', object: 'model' },
- { id: 'claude-3-haiku-20240307', object: 'model' },
+ { id: 'us.anthropic.claude-3-7-sonnet-20250219-v1:0', object: 'model' },
{ created: 1_698_318_177 * 1000, id: 'gpt-4o-mini', object: 'model' },
{ created: 1_736_499_509_125, id: 'gemini', object: 'model' },
],
@@ -2899,53 +2899,37 @@ describe('LobeOpenAICompatibleFactory', () => {
{
abilities: {
functionCall: true,
+ reasoning: true,
+ structuredOutput: true,
vision: true,
},
contextWindowTokens: 200_000,
description:
- 'Claude 3 Haiku is Anthropic’s fastest and most compact model, designed for near-instant responses with fast, accurate performance.',
- displayName: 'Claude 3 Haiku',
+ "Claude 3.7 Sonnet is Anthropic's fastest next-gen model. Compared to Claude 3 Haiku, it improves across skills and surpasses the previous flagship Claude 3 Opus on many intelligence benchmarks.",
+ displayName: 'Claude 3.7 Sonnet',
enabled: false,
- id: 'claude-3-haiku-20240307',
- maxOutput: 4096,
+ id: 'us.anthropic.claude-3-7-sonnet-20250219-v1:0',
+ maxOutput: 64_000,
pricing: {
units: [
- {
- name: 'textInput_cacheRead',
- rate: 0.03,
- strategy: 'fixed',
- unit: 'millionTokens',
- },
{
name: 'textInput',
- rate: 0.25,
+ rate: 3,
strategy: 'fixed',
unit: 'millionTokens',
},
{
name: 'textOutput',
- rate: 1.25,
+ rate: 15,
strategy: 'fixed',
unit: 'millionTokens',
},
- {
- lookup: {
- prices: {
- '1h': 0.5,
- '5m': 0.3,
- },
- pricingParams: ['ttl'],
- },
- name: 'textInput_cacheWrite',
- strategy: 'lookup',
- unit: 'millionTokens',
- },
],
},
- providerId: 'anthropic',
- releasedAt: '2024-03-07',
+ providerId: 'bedrock',
+ releasedAt: '2025-02-24',
settings: {
- extendParams: ['disableContextCaching'],
+ extendParams: ['disableContextCaching', 'enableReasoning', 'reasoningBudgetToken'],
},
source: 'builtin',
type: 'chat',
diff --git a/packages/model-runtime/src/providers/anthropic/index.test.ts b/packages/model-runtime/src/providers/anthropic/index.test.ts
index 2152bf00b3a..004b1affad0 100644
--- a/packages/model-runtime/src/providers/anthropic/index.test.ts
+++ b/packages/model-runtime/src/providers/anthropic/index.test.ts
@@ -60,7 +60,7 @@ describe('LobeAnthropicAI', () => {
it('should return a StreamingTextResponse on successful API call', async () => {
const result = await instance.chat({
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0,
});
@@ -82,7 +82,7 @@ describe('LobeAnthropicAI', () => {
// Act
const result = await instance.chat({
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0,
top_p: 1,
});
@@ -90,14 +90,14 @@ describe('LobeAnthropicAI', () => {
// Assert
expect(instance['client'].messages.create).toHaveBeenCalledWith(
expect.objectContaining({
- max_tokens: 4096,
+ max_tokens: 64000,
messages: [
{
content: [{ cache_control: { type: 'ephemeral' }, text: 'Hello', type: 'text' }],
role: 'user',
},
],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
stream: true,
temperature: 0,
top_p: 1,
@@ -172,7 +172,7 @@ describe('LobeAnthropicAI', () => {
const result = await instance.chat({
max_tokens: 2048,
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.5,
top_p: 1,
});
@@ -187,7 +187,7 @@ describe('LobeAnthropicAI', () => {
role: 'user',
},
],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
stream: true,
temperature: 0.25,
top_p: 1,
@@ -213,7 +213,7 @@ describe('LobeAnthropicAI', () => {
frequency_penalty: 0.5, // Unsupported option
max_tokens: 2048,
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
presence_penalty: 0.5,
temperature: 0.5,
top_p: 1,
@@ -229,7 +229,7 @@ describe('LobeAnthropicAI', () => {
role: 'user',
},
],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
stream: true,
temperature: 0.25,
top_p: 1,
@@ -267,7 +267,7 @@ describe('LobeAnthropicAI', () => {
// Act
await instance.chat({
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0,
});
@@ -289,7 +289,7 @@ describe('LobeAnthropicAI', () => {
// Act
await instance.chat({
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 1,
tools,
});
@@ -315,7 +315,7 @@ describe('LobeAnthropicAI', () => {
const payload: ChatStreamPayload = {
messages: [{ content: 'Search and get info', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.5,
tools,
enabledSearch: true,
@@ -341,7 +341,7 @@ describe('LobeAnthropicAI', () => {
const payload: ChatStreamPayload = {
messages: [{ content: 'Search for information', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.5,
enabledSearch: true,
};
@@ -380,7 +380,7 @@ describe('LobeAnthropicAI', () => {
// Act
await instance.chat({
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0,
});
} catch (e) {
@@ -411,7 +411,7 @@ describe('LobeAnthropicAI', () => {
// Act
await instance.chat({
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0,
});
} catch (e) {
@@ -445,7 +445,7 @@ describe('LobeAnthropicAI', () => {
await expect(
instance.chat({
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 1,
}),
).rejects.toEqual({
@@ -465,7 +465,7 @@ describe('LobeAnthropicAI', () => {
await expect(
instance.chat({
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 1,
}),
).rejects.toEqual({
@@ -489,7 +489,7 @@ describe('LobeAnthropicAI', () => {
await expect(
customInstance.chat({
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0,
}),
).rejects.toEqual({
@@ -510,7 +510,7 @@ describe('LobeAnthropicAI', () => {
await instance.chat(
{
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 1,
},
{ signal: controller.signal },
@@ -531,7 +531,7 @@ describe('LobeAnthropicAI', () => {
await instance.chat(
{
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0,
},
{
@@ -551,7 +551,7 @@ describe('LobeAnthropicAI', () => {
const result = await instance.chat(
{
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 1,
},
{ headers },
@@ -568,7 +568,7 @@ describe('LobeAnthropicAI', () => {
await expect(
instance.chat({
messages: [],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 1,
}),
).resolves.toBeInstanceOf(Response);
@@ -579,7 +579,7 @@ describe('LobeAnthropicAI', () => {
it('should correctly build payload with user messages only', async () => {
const payload: ChatStreamPayload = {
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.5,
};
@@ -587,14 +587,14 @@ describe('LobeAnthropicAI', () => {
expect(result).toEqual(
expect.objectContaining({
- max_tokens: 4096,
+ max_tokens: 64000,
messages: [
{
content: [{ cache_control: { type: 'ephemeral' }, text: 'Hello', type: 'text' }],
role: 'user',
},
],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.25,
}),
);
@@ -606,7 +606,7 @@ describe('LobeAnthropicAI', () => {
{ content: 'You are a helpful assistant', role: 'system' },
{ content: 'Hello', role: 'user' },
],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.7,
};
@@ -614,14 +614,14 @@ describe('LobeAnthropicAI', () => {
expect(result).toEqual(
expect.objectContaining({
- max_tokens: 4096,
+ max_tokens: 64000,
messages: [
{
content: [{ cache_control: { type: 'ephemeral' }, text: 'Hello', type: 'text' }],
role: 'user',
},
],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
system: [
{
cache_control: { type: 'ephemeral' },
@@ -677,7 +677,7 @@ describe('LobeAnthropicAI', () => {
{ content: ' \n\t ', role: 'system' },
{ content: 'Hello', role: 'user' },
],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.7,
};
@@ -710,7 +710,7 @@ describe('LobeAnthropicAI', () => {
const payload: ChatStreamPayload = {
messages: [{ content: 'Use a tool', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.8,
tools,
};
@@ -719,7 +719,7 @@ describe('LobeAnthropicAI', () => {
expect(result).toEqual(
expect.objectContaining({
- max_tokens: 4096,
+ max_tokens: 64000,
messages: [
{
content: [
@@ -728,7 +728,7 @@ describe('LobeAnthropicAI', () => {
role: 'user',
},
],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.4,
tools: [{ name: 'tool1', description: 'desc1' }],
}),
@@ -742,7 +742,7 @@ describe('LobeAnthropicAI', () => {
it('should correctly build payload with thinking mode enabled', async () => {
const payload: ChatStreamPayload = {
messages: [{ content: 'Solve this problem', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.9,
thinking: { type: 'enabled', budget_tokens: 0 },
};
@@ -750,7 +750,7 @@ describe('LobeAnthropicAI', () => {
const result = await buildDefaultAnthropicPayload(payload);
expect(result).toEqual({
- max_tokens: 4096,
+ max_tokens: 32000,
messages: [
{
content: [
@@ -759,7 +759,7 @@ describe('LobeAnthropicAI', () => {
role: 'user',
},
],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
system: undefined,
thinking: { type: 'enabled', budget_tokens: 1024 },
tools: undefined,
@@ -828,7 +828,7 @@ describe('LobeAnthropicAI', () => {
const payload: ChatStreamPayload = {
max_tokens: 1000,
messages: [{ content: 'Solve this problem', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.7,
thinking: { type: 'enabled', budget_tokens: 0 },
};
@@ -845,7 +845,7 @@ describe('LobeAnthropicAI', () => {
role: 'user',
},
],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
system: undefined,
thinking: { type: 'enabled', budget_tokens: 999 },
tools: undefined,
@@ -856,7 +856,7 @@ describe('LobeAnthropicAI', () => {
const payload: ChatStreamPayload = {
max_tokens: 1000,
messages: [{ content: 'Solve this problem', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.5,
thinking: { type: 'enabled', budget_tokens: 2000 },
};
@@ -873,7 +873,7 @@ describe('LobeAnthropicAI', () => {
role: 'user',
},
],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
system: undefined,
thinking: { type: 'enabled', budget_tokens: 999 },
tools: undefined,
@@ -884,7 +884,7 @@ describe('LobeAnthropicAI', () => {
const payload: ChatStreamPayload = {
max_tokens: 10000,
messages: [{ content: 'Solve this problem', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.6,
thinking: { type: 'enabled', budget_tokens: 60000 },
};
@@ -901,30 +901,18 @@ describe('LobeAnthropicAI', () => {
role: 'user',
},
],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
system: undefined,
thinking: { type: 'enabled', budget_tokens: 9999 },
tools: undefined,
});
});
- it('should set correct max_tokens based on model for claude-3 models', async () => {
- const payload: ChatStreamPayload = {
- messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
- temperature: 0.7,
- };
-
- const result = await buildDefaultAnthropicPayload(payload);
-
- expect(result.max_tokens).toBe(4096);
- });
-
it('should respect max_tokens when explicitly provided', async () => {
const payload: ChatStreamPayload = {
max_tokens: 2000,
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.7,
};
@@ -936,7 +924,7 @@ describe('LobeAnthropicAI', () => {
it('should correctly handle temperature scaling', async () => {
const payload: ChatStreamPayload = {
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 1,
};
@@ -950,7 +938,7 @@ describe('LobeAnthropicAI', () => {
// but since the type requires it, we'll use type assertion
const partialPayload = {
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
} as ChatStreamPayload;
// Delete the temperature property to simulate it not being provided
@@ -964,7 +952,7 @@ describe('LobeAnthropicAI', () => {
it('should not include top_p when thinking is enabled', async () => {
const payload: ChatStreamPayload = {
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.7,
thinking: { type: 'enabled', budget_tokens: 0 },
top_p: 0.9,
@@ -978,7 +966,7 @@ describe('LobeAnthropicAI', () => {
it('should include top_p when thinking is not enabled', async () => {
const payload: ChatStreamPayload = {
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.7,
top_p: 0.9,
};
@@ -991,7 +979,7 @@ describe('LobeAnthropicAI', () => {
it('should handle thinking with type disabled', async () => {
const payload: ChatStreamPayload = {
messages: [{ content: 'Hello', role: 'user' }],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.7,
thinking: { type: 'disabled', budget_tokens: 0 },
};
@@ -1001,14 +989,14 @@ describe('LobeAnthropicAI', () => {
// When thinking is disabled, it should be treated as if thinking wasn't provided
expect(result).toEqual(
expect.objectContaining({
- max_tokens: 4096,
+ max_tokens: 64000,
messages: [
{
content: [{ cache_control: { type: 'ephemeral' }, text: 'Hello', type: 'text' }],
role: 'user',
},
],
- model: 'claude-3-haiku-20240307',
+ model: 'claude-3-5-haiku-20241022',
temperature: 0.35,
}),
);
diff --git a/packages/model-runtime/src/providers/moonshot/index.ts b/packages/model-runtime/src/providers/moonshot/index.ts
index 8885ae1bbe7..408a547d78d 100644
--- a/packages/model-runtime/src/providers/moonshot/index.ts
+++ b/packages/model-runtime/src/providers/moonshot/index.ts
@@ -26,7 +26,7 @@ const DEFAULT_MOONSHOT_ANTHROPIC_BASE_URL = 'https://api.moonshot.cn/anthropic';
// Shared constants and helpers
const MOONSHOT_SEARCH_TOOL = { function: { name: '$web_search' }, type: 'builtin_function' } as any;
-const isKimiK25Model = (model: string) => model === 'kimi-k2.5';
+const isKimiK25Model = (model: string) => model.startsWith('kimi-k2.');
const isKimiNativeThinkingModel = (model: string) => model.startsWith('kimi-k2-thinking');
const isEmptyContent = (content: any) =>
content === '' || content === null || content === undefined;