Skip to content

Commit 1339c7c

Browse files
committed
feat: add GLM-4.6 model support to Z.AI provider
- Add glm-4.6 model to both international and mainland Z.AI configurations - Update model to GLM-4.6 as default for both regions - Configure 200K context window (upgraded from 131K in GLM-4.5) - Add tiered pricing for mainland China (32K, 128K, 200K+ contexts) - Support 355B-parameter MoE architecture with improved capabilities - Enable prompt caching support for cost optimization GLM-4.6 represents Zhipu's latest SOTA model with significant improvements in coding, reasoning, search, writing, and agent applications across 8 authoritative benchmarks.
1 parent 702b269 commit 1339c7c

File tree

1 file changed

+49
-5
lines changed
  • packages/types/src/providers

1 file changed

+49
-5
lines changed

packages/types/src/providers/zai.ts

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,24 @@ 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.5
5+
// https://docs.z.ai/guides/llm/glm-4.6
66
// https://docs.z.ai/guides/overview/pricing
77

88
export type InternationalZAiModelId = keyof typeof internationalZAiModels
9-
export const internationalZAiDefaultModelId: InternationalZAiModelId = "glm-4.5"
9+
export const internationalZAiDefaultModelId: InternationalZAiModelId = "glm-4.6"
1010
export const internationalZAiModels = {
11+
"glm-4.6": {
12+
maxTokens: 98_304,
13+
contextWindow: 200_000,
14+
supportsImages: false,
15+
supportsPromptCache: true,
16+
inputPrice: 0.6,
17+
outputPrice: 2.2,
18+
cacheWritesPrice: 0,
19+
cacheReadsPrice: 0.11,
20+
description:
21+
"GLM-4.6 is Zhipu's latest SOTA models for reasoning, code, and agentsUpgraded across 8 authoritative benchmarks. With a 355B-parameter MoE architecture and 200K context, it surpasses GLM-4.5 in coding, reasoning, search, writing, and agent applications.",
22+
},
1123
"glm-4.5": {
1224
maxTokens: 98_304,
1325
contextWindow: 131_072,
@@ -18,7 +30,7 @@ export const internationalZAiModels = {
1830
cacheWritesPrice: 0,
1931
cacheReadsPrice: 0.11,
2032
description:
21-
"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.",
33+
"GLM-4.5 is Zhipu's previous flagship model. Its comprehensive capabilities in reasoning, coding, and agent are excellent among open-source models, with a context length of up to 128k.",
2234
},
2335
"glm-4.5-air": {
2436
maxTokens: 98_304,
@@ -35,8 +47,40 @@ export const internationalZAiModels = {
3547
} as const satisfies Record<string, ModelInfo>
3648

3749
export type MainlandZAiModelId = keyof typeof mainlandZAiModels
38-
export const mainlandZAiDefaultModelId: MainlandZAiModelId = "glm-4.5"
50+
export const mainlandZAiDefaultModelId: MainlandZAiModelId = "glm-4.6"
3951
export const mainlandZAiModels = {
52+
"glm-4.6": {
53+
maxTokens: 98_304,
54+
contextWindow: 200_000,
55+
supportsImages: false,
56+
supportsPromptCache: true,
57+
inputPrice: 0.29,
58+
outputPrice: 1.14,
59+
cacheWritesPrice: 0,
60+
cacheReadsPrice: 0.057,
61+
description:
62+
"GLM-4.6 is Zhipu's latest SOTA models for reasoning, code, and agentsUpgraded across 8 authoritative benchmarks. With a 355B-parameter MoE architecture and 200K context, it surpasses GLM-4.5 in coding, reasoning, search, writing, and agent applications.",
63+
tiers: [
64+
{
65+
contextWindow: 32_000,
66+
inputPrice: 0.21,
67+
outputPrice: 1.0,
68+
cacheReadsPrice: 0.043,
69+
},
70+
{
71+
contextWindow: 128_000,
72+
inputPrice: 0.29,
73+
outputPrice: 1.14,
74+
cacheReadsPrice: 0.057,
75+
},
76+
{
77+
contextWindow: Infinity,
78+
inputPrice: 0.29,
79+
outputPrice: 1.14,
80+
cacheReadsPrice: 0.057,
81+
},
82+
],
83+
},
4084
"glm-4.5": {
4185
maxTokens: 98_304,
4286
contextWindow: 131_072,
@@ -47,7 +91,7 @@ export const mainlandZAiModels = {
4791
cacheWritesPrice: 0,
4892
cacheReadsPrice: 0.057,
4993
description:
50-
"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.",
94+
"GLM-4.5 is Zhipu's previous flagship model. Its comprehensive capabilities in reasoning, coding, and agent are excellent among open-source models, with a context length of up to 128k.",
5195
tiers: [
5296
{
5397
contextWindow: 32_000,

0 commit comments

Comments
 (0)