From 1339c7cc8bad17f95532117f36049d84a9ee8266 Mon Sep 17 00:00:00 2001 From: wangshan Date: Tue, 30 Sep 2025 19:03:20 +0800 Subject: [PATCH] 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. --- packages/types/src/providers/zai.ts | 54 ++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/packages/types/src/providers/zai.ts b/packages/types/src/providers/zai.ts index b3838c1406a..050b9ba1d98 100644 --- a/packages/types/src/providers/zai.ts +++ b/packages/types/src/providers/zai.ts @@ -2,12 +2,24 @@ import type { ModelInfo } from "../model.js" import { ZaiApiLine } from "../provider-settings.js" // Z AI -// https://docs.z.ai/guides/llm/glm-4.5 +// https://docs.z.ai/guides/llm/glm-4.6 // https://docs.z.ai/guides/overview/pricing export type InternationalZAiModelId = keyof typeof internationalZAiModels -export const internationalZAiDefaultModelId: InternationalZAiModelId = "glm-4.5" +export const internationalZAiDefaultModelId: InternationalZAiModelId = "glm-4.6" export const internationalZAiModels = { + "glm-4.6": { + maxTokens: 98_304, + contextWindow: 200_000, + supportsImages: false, + supportsPromptCache: true, + inputPrice: 0.6, + outputPrice: 2.2, + cacheWritesPrice: 0, + cacheReadsPrice: 0.11, + description: + "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.", + }, "glm-4.5": { maxTokens: 98_304, contextWindow: 131_072, @@ -18,7 +30,7 @@ export const internationalZAiModels = { cacheWritesPrice: 0, cacheReadsPrice: 0.11, description: - "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.", + "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.", }, "glm-4.5-air": { maxTokens: 98_304, @@ -35,8 +47,40 @@ export const internationalZAiModels = { } as const satisfies Record export type MainlandZAiModelId = keyof typeof mainlandZAiModels -export const mainlandZAiDefaultModelId: MainlandZAiModelId = "glm-4.5" +export const mainlandZAiDefaultModelId: MainlandZAiModelId = "glm-4.6" export const mainlandZAiModels = { + "glm-4.6": { + maxTokens: 98_304, + contextWindow: 200_000, + supportsImages: false, + supportsPromptCache: true, + inputPrice: 0.29, + outputPrice: 1.14, + cacheWritesPrice: 0, + cacheReadsPrice: 0.057, + description: + "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.", + tiers: [ + { + contextWindow: 32_000, + inputPrice: 0.21, + outputPrice: 1.0, + cacheReadsPrice: 0.043, + }, + { + contextWindow: 128_000, + inputPrice: 0.29, + outputPrice: 1.14, + cacheReadsPrice: 0.057, + }, + { + contextWindow: Infinity, + inputPrice: 0.29, + outputPrice: 1.14, + cacheReadsPrice: 0.057, + }, + ], + }, "glm-4.5": { maxTokens: 98_304, contextWindow: 131_072, @@ -47,7 +91,7 @@ export const mainlandZAiModels = { cacheWritesPrice: 0, cacheReadsPrice: 0.057, description: - "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.", + "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.", tiers: [ { contextWindow: 32_000,