Skip to content

feat: add MiniMax & ZHIPU(Z.ai) CN region endpoint support#41

Merged
prakersh merged 3 commits intoonllm-dev:mainfrom
jinquan-shi:feat/minimax-cn
Mar 24, 2026
Merged

feat: add MiniMax & ZHIPU(Z.ai) CN region endpoint support#41
prakersh merged 3 commits intoonllm-dev:mainfrom
jinquan-shi:feat/minimax-cn

Conversation

@jinquan-shi
Copy link
Copy Markdown
Contributor

This pull request adds support for configuring the MiniMax provider's region via a new MINIMAX_REGION environment variable. This allows users to select between the global and China (cn) endpoints, with global as the default. The changes include updates to documentation, configuration loading, the main application logic, and new tests to ensure correct behavior.

MiniMax Region Configuration:

  • Added MINIMAX_REGION as an optional environment variable to select the MiniMax API region (global or cn, defaulting to global). The configuration is normalized to lowercase and defaults to global if unset. [1] [2]
  • Updated main.go to use the appropriate MiniMax API base URL based on the configured region, and improved logging to indicate the selected region.

Documentation Updates:

  • Updated README.md and docs/MINIMAX_SETUP.md to document the new MINIMAX_REGION variable, its usage, and default behavior.

Testing:

  • Added tests to ensure MINIMAX_REGION is loaded from the environment, defaults to global if unset, and is normalized to lowercase.

Jinquan Shi and others added 3 commits March 23, 2026 15:40
Use www.minimaxi.com endpoint when MINIMAX_REGION=cn is set.
Remove GroupId requirement - endpoint works without it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Test MINIMAX_REGION env var loading
- Test default value of "global" when not set
- Test lowercase normalization

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add ZAI_REGION config option (global | cn) to select Z.ai API endpoint.
When ZAI_REGION=cn, use https://open.bigmodel.cn/api instead of
https://api.z.ai/api. Mirrors the MiniMax region selection pattern.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jinquan-shi jinquan-shi changed the title feat: add MiniMax CN region endpoint support feat: add MiniMax & ZHIPU(Z.ai) CN region endpoint support Mar 23, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
main.go 50.00% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@prakersh
Copy link
Copy Markdown
Contributor

prakersh commented Mar 24, 2026

Thanks @jinquan-shi Clean implementation - follows existing config patterns nicely, domains check out, and tests cover the key cases. Merging this in.

@prakersh prakersh merged commit cdc94d9 into onllm-dev:main Mar 24, 2026
3 checks passed
prakersh added a commit that referenced this pull request Mar 24, 2026
Add ZAI_REGION env var documentation to both env var tables in README,
matching the MINIMAX_REGION entries added in PR #41.
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