hermes - 💡(How to fix) Fix [Feature] Add GLM (ZhipuAI) as first-class auxiliary provider [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  • The open.bigmodel.cn endpoint is OpenAI-compatible but has GLM-specific quirks (rejects max_tokens on vision calls, different error codes)
  • Users currently hit error 1210 (see #26827, #26879) because the custom provider path doesn't handle these quirks

Root Cause

  • ZhipuAI is a major Chinese LLM provider with multimodal models (GLM-4V, GLM-5V)
  • The open.bigmodel.cn endpoint is OpenAI-compatible but has GLM-specific quirks (rejects max_tokens on vision calls, different error codes)
  • Users currently hit error 1210 (see #26827, #26879) because the custom provider path doesn't handle these quirks

Fix Action

Fixed

Code Example

auxiliary:
  vision:
    provider: glm
    model: glm-4v-flash
    base_url: "https://open.bigmodel.cn/api/paas/v4/"
    api_key: "<key>"

---

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

---

# In resolve_vision_provider_client, line 3566:
   if requested in ("zai", "glm") and not resolved_base_url:

---

_skip_max_tokens = (
       provider in ("zai", "glm")
       and ("4v" in _model_lower or "5v" in _model_lower or "-v" in _model_lower)
   )
RAW_BUFFERClick to expand / collapse

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:

  1. Strips the provider identity, breaking all provider-specific logic downstream
  2. Requires manual base_url and api_key configuration
  3. 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:

  1. 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)
  2. 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:
  3. 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

  • ZhipuAI is a major Chinese LLM provider with multimodal models (GLM-4V, GLM-5V)
  • The open.bigmodel.cn endpoint is OpenAI-compatible but has GLM-specific quirks (rejects max_tokens on vision calls, different error codes)
  • Users currently hit error 1210 (see #26827, #26879) because the custom provider path doesn't handle these quirks

Related

  • #26827 (vision_analyze fails with GLM)
  • #26879 (provider identity lost in auxiliary task config)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Feature] Add GLM (ZhipuAI) as first-class auxiliary provider [1 pull requests]