Skip to content

feat: add Kimi (Moonshot AI) as auto-detected provider#21

Merged
idapixl merged 5 commits intomasterfrom
claude/kimi-2.5-integration-8NCOf
Mar 24, 2026
Merged

feat: add Kimi (Moonshot AI) as auto-detected provider#21
idapixl merged 5 commits intomasterfrom
claude/kimi-2.5-integration-8NCOf

Conversation

@idapixl
Copy link
Copy Markdown
Collaborator

@idapixl idapixl commented Mar 24, 2026

Summary

  • Adds kimi to KNOWN_PROVIDERS in OpenAICompatibleLLMProvider
  • Auto-detects via MOONSHOT_API_KEY env var — no extra config needed
  • Base URL: https://api.moonshot.cn/v1 (OpenAI-compatible)

Usage

// Auto-detected if MOONSHOT_API_KEY is set:
new OpenAICompatibleLLMProvider({ model: 'kimi-k2-0711-preview' })

// Or explicit:
new OpenAICompatibleLLMProvider({
  providerName: 'kimi',
  model: 'kimi-k2-0711-preview',
  apiKey: process.env.MOONSHOT_API_KEY,
})

Test plan

  • Set MOONSHOT_API_KEY and confirm provider auto-detects to kimi
  • Confirm generate() and generateJSON() work against Moonshot API

https://claude.ai/code/session_011wA9KfhwognGYx47x7JfjH

Adds `kimi` as a first-class auto-detected provider in OpenAICompatibleLLMProvider.
Set MOONSHOT_API_KEY to use Kimi 2.5 or any Moonshot model without extra config.

https://claude.ai/code/session_011wA9KfhwognGYx47x7JfjH
Copilot AI review requested due to automatic review settings March 24, 2026 19:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the OpenAICompatibleLLMProvider’s auto-detection map to recognize Moonshot AI’s Kimi as an OpenAI-compatible provider when MOONSHOT_API_KEY is present, and updates the provider coverage comment accordingly.

Changes:

  • Add kimi to KNOWN_PROVIDERS with base URL https://api.moonshot.cn/v1 and env key MOONSHOT_API_KEY
  • Update the header comment list of covered providers to include Kimi (Moonshot AI)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

openrouter: { baseUrl: 'https://openrouter.ai/api/v1', envKey: 'OPENROUTER_API_KEY' },
together: { baseUrl: 'https://api.together.xyz/v1', envKey: 'TOGETHER_API_KEY' },
fireworks: { baseUrl: 'https://api.fireworks.ai/inference/v1', envKey: 'FIREWORKS_API_KEY' },
kimi: { baseUrl: 'https://api.moonshot.cn/v1', envKey: 'MOONSHOT_API_KEY' },
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

The PR description’s “explicit” example sets providerName: 'kimi' and an apiKey, but does not set baseUrl. In the current implementation, providerName only affects this.name; it does not influence base URL selection, so the request may still go to whatever detectProvider() picks (or localhost) rather than Moonshot. Either update the usage example to include baseUrl: 'https://api.moonshot.cn/v1', or adjust the constructor to derive baseUrl (and optionally default apiKey env var) from providerName when it matches KNOWN_PROVIDERS.

Copilot uses AI. Check for mistakes.
claude added 4 commits March 24, 2026 19:21
Adds llm: 'kimi' support to CortexConfig and createLLMProvider.
Users can now set llm: kimi in .fozikio/config.yaml and optionally
specify kimi_model / kimi_api_key under llm_options.
Falls back to MOONSHOT_API_KEY env var.

https://claude.ai/code/session_011wA9KfhwognGYx47x7JfjH
Adds strategy: 'long-context' to DreamOptions. When set, Phase 4
(Connect) makes a single LLM call with the full memory graph visible
instead of N² pairwise calls capped at 15 memories.

The model sees all nodes and existing edges, enabling it to find
transitive patterns, cross-domain contradictions, and causal chains
that the sequential approach structurally cannot detect.

Also wires llm: 'kimi' fully through config + createLLMProvider.

https://claude.ai/code/session_011wA9KfhwognGYx47x7JfjH
…xt dream

- Add Kimi (Moonshot AI) to provider lists and environment variable table
- Document strategy: long-context in quick-start with config example
- Add MOONSHOT_API_KEY to env var reference
- Add unreleased changelog entry for both features

https://claude.ai/code/session_011wA9KfhwognGYx47x7JfjH
@idapixl idapixl merged commit e9bf1e9 into master Mar 24, 2026
9 checks passed
@idapixl idapixl deleted the claude/kimi-2.5-integration-8NCOf branch March 24, 2026 22:20
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.

3 participants