feat: add Z.AI GLM models as router provider#129
Open
rizkydwicmt wants to merge 2 commits intoKeygraphHQ:mainfrom
Open
feat: add Z.AI GLM models as router provider#129rizkydwicmt wants to merge 2 commits intoKeygraphHQ:mainfrom
rizkydwicmt wants to merge 2 commits intoKeygraphHQ:mainfrom
Conversation
- Add Z.AI (zai) provider to router-config.json with glm-5, glm-4.7, glm-4.7-flash models - Use coding-specific endpoint: api.z.ai/api/coding/paas/v4/chat/completions - Forward ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, ROUTER_DEFAULT env vars to SDK subprocess in claude-executor.ts (fixes router auth issue) - Add ZAI_API_KEY to docker-compose.yml router service - Add ZAI_API_KEY to shannon CLI provider key checks - Update .env.example and README.md with Z.AI configuration docs
There was a problem hiding this comment.
Pull request overview
This PR adds Z.AI (Zhipu AI) GLM models as a new router provider for Shannon's experimental multi-model support, alongside an important bug fix for router mode environment variable forwarding.
Changes:
- Added Z.AI provider configuration with GLM models (glm-5, glm-4.7, glm-4.7-flash) to the router
- Fixed SDK subprocess environment variable forwarding for ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and ROUTER_DEFAULT (critical for all router providers)
- Updated CLI validation, Docker configuration, and documentation to include Z.AI API key support
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| configs/router-config.json | Added Z.AI provider configuration with GLM models and maxcompletiontokens transformer; reformatted existing providers for consistency |
| src/ai/claude-executor.ts | Fixed router mode by forwarding required environment variables to SDK subprocess; corrected comment indentation |
| shannon | Added ZAI_API_KEY validation checks in router mode API key logic and error messages |
| docker-compose.yml | Added ZAI_API_KEY environment variable to router service |
| .env.example | Added Z.AI configuration section with example API key and model settings |
| README.md | Added Z.AI to experimental router mode documentation and models table |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Adds Z.AI (Zhipu AI) GLM models as a new provider option for Shannon's router mode, enabling pentesting with Chinese-developed large language models.
Changes
Router Configuration (
configs/router-config.json)zaiprovider with endpointhttps://api.z.ai/api/coding/paas/v4/chat/completionsglm-5,glm-4.7,glm-4.7-flashmaxcompletiontokenstransformer pattern as OpenAISDK Environment Forwarding (
src/ai/claude-executor.ts)ANTHROPIC_BASE_URL,ANTHROPIC_AUTH_TOKEN, andROUTER_DEFAULTenv vars to the SDK subprocessAuthenticationError: Invalid API keyDocker & CLI
ZAI_API_KEYtodocker-compose.ymlrouter service environmentZAI_API_KEYtoshannonCLI provider key validation checksDocumentation
.env.examplewith Z.AI configuration sectionREADME.mdwith Z.AI in Quick Setup and Experimental Models tableTesting
glm-4.7model via curlglm-4.7Usage