Skip to content

feat: Add Moonshot (Kimi) provider and documentation improvements#1246

Open
nKOxxx wants to merge 23 commits intoruvnet:mainfrom
nKOxxx:main
Open

feat: Add Moonshot (Kimi) provider and documentation improvements#1246
nKOxxx wants to merge 23 commits intoruvnet:mainfrom
nKOxxx:main

Conversation

@nKOxxx
Copy link

@nKOxxx nKOxxx commented Feb 28, 2026

Summary

This PR adds support for Moonshot AI (Kimi models) as a first-class LLM provider alongside Anthropic, OpenAI, and others.

Changes

Moonshot Provider (4 commits)

  • Add 'moonshot' to LLMProvider type with Kimi model variants
  • Full provider implementation with streaming, tool calling, health checks
  • Register in ProviderManager for automatic instantiation
  • Export from public API

Documentation & DX (6 commits)

  • Fix README links (claude-flow → ruflo)
  • Add .env.example template for easy configuration
  • Add CONTRIBUTING.md guide for new contributors
  • Add health-check.sh diagnostic script
  • Add MockProvider for unit testing
  • Update .gitignore for common patterns

Supported Models

  • kimi-k2-5 (256k context, 8k output)
  • kimi-k2 (256k context, 8k output)
  • kimi-k2-thinking (256k context, 8k output)

Testing

  • Provider implements full ILLMProvider interface
  • Health check validates API connectivity
  • Cost tracking with competitive pricing (/bin/zsh.002//bin/zsh.008 per 1k)

Checklist

  • Provider implements all required methods
  • Added to ProviderManager factory
  • Exported from public API
  • Documentation updated
  • No breaking changes

cc @ruvnet

Add 'moonshot' to the LLMProvider union type and define
Kimi model variants (kimi-k2-5, kimi-k2, kimi-k2-thinking).

This enables Moonshot AI as a supported provider in the
multi-LLM orchestration system.
Add MoonshotProvider to public exports and update module
documentation to include Moonshot in supported providers list.
Add MoonshotProvider to the provider factory switch statement,
enabling automatic provider instantiation from configuration.
Add complete Moonshot provider implementation supporting:
- Kimi K2.5, K2, and K2 Thinking models
- 256k context length
- Streaming and non-streaming completions
- Cost tracking with competitive pricing
- Health checks and proper error handling
- OpenAI-compatible API integration

Enables multi-LLM orchestration with Moonshot as a
first-class provider alongside Anthropic, OpenAI, etc.
Update GitHub repository links from claude-flow to ruflo:
- Fix badge links to point to ruvnet/ruflo
- Update CDN install script URLs
- Fix documentation links

Note: npm package remains claude-flow (not renamed)
Config files and CLI commands unchanged
Add example environment file with all supported provider
API keys and configuration options. Makes it easier for
new users to get started with proper configuration.
Add basic contribution guidelines with setup instructions,
testing commands, and submission process. Helps new
contributors get started quickly.
Add scripts/health-check.sh for quick installation verification.
Checks Node.js, npm, Ruflo CLI, and environment variables.
Helps users troubleshoot setup issues.
Add simple mock LLM provider implementation for use in
tests. Makes it easier to test components without calling
real APIs or needing API keys.
Add common development patterns to .gitignore:
- Local environment files (.env)
- Log files and directories
- Build artifacts
- Temporary directories
Add SECURITY.md with:
- Supported versions table
- Vulnerability reporting process
- Response timeline commitments
- Security best practices
- Environment variable guidance
- Local development security tips
- Security audit results

Helps users and security researchers understand
how to report issues responsibly.
Update settings generator to default to Kimi models:
- Default model: kimi-k2-5 (instead of claude-opus-4-6)
- Routing model: kimi-k2 (instead of claude-haiku)
- Add MOONSHOT_API_KEY to environment config template
- Update comments to reference Kimi capabilities

This makes the fork Kimi-first while maintaining
support for other providers as fallbacks.
- Update tagline to highlight Moonshot/Kimi as default
- Add star indicator for Moonshot in supported providers
- Maintain mention of other supported providers
- Position as multi-LLM with Kimi as primary
Add config/kimi-default.json with:
- Moonshot as priority 1 provider (default)
- Anthropic as priority 2 (fallback)
- Kimi model routing preferences
- Cost-optimized routing strategy

Makes it easy to start with Kimi-first setup.
Put MOONSHOT_API_KEY first as the required/default provider.
Add DEFAULT_PROVIDER and DEFAULT_MODEL environment variables.
Keep other providers as optional fallbacks.
Add KIMI_QUICKSTART.md with:
- Moonshot API key setup instructions
- Available Kimi models overview
- Configuration examples
- How to use other providers as fallbacks
- Why Kimi as default explanation
Fix BaseProvider initialization to match other providers:
- Move API key setup to doInitialize() method
- Use this.config.apiKey/apiUrl instead of options
- Update complete() to check apiKey directly
- Remove custom validate() in favor of doInitialize()

This fixes the 'Cannot read properties of undefined' error
when initializing the provider.
Moonshot uses different endpoints for different regions:
- api.moonshot.cn for China users
- api.moonshot.ai for international users

Update baseUrl to use the .ai endpoint which works
with international API keys.
API uses dot notation, not dashes:
- kimi-k2.5 (not kimi-k2-5)
- kimi-k2-turbo-preview (not kimi-k2)
- kimi-k2-thinking

Also updated pricing and capabilities to match.

Fixes 'resource_not_found_error' when using incorrect model names.
Use correct API model names:
- Default: kimi-k2.5
- Routing: kimi-k2-turbo-preview
Moonshot API rejects temperature values other than 1 for some models.
Only include these params in the request if user explicitly sets them.

Fixes 'invalid temperature' error.
Prevent accidental commits of test files that might
temporarily contain sensitive data during development.

test-moonshot-live.ts and test-moonshot-isolated.ts
are now ignored by git.
Complete rebrand of the fork:
- Package name: anthill
- Product name: Anthill
- CLI commands: anthill (instead of ruflo/claude-flow)
- Updated all documentation
- New README with ant metaphor

Kimi-first multi-agent platform.
@bono-bot
Copy link

Code Review: PR #1246

Verdict: ❌ REQUEST CHANGES — Close this PR

This PR must not be merged in its current form. It violates multiple contribution principles:


1. Do NOT Overwrite Upstream

This PR replaces the upstream project's README, tagline, badges, and identity. Contributors should not overwrite the upstream project's branding, positioning, or documentation structure. These changes belong in your own fork, not in a PR to the upstream repo.

2. Do NOT Change the Default LLM Provider

The PR changes the default LLM provider from Claude to Moonshot (Kimi) in the settings generator. Changing the default provider is a major architectural decision that requires explicit approval from the project maintainers. This was not requested or authorized.

3. Do NOT Rebrand the Project

The PR renames the project from Ruflo to Anthill across README, docs, CLI references, and install scripts. You cannot rebrand someone else's project in a pull request. If you want to rebrand, do it in your own fork.


What could be acceptable (as separate PRs)

  • Moonshot provider implementation only — Adding Moonshot as an optional provider (not the default) could be a valid contribution, submitted as its own focused PR
  • Bug fixes — The constructor pattern fix and API endpoint corrections are legitimate fixes for the provider code

What is NOT acceptable

  • Rebranding Ruflo → Anthill in upstream
  • Making Kimi the default over Claude
  • Overwriting the README with fork-specific content
  • Changing install scripts to point to a different repo

🤖 Review by Claude Code

@bono-bot
Copy link

Closing: This PR rebrands the project, overwrites the upstream README, and changes the default LLM provider without maintainer authorization. Please resubmit as a focused PR adding Moonshot as an optional provider only.

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