Skip to content

Commit a0621e4

Browse files
committed
feat(types,zai): sync Z.AI international model map and tests
- Update pricing, context window, and capabilities for: glm-4.5-x, glm-4.5-airx, glm-4.5-flash, glm-4.5v, glm-4.6 - Add glm-4-32b-0414-128k - Align tests with new model specs
1 parent 81c3317 commit a0621e4

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

packages/types/src/providers/zai.ts

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ export const internationalZAiModels = {
3737
contextWindow: 131_072,
3838
supportsImages: false,
3939
supportsPromptCache: true,
40-
inputPrice: 0.6,
41-
outputPrice: 2.2,
40+
inputPrice: 2.2,
41+
outputPrice: 8.9,
4242
cacheWritesPrice: 0,
43-
cacheReadsPrice: 0.11,
43+
cacheReadsPrice: 0.45,
4444
description:
4545
"GLM-4.5-X is a high-performance variant optimized for strong reasoning with ultra-fast responses.",
4646
},
@@ -49,25 +49,25 @@ export const internationalZAiModels = {
4949
contextWindow: 131_072,
5050
supportsImages: false,
5151
supportsPromptCache: true,
52-
inputPrice: 0.2,
53-
outputPrice: 1.1,
52+
inputPrice: 1.1,
53+
outputPrice: 4.5,
5454
cacheWritesPrice: 0,
55-
cacheReadsPrice: 0.03,
55+
cacheReadsPrice: 0.22,
5656
description: "GLM-4.5-AirX is a lightweight, ultra-fast variant delivering strong performance with lower cost.",
5757
},
5858
"glm-4.5-flash": {
5959
maxTokens: 98_304,
6060
contextWindow: 131_072,
6161
supportsImages: false,
62-
supportsPromptCache: true,
62+
supportsPromptCache: false,
6363
inputPrice: 0,
6464
outputPrice: 0,
6565
cacheWritesPrice: 0,
6666
cacheReadsPrice: 0,
6767
description: "GLM-4.5-Flash is a free, high-speed model excellent for reasoning, coding, and agentic tasks.",
6868
},
6969
"glm-4.5v": {
70-
maxTokens: 16_384,
70+
maxTokens: 98_304,
7171
contextWindow: 131_072,
7272
supportsImages: true,
7373
supportsPromptCache: true,
@@ -80,7 +80,7 @@ export const internationalZAiModels = {
8080
},
8181
"glm-4.6": {
8282
maxTokens: 98_304,
83-
contextWindow: 204_800,
83+
contextWindow: 200_000,
8484
supportsImages: false,
8585
supportsPromptCache: true,
8686
inputPrice: 0.6,
@@ -90,6 +90,17 @@ export const internationalZAiModels = {
9090
description:
9191
"GLM-4.6 is Zhipu's newest model with an extended context window of up to 200k tokens, providing enhanced capabilities for processing longer documents and conversations.",
9292
},
93+
"glm-4-32b-0414-128k": {
94+
maxTokens: 98_304,
95+
contextWindow: 131_072,
96+
supportsImages: false,
97+
supportsPromptCache: false,
98+
inputPrice: 0.1,
99+
outputPrice: 0.1,
100+
cacheWritesPrice: 0,
101+
cacheReadsPrice: 0,
102+
description: "GLM-4-32B is a 32 billion parameter model with 128k context length, optimized for efficiency.",
103+
},
93104
} as const satisfies Record<string, ModelInfo>
94105

95106
export type MainlandZAiModelId = keyof typeof mainlandZAiModels

src/api/providers/__tests__/zai.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe("ZAiHandler", () => {
8282
const model = handlerWithModel.getModel()
8383
expect(model.id).toBe(testModelId)
8484
expect(model.info).toEqual(internationalZAiModels[testModelId])
85-
expect(model.info.contextWindow).toBe(204_800)
85+
expect(model.info.contextWindow).toBe(200_000)
8686
})
8787

8888
it("should return GLM-4.5v international model with vision support", () => {
@@ -96,7 +96,7 @@ describe("ZAiHandler", () => {
9696
expect(model.id).toBe(testModelId)
9797
expect(model.info).toEqual(internationalZAiModels[testModelId])
9898
expect(model.info.supportsImages).toBe(true)
99-
expect(model.info.maxTokens).toBe(16_384)
99+
expect(model.info.maxTokens).toBe(98_304)
100100
expect(model.info.contextWindow).toBe(131_072)
101101
})
102102
})

0 commit comments

Comments
 (0)