Add Z.ai / GLM 5.2 support as alternative agent backend#92
Merged
Conversation
Mirror the existing DeepSeek integration to support driving the stack with Z.ai's GLM 5.2 via its Anthropic-compatible API. The new `zai` profile reuses the crhacky/blhackbox:claude-code image and points it at https://api.z.ai/api/anthropic through ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN (from ZAI_API_KEY) -- same MCP wiring, skills, and entrypoint, only the model backend differs. No new image to build. - docker-compose.yml: new `zai` service (glm-5.2 / glm-4.5-air tiers, API_TIMEOUT_MS, optional commented 1M-context lines) - Makefile: `make zai` target + zai profile in down/clean/nuke/status - setup.sh: --zai-key flag, interactive menu option 4, ZAI_API_KEY prompt - .env.example: ZAI_API_KEY block - tests: zai compose-wiring tests (mirror the deepseek pair) - README.md / DOCKER.md: Tutorial 1c + reference-table entries Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FgsGd8LzjeLEbnVAUv6Szy
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 support for Z.ai's GLM 5.2 model as an alternative agent backend, following the same pattern as the existing DeepSeek integration. The
zaiprofile reuses the Claude Code image and routes it to Z.ai's Anthropic-compatible API via environment variables, requiring no separate Dockerfile or entrypoint.Key Changes
zaiservice under thezaiprofile that reusescrhacky/blhackbox:claude-codeand configures it to point at Z.ai's API endpoint (https://api.z.ai/api/anthropic) with model mappings for GLM 5.2 and GLM 4.5-air--zai-keyflag for non-interactive mode and help text explaining how to obtain a Z.ai API keyzaitarget to launch the Z.ai agent and updateddown,clean, andnuketargets to include thezaiprofilezaiservice configuration, environment variables, and model mappingsZAI_API_KEYzaiservice reuses the Claude Code image without a separate Dockerfile and correctly configures the Z.ai API endpointImplementation Details
ANTHROPIC_BASE_URLandANTHROPIC_AUTH_TOKENenvironment variablesglm-5.2for Sonnet/Opus,glm-4.5-airfor Haikuhttps://claude.ai/code/session_01FgsGd8LzjeLEbnVAUv6Szy