Skip to content

Add native Kimi Moonshot AI support#13649

Closed
robertmonka wants to merge 1 commit intogitbutlerapp:masterfrom
robertmonka:add-kimi-moonshot-ai-support
Closed

Add native Kimi Moonshot AI support#13649
robertmonka wants to merge 1 commit intogitbutlerapp:masterfrom
robertmonka:add-kimi-moonshot-ai-support

Conversation

@robertmonka
Copy link
Copy Markdown

@robertmonka robertmonka commented May 6, 2026

🧢 Changes

  • Adds Kimi K2.6 as a selectable AI model in desktop AI settings.
  • Adds Moonshot/Kimi-specific request handling for both the desktop OpenAI client and the Rust but-llm OpenAI provider.
  • Detects Kimi either from kimi-* model names or a moonshot.ai custom endpoint.
  • Sends Kimi requests with thinking: { type: "disabled" }, uses max_tokens, and avoids OpenAI-only structured output parameters.
  • Supports Kimi structured output through JSON mode by injecting the expected JSON schema into the prompt.
  • Requires direct OpenAI-compatible credentials for Kimi instead of GitButler-proxied OpenAI credentials.
  • Allows https://api.moonshot.ai in desktop/server CSP connect sources.
  • Adds Rust tests for Kimi flavor detection and request body generation.

☕️ Reasoning

Kimi's Moonshot API is OpenAI-compatible, but it does not accept every request shape GitButler currently sends to OpenAI. In particular, Kimi needs max_tokens instead of max_completion_tokens, should have thinking disabled for short GitButler AI tasks, and uses JSON mode rather than OpenAI's structured output schema format.

This keeps the existing OpenAI behavior unchanged while routing Kimi models through a small Moonshot-specific path, so users can select kimi-k2.6 and use their Moonshot API key for commit messages, branch summaries, and other AI-generated text.

🧪 Testing

  • Added unit coverage for Kimi API flavor detection.
  • Added unit coverage for Kimi plain chat and structured JSON request bodies.
  • Not run locally while updating this PR description.

@robertmonka robertmonka force-pushed the add-kimi-moonshot-ai-support branch 3 times, most recently from 2523b63 to 3685924 Compare May 6, 2026 18:04
@robertmonka robertmonka force-pushed the add-kimi-moonshot-ai-support branch from 3685924 to 93e8f7d Compare May 6, 2026 20:09
@Byron
Copy link
Copy Markdown
Collaborator

Byron commented May 7, 2026

I'm very sorry, but I have to close all of your PRs on the basis of them being fully automated coming from a profile that doesn't show much related history.

Thanks a lot for your understanding.

@Byron Byron closed this May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants