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: Update Kimi K2.5 & Qwen3 Max Thinking models (#11925)

sxjeru6f9e01047b87
diff --git a/packages/model-bank/src/aiModels/google.ts b/packages/model-bank/src/aiModels/google.ts
index ad30ca6731e..0091c2942c6 100644
--- a/packages/model-bank/src/aiModels/google.ts
+++ b/packages/model-bank/src/aiModels/google.ts
@@ -651,25 +651,6 @@ const googleChatModels: AIChatModelCard[] = [
releasedAt: '2025-02-05',
type: 'chat',
},
- {
- abilities: {
- imageOutput: true,
- vision: true,
- },
- contextWindowTokens: 1_048_576 + 8192,
- description: 'A Gemini 2.0 Flash variant optimized for cost efficiency and low latency.',
- displayName: 'Gemini 2.0 Flash Exp',
- id: 'gemini-2.0-flash-exp',
- maxOutput: 8192,
- pricing: {
- units: [
- { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- releasedAt: '2025-02-05',
- type: 'chat',
- },
{
abilities: {
vision: true,
diff --git a/packages/model-bank/src/aiModels/moonshot.ts b/packages/model-bank/src/aiModels/moonshot.ts
index 2bf96e5f202..9edefc5578e 100644
--- a/packages/model-bank/src/aiModels/moonshot.ts
+++ b/packages/model-bank/src/aiModels/moonshot.ts
@@ -2,6 +2,34 @@ import { AIChatModelCard } from '../types/aiModel';
// https://platform.moonshot.cn/docs/pricing/chat
const moonshotChatModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ structuredOutput: true,
+ vision: true,
+ },
+ contextWindowTokens: 262_144,
+ 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: {
+ currency: 'CNY',
+ units: [
+ { 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: '2026-01-27',
+ settings: {
+ extendParams: ['enableReasoning'],
+ },
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
@@ -12,7 +40,6 @@ const moonshotChatModels: AIChatModelCard[] = [
description:
'K2 long-thinking model with 256k context, supporting multi-step tool use and reasoning for complex problems.',
displayName: 'Kimi K2 Thinking',
- enabled: true,
id: 'kimi-k2-thinking',
maxOutput: 65_536,
pricing: {
@@ -58,7 +85,6 @@ const moonshotChatModels: AIChatModelCard[] = [
description:
'kimi-k2-0905-preview offers a 256k context window, stronger agentic coding, better front-end code quality, and improved context understanding.',
displayName: 'Kimi K2 0905',
- enabled: true,
id: 'kimi-k2-0905-preview',
pricing: {
currency: 'CNY',
@@ -126,8 +152,32 @@ const moonshotChatModels: AIChatModelCard[] = [
currency: 'CNY',
units: [
{ name: 'textInput_cacheRead', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.008_192]': 2,
+ '[0.008_193, 0.032_768]': 5,
+ '[0.032_769, 0.131_072]': 10,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.008_192]': 10,
+ '[0.008_193, 0.032_768]': 20,
+ '[0.032_769, 0.131_072]': 30,
+ },
+ pricingParams: ['textInput'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
],
},
releasedAt: '2025-02-17',
@@ -138,7 +188,8 @@ const moonshotChatModels: AIChatModelCard[] = [
functionCall: true,
},
contextWindowTokens: 131_072,
- description: 'Moonshot V1 Auto selects the appropriate model based on current context token usage.',
+ description:
+ 'Moonshot V1 Auto selects the appropriate model based on current context token usage.',
displayName: 'Moonshot V1 Auto',
id: 'moonshot-v1-auto',
pricing: {
diff --git a/packages/model-bank/src/aiModels/ollamacloud.ts b/packages/model-bank/src/aiModels/ollamacloud.ts
index bc06ff081b1..bf9f6d70ae7 100644
--- a/packages/model-bank/src/aiModels/ollamacloud.ts
+++ b/packages/model-bank/src/aiModels/ollamacloud.ts
@@ -1,6 +1,20 @@
import { AIChatModelCard } from '../types/aiModel';
const ollamaCloudModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ vision: true,
+ },
+ contextWindowTokens: 262_144,
+ 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',
+ },
{
abilities: {
functionCall: true,
diff --git a/packages/model-bank/src/aiModels/openrouter.ts b/packages/model-bank/src/aiModels/openrouter.ts
index a4fd293ec3f..98cb3389bb6 100644
--- a/packages/model-bank/src/aiModels/openrouter.ts
+++ b/packages/model-bank/src/aiModels/openrouter.ts
@@ -1079,20 +1079,6 @@ const openrouterChatModels: AIChatModelCard[] = [
id: 'google/gemma-2-9b-it:free',
type: 'chat',
},
- {
- abilities: {
- functionCall: true,
- vision: true,
- },
- contextWindowTokens: 1_048_576 + 8192,
- description:
- 'Gemini 2.0 Flash Experimental is Google’s latest experimental multimodal AI model with quality improvements over prior versions, especially in world knowledge, code, and long context.',
- displayName: 'Gemini 2.0 Flash Experimental (Free)',
- id: 'google/gemini-2.0-flash-exp:free',
- maxOutput: 8192,
- releasedAt: '2024-12-11',
- type: 'chat',
- },
];
export const allModels = [...openrouterChatModels];
diff --git a/packages/model-bank/src/aiModels/qwen.ts b/packages/model-bank/src/aiModels/qwen.ts
index 0ac4a90f7ba..d2d8ccd509f 100644
--- a/packages/model-bank/src/aiModels/qwen.ts
+++ b/packages/model-bank/src/aiModels/qwen.ts
@@ -3,6 +3,55 @@ import { AIChatModelCard, AIImageModelCard } from '../types/aiModel';
// https://help.aliyun.com/zh/model-studio/models?spm=a2c4g.11186623
const qwenChatModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ vision: true,
+ },
+ contextWindowTokens: 262_144,
+ description:
+ 'Kimi K2.5 is the most capable Kimi model, delivering open-source SOTA in agent tasks, coding, and vision understanding. It supports multimodal inputs and both thinking and non-thinking modes.',
+ displayName: 'Kimi K2.5',
+ id: 'kimi-k2.5',
+ maxOutput: 32_768,
+ organization: 'Qwen',
+ pricing: {
+ currency: 'CNY',
+ units: [
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 21, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ settings: {
+ extendParams: ['enableReasoning', 'reasoningBudgetToken'],
+ },
+ type: 'chat',
+ },
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ search: true,
+ },
+ contextWindowTokens: 204_800,
+ description:
+ 'MiniMax-M2.1 is a flagship open-source large model from MiniMax, focusing on solving complex real-world tasks. Its core strengths are multi-language programming capabilities and the ability to solve complex tasks as an Agent.',
+ displayName: 'MiniMax-M2.1',
+ id: 'MiniMax-M2.1',
+ maxOutput: 32_768,
+ pricing: {
+ currency: 'CNY',
+ units: [
+ { name: 'textInput', rate: 2.1, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 8.4, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ settings: {
+ searchImpl: 'params',
+ },
+ type: 'chat',
+ },
{
abilities: {
reasoning: true,
@@ -61,7 +110,7 @@ const qwenChatModels: AIChatModelCard[] = [
vision: true,
},
config: {
- deploymentName: 'qwen3-vl-flash-2025-10-15',
+ deploymentName: 'qwen3-vl-flash-2026-01-22',
},
contextWindowTokens: 262_144,
description:
@@ -101,7 +150,6 @@ const qwenChatModels: AIChatModelCard[] = [
},
],
},
- releasedAt: '2025-10-15',
settings: {
extendParams: ['enableReasoning', 'reasoningBudgetToken'],
},
@@ -1019,7 +1067,8 @@ const qwenChatModels: AIChatModelCard[] = [
deploymentName: 'qwen-plus-2025-12-01',
},
contextWindowTokens: 1_000_000,
- description: 'Enhanced ultra-large Qwen model supporting Chinese, English, and other languages.',
+ description:
+ 'Enhanced ultra-large Qwen model supporting Chinese, English, and other languages.',
displayName: 'Qwen Plus',
enabled: true,
id: 'qwen-plus',
@@ -1078,6 +1127,57 @@ const qwenChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
+ {
+ abilities: {
+ functionCall: true,
+ search: true,
+ reasoning: true,
+ },
+ contextWindowTokens: 262_144,
+ description:
+ 'Qwen3 Max models deliver large gains over the 2.5 series in general ability, Chinese/English understanding, complex instruction following, subjective open tasks, multilingual ability, and tool use, with fewer hallucinations. The latest qwen3-max improves agentic programming and tool use over qwen3-max-preview. This release reaches field SOTA and targets more complex agent needs.',
+ displayName: 'Qwen3 Max Thinking',
+ id: 'qwen3-max-2026-01-23',
+ maxOutput: 65_536,
+ organization: 'Qwen',
+ pricing: {
+ currency: 'CNY',
+ units: [
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 2.5,
+ '[0.032, 0.128]': 4,
+ '[0.128, 0.252]': 7,
+ },
+ pricingParams: ['textInputRange'],
+ },
+ name: 'textInput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ {
+ lookup: {
+ prices: {
+ '[0, 0.032]': 10,
+ '[0.032, 0.128]': 16,
+ '[0.128, 0.252]': 28,
+ },
+ pricingParams: ['textInputRange'],
+ },
+ name: 'textOutput',
+ strategy: 'lookup',
+ unit: 'millionTokens',
+ },
+ ],
+ },
+ releasedAt: '2026-01-23',
+ settings: {
+ extendParams: ['enableReasoning', 'reasoningBudgetToken'],
+ searchImpl: 'params',
+ },
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
@@ -1477,7 +1577,8 @@ const qwenChatModels: AIChatModelCard[] = [
vision: true,
},
contextWindowTokens: 131_072,
- description: 'Qwen3 VL 8B non-thinking mode (Instruct) for standard multimodal generation and recognition.',
+ description:
+ 'Qwen3 VL 8B non-thinking mode (Instruct) for standard multimodal generation and recognition.',
displayName: 'Qwen3 VL 8B Instruct',
id: 'qwen3-vl-8b-instruct',
maxOutput: 32_768,
diff --git a/packages/model-bank/src/aiModels/siliconcloud.ts b/packages/model-bank/src/aiModels/siliconcloud.ts
index 3025ca680a2..4fb55788aa0 100644
--- a/packages/model-bank/src/aiModels/siliconcloud.ts
+++ b/packages/model-bank/src/aiModels/siliconcloud.ts
@@ -2,6 +2,45 @@ import { AIChatModelCard, AIImageModelCard } from '../types/aiModel';
// https://siliconflow.cn/zh-cn/models
const siliconcloudChatModels: AIChatModelCard[] = [
+ {
+ abilities: {
+ functionCall: true,
+ reasoning: true,
+ vision: true,
+ },
+ contextWindowTokens: 262_144,
+ description:
+ 'Kimi K2.5 is an open-source native multimodal agent model, built on Kimi-K2-Base, trained on approximately 1.5 trillion mixed vision and text tokens. The model adopts an MoE architecture with 1T total parameters and 32B active parameters, supporting a 256K context window, seamlessly integrating vision and language understanding capabilities.',
+ displayName: 'Kimi-K2.5 (Pro)',
+ id: 'Pro/moonshotai/Kimi-K2.5',
+ pricing: {
+ currency: 'CNY',
+ units: [
+ { name: 'textInput', rate: 4, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 21, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ releasedAt: '2026-01-27',
+ type: 'chat',
+ },
+ {
+ abilities: {
+ vision: true,
+ },
+ description:
+ 'PaddleOCR-VL-1.5 is an upgraded version of the PaddleOCR-VL series, achieving 94.5% accuracy on the OmniDocBench v1.5 document parsing benchmark, surpassing leading general large models and specialized document parsing models. It innovatively supports irregular bounding box localization for document elements, handling scanned, tilted, and screen-captured images effectively.',
+ displayName: 'PaddleOCR-VL 1.5',
+ id: 'PaddlePaddle/PaddleOCR-VL-1.5',
+ pricing: {
+ currency: 'CNY',
+ units: [
+ { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
+ { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
+ ],
+ },
+ releasedAt: '2026-01-29',
+ type: 'chat',
+ },
{
abilities: {
functionCall: true,
diff --git a/packages/model-bank/src/aiModels/wenxin.ts b/packages/model-bank/src/aiModels/wenxin.ts
index 7e0400c8b6c..b813cc8ecc0 100644
--- a/packages/model-bank/src/aiModels/wenxin.ts
+++ b/packages/model-bank/src/aiModels/wenxin.ts
@@ -191,37 +191,6 @@ const wenxinChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- contextWindowTokens: 131_072,
- description:
- 'ERNIE Speed 128K is a no-I/O-fee model for long-text understanding and large-scale trials.',
- displayName: 'ERNIE Speed 128K',
- id: 'ernie-speed-128k',
- maxOutput: 4096,
- pricing: {
- currency: 'CNY',
- units: [
- { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
- {
- contextWindowTokens: 8192,
- description: 'ERNIE Speed 8K is a free, fast model for daily chat and light text tasks.',
- displayName: 'ERNIE Speed 8K',
- id: 'ernie-speed-8k',
- maxOutput: 2048,
- pricing: {
- currency: 'CNY',
- units: [
- { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
contextWindowTokens: 131_072,
description:
@@ -238,22 +207,6 @@ const wenxinChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- contextWindowTokens: 8192,
- description:
- 'ERNIE Lite 8K is a lightweight general model for cost-sensitive daily QA and content generation.',
- displayName: 'ERNIE Lite 8K',
- id: 'ernie-lite-8k',
- maxOutput: 2048,
- pricing: {
- currency: 'CNY',
- units: [
- { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
abilities: {
functionCall: true,
@@ -273,22 +226,6 @@ const wenxinChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- contextWindowTokens: 8192,
- description:
- 'ERNIE Tiny 8K is ultra-lightweight for simple QA, classification, and low-cost inference.',
- displayName: 'ERNIE Tiny 8K',
- id: 'ernie-tiny-8k',
- maxOutput: 2048,
- pricing: {
- currency: 'CNY',
- units: [
- { name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- type: 'chat',
- },
{
contextWindowTokens: 8192,
description:
@@ -486,24 +423,6 @@ const wenxinChatModels: AIChatModelCard[] = [
maxOutput: 2048,
type: 'chat',
},
- {
- contextWindowTokens: 32_768,
- description:
- 'Qianfan Agent Speed 32K is a high-throughput agent model for large-scale, multi-task agent apps.',
- displayName: 'Qianfan Agent Speed 32K',
- id: 'qianfan-agent-speed-32k',
- maxOutput: 4096,
- type: 'chat',
- },
- {
- contextWindowTokens: 8192,
- description:
- 'Qianfan Agent Speed 8K is a high-concurrency agent model for short-to-mid conversations and fast response.',
- displayName: 'Qianfan Agent Speed 8K',
- id: 'qianfan-agent-speed-8k',
- maxOutput: 2048,
- type: 'chat',
- },
{
abilities: {
vision: true,
@@ -1616,24 +1535,6 @@ const wenxinChatModels: AIChatModelCard[] = [
},
type: 'chat',
},
- {
- contextWindowTokens: 32_768,
- description: 'Qwen3 235B A22B is a general large model for complex tasks.',
- displayName: 'Qwen3 235B A22B',
- id: 'qwen3-235b-a22b',
- maxOutput: 8192,
- pricing: {
- currency: 'CNY',
- units: [
- { name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
- { name: 'textOutput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
- ],
- },
- settings: {
- extendParams: ['enableReasoning', 'reasoningBudgetToken'],
- },
- type: 'chat',
- },
{
contextWindowTokens: 32_768,
description: 'Qwen3 30B A3B is a mid-large general model balancing cost and quality.',
diff --git a/packages/model-runtime/src/core/contextBuilders/openai.test.ts b/packages/model-runtime/src/core/contextBuilders/openai.test.ts
index 4ffa2db3fa2..a6f4a8ead81 100644
--- a/packages/model-runtime/src/core/contextBuilders/openai.test.ts
+++ b/packages/model-runtime/src/core/contextBuilders/openai.test.ts
@@ -73,6 +73,30 @@ describe('convertMessageContent', () => {
expect(result).toEqual(content);
expect(imageUrlToBase64).not.toHaveBeenCalled();
});
+
+ it('should convert image URL when forceImageBase64 is true', async () => {
+ process.env.LLM_VISION_IMAGE_USE_BASE64 = undefined;
+
+ const content = {
+ type: 'image_url',
+ image_url: { url: 'https://example.com/image.jpg' },
+ } as OpenAI.ChatCompletionContentPart;
+
+ vi.mocked(parseDataUri).mockReturnValue({ type: 'url', base64: null, mimeType: null });
+ vi.mocked(imageUrlToBase64).mockResolvedValue({
+ base64: 'forcedBase64',
+ mimeType: 'image/jpeg',
+ });
+
+ const result = await convertMessageContent(content, { forceImageBase64: true });
+
+ expect(result).toEqual({
+ type: 'image_url',
+ image_url: { url: 'data:image/jpeg;base64,forcedBase64' },
+ });
+
+ expect(imageUrlToBase64).toHaveBeenCalledWith('https://example.com/image.jpg');
+ });
});
describe('convertOpenAIMessages', () => {
diff --git a/packages/model-runtime/src/core/contextBuilders/openai.ts b/packages/model-runtime/src/core/contextBuilders/openai.ts
index 1a8b53b0e95..ca361a34ebb 100644
--- a/packages/model-runtime/src/core/contextBuilders/openai.ts
+++ b/packages/model-runtime/src/core/contextBuilders/openai.ts
@@ -5,13 +5,21 @@ import { disableStreamModels, systemToUserModels } from '../../const/models';
import { ChatStreamPayload, OpenAIChatMessage } from '../../types';
import { parseDataUri } from '../../utils/uriParser';
+type ConvertMessageContentOptions = {
+ forceImageBase64?: boolean;
+};
+
export const convertMessageContent = async (
content: OpenAI.ChatCompletionContentPart,
+ options?: ConvertMessageContentOptions,
): Promise<OpenAI.ChatCompletionContentPart> => {
if (content.type === 'image_url') {
const { type } = parseDataUri(content.image_url.url);
- if (type === 'url' && process.env.LLM_VISION_IMAGE_USE_BASE64 === '1') {
+ const shouldUseBase64 =
+ options?.forceImageBase64 || process.env.LLM_VISION_IMAGE_USE_BASE64 === '1';
+
+ if (type === 'url' && shouldUseBase64) {
const { base64, mimeType } = await imageUrlToBase64(content.image_url.url);
return {
@@ -24,7 +32,10 @@ export const convertMessageContent = async (
return content;
};
-export const convertOpenAIMessages = async (messages: OpenAI.ChatCompletionMessageParam[]) => {
+export const convertOpenAIMessages = async (
+ messages: OpenAI.ChatCompletionMessageParam[],
+ options?: ConvertMessageContentOptions,
+) => {
return (await Promise.all(
messages.map(async (message) => {
const msg = message as any;
@@ -37,7 +48,7 @@ export const convertOpenAIMessages = async (messages: OpenAI.ChatCompletionMessa
? message.content
: await Promise.all(
(message.content || []).map((c) =>
- convertMessageContent(c as OpenAI.ChatCompletionContentPart),
+ convertMessageContent(c as OpenAI.ChatCompletionContentPart, options),
),
),
role: msg.role,
@@ -59,7 +70,10 @@ export const convertOpenAIMessages = async (messages: OpenAI.ChatCompletionMessa
)) as OpenAI.ChatCompletionMessageParam[];
};
-export const convertOpenAIResponseInputs = async (messages: OpenAIChatMessage[]) => {
+export const convertOpenAIResponseInputs = async (
+ messages: OpenAIChatMessage[],
+ options?: ConvertMessageContentOptions,
+) => {
let input: OpenAI.Responses.ResponseInputItem[] = [];
await Promise.all(
messages.map(async (message) => {
@@ -113,7 +127,10 @@ export const convertOpenAIResponseInputs = async (messages: OpenAIChatMessage[])
return { ...c, type: 'input_text' };
}
- const image = await convertMessageContent(c as OpenAI.ChatCompletionContentPart);
+ const image = await convertMessageContent(
+ c as OpenAI.ChatCompletionContentPart,
+ options,
+ );
return {
image_url: (image as OpenAI.ChatCompletionContentPartImage).image_url?.url,
type: 'input_image',
diff --git a/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts b/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts
index 0c5c5547df8..d5fbc5dd394 100644
--- a/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts
+++ b/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts
@@ -73,6 +73,7 @@ export interface OpenAICompatibleFactoryOptions<T extends Record<string, any> =
baseURL?: string;
chatCompletion?: {
excludeUsage?: boolean;
+ forceImageBase64?: boolean;
handleError?: (
error: any,
options: ConstructorOptions<T>,
@@ -387,7 +388,9 @@ export const createOpenAICompatibleRuntime = <T extends Record<string, any> = an
this.baseURL = targetBaseURL;
}
- const messages = await convertOpenAIMessages(postPayload.messages);
+ const messages = await convertOpenAIMessages(postPayload.messages, {
+ forceImageBase64: chatCompletion?.forceImageBase64,
+ });
let response: Stream<OpenAI.Chat.Completions.ChatCompletionChunk>;
@@ -877,7 +880,9 @@ export const createOpenAICompatibleRuntime = <T extends Record<string, any> = an
delete res.frequency_penalty;
delete res.presence_penalty;
- const input = await convertOpenAIResponseInputs(messages as any);
+ const input = await convertOpenAIResponseInputs(messages as any, {
+ forceImageBase64: chatCompletion?.forceImageBase64,
+ });
const isStreaming = payload.stream !== false;
log(
@@ -1006,7 +1011,9 @@ export const createOpenAICompatibleRuntime = <T extends Record<string, any> = an
if (shouldUseResponses) {
log('calling responses.create for tool calling');
- const input = await convertOpenAIResponseInputs(messages as any);
+ const input = await convertOpenAIResponseInputs(messages as any, {
+ forceImageBase64: chatCompletion?.forceImageBase64,
+ });
const res = await this.client.responses.create(
{
diff --git a/packages/model-runtime/src/providers/moonshot/index.ts b/packages/model-runtime/src/providers/moonshot/index.ts
index 44dd46cd903..b1820aea866 100644
--- a/packages/model-runtime/src/providers/moonshot/index.ts
+++ b/packages/model-runtime/src/providers/moonshot/index.ts
@@ -15,8 +15,9 @@ export interface MoonshotModelCard {
export const params = {
baseURL: 'https://api.moonshot.cn/v1',
chatCompletion: {
+ forceImageBase64: true,
handlePayload: (payload: ChatStreamPayload) => {
- const { enabledSearch, messages, temperature, tools, ...rest } = payload;
+ const { enabledSearch, messages, model, temperature, thinking, tools, ...rest } = payload;
const filteredMessages = messages.map((message: any) => {
let normalizedMessage = message;
@@ -51,12 +52,33 @@ export const params = {
]
: tools;
- // Resolve parameters with normalization
+ const isK25Model = model === 'kimi-k2.5';
+
+ if (isK25Model) {
+ const thinkingParam =
+ thinking?.type === 'disabled' ? { type: 'disabled' } : { type: 'enabled' };
+ const isThinkingEnabled = thinkingParam.type === 'enabled';
+
+ return {
+ ...rest,
+ frequency_penalty: 0,
+ messages: filteredMessages,
+ model,
+ presence_penalty: 0,
+ temperature: isThinkingEnabled ? 1 : 0.6,
+ thinking: thinkingParam,
+ tools: moonshotTools,
+ top_p: 0.95,
+ } as any;
+ }
+
+ // Resolve parameters with normalization for non-K2.5 models
const resolvedParams = resolveParameters({ temperature }, { normalizeTemperature: true });
return {
...rest,
messages: filteredMessages,
+ model,
temperature: resolvedParams.temperature,
tools: moonshotTools,
} as any;
diff --git a/packages/model-runtime/src/providers/qwen/index.ts b/packages/model-runtime/src/providers/qwen/index.ts
index 36b502e8084..1162b7ab1ea 100644
--- a/packages/model-runtime/src/providers/qwen/index.ts
+++ b/packages/model-runtime/src/providers/qwen/index.ts
@@ -47,24 +47,25 @@ export const LobeQwenAI = createOpenAICompatibleRuntime({
...rest,
...(model.includes('-thinking')
? {
- enable_thinking: true,
+ enable_thinking: true,
+ thinking_budget:
+ thinking?.budget_tokens === 0 ? 0 : thinking?.budget_tokens || undefined,
+ }
+ : [
+ 'qwen3',
+ 'qwen-turbo',
+ 'qwen-plus',
+ 'qwen-flash',
+ 'deepseek-v3.1',
+ 'deepseek-v3.2',
+ 'glm',
+ 'kimi-k2.5',
+ ].some((keyword) => model.toLowerCase().includes(keyword))
+ ? {
+ enable_thinking: thinking !== undefined ? thinking.type === 'enabled' : false,
thinking_budget:
thinking?.budget_tokens === 0 ? 0 : thinking?.budget_tokens || undefined,
}
- : [
- 'qwen3',
- 'qwen-turbo',
- 'qwen-plus',
- 'qwen-flash',
- 'deepseek-v3.1',
- 'deepseek-v3.2',
- 'glm',
- ].some((keyword) => model.toLowerCase().includes(keyword))
- ? {
- enable_thinking: thinking !== undefined ? thinking.type === 'enabled' : false,
- thinking_budget:
- thinking?.budget_tokens === 0 ? 0 : thinking?.budget_tokens || undefined,
- }
: {}),
frequency_penalty: undefined,
model,