Add native Z.ai (GLM) provider#1
Merged
jamiepine merged 3 commits intospacedriveapp:mainfrom Feb 16, 2026
Merged
Conversation
Allow users with a GLM Coding Plan subscription to use Z.ai models directly without an intermediary like OpenRouter. Z.ai's API is OpenAI-compatible so the implementation reuses existing message conversion and response parsing, only changing the endpoint URL and auth header. Changes: - Add zhipu_key to LlmConfig, TomlLlmConfig, and env/TOML resolution - Add "zhipu" match arm in LlmManager::get_api_key() - Add call_zhipu() in SpacebotModel targeting api.z.ai - Add "Z.ai (GLM)" to onboarding wizard provider list - Fix fallbacks resolution to replace (not extend) when explicitly set Usage: configure zhipu_key and route models as zhipu/glm-4.7, etc. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
How do you use this? I have the which worked fine on OpenClaw, but for spacebot i'm getting Cannot change the model to anything but |
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
fallbacks = {}would not clear Anthropic defaults)Changes
zhipu_keyto config structs, env/TOML resolution, onboarding wizard; fixfallbacksfield to useOption<HashMap>so explicit empty config clears defaults"zhipu"match arm inget_api_key()call_zhipu()method and route"zhipu"provider inattempt_completion()Usage
Test plan
cargo checkpassescargo test --lib— all 41 tests passZHIPU_API_KEY+zhipu/glm-4.7routing, verify completions work via Discord