Skip to content

feat(moonshot): add kimi-k3 and kimi-k2.7-code model support#3458

Merged
lin-snow merged 6 commits into
mainfrom
feat/moonshot-kimi-k3-k27-code
Jul 17, 2026
Merged

feat(moonshot): add kimi-k3 and kimi-k2.7-code model support#3458
lin-snow merged 6 commits into
mainfrom
feat/moonshot-kimi-k3-k27-code

Conversation

@lin-snow

Copy link
Copy Markdown
Contributor

Summary

Add the latest Kimi models to the Moonshot plugin: kimi-k3, kimi-k2.7-code, and kimi-k2.7-code-highspeed.

  • kimi-k3: 1M context (1,048,576), vision + tool calling, thinking always enabled. Pricing ¥20/¥100 per 1M tokens (CN platform, cache-miss input / output).
  • kimi-k2.7-code / -highspeed: 256K context (262,144), vision + tool calling, thinking mandatory. Pricing ¥6.5/¥27 and ¥13/¥54.

Per official docs, both generations lock temperature / top_p / penalties to fixed values (overriding triggers errors) and do not support non-thinking mode, so these models intentionally expose neither the sampling parameters nor the thinking toggle. llm.py's thinking-model detection is extended to k3 / k2.7 so assistant messages round-trip reasoning_content, which the API requires for multi-turn tool calling.

References: K3 quickstart, K2.7 Code quickstart, K3 pricing, K2.7 Code pricing, Chat API reference

Change Type

  • Documentation / non-plugin change
  • Non-LLM plugin (tools, extensions, datasource, etc.)
  • LLM plugin

Screenshots / Videos

N/A — no K3-enabled API key available; see Testing notes below.

LLM Plugin Checklist

Areas affected by this change (check all that apply)
  • Message flow (system messages, user ↔ assistant turn-taking)
  • Tool interaction flow (multi-round usage, Agent App and Agent Node)
  • Multimodal input (images, PDFs, audio, video, etc.)
  • Multimodal output (images, audio, video, etc.)
  • Structured output (JSON, XML, etc.)
  • Token consumption metrics
  • Other LLM functionality (reasoning, grounding, prompt caching, etc.)
  • New models / model parameter fixes

Version

  • Bumped top-level version in manifest.yaml (not the one under meta) — 0.1.8 → 0.1.9
  • dify_plugin is declared in pyproject.toml (>=0.9.0) and locked in uv.lock

Testing

  • Local deployment — Dify version:
  • SaaS (cloud.dify.ai)

Not runtime-tested: no K3-enabled API key was available. Verification done instead:

  • Every field (model IDs, context sizes, max tokens, features, fixed parameters, tool_choice constraints, reasoning_content round-trip requirement, pricing) cross-checked against the official quickstarts, pricing pages, and chat API reference on both platform.kimi.ai (intl) and platform.kimi.com (CN).
  • All three model YAMLs load successfully through the SDK's AIModelEntity schema validation.
  • tool_choice sent by the OAI-compat SDK is "auto", within kimi-k2.7-code's allowed values (auto / none).

Runtime verification by a reviewer with K3 API access would be appreciated.

Copilot AI review requested due to automatic review settings July 17, 2026 11:50
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jul 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dosubot dosubot Bot added the enhancement New feature or request label Jul 17, 2026
@lin-snow lin-snow self-assigned this Jul 17, 2026
@lin-snow
lin-snow force-pushed the feat/moonshot-kimi-k3-k27-code branch from 163e309 to e793121 Compare July 17, 2026 11:51
@lin-snow
lin-snow enabled auto-merge (squash) July 17, 2026 11:56
@lin-snow
lin-snow requested a review from WH-2099 July 17, 2026 11:57

@WH-2099 WH-2099 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just wait a moment

@asukaminato0721

Copy link
Copy Markdown
Contributor

lgtm

Copilot AI review requested due to automatic review settings July 17, 2026 12:47
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jul 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 17, 2026 17:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Comment thread models/moonshot/pyproject.toml
Copilot AI review requested due to automatic review settings July 17, 2026 18:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Comment thread models/moonshot/tests/test_live.py
Copilot AI review requested due to automatic review settings July 17, 2026 19:07

@WH-2099 WH-2099 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All actionable review threads are resolved. The frozen test suite passes, default runs skip billable live tests, explicit live opt-in passes, and all CI checks are green.

@lin-snow
lin-snow merged commit 1bf2ad0 into main Jul 17, 2026
7 checks passed
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 17, 2026
@WH-2099
WH-2099 temporarily deployed to models/moonshot July 17, 2026 19:10 — with GitHub Actions Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

models/moonshot/.env.example:1

  • Deleting this file removes the standard remote-debug bootstrap for this plugin. The new .difyignore only excludes .env, so it does not make the tracked example redundant; plugins with the same ignore file retain this template (for example, models/aihubmix/.env.example:1-4 and models/tongyi/.env.example:1-4). Restore the template, optionally extending it with the live-test variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants