Feature Description
Add GLM (ZhipuAI) as a first-class built-in provider in the auxiliary client's PROVIDER_REGISTRY, alongside OpenRouter, Nous, xAI, etc.
Current Behavior
Users must configure GLM through the custom endpoint path:
auxiliary:
vision:
provider: glm
model: glm-4v-flash
base_url: "https://open.bigmodel.cn/api/paas/v4/"
api_key: "<key>"
This triggers the "custom" provider branch in _resolve_task_provider_model (line 3985-3987), which:
- Strips the provider identity, breaking all provider-specific logic downstream
- Requires manual
base_url and api_key configuration
- Bypasses the ZAI/GLM-specific vision handling in
resolve_vision_provider_client
Proposed Behavior
auxiliary:
vision:
provider: glm # or "zhipu" or "zhipuai"
model: glm-4v-flash
# base_url and api_key auto-resolved from ZHIPU_API_KEY env var
This would require:
-
Add "glm" / "zhipu" / "zhipuai" to PROVIDER_REGISTRY with:
api_key_env_vars: ["ZHIPU_API_KEY", "ZHIPUAI_API_KEY", "GLM_API_KEY"]
inference_base_url: "https://open.bigmodel.cn/api/paas/v4"
default_auxiliary_model: "glm-4v-flash" (for vision)
-
Extend ZAI vision logic to also cover GLM provider:
# In resolve_vision_provider_client, line 3566:
if requested in ("zai", "glm") and not resolved_base_url:
-
Extend _build_call_kwargs ZAI vision max_tokens skip to also match GLM:
_skip_max_tokens = (
provider in ("zai", "glm")
and ("4v" in _model_lower or "5v" in _model_lower or "-v" in _model_lower)
)
Motivation
Related
Feature Description
Add GLM (ZhipuAI) as a first-class built-in provider in the auxiliary client's
PROVIDER_REGISTRY, alongside OpenRouter, Nous, xAI, etc.Current Behavior
Users must configure GLM through the
customendpoint path:This triggers the
"custom"provider branch in_resolve_task_provider_model(line 3985-3987), which:base_urlandapi_keyconfigurationresolve_vision_provider_clientProposed Behavior
This would require:
Add
"glm"/"zhipu"/"zhipuai"toPROVIDER_REGISTRYwith:api_key_env_vars: ["ZHIPU_API_KEY", "ZHIPUAI_API_KEY", "GLM_API_KEY"]inference_base_url: "https://open.bigmodel.cn/api/paas/v4"default_auxiliary_model: "glm-4v-flash"(for vision)Extend ZAI vision logic to also cover GLM provider:
Extend
_build_call_kwargsZAI visionmax_tokensskip to also match GLM:Motivation
open.bigmodel.cnendpoint is OpenAI-compatible but has GLM-specific quirks (rejectsmax_tokenson vision calls, different error codes)Related