-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(zai): add Z.AI GLM model integration #441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
petems
wants to merge
13
commits into
BeehiveInnovations:main
Choose a base branch
from
petems:feat/add-zai-api-model-integration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
470b559
feat(zai): add Z.AI GLM model integration via registry-backed provider
petems bf8e742
test(zai): add Z.AI provider tests and Docker parity coverage
petems 23d9257
docs(zai): document Z.AI provider configuration
petems 836eb14
fix(zai): make alias-allowlist test register provider and pin black
petems b3010fc
fix(zai): clamp temperature range
petems bf3debf
test(auto): isolate zai env in model listing
petems f7a8730
test(zai): skip smoke test for dummy keys
petems c4c8c3d
fix(zai): forward thinking mode
petems 559db21
fix(zai): ignore documented placeholder keys
petems 03a3836
test(zai): skip documented placeholder keys
petems 22c3fc7
fix(setup): preserve exported zai key
petems 496329e
fix(setup): wire zai into powershell
petems 9d7314a
fix(setup): propagate zai allowlist to qwen
petems File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| { | ||
| "_README": { | ||
| "description": "Model metadata for Z.AI GLM API access.", | ||
| "documentation": "https://github.com/BeehiveInnovations/pal-mcp-server/blob/main/docs/custom_models.md", | ||
| "usage": "Models listed here are exposed directly through the Z.AI provider. Aliases are case-insensitive.", | ||
| "field_notes": "Matches providers/shared/model_capabilities.py.", | ||
| "field_descriptions": { | ||
| "model_name": "The model identifier (e.g., 'glm-4.6')", | ||
| "aliases": "Array of short names users can type instead of the full model name", | ||
| "context_window": "Total number of tokens the model can process (input + output combined)", | ||
| "max_output_tokens": "Maximum number of tokens the model can generate in a single response", | ||
| "supports_extended_thinking": "Whether the model supports extended reasoning tokens", | ||
| "supports_json_mode": "Whether the model can guarantee valid JSON output", | ||
| "supports_function_calling": "Whether the model supports function/tool calling", | ||
| "supports_images": "Whether the model can process images/visual input", | ||
| "supports_temperature": "Whether the model accepts temperature parameter in API calls", | ||
| "temperature_constraint": "Temperature constraint object. Z.AI chat completions require temperature in [0.0, 1.0].", | ||
| "description": "Human-readable description of the model", | ||
| "intelligence_score": "1-20 human rating used as the primary signal for auto-mode model ordering" | ||
| }, | ||
| "verification_sources": { | ||
| "model_overview": "https://docs.z.ai/guides/llm/glm-4.6", | ||
| "api_reference": "https://docs.z.ai/api-reference/llm/chat-completion", | ||
| "announcement": "https://z.ai/blog/glm-4.6" | ||
| } | ||
| }, | ||
| "models": [ | ||
| { | ||
| "model_name": "glm-4.6", | ||
| "friendly_name": "Z.AI (GLM-4.6)", | ||
| "aliases": [ | ||
| "glm", | ||
| "glm-4", | ||
| "glm4.6", | ||
| "glm-4.6" | ||
| ], | ||
| "intelligence_score": 12, | ||
| "description": "GLM-4.6 (200K context) - Z.AI reasoning and coding model", | ||
| "context_window": 200000, | ||
| "max_output_tokens": 128000, | ||
| "supports_extended_thinking": true, | ||
| "supports_system_prompts": true, | ||
| "supports_streaming": true, | ||
| "supports_function_calling": true, | ||
| "supports_json_mode": true, | ||
| "supports_images": false, | ||
| "supports_temperature": true, | ||
| "temperature_constraint": { | ||
| "type": "range", | ||
| "min": 0.0, | ||
| "max": 1.0, | ||
| "default": 1.0 | ||
| } | ||
| } | ||
| ] | ||
| } |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| """Registry loader for Z.AI model capabilities.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from ..shared import ProviderType | ||
| from .base import CapabilityModelRegistry | ||
|
|
||
|
|
||
| class ZAIModelRegistry(CapabilityModelRegistry): | ||
| """Capability registry backed by ``conf/zai_models.json``.""" | ||
|
|
||
| def __init__(self, config_path: str | None = None) -> None: | ||
| super().__init__( | ||
| env_var_name="ZAI_MODELS_CONFIG_PATH", | ||
| default_filename="zai_models.json", | ||
| provider=ProviderType.ZAI, | ||
| friendly_prefix="Z.AI ({model})", | ||
| config_path=config_path, | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.