feat(providers): add Kimi / Moonshot China to Providers#7637
Closed
hcshen0111 wants to merge 2 commits into
Closed
feat(providers): add Kimi / Moonshot China to Providers#7637hcshen0111 wants to merge 2 commits into
hcshen0111 wants to merge 2 commits into
Conversation
3e9186d to
0702f28
Compare
teknium1
pushed a commit
that referenced
this pull request
Apr 13, 2026
Cherry-picked from PR #7637 by hcshen0111. Adds kimi-coding-cn provider with dedicated KIMI_CN_API_KEY env var and api.moonshot.cn/v1 endpoint for China-region Moonshot users.
teknium1
added a commit
that referenced
this pull request
Apr 13, 2026
Follow-up for salvaged PR #7637. Adds kimi-coding-cn to: - model_normalize.py (prefix strip) - providers.py (models.dev mapping) - runtime_provider.py (credential resolution) - setup.py (model list + setup label) - doctor.py (health check) - trajectory_compressor.py (URL detection) - models_dev.py (registry mapping) - integrations/providers.md (docs)
teknium1
pushed a commit
that referenced
this pull request
Apr 13, 2026
Cherry-picked from PR #7637 by hcshen0111. Adds kimi-coding-cn provider with dedicated KIMI_CN_API_KEY env var and api.moonshot.cn/v1 endpoint for China-region Moonshot users.
teknium1
added a commit
that referenced
this pull request
Apr 13, 2026
Follow-up for salvaged PR #7637. Adds kimi-coding-cn to: - model_normalize.py (prefix strip) - providers.py (models.dev mapping) - runtime_provider.py (credential resolution) - setup.py (model list + setup label) - doctor.py (health check) - trajectory_compressor.py (URL detection) - models_dev.py (registry mapping) - integrations/providers.md (docs)
Contributor
|
Merged via PR #9172. Your commit was cherry-picked onto current main with your authorship preserved in git log. The salvage PR also incorporated supplementary coverage from PRs #8900, #8856, and #8166 (additional touchpoints like doctor.py, setup.py, model_normalize, runtime_provider, trajectory_compressor, and full docs). Thank you for the thorough implementation @hcshen0111! |
4 tasks
ulasbilgen
pushed a commit
to ulasbilgen/hermes-adhd-agent
that referenced
this pull request
May 1, 2026
Cherry-picked from PR NousResearch#7637 by hcshen0111. Adds kimi-coding-cn provider with dedicated KIMI_CN_API_KEY env var and api.moonshot.cn/v1 endpoint for China-region Moonshot users.
ulasbilgen
pushed a commit
to ulasbilgen/hermes-adhd-agent
that referenced
this pull request
May 1, 2026
Follow-up for salvaged PR NousResearch#7637. Adds kimi-coding-cn to: - model_normalize.py (prefix strip) - providers.py (models.dev mapping) - runtime_provider.py (credential resolution) - setup.py (model list + setup label) - doctor.py (health check) - trajectory_compressor.py (URL detection) - models_dev.py (registry mapping) - integrations/providers.md (docs)
aj-nt
pushed a commit
to aj-nt/hermes-agent
that referenced
this pull request
May 1, 2026
Cherry-picked from PR NousResearch#7637 by hcshen0111. Adds kimi-coding-cn provider with dedicated KIMI_CN_API_KEY env var and api.moonshot.cn/v1 endpoint for China-region Moonshot users.
aj-nt
pushed a commit
to aj-nt/hermes-agent
that referenced
this pull request
May 1, 2026
Follow-up for salvaged PR NousResearch#7637. Adds kimi-coding-cn to: - model_normalize.py (prefix strip) - providers.py (models.dev mapping) - runtime_provider.py (credential resolution) - setup.py (model list + setup label) - doctor.py (health check) - trajectory_compressor.py (URL detection) - models_dev.py (registry mapping) - integrations/providers.md (docs)
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
Cherry-picked from PR NousResearch#7637 by hcshen0111. Adds kimi-coding-cn provider with dedicated KIMI_CN_API_KEY env var and api.moonshot.cn/v1 endpoint for China-region Moonshot users.
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
Follow-up for salvaged PR NousResearch#7637. Adds kimi-coding-cn to: - model_normalize.py (prefix strip) - providers.py (models.dev mapping) - runtime_provider.py (credential resolution) - setup.py (model list + setup label) - doctor.py (health check) - trajectory_compressor.py (URL detection) - models_dev.py (registry mapping) - integrations/providers.md (docs)
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
Cherry-picked from PR NousResearch#7637 by hcshen0111. Adds kimi-coding-cn provider with dedicated KIMI_CN_API_KEY env var and api.moonshot.cn/v1 endpoint for China-region Moonshot users.
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
Follow-up for salvaged PR NousResearch#7637. Adds kimi-coding-cn to: - model_normalize.py (prefix strip) - providers.py (models.dev mapping) - runtime_provider.py (credential resolution) - setup.py (model list + setup label) - doctor.py (health check) - trajectory_compressor.py (URL detection) - models_dev.py (registry mapping) - integrations/providers.md (docs)
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
Cherry-picked from PR NousResearch#7637 by hcshen0111. Adds kimi-coding-cn provider with dedicated KIMI_CN_API_KEY env var and api.moonshot.cn/v1 endpoint for China-region Moonshot users.
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
Follow-up for salvaged PR NousResearch#7637. Adds kimi-coding-cn to: - model_normalize.py (prefix strip) - providers.py (models.dev mapping) - runtime_provider.py (credential resolution) - setup.py (model list + setup label) - doctor.py (health check) - trajectory_compressor.py (URL detection) - models_dev.py (registry mapping) - integrations/providers.md (docs)
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.
What does this PR do?
This PR adds first-class support for Moonshot China as a built-in provider by introducing
kimi-coding-cnwith a dedicated API key (KIMI_CN_API_KEY) and default China endpoint (https://api.moonshot.cn/v1).It solves the current gap where China-region Moonshot usage required manual endpoint workarounds or conflicted with
kimi-codingdefault routing.This approach is low-risk and consistent with existing provider architecture: it reuses the existing OpenAI-compatible API-key provider path (no new adapter / api_mode), and wires the provider through auth, runtime resolution, CLI selection, model catalog, auxiliary routing, metadata inference, and docs.
Related Issue
Resolves #8825
Type of Change
Changes Made
kimi-coding-cninhermes_cli/auth.pyapi_key_env_vars=("KIMI_CN_API_KEY",)inference_base_url="https://api.moonshot.cn/v1"kimi-cn,moonshot-cnhermes_cli/models.py_PROVIDER_MODELS["kimi-coding-cn"]_PROVIDER_LABELS["kimi-coding-cn"]hermes_cli/main.pychat --providerchoiceshermes_cli/config.pyKIMI_CN_API_KEYtoOPTIONAL_ENV_VARSagent/auxiliary_client.py: alias mapping + aux default model forkimi-coding-cnagent/model_metadata.py: provider prefixes and URL-to-provider mapping forapi.moonshot.cn.env.examplewebsite/docs/reference/environment-variables.mdwebsite/docs/user-guide/configuration.mdwebsite/docs/getting-started/quickstart.mdhermes_cli/auth.pyduring integration.How to Test
KIMI_CN_API_KEYin~/.hermes/.envKIMI_API_KEYis unset to avoid ambiguity during manual checkssource venv/bin/activatepython -m hermes_cli.main chat -q "Say hello" --provider kimi-coding-cn --model kimi-k2.5https://api.moonshot.cn/v1source venv/bin/activatepython -m pytest tests/hermes_cli/test_api_key_providers.py tests/hermes_cli/test_runtime_provider_resolution.py -n0 -qChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/A (N/A: only.envprovider key added)CONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A (N/A)For New Skills
N/A
Screenshots / Logs
Targeted test run:
python -m pytest tests/hermes_cli/test_api_key_providers.py tests/hermes_cli/test_runtime_provider_resolution.py -n0 -q
185 passed