Skip to content

feat: add GLM models to Claude provider options#751

Open
hyunsir wants to merge 2 commits intositeboon:mainfrom
hyunsir:main
Open

feat: add GLM models to Claude provider options#751
hyunsir wants to merge 2 commits intositeboon:mainfrom
hyunsir:main

Conversation

@hyunsir
Copy link
Copy Markdown

@hyunsir hyunsir commented May 8, 2026

  • Add glm-4.7, glm-4-flash, glm-4-plus, glm-4-air to CLAUDE_MODELS
  • These models work with Anthropic-compatible APIs like ZhipuAI (https://open.bigmodel.cn/api/anthropic)
  • Users can configure via ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN environment variables

Summary by CodeRabbit

  • New Features
    • Added support for four new Claude-family models: GLM-4.7, GLM-4 Flash, GLM-4 Plus, and GLM-4 Air — these appear in model selection lists for users.

- Add glm-4.7, glm-4-flash, glm-4-plus, glm-4-air to CLAUDE_MODELS
- These models work with Anthropic-compatible APIs like ZhipuAI (https://open.bigmodel.cn/api/anthropic)
- Users can configure via ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN environment variables
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 35d98b91-48f6-4e08-82d3-50504b24eb92

📥 Commits

Reviewing files that changed from the base of the PR and between f56f162 and 6faa1ff.

📒 Files selected for processing (1)
  • shared/modelConstants.js
✅ Files skipped from review due to trivial changes (1)
  • shared/modelConstants.js

📝 Walkthrough

Walkthrough

Four new GLM model variants (glm-4.7, glm-4-flash, glm-4-plus, glm-4-air) are added to the CLAUDE_MODELS.OPTIONS registry with corresponding display labels, including a localized Chinese label for GLM-4.7.

Changes

Model Registry Update

Layer / File(s) Summary
Model Options Registry
shared/modelConstants.js
Four new GLM model entries are added to CLAUDE_MODELS.OPTIONS: glm-4.7 (with Chinese label), glm-4-flash, glm-4-plus, and glm-4-air.

Poem

🐰 Four models hop into the list,
GLM variants, none are missed,
From flash to air, they find their place,
Labels set with tidy grace,
A tiny hop expands the space.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding GLM models to the Claude provider options list, which is exactly what the changeset does.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
shared/modelConstants.js (1)

7-12: ⚡ Quick win

Update documentation to explain API-compatible third-party models.

The comment describes Claude model formats but doesn't mention that CLAUDE_MODELS now includes API-compatible models from other providers (e.g., ZhipuAI GLM models). Adding this context would help future maintainers understand why non-Claude models appear in this registry.

📝 Suggested documentation enhancement
 /**
  * Claude (Anthropic) Models
  *
+ * Includes both native Claude models and third-party models that are
+ * compatible with the Anthropic API format (e.g., ZhipuAI GLM models).
+ *
  * Note: Claude uses two different formats:
  * - SDK format ('sonnet', 'opus') - used by the UI and claude-sdk.js
  * - API format ('claude-sonnet-4.5') - used by slash commands for display
  */
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@shared/modelConstants.js` around lines 7 - 12, The comment above the Claude
model registry lacks mention that CLAUDE_MODELS now contains API-compatible
third-party models (not just Anthropic formats); update the block comment near
CLAUDE_MODELS in shared/modelConstants.js to state that the registry may include
non-Anthropic models (e.g., ZhipuAI GLM) that use the same API-compatible
naming, and clarify which entries are SDK-format vs API-format so maintainers
understand why non-Claude names appear.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@shared/modelConstants.js`:
- Around line 23-26: Remove the invalid model entries "glm-4-flash",
"glm-4-plus", and "glm-4-air" from the model list in shared/modelConstants.js
because they are not supported by ZhipuAI; replace or add the supported
identifiers "glm-5.1" and "glm-5" if you need more options, and update the
existing { value: "glm-4.7", label: "GLM-4.7 (智谱AI)" } entry to use a consistent
English label like "GLM-4.7 (ZhipuAI)" or "GLM-4.7" to avoid mixed-language
labels. Ensure the final array only contains the documented model value strings
("glm-5.1", "glm-5", "glm-4.7") and their matching labels.

---

Nitpick comments:
In `@shared/modelConstants.js`:
- Around line 7-12: The comment above the Claude model registry lacks mention
that CLAUDE_MODELS now contains API-compatible third-party models (not just
Anthropic formats); update the block comment near CLAUDE_MODELS in
shared/modelConstants.js to state that the registry may include non-Anthropic
models (e.g., ZhipuAI GLM) that use the same API-compatible naming, and clarify
which entries are SDK-format vs API-format so maintainers understand why
non-Claude names appear.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e0d00608-8fbb-4e8f-be38-2f8af0aed36b

📥 Commits

Reviewing files that changed from the base of the PR and between beb0a50 and f56f162.

📒 Files selected for processing (1)
  • shared/modelConstants.js

Comment thread shared/modelConstants.js
Comment on lines +23 to +26
{ value: "glm-4.7", label: "GLM-4.7 (智谱AI)" },
{ value: "glm-4-flash", label: "GLM-4 Flash" },
{ value: "glm-4-plus", label: "GLM-4 Plus" },
{ value: "glm-4-air", label: "GLM-4 Air" },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

What are the correct model identifiers for ZhipuAI GLM models when using their Anthropic-compatible API at https://open.bigmodel.cn/api/anthropic

💡 Result:

Correct model identifiers (the value of the model field) for ZhipuAI GLM models when calling the Anthropic-compatible API at https://open.bigmodel.cn/api/anthropic are: - glm-5.1 [1] - glm-5 [1] - glm-4.7 [1] These are the GLM model codes shown in ZhipuAI’s Anthropic API compatibility documentation, and the examples for base_url: https://open.bigmodel.cn/api/anthropic use the same model identifiers (e.g., glm-5.1, glm-4.7, glm-5). [1]

Citations:


Remove non-existent model identifiers.

The ZhipuAI Anthropic-compatible API documentation only supports glm-5.1, glm-5, and glm-4.7. The identifiers glm-4-flash, glm-4-plus, and glm-4-air do not exist in ZhipuAI's API and will cause runtime failures when users attempt to use them. Remove lines 24–26 or replace with documented model identifiers.

Additionally, line 23 mixes Chinese characters with English labels; consider using a consistent language approach.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@shared/modelConstants.js` around lines 23 - 26, Remove the invalid model
entries "glm-4-flash", "glm-4-plus", and "glm-4-air" from the model list in
shared/modelConstants.js because they are not supported by ZhipuAI; replace or
add the supported identifiers "glm-5.1" and "glm-5" if you need more options,
and update the existing { value: "glm-4.7", label: "GLM-4.7 (智谱AI)" } entry to
use a consistent English label like "GLM-4.7 (ZhipuAI)" or "GLM-4.7" to avoid
mixed-language labels. Ensure the final array only contains the documented model
value strings ("glm-5.1", "glm-5", "glm-4.7") and their matching labels.

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