Skip to content

feat(providers): add kimi-coding-cn provider for mainland China users#9172

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-06b6b472
Apr 13, 2026
Merged

feat(providers): add kimi-coding-cn provider for mainland China users#9172
teknium1 merged 2 commits into
mainfrom
hermes/hermes-06b6b472

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Adds a dedicated kimi-coding-cn provider for mainland China Moonshot/Kimi users. The international endpoint (api.moonshot.ai) is inaccessible from China — this adds api.moonshot.cn/v1 as a first-class provider following the established minimax/minimax-cn dual-provider pattern.

Provider Endpoint Region Env Var
kimi-coding api.moonshot.ai/v1 International (unchanged) KIMI_API_KEY
kimi-coding-cn api.moonshot.cn/v1 Mainland China (new) KIMI_CN_API_KEY

Aliases: kimi-cn, moonshot-cn

Changes

Salvaged from PR #7637 by @hcshen0111, with supplementary coverage from PRs #8900 (@LoikStyle), #8856 (@bugmaker2), and #8166 (@konsisumer).

Core provider wiring

  • hermes_cli/auth.pykimi-coding-cn ProviderConfig + aliases
  • hermes_cli/config.pyKIMI_CN_API_KEY in OPTIONAL_ENV_VARS
  • hermes_cli/models.py — model list, labels, aliases, provider order
  • hermes_cli/main.py — setup menu, CLI choices, model flow dispatch
  • hermes_cli/runtime_provider.py — credential resolution
  • hermes_cli/setup.py — model list + setup label
  • hermes_cli/model_normalize.py — prefix strip
  • hermes_cli/providers.py — models.dev mapping
  • hermes_cli/doctor.py — health check entry

Agent internals

  • agent/auxiliary_client.py — aux model mapping
  • agent/model_metadata.py — provider prefixes + URL-to-provider
  • agent/models_dev.py — models.dev registry mapping
  • trajectory_compressor.py — moonshot.cn URL detection

Docs

  • website/docs/getting-started/quickstart.md — provider table
  • website/docs/reference/environment-variables.md — KIMI_CN_API_KEY + provider list
  • website/docs/user-guide/configuration.md — auxiliary provider list
  • website/docs/integrations/providers.md — full provider docs
  • .env.example — commented example

Test results

  • E2E verification: all 11 provider wiring checks pass (auth, aliases, models, config, auxiliary, metadata, normalize, providers.py, models_dev, status, international unchanged)
  • tests/hermes_cli/: 1887 passed (all failures pre-existing)

Closes

Supersedes PRs #7637, #8900, #8856, #8166

hcshen0111 and others added 2 commits April 13, 2026 11:13
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.
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 teknium1 merged commit 0e60a9d into main Apr 13, 2026
4 of 7 checks passed
@teknium1 teknium1 deleted the hermes/hermes-06b6b472 branch April 13, 2026 18:20
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Supply Chain Risk Detected

This PR contains patterns commonly associated with supply chain attacks. This does not mean the PR is malicious — but these patterns require careful human review before merging.

⚠️ WARNING: Install hook files modified

These files can execute code during package installation or interpreter startup.

Files:

hermes_cli/setup.py

Automated scan triggered by supply-chain-audit. If this is a false positive, a maintainer can approve after manual review.

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