kimi-code icon indicating copy to clipboard operation
kimi-code copied to clipboard

[Bug] kimi-for-coding 在关闭 thinking 模式后报错 invalid temperature: only 0.6 is allowed

Open 53422245 opened this issue 5 months ago • 3 comments

What version of Kimi Code is running?

0.14.1

Which open platform/subscription were you using?

Kimi Code (OAuth)

Which model were you using?

No response

What platform is your computer?

No response

What issue are you seeing?

当在 Kimi Code CLI 中关闭 thinking 模式后,使用 kimi-for-coding 模型会立即报错:

400 invalid temperature: only 0.6 is allowed for this model

开启 thinking 模式时一切正常。

What steps can reproduce the bug?

  1. 启动 Kimi Code CLI,默认模型为 kimi-code/kimi-for-coding
  2. 在界面中关闭 thinking 模式
  3. 发送任意消息
  4. 观察到上述 400 错误

What is the expected behavior?

关闭 thinking 模式后,Kimi Code CLI 应该自动将 temperature 设置为 0.6(根据 Moonshot 官方文档,kimi-k2.6/kimi-k2.5/kimi-for-coding 非 thinking 模式要求 temperature=0.6),请求应正常返回。

Additional information

相关日志

2026-06-12T04:23:12.790Z INFO  llm config  turnStep=0.1 provider=kimi model=kimi-for-coding ...
2026-06-12T04:23:13.121Z WARN  llm request failed  ... errorMessage="400 invalid temperature: only 0.6 is allowed for this model" statusCode=400

相关配置

default_model = "kimi-code/kimi-for-coding"
default_thinking = true

[models."kimi-code/kimi-for-coding"]
provider = "managed:kimi-code"
model = "kimi-for-coding"
max_context_size = 262144
capabilities = [ "thinking", "video_in", "image_in" ]

参考

根据 Moonshot 官方文档,kimi-k2.6 / kimi-k2.5 / kimi-for-coding 模型的 temperature 约束:

  • Thinking 模式:temperature 必须为 1.0
  • 非 Thinking 模式:temperature 必须为 0.6

目前 Kimi Code CLI 在 thinking 关闭时没有正确切换到 0.6。

53422245 avatar Jun 12 '26 06:06 53422245

你是用的 python 版本还是 ts 版本 cli 啊

liruifengv avatar Jun 12 '26 08:06 liruifengv

你是用的 python 版本还是 ts 版本 cli 啊

用的是 ts 的版本。

现在看可能和 https://platform.kimi.ai/docs/guide/use-kimi-k2-thinking-model 有关。

Image

网页上看模型更新了 Image

kimi code 中还无法选择 2.7 Image

53422245 avatar Jun 13 '26 06:06 53422245

这个问题可以关闭了。根因是我本地的模型显示名称配置导致了对当前模型能力边界的误判,不是 Kimi Code CLI 本身的 bug。

现象

在 Kimi Code CLI 中使用 kimi-for-coding 模型,开启 thinking 模式时正常;关闭 thinking 模式后,请求报错:

400 invalid temperature: only 0.6 is allowed for this model

同时 UI 中模型显示为 Kimi-k2.6(之前还曾手动改为 Kimi-k2.7)。

根因

本地 ~/.kimi-code/config.toml 给模型设置了自定义 display_name:

[models."kimi-code/kimi-for-coding"]
provider = "managed:kimi-code"
model = "kimi-for-coding"
max_context_size = 262144
capabilities = [ "thinking", "video_in", "image_in" ]
display_name = "Kimi-k2.6"

display_name 只是 UI 展示别名,不改变实际调用的模型。但这个自定义显示名让我误以为当前模型就是 kimi-k2.6 或 kimi-k2.7,从而错误地期望它可以像 K2.6 一样在 thinking / 非 thinking 模式间切换。实际上当前托管模型 kimi-for-coding 的约束与 K2.7-code 系列一致:仅支持 thinking 模式,关闭 thinking 会触发 API 400 错误。

证据链

1. kimi-for-coding 是 Kimi Code 托管服务的模型别名

  • 在 Kimi 开放平台官方模型列表中(https://platform.kimi.com/docs/models),并没有名为 kimi-for-coding 的公开模型。
  • 官方列出的 Coding 模型是 kimi-k2.7-code 和 kimi-k2.7-code-highspeed。
  • kimi-for-coding 只出现在 Kimi Code CLI 的托管 provider(managed:kimi-code)配置中,是 Kimi Code 服务内部路由使用的标识,不是开放平台模型名。

2. kimi-k2.7-code 系列仅支持 thinking 模式,不可关闭

Kimi 官方文档明确说明:

  • Kimi K2.7 Code 的产品说明(https://platform.kimi.com/docs/pricing/chat-k27-code):

    "Kimi K2.7 Code 是 Kimi 迄今最智能的 Coding 模型……仅支持思考模式,对话与 Agent 任务"

  • 在"使用思考模型"文档(https://platform.kimi.com/docs/guide/use-kimi-k2-thinking-model)的 kimi-k2.7-code 示例中,注释写明:

    # temperature 不可修改、thinking 始终开启,均无需设置

  • 阿里云 Model Studio 的 Kimi 参数表(https://help.aliyun.com/en/model-studio/kimi-api-by-moonshot-ai)也写明:

    kimi/kimi-k2.7-code:enable_thinking = true(仅思考模式,不可关闭)

3. display_name 是本地 UI 别名,不影响真实模型

Kimi Code 官方配置文档(https://moonshotai.github.io/kimi-code/en/configuration/config-files.html)对 models.*.display_name 的说明:

display_name | string | No | Name shown in the UI; falls back to model when unset

也就是说它只是一个显示名称,未设置时自动回退到 model 字段。把它设成 Kimi-k2.6 或 Kimi-k2.7 并不能改变后端实际调用的模型及其约束。

解决办法

删除配置中的 display_name,让 UI 显示真实模型标识,避免再被别名误导:

[models."kimi-code/kimi-for-coding"]
provider = "managed:kimi-code"
model = "kimi-for-coding"
max_context_size = 262144
capabilities = [ "thinking", "video_in", "image_in" ]

然后执行 /reload reload 配置。对于 kimi-for-coding / K2.7-code 系列模型,保持 thinking 开启即可正常使用。

感谢维护者的回复。

53422245 avatar Jun 24 '26 02:06 53422245