From abcf836a0c3bebf3d74d100e2829787aad37fe0e Mon Sep 17 00:00:00 2001 From: Chris Staley Date: Fri, 27 Mar 2026 15:44:35 -0600 Subject: [PATCH] feat: add GLM-5.1 to GLM Coding provider, update GLM-5 pricing - Add glm-5.1 model to GLM Coding provider with fitness scores - Update glm-5 pricing to match Z.AI API page ($1/$3.2/$0.2) - Set glm-5.1 pricing to $1.2/$5/$0.3 per Z.AI - Remove glm-4-32b (deprecated, returns empty from upstream) - Rename Z.AI provider display name from "Z.AI (GLM-5)" to "Z.AI" - Update zai pricing section to match glm pricing --- open-sse/config/providerRegistry.ts | 2 +- open-sse/services/autoCombo/taskFitness.ts | 5 +- src/shared/constants/pricing.ts | 79 ++++++++++++++++------ src/shared/constants/providers.ts | 2 +- tests/unit/t12-pricing-updates.test.mjs | 4 +- 5 files changed, 65 insertions(+), 27 deletions(-) diff --git a/open-sse/config/providerRegistry.ts b/open-sse/config/providerRegistry.ts index 0bcf0592ea..69b018b2d2 100644 --- a/open-sse/config/providerRegistry.ts +++ b/open-sse/config/providerRegistry.ts @@ -626,6 +626,7 @@ export const REGISTRY: Record = { "Anthropic-Beta": "claude-code-20250219,interleaved-thinking-2025-05-14", }, models: [ + { id: "glm-5.1", name: "GLM 5.1" }, { id: "glm-5", name: "GLM 5" }, { id: "glm-5-turbo", name: "GLM 5 Turbo" }, { id: "glm-4.7-flash", name: "GLM 4.7 Flash" }, @@ -635,7 +636,6 @@ export const REGISTRY: Record = { { id: "glm-4.5v", name: "GLM 4.5V (Vision)" }, { id: "glm-4.5", name: "GLM 4.5" }, { id: "glm-4.5-air", name: "GLM 4.5 Air" }, - { id: "glm-4-32b", name: "GLM 4 32B" }, ], }, diff --git a/open-sse/services/autoCombo/taskFitness.ts b/open-sse/services/autoCombo/taskFitness.ts index e29b10ab17..123d479b1c 100644 --- a/open-sse/services/autoCombo/taskFitness.ts +++ b/open-sse/services/autoCombo/taskFitness.ts @@ -36,7 +36,8 @@ const FITNESS_TABLE: Record> = { "grok-3": 0.8, // Kimi K2.5 — agentic with tool calling, good at code tasks "kimi-k2": 0.82, - // GLM-5 — Z.AI model with 128k output + // GLM-5.1 / GLM-5 — Z.AI reasoning models, 200K context / 128k output + "glm-5.1": 0.78, "glm-5": 0.78, // MiniMax M2.5 — reasoning support helps complex code "minimax-m2.5": 0.75, @@ -78,6 +79,7 @@ const FITNESS_TABLE: Record> = { "deepseek-r1": 0.88, "deepseek-chat": 0.8, "kimi-k2": 0.82, // Kimi K2.5 agentic — good for analysis + "glm-5.1": 0.82, // GLM-5.1 free reasoning, 200K context for long analysis "glm-5": 0.78, // GLM-5 with 128k output for long analysis "minimax-m2.5": 0.76, }, @@ -114,6 +116,7 @@ const FITNESS_TABLE: Record> = { "grok-4": 0.74, "grok-3": 0.73, "kimi-k2": 0.76, // agentic multi-step tasks + "glm-5.1": 0.75, "glm-5": 0.7, "minimax-m2.5": 0.7, }, diff --git a/src/shared/constants/pricing.ts b/src/shared/constants/pricing.ts index 62fdd82c82..789ae0a06a 100644 --- a/src/shared/constants/pricing.ts +++ b/src/shared/constants/pricing.ts @@ -729,40 +729,75 @@ export const DEFAULT_PRICING = { // GLM glm: { + "glm-5.1": { + input: 1.2, + output: 5, + cached: 0.3, + reasoning: 5, + cache_creation: 1.2, + }, "glm-5": { - input: 0.38, - output: 1.98, - cached: 0.19, - reasoning: 2.97, - cache_creation: 0.38, + input: 1.0, + output: 3.2, + cached: 0.2, + reasoning: 4.8, + cache_creation: 1.0, }, "glm-5-turbo": { input: 1.2, output: 4.0, - cached: 0.6, - reasoning: 6.0, + cached: 0.24, + reasoning: 4.0, cache_creation: 1.2, }, + "glm-4.7-flash": { + input: 0, + output: 0, + cached: 0, + reasoning: 0, + cache_creation: 0, + }, "glm-4.7": { - input: 0.38, - output: 1.98, - cached: 0.19, - reasoning: 2.97, - cache_creation: 0.38, + input: 0.6, + output: 2.2, + cached: 0.11, + reasoning: 2.2, + cache_creation: 0.6, }, "glm-4.6": { - input: 0.5, - output: 2.0, - cached: 0.25, - reasoning: 3.0, - cache_creation: 0.5, + input: 0.6, + output: 2.2, + cached: 0.11, + reasoning: 2.2, + cache_creation: 0.6, }, "glm-4.6v": { - input: 0.75, - output: 3.0, - cached: 0.375, - reasoning: 4.5, - cache_creation: 0.75, + input: 0.3, + output: 0.9, + cached: 0.05, + reasoning: 0.9, + cache_creation: 0.3, + }, + "glm-4.5v": { + input: 0.6, + output: 1.8, + cached: 0.11, + reasoning: 1.8, + cache_creation: 0.6, + }, + "glm-4.5": { + input: 0.6, + output: 2.2, + cached: 0.11, + reasoning: 2.2, + cache_creation: 0.6, + }, + "glm-4.5-air": { + input: 0.2, + output: 1.1, + cached: 0.03, + reasoning: 1.1, + cache_creation: 0.2, }, }, diff --git a/src/shared/constants/providers.ts b/src/shared/constants/providers.ts index 46cd919576..f9a83bb312 100644 --- a/src/shared/constants/providers.ts +++ b/src/shared/constants/providers.ts @@ -439,7 +439,7 @@ export const APIKEY_PROVIDERS = { zai: { id: "zai", alias: "zai", - name: "Z.AI (GLM-5)", + name: "Z.AI", icon: "psychology", color: "#2563EB", textIcon: "ZA", diff --git a/tests/unit/t12-pricing-updates.test.mjs b/tests/unit/t12-pricing-updates.test.mjs index e9e511d498..b53a9984ef 100644 --- a/tests/unit/t12-pricing-updates.test.mjs +++ b/tests/unit/t12-pricing-updates.test.mjs @@ -17,8 +17,8 @@ test("T12: pricing table includes MiniMax, GLM, Kimi and gpt-5.4 mini entries", assert.ok(pricing.glm["glm-4.7"], "missing glm/glm-4.7"); assert.ok(pricing.glm["glm-5"], "missing glm/glm-5"); - assert.equal(pricing.glm["glm-4.7"].input, 0.38); - assert.equal(pricing.glm["glm-4.7"].output, 1.98); + assert.equal(pricing.glm["glm-4.7"].input, 0.6); + assert.equal(pricing.glm["glm-4.7"].output, 2.2); assert.ok(pricing.kimi["kimi-k2.5"], "missing kimi/kimi-k2.5"); assert.ok(pricing.kimi["kimi-k2.5-thinking"], "missing kimi/kimi-k2.5-thinking");