feat(zai): expand static model registry with additional GLM models#17
Merged
Conversation
Add glm-5.1, glm-5, glm-5-turbo, and glm-4.7 to the Z.ai static model registry with 200K context windows. Make reasoning_effort conditional (only glm-5.2 receives it) via ZAI_REASONING_EFFORT_MODELS set, and expose prompt_tokens_details.cached_tokens as input_cached_tokens in the serializer. Update docs, AGENTS.md, and tests accordingly.
Keep both Z.ai model tests and session-scope model override tests in model-state-sync.test.ts. Update Anthropic section heading to Opus 4.8/4.7 while preserving Z.ai models section in AGENTS.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands the Z.ai native provider to support additional GLM models beyond
glm-5.2.Changes
glm-5.1,glm-5,glm-5-turbo, andglm-4.7with 200K context windows and 131,072 max output tokensreasoning_effort: Onlyglm-5.2receivesreasoning_effortviaZAI_REASONING_EFFORT_MODELSset; older models keepthinkingenabled but use provider defaultsprompt_tokens_details.cached_tokensasinput_cached_tokensin usage normalizationzai-provider.mdspec,AGENTS.mdfiles, andREADME.mdprovider listTest plan
bun testfor affected test files (27 pass, 0 fail)model-registry.test.ts— static fallback for new Z.ai modelsmodel-list-static.test.ts— model.list returns all 5 Z.ai modelsmodel-state-sync.test.ts—model.setacceptsglm-5.1zai-chat.test.ts—reasoning_effortomitted for non-5.2 modelszai-tools-serializer.test.ts—cached_tokensmapping