Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 0271c9f

Browse files
roomote[bot]hannesrudolph
authored andcommitted
feat: add GLM-5 model support to Z.ai provider (#11440)
1 parent e049215 commit 0271c9f

2 files changed

Lines changed: 32 additions & 2 deletions

File tree

packages/types/src/providers/zai.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,21 @@ export const internationalZAiModels = {
120120
description:
121121
"GLM-4.7 is Zhipu's latest model with built-in thinking capabilities enabled by default. It provides enhanced reasoning for complex tasks while maintaining fast response times.",
122122
},
123+
"glm-5": {
124+
maxTokens: 16_384,
125+
contextWindow: 202_752,
126+
supportsImages: false,
127+
supportsPromptCache: true,
128+
supportsReasoningEffort: ["disable", "medium"],
129+
reasoningEffort: "medium",
130+
preserveReasoning: true,
131+
inputPrice: 0.6,
132+
outputPrice: 2.2,
133+
cacheWritesPrice: 0,
134+
cacheReadsPrice: 0.11,
135+
description:
136+
"GLM-5 is Zhipu's next-generation model with a 202k context window and built-in thinking capabilities. It delivers state-of-the-art reasoning, coding, and agentic performance.",
137+
},
123138
"glm-4.7-flash": {
124139
maxTokens: 16_384,
125140
contextWindow: 200_000,
@@ -281,6 +296,21 @@ export const mainlandZAiModels = {
281296
description:
282297
"GLM-4.7 is Zhipu's latest model with built-in thinking capabilities enabled by default. It provides enhanced reasoning for complex tasks while maintaining fast response times.",
283298
},
299+
"glm-5": {
300+
maxTokens: 16_384,
301+
contextWindow: 202_752,
302+
supportsImages: false,
303+
supportsPromptCache: true,
304+
supportsReasoningEffort: ["disable", "medium"],
305+
reasoningEffort: "medium",
306+
preserveReasoning: true,
307+
inputPrice: 0.29,
308+
outputPrice: 1.14,
309+
cacheWritesPrice: 0,
310+
cacheReadsPrice: 0.057,
311+
description:
312+
"GLM-5 is Zhipu's next-generation model with a 202k context window and built-in thinking capabilities. It delivers state-of-the-art reasoning, coding, and agentic performance.",
313+
},
284314
"glm-4.7-flash": {
285315
maxTokens: 16_384,
286316
contextWindow: 204_800,

src/api/providers/zai.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export class ZAiHandler extends BaseOpenAiCompatibleProvider<string> {
5252
) {
5353
const { id: modelId, info } = this.getModel()
5454

55-
// Check if this is a GLM-4.7 model with thinking support
56-
const isThinkingModel = modelId === "glm-4.7" && Array.isArray(info.supportsReasoningEffort)
55+
// Check if this is a model with thinking support (e.g. GLM-4.7, GLM-5)
56+
const isThinkingModel = Array.isArray(info.supportsReasoningEffort)
5757

5858
if (isThinkingModel) {
5959
// For GLM-4.7, thinking is ON by default in the API.

0 commit comments

Comments
 (0)