feat: add Kimi (Moonshot AI) as auto-detected provider#21
Conversation
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
There was a problem hiding this comment.
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
kimitoKNOWN_PROVIDERSwith base URLhttps://api.moonshot.cn/v1and env keyMOONSHOT_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' }, |
There was a problem hiding this comment.
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.
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
Summary
kimitoKNOWN_PROVIDERSinOpenAICompatibleLLMProviderMOONSHOT_API_KEYenv var — no extra config neededhttps://api.moonshot.cn/v1(OpenAI-compatible)Usage
Test plan
MOONSHOT_API_KEYand confirm provider auto-detects tokimigenerate()andgenerateJSON()work against Moonshot APIhttps://claude.ai/code/session_011wA9KfhwognGYx47x7JfjH