feat: add kimi-coding-cn provider for mainland China users#8900
Closed
LoikStyle wants to merge 1 commit into
Closed
feat: add kimi-coding-cn provider for mainland China users#8900LoikStyle wants to merge 1 commit into
LoikStyle wants to merge 1 commit into
Conversation
Moonshot AI has separate endpoints for international (api.moonshot.ai) and mainland China (api.moonshot.cn) users. The international endpoint is not accessible from China, causing connection failures. This adds a new `kimi-coding-cn` provider alongside the existing `kimi-coding`, following the same pattern as `minimax` / `minimax-cn`: - `kimi-coding`: api.moonshot.ai/v1 (international, unchanged) - `kimi-coding-cn`: api.moonshot.cn/v1 (mainland China, new) Users in China can select `kimi-coding-cn` via `hermes setup model` or `--provider kimi-coding-cn`. Aliases: `kimi-cn`, `moonshot-cn`. Also adds `api.moonshot.cn` to provider auto-detection in model_metadata.py and trajectory_compressor.py. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
508fb89 to
17a7be9
Compare
This was referenced Apr 13, 2026
Contributor
|
Merged via PR #9172 which salvaged #7637 as the base and incorporated good ideas from your PR (model_normalize, providers.py, runtime_provider, trajectory_compressor, setup.py changes). The key design difference: #9172 uses a separate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moonshot AI has separate endpoints for international and mainland China users. The international endpoint (
api.moonshot.ai) is not accessible from China, causing connection failures when using thekimi-codingprovider.This adds a new
kimi-coding-cnprovider alongside the existingkimi-coding, following the same pattern asminimax/minimax-cn:kimi-codingapi.moonshot.ai/v1kimi-coding-cnapi.moonshot.cn/v1Changes
hermes_cli/auth.py: Addkimi-coding-cnProviderConfig withapi.moonshot.cn/v1, plus aliaseskimi-cn/moonshot-cnhermes_cli/models.py: Register models, labels, and aliases forkimi-coding-cnhermes_cli/main.py: Add to setup menu, CLI choices, and model flowhermes_cli/setup.py: Add model list forkimi-coding-cnhermes_cli/providers.py: Map tokimi-for-codingmodels.dev IDhermes_cli/runtime_provider.py: Handlekimi-coding-cnin credential resolutionhermes_cli/model_normalize.py: Add to prefix-strip providershermes_cli/doctor.py: Revert tomoonshot.aifor default health check (CN uses env override)agent/model_metadata.py: Addapi.moonshot.cnto provider auto-detectiontrajectory_compressor.py: Addmoonshot.cnto provider matchingUsage
Test plan
api.moonshot.cn/v1/chat/completionsreturns 200 with valid Kimi API key from China serverkimi-coding(international) provider unchangedkimi-cnandmoonshot-cnresolve correctlyminimax/minimax-cndual-provider pattern🤖 Generated with Claude Code