Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Feb 12, 2026

Related GitHub Issue

Closes: #11438

Description

This PR attempts to address Issue #11438 by updating the GLM-5 model entry in the Z.ai provider with correct specs as provided in the issue comments (from z.ai docs).

Changes made:

International (z.ai) GLM-5:

  • maxTokens: 16,384 -> 128,000 (128k max output per docs)
  • contextWindow: 202,752 -> 200,000 (200k per docs)
  • inputPrice: $0.60 -> $1.00 per 1M tokens
  • outputPrice: $2.20 -> $3.20 per 1M tokens
  • cacheReadsPrice: $0.11 -> $0.20 per 1M tokens

Mainland China (bigmodel.cn) GLM-5:

  • maxTokens: 16,384 -> 128,000
  • contextWindow: 202,752 -> 200,000
  • Pricing scaled proportionally using the same international/mainland ratio as other models (GLM-4.7)

Other features (already correctly configured):

  • Thinking/reasoning mode: Yes (supportsReasoningEffort)
  • Prompt caching: Yes
  • Image support: No (text only)

Feedback and guidance are welcome.

Test Procedure

  • Ran npx vitest run api/providers/__tests__/zai.spec.ts from src/ directory -- all 31 tests pass
  • Updated test expectations for GLM-5 contextWindow assertions (both international and mainland)
  • Full lint and type-check passed via pre-push hooks

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Documentation Updates

  • No documentation updates are required.

Additional Notes

The GLM-5 model entry already existed in the codebase but with placeholder values copied from GLM-4.7. This PR corrects those values using the specs provided by @damianar1984 in the issue comments, sourced from the official z.ai documentation.

…dow, and max output tokens

- International: input $1.00, output $3.20, cached $0.20 per 1M tokens (per z.ai docs)
- Mainland: proportionally scaled pricing based on existing model ratios
- Context window: 200k tokens (was 202,752)
- Max output tokens: 128k (was 16,384)
- Updated test expectations to match new contextWindow value

Closes #11438
@roomote
Copy link
Contributor Author

roomote bot commented Feb 12, 2026

Rooviewer Clock   See task

The international GLM-5 specs look correct per the z.ai docs. One inconsistency found in the mainland entry:

  • Mainland GLM-5 contextWindow should likely be 204_800 (not 200_000) to match the pattern used by all other mainland ~200k-context models (glm-4.6, glm-4.7, glm-4.7-flash, glm-4.7-flashx)

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

maxTokens: 16_384,
contextWindow: 202_752,
maxTokens: 128_000,
contextWindow: 200_000,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Every other mainland model with a ~200k context window (glm-4.6, glm-4.7, glm-4.7-flash, glm-4.7-flashx) uses contextWindow: 204_800, while their international counterparts use 200_000. Setting mainland GLM-5 to 200_000 breaks this established pattern. Since you already proportionally scaled the pricing to match mainland conventions, the context window likely needs the same treatment. If the bigmodel.cn docs confirm 200k exactly, this is fine -- but worth double-checking.

Suggested change
contextWindow: 200_000,
contextWindow: 204_800,

Fix it with Roo Code or mention @roomote and request a fix.

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.

[ENHANCEMENT] please add glm-5 on z.ai

1 participant