Skip to content

feat(config): add Zhipu and MiniMax China Anthropic presets - #455

Open
dej4vu wants to merge 2 commits into
pleaseai:mainfrom
dej4vu:feat/zhipu-minimax-cn-anthropic-presets
Open

feat(config): add Zhipu and MiniMax China Anthropic presets#455
dej4vu wants to merge 2 commits into
pleaseai:mainfrom
dej4vu:feat/zhipu-minimax-cn-anthropic-presets

Conversation

@dej4vu

@dej4vu dej4vu commented Sep 4, 2026

Copy link
Copy Markdown

Summary

  • Add built-in Anthropic-compatible presets for Zhipu's China BigModel endpoint and MiniMax's China endpoint.
  • Register matching upstream blueprints and focused preset coverage.
  • Update the README surfaces, engineering docs, site navigation, provider guides, configuration/CLI references, and maintained ko/ja/zh-cn translations.

Details

Preset Base URL Auth
zhipu https://open.bigmodel.cn/api/anthropic ZHIPUAI_API_KEY
minimax-cn https://api.minimax.cn/anthropic MINIMAX_API_KEY

The presets use the existing Anthropic provider kind, so no protocol behavior changes are required. Ordered upstream configurations still explicitly preserve the Anthropic passthrough/default.

Testing

  • cargo fmt --all --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-features --workspace

I also validated the China endpoints end to end with real provider traffic from two newly connected clients.


Summary by cubic

Adds built-in zhipu and minimax-cn provider presets so users can route to Zhipu's China BigModel and MiniMax's China Anthropic-compatible endpoints. Both reuse the existing Anthropic provider kind, so no protocol behavior changes.

  • zhipu targets https://open.bigmodel.cn/api/anthropic and reads ZHIPUAI_API_KEY.
  • minimax-cn targets https://api.minimax.cn/anthropic and reads MINIMAX_API_KEY.
  • Registers both as accepted shunt init --upstream names and ships matching upstream blueprints.
  • Adds provider pages, navigation entries, and reference updates across en, ko, ja, and zh-cn docs.
  • Adds preset unit tests covering kind, base URL, auth mode, and API key env.

Written for commit b5a5d11. Summary will update on new commits.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for two new Anthropic-compatible providers: Zhipu (GLM China) and MiniMax China (minimax-cn). The changes introduce new presets, blueprints, CLI configurations, and extensive multi-language documentation across English, Japanese, Korean, and Chinese. The review feedback suggests reordering the navigation items in the i18n configuration to place 'MiniMax China' immediately after 'MiniMax' for improved readability and logical grouping.

Comment thread site/src/lib/i18n.ts
Comment on lines +51 to +60
{
label: "Zhipu (GLM China)",
translations: { ko: "Zhipu (GLM 중국)", ja: "Zhipu(GLM 中国版)", "zh-cn": "智谱(GLM 国内版)" },
slug: "providers/zhipu",
},
{
label: "MiniMax China",
translations: { ko: "MiniMax 중국", ja: "MiniMax 中国版", "zh-cn": "MiniMax 国内版" },
slug: "providers/minimax-cn",
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and to group related providers, it would be clearer to place MiniMax China immediately after MiniMax in the navigation list.

Suggested change
{
label: "Zhipu (GLM China)",
translations: { ko: "Zhipu (GLM 중국)", ja: "Zhipu(GLM 中国版", "zh-cn": "智谱(GLM 国内版" },
slug: "providers/zhipu",
},
{
label: "MiniMax China",
translations: { ko: "MiniMax 중국", ja: "MiniMax 中国版", "zh-cn": "MiniMax 国内版" },
slug: "providers/minimax-cn",
},
{
label: "MiniMax China",
translations: { ko: "MiniMax 중국", ja: "MiniMax 中国版", "zh-cn": "MiniMax 国内版" },
slug: "providers/minimax-cn",
},
{
label: "Zhipu (GLM China)",
translations: { ko: "Zhipu (GLM 중국)", ja: "Zhipu(GLM 中国版", "zh-cn": "智谱(GLM 国内版" },
slug: "providers/zhipu",
},

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 30 files

Architecture diagram
sequenceDiagram
    participant CC as Claude Code Client
    participant G as shunt Gateway
    participant P as Preset Registry
    participant B as Blueprint Store
    participant Z as Zhipu API
    participant M as MiniMax China API

    Note over CC,M: Provider Configuration Flow
    CC->>G: shunt init --upstream zhipu
    G->>P: Lookup zhipu preset
    P-->>G: kind=anthropic, base_url=open.bigmodel.cn, auth=ApiKey, env=ZHIPUAI_API_KEY
    G->>B: Fetch zhipu blueprint
    B-->>G: Configuration guidance
    G-->>CC: Generate shunt.toml with zhipu upstream

    CC->>G: shunt init --upstream minimax-cn
    G->>P: Lookup minimax-cn preset
    P-->>G: kind=anthropic, base_url=api.minimax.cn, auth=ApiKey, env=MINIMAX_API_KEY
    G->>B: Fetch minimax-cn blueprint
    B-->>G: Configuration guidance
    G-->>CC: Generate shunt.toml with minimax-cn upstream

    Note over CC,M: Runtime Request Flow
    CC->>G: POST /v1/messages (model=glm-5.3-flash)
    G->>G: Strip [1m] suffix from model
    G->>G: Match route to zhipu provider
    alt Route to zhipu
        G->>Z: Forward Anthropic request with ZHIPUAI_API_KEY
        Z-->>G: Anthropic response
        G-->>CC: Response with x-gateway-upstream: zhipu
    else Route to minimax-cn
        G->>M: Forward Anthropic request with MINIMAX_API_KEY
        M-->>G: Anthropic response
        G-->>CC: Response with x-gateway-upstream: minimax-cn
    else No route match
        G->>G: Use default anthropic passthrough
        G-->>CC: Response via default provider
    end

    Note over G,Z: Missing API Key
    alt ZHIPUAI_API_KEY not set
        Z-->>G: 401 Authentication Error
        G-->>CC: Authentication error response
    end
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread site/src/content/docs/ko/providers/minimax-cn.md Outdated
Comment thread site/src/content/docs/zh-cn/providers/minimax-cn.md Outdated
Comment thread site/src/content/docs/ja/providers/minimax-cn.md
Comment thread blueprints/upstream/minimax-cn.md
Comment thread docs/running.md Outdated
@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds built-in Anthropic-compatible presets and blueprints for Zhipu and MiniMax’s China endpoints.

  • Registers zhipu and minimax-cn with their HTTPS endpoints and API-key environment variables.
  • Adds agent-facing upstream blueprints and preset-focused tests.
  • Documents both providers across the README, site navigation, provider guides, CLI/configuration references, and maintained translations.

Confidence Score: 5/5

The PR appears safe to merge, with the new presets, blueprints, and localized documentation remaining consistent with existing configuration and routing behavior.

The preset fields flow through established normalization and credential-resolution paths, blueprint instructions produce valid configurations when followed, and all added localized navigation targets exist.

Important Files Changed

Filename Overview
src/config/presets.rs Adds aligned Zhipu and MiniMax China preset definitions and focused table assertions without changing protocol behavior.
src/blueprints.rs Registers the two embedded upstream guides, aliases, and availability-test expectations consistently.
blueprints/upstream/zhipu.md Provides a valid preset-based Zhipu setup with credential, fallback, model-routing, and validation guidance.
blueprints/upstream/minimax-cn.md Provides a valid preset-based MiniMax China setup with credential, fallback, model-routing, and validation guidance.
site/src/lib/i18n.ts Adds localized navigation entries whose slugs match the new provider pages in every maintained locale.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Operator selects zhipu or minimax-cn] --> B[Preset normalization]
  B --> C[Anthropic provider kind]
  B --> D[China endpoint]
  B --> E[API key environment variable]
  C --> F[Model route]
  D --> G[Upstream request]
  E --> G
  F --> G
Loading

Reviews (1): Last reviewed commit: "feat(config): add Zhipu and MiniMax Chin..." | Re-trigger Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0a3e6d2761

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +52 to +53
Claude Code では `ANTHROPIC_MODEL`、`ANTHROPIC_CUSTOM_MODEL_OPTION`、またはサブエージェントの
`model:` frontmatter でルーティングされた ID を選択します。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Translate the missing model-picker guidance

For Japanese, Korean, and Chinese readers, both new provider pages stop after explaining direct model selection, while the English pages also explain how to expose an alias in the /model picker through [models.upstream_model]; the MiniMax page additionally warns that a mapped ID ending in [1m] is invalid. Add equivalent localized guidance and links to all six locale pages so they remain current with the English sources, as required by the repository documentation policy.

AGENTS.md reference: AGENTS.md:L57-L66

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b5a5d11035

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/config/presets.rs
api_key_env: None,
},
ProviderPreset {
name: "zhipu",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the preset implementation contracts

Adding this preset and minimax-cn makes both names valid for [[upstreams]] and shunt init --upstream, but docs/init-command.md:9 still says the accepted set ends at kimi-code, while the implementation-contract table in docs/upstreams-failover.md:36-45 omits both presets. Update both engineering documents with the new names and metadata so they do not contradict the implemented CLI and configuration schema.

AGENTS.md reference: src/AGENTS.md:L34-L38

Useful? React with 👍 / 👎.

@dej4vu

dej4vu commented Sep 4, 2026

Copy link
Copy Markdown
Author

The automated review feedback has been addressed in b5a5d11. Ready for maintainer 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.

1 participant