Skip to content

chore: add glm-5.4 to zai provider - #794

Open
LarsArtmann wants to merge 1 commit into
charmbracelet:mainfrom
LarsArtmann:chore/add-glm-5.4-to-zai
Open

LarsArtmann wants to merge 1 commit into
charmbracelet:mainfrom
LarsArtmann:chore/add-glm-5.4-to-zai

Conversation

@LarsArtmann

@LarsArtmann LarsArtmann commented Nov 28, 2026 •

Copy link
Copy Markdown

chore: add glm-5.4 to zai provider

Why

zai points at the GLM Coding Plan endpoint (https://api.z.ai/api/coding/paas/v4), and GLM-5.4 is live there for every plan: "All plans support GLM-5.4, GLM-5.3 and GLM-5.3-Flash" (Coding Plan overview). The catalog has no glm-5.4 entry, so Crush doesn't list it.

I've been working around that with a model add line, which can't declare effort levels. On the wire that sends no reasoning_effort at all (Z.ai then runs max), and without --think on the slot it sends thinking: disabled.

What changed

Adds glm-5.4 to internal/providers/configs/zai.json, above glm-5.3-flash. Defaults are unchanged.

  • Context window: 1000000, default_max_tokens 131072 (128K) — GLM-5.4 guide; the switch guide also says "Set Context Window Size to 1000000". OpenRouter and models.dev don't list GLM-5.4 yet, so there is no second source for the numbers.
  • Reasoning: always with low / high / max, default max — that is Z.ai's own default ("The default level is max"). thinking.type: disabled is turned into low ("Continues the request; still performs lightweight thinking"), so there is no off switch — same shape as MiniMax-M3.1-Flash in chore: add minimax m3.1 flash #786.
  • Vision: true. Input modality is Video / Image / Text / File.
  • Pricing: 0 / 0 until Z.ai publishes Model API pricing. GLM-5.4 is Coding-Plan-only for now and not on the pricing page.

zhipu-coding.json and zhipu.json are untouched, I only checked docs.z.ai.

Test plan

  • go run ./cmd/format → done: 0/43 files reformatted

  • go test ./..., go vet ./..., golangci-lint run ./... → 0 issues

  • go run . on this branch: GET /v3/providers lists glm-5.4 first under zai with the fields above; /v2/providers derives can_reason: true, reasoning_levels: ["low", "high", "max"], default_reasoning_effort: "max", supports_attachments: true

  • Crush v0.102.0 on that server, wire-captured against a mock endpoint in an isolated config: with no slot flag the request is {"model":"glm-5.4","thinking":{"type":"enabled"},"reasoning_effort":"max","max_tokens":131072}, the same shape as glm-5.3 and glm-5.3-flash; --reasoning-effort low and high put low and high on the wire

  • Same setup against the live Coding Plan endpoint: --reasoning-effort low, high and max each return a completion

  • I have read CONTRIBUTING.md.

  • I have created a discussion that was approved by a maintainer (for new features).

💘 Generated with Crush

Z.ai serves GLM-5.4 on the GLM Coding Plan endpoint that the zai
provider points at, but the catalog had no entry, so clients such as
Crush do not list the model.

💘 Generated with Crush

Assisted-by: Crush:glm-5.4
@LarsArtmann

Copy link
Copy Markdown
Author

I think this looks solid.
~HUMAN, Lars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant