From 5c7f3229a2fca484b87017376415291df101252f Mon Sep 17 00:00:00 2001 From: Yuxi Long / Jaden Long Date: Wed, 28 Jan 2026 23:11:13 -0500 Subject: [PATCH] feat: allow Kimi K2.5 to be specified via Model Name (#12639) * feat: allow Kimi K2.5 to be specified via Model Name * fix: allow Kimi K2.5 specified via Model Name through button renderer --- src/renderer/src/config/models/reasoning.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/renderer/src/config/models/reasoning.ts b/src/renderer/src/config/models/reasoning.ts index b3e81d98a3..f6abf89e88 100644 --- a/src/renderer/src/config/models/reasoning.ts +++ b/src/renderer/src/config/models/reasoning.ts @@ -603,11 +603,16 @@ export const isSupportedThinkingTokenMiMoModel = (model: Model): boolean => { * @param model - The model object to check * @returns true if the model supports thinking control, false otherwise */ -export const isSupportedThinkingTokenKimiModel = (model: Model): boolean => { +const _isSupportedThinkingTokenKimiModel = (model: Model): boolean => { const modelId = getLowerBaseModelName(model.id, '/') return ['kimi-k2.5'].some((id) => modelId.includes(id)) } +export const isSupportedThinkingTokenKimiModel = (model: Model): boolean => { + const { idResult, nameResult } = withModelIdAndNameAsId(model, _isSupportedThinkingTokenKimiModel) + return idResult || nameResult +} + export const isDeepSeekHybridInferenceModel = (model: Model) => { const { idResult, nameResult } = withModelIdAndNameAsId(model, (model) => { const modelId = getLowerBaseModelName(model.id) @@ -685,16 +690,21 @@ export const isBaichuanReasoningModel = (model?: Model): boolean => { * @param model - The model object to check, can be undefined * @returns true if it's a Kimi reasoning model, false otherwise */ -export function isKimiReasoningModel(model?: Model): boolean { - if (!model) { - return false - } +const _isKimiReasoningModel = (model: Model): boolean => { const modelId = getLowerBaseModelName(model.id, '/') // Match kimi-k2-thinking, kimi-k2-thinking-turbo, or kimi-k2.5 // The regex ensures no extra suffixes after these patterns return /^kimi-k2-thinking(?:-turbo)?$|^kimi-k2\.5(?:-\w)*$/.test(modelId) } +export function isKimiReasoningModel(model?: Model): boolean { + if (!model) { + return false + } + const { idResult, nameResult } = withModelIdAndNameAsId(model, _isKimiReasoningModel) + return idResult || nameResult +} + export function isReasoningModel(model?: Model): boolean { if (!model || isEmbeddingModel(model) || isRerankModel(model) || isTextToImageModel(model)) { return false