feat(models): add GLM-5.1 to Z.AI provider in custom models

GLM-5.1 is the latest Zhipu AI model with 204K context window and
131K max output tokens. It uses the Z.AI Coding Plan endpoint
(OpenAI-compatible) and supports reasoning via enable_thinking.

Not yet tracked by models.dev, so added to models.custom.ts alongside
existing alibaba-coding-plan entries. Merges additively with the
generated Z.AI provider (glm-5, glm-5-turbo, etc.).

Specs from https://docs.z.ai/devpack/using5.1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matt Haynes 2026-03-27 14:49:43 -06:00
parent 24c4e393a7
commit 64f0a5e7b3

View file

@ -169,4 +169,29 @@ export const CUSTOM_MODELS = {
compat: { thinkingFormat: "zai", supportsDeveloperRole: false },
} satisfies Model<"openai-completions">,
},
// ─── Z.AI (GLM-5.1) ────────────────────────────────────────────────
// GLM-5.1 is the latest GLM model from Zhipu AI, not yet in models.dev.
// Uses the Z.AI Coding Plan endpoint (OpenAI-compatible).
// Ref: https://docs.z.ai/devpack/using5.1
"zai": {
"glm-5.1": {
id: "glm-5.1",
name: "GLM-5.1",
api: "openai-completions",
provider: "zai",
baseUrl: "https://api.z.ai/api/coding/paas/v4",
reasoning: true,
input: ["text"],
cost: {
input: 1,
output: 3.2,
cacheRead: 0.2,
cacheWrite: 0,
},
contextWindow: 204800,
maxTokens: 131072,
compat: { thinkingFormat: "zai", supportsDeveloperRole: false },
} satisfies Model<"openai-completions">,
},
} as const;