Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 49 additions & 5 deletions packages/types/src/providers/zai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: In the GLM-4.6 description, 'agentsUpgraded' is missing a separator (e.g. a space or punctuation).

Suggested change
"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.6 is Zhipu's latest SOTA models for reasoning, code, and agents, upgraded 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.",

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Typo/grammar. Missing space in 'agentsUpgraded' and plural 'models' should be singular. Add 'window' for clarity.

Suggested change
"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.6 is Zhipu's latest SOTA model for reasoning, coding, and agents. Upgraded across 8 authoritative benchmarks. With a 355B-parameter MoE architecture and a 200K context window, it surpasses GLM-4.5 in coding, reasoning, search, writing, and agent applications.\",

},
"glm-4.5": {
maxTokens: 98_304,
contextWindow: 131_072,
Expand All @@ -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,
Expand All @@ -35,8 +47,40 @@ export const internationalZAiModels = {
} as const satisfies Record<string, ModelInfo>

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.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: In the GLM-4.6 description for the Mainland model, 'agentsUpgraded' is missing a separator.

Suggested change
"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.6 is Zhipu's latest SOTA models for reasoning, code, and agents, Upgraded 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.",

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Same copy issue as above.

Suggested change
"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.6 is Zhipu's latest SOTA model for reasoning, coding, and agents. Upgraded across 8 authoritative benchmarks. With a 355B-parameter MoE architecture and a 200K context window, 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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Using Infinity for a tier contextWindow can cause issues in some consumers (JSON serialization, numeric comparisons). Given the model’s max supported context is 200K, use explicit numeric value.

Suggested change
contextWindow: Infinity,
contextWindow: 200_000,

inputPrice: 0.29,
outputPrice: 1.14,
cacheReadsPrice: 0.057,
},
],
},
"glm-4.5": {
maxTokens: 98_304,
contextWindow: 131_072,
Expand All @@ -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,
Expand Down