Skip to content

Commit e0cb1bb

Browse files
committed
chore(zai): remove tier pricing blocks for Z.ai models
1 parent 03a0111 commit e0cb1bb

File tree

2 files changed

+8
-71
lines changed

2 files changed

+8
-71
lines changed

packages/types/src/providers/zai.ts

Lines changed: 7 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ import type { ModelInfo } from "../model.js"
22
import { ZaiApiLine } from "../provider-settings.js"
33

44
// Z AI
5+
// https://docs.z.ai/guides/llm/glm-4-32b-0414-128k
56
// https://docs.z.ai/guides/llm/glm-4.5
7+
// https://docs.z.ai/guides/llm/glm-4.6
68
// https://docs.z.ai/guides/overview/pricing
9+
// https://bigmodel.cn/pricing
710

811
export type InternationalZAiModelId = keyof typeof internationalZAiModels
9-
export const internationalZAiDefaultModelId: InternationalZAiModelId = "glm-4.5"
12+
export const internationalZAiDefaultModelId: InternationalZAiModelId = "glm-4.6"
1013
export const internationalZAiModels = {
1114
"glm-4.5": {
1215
maxTokens: 98_304,
@@ -59,15 +62,15 @@ export const internationalZAiModels = {
5962
maxTokens: 98_304,
6063
contextWindow: 131_072,
6164
supportsImages: false,
62-
supportsPromptCache: false,
65+
supportsPromptCache: true,
6366
inputPrice: 0,
6467
outputPrice: 0,
6568
cacheWritesPrice: 0,
6669
cacheReadsPrice: 0,
6770
description: "GLM-4.5-Flash is a free, high-speed model excellent for reasoning, coding, and agentic tasks.",
6871
},
6972
"glm-4.5v": {
70-
maxTokens: 98_304,
73+
maxTokens: 16_384,
7174
contextWindow: 131_072,
7275
supportsImages: true,
7376
supportsPromptCache: true,
@@ -104,7 +107,7 @@ export const internationalZAiModels = {
104107
} as const satisfies Record<string, ModelInfo>
105108

106109
export type MainlandZAiModelId = keyof typeof mainlandZAiModels
107-
export const mainlandZAiDefaultModelId: MainlandZAiModelId = "glm-4.5"
110+
export const mainlandZAiDefaultModelId: MainlandZAiModelId = "glm-4.6"
108111
export const mainlandZAiModels = {
109112
"glm-4.5": {
110113
maxTokens: 98_304,
@@ -117,26 +120,6 @@ export const mainlandZAiModels = {
117120
cacheReadsPrice: 0.057,
118121
description:
119122
"GLM-4.5 is Zhipu's latest featured model. Its comprehensive capabilities in reasoning, coding, and agent reach the state-of-the-art (SOTA) level among open-source models, with a context length of up to 128k.",
120-
tiers: [
121-
{
122-
contextWindow: 32_000,
123-
inputPrice: 0.21,
124-
outputPrice: 1.0,
125-
cacheReadsPrice: 0.043,
126-
},
127-
{
128-
contextWindow: 128_000,
129-
inputPrice: 0.29,
130-
outputPrice: 1.14,
131-
cacheReadsPrice: 0.057,
132-
},
133-
{
134-
contextWindow: Infinity,
135-
inputPrice: 0.29,
136-
outputPrice: 1.14,
137-
cacheReadsPrice: 0.057,
138-
},
139-
],
140123
},
141124
"glm-4.5-air": {
142125
maxTokens: 98_304,
@@ -149,26 +132,6 @@ export const mainlandZAiModels = {
149132
cacheReadsPrice: 0.02,
150133
description:
151134
"GLM-4.5-Air is the lightweight version of GLM-4.5. It balances performance and cost-effectiveness, and can flexibly switch to hybrid thinking models.",
152-
tiers: [
153-
{
154-
contextWindow: 32_000,
155-
inputPrice: 0.07,
156-
outputPrice: 0.4,
157-
cacheReadsPrice: 0.014,
158-
},
159-
{
160-
contextWindow: 128_000,
161-
inputPrice: 0.1,
162-
outputPrice: 0.6,
163-
cacheReadsPrice: 0.02,
164-
},
165-
{
166-
contextWindow: Infinity,
167-
inputPrice: 0.1,
168-
outputPrice: 0.6,
169-
cacheReadsPrice: 0.02,
170-
},
171-
],
172135
},
173136
"glm-4.5-x": {
174137
maxTokens: 98_304,
@@ -227,32 +190,6 @@ export const mainlandZAiModels = {
227190
cacheReadsPrice: 0.057,
228191
description:
229192
"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.",
230-
tiers: [
231-
{
232-
contextWindow: 32_000,
233-
inputPrice: 0.21,
234-
outputPrice: 1.0,
235-
cacheReadsPrice: 0.043,
236-
},
237-
{
238-
contextWindow: 128_000,
239-
inputPrice: 0.29,
240-
outputPrice: 1.14,
241-
cacheReadsPrice: 0.057,
242-
},
243-
{
244-
contextWindow: 200_000,
245-
inputPrice: 0.29,
246-
outputPrice: 1.14,
247-
cacheReadsPrice: 0.057,
248-
},
249-
{
250-
contextWindow: Infinity,
251-
inputPrice: 0.29,
252-
outputPrice: 1.14,
253-
cacheReadsPrice: 0.057,
254-
},
255-
],
256193
},
257194
} as const satisfies Record<string, ModelInfo>
258195

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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(98_304)
99+
expect(model.info.maxTokens).toBe(16_384)
100100
expect(model.info.contextWindow).toBe(131_072)
101101
})
102102
})

0 commit comments

Comments
 (0)