Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions packages/types/src/providers/zai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,19 @@ export const internationalZAiModels = {
"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.",
},
"glm-5": {
maxTokens: 16_384,
contextWindow: 202_752,
maxTokens: 128_000,
contextWindow: 200_000,
supportsImages: false,
supportsPromptCache: true,
supportsReasoningEffort: ["disable", "medium"],
reasoningEffort: "medium",
preserveReasoning: true,
inputPrice: 0.6,
outputPrice: 2.2,
inputPrice: 1.0,
outputPrice: 3.2,
cacheWritesPrice: 0,
cacheReadsPrice: 0.11,
cacheReadsPrice: 0.2,
description:
"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.",
"GLM-5 is Zhipu's next-generation model with a 200k context window, 128k max output, and built-in thinking capabilities. It delivers state-of-the-art reasoning, coding, and agentic performance.",
},
"glm-4.7-flash": {
maxTokens: 16_384,
Expand Down Expand Up @@ -297,19 +297,19 @@ export const mainlandZAiModels = {
"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.",
},
"glm-5": {
maxTokens: 16_384,
contextWindow: 202_752,
maxTokens: 128_000,
contextWindow: 200_000,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every other mainland model with a ~200k context window (glm-4.6, glm-4.7, glm-4.7-flash, glm-4.7-flashx) uses contextWindow: 204_800, while their international counterparts use 200_000. Setting mainland GLM-5 to 200_000 breaks this established pattern. Since you already proportionally scaled the pricing to match mainland conventions, the context window likely needs the same treatment. If the bigmodel.cn docs confirm 200k exactly, this is fine -- but worth double-checking.

Suggested change
contextWindow: 200_000,
contextWindow: 204_800,

Fix it with Roo Code or mention @roomote and request a fix.

supportsImages: false,
supportsPromptCache: true,
supportsReasoningEffort: ["disable", "medium"],
reasoningEffort: "medium",
preserveReasoning: true,
inputPrice: 0.29,
outputPrice: 1.14,
inputPrice: 0.48,
outputPrice: 1.66,
cacheWritesPrice: 0,
cacheReadsPrice: 0.057,
cacheReadsPrice: 0.1,
description:
"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.",
"GLM-5 is Zhipu's next-generation model with a 200k context window, 128k max output, and built-in thinking capabilities. It delivers state-of-the-art reasoning, coding, and agentic performance.",
},
"glm-4.7-flash": {
maxTokens: 16_384,
Expand Down
4 changes: 2 additions & 2 deletions src/api/providers/__tests__/zai.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ describe("ZAiHandler", () => {
const model = handlerWithModel.getModel()
expect(model.id).toBe(testModelId)
expect(model.info).toEqual(internationalZAiModels[testModelId])
expect(model.info.contextWindow).toBe(202_752)
expect(model.info.contextWindow).toBe(200_000)
expect(model.info.supportsReasoningEffort).toEqual(["disable", "medium"])
expect(model.info.reasoningEffort).toBe("medium")
expect(model.info.preserveReasoning).toBe(true)
Expand Down Expand Up @@ -230,7 +230,7 @@ describe("ZAiHandler", () => {
const model = handlerWithModel.getModel()
expect(model.id).toBe(testModelId)
expect(model.info).toEqual(mainlandZAiModels[testModelId])
expect(model.info.contextWindow).toBe(202_752)
expect(model.info.contextWindow).toBe(200_000)
expect(model.info.supportsReasoningEffort).toEqual(["disable", "medium"])
expect(model.info.reasoningEffort).toBe("medium")
expect(model.info.preserveReasoning).toBe(true)
Expand Down
Loading