惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recent Announcements
Recent Announcements
博客园 - Franky
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
H
Help Net Security
爱范儿
爱范儿
罗磊的独立博客
博客园_首页
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
月光博客
月光博客
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 叶小钗
V
Visual Studio Blog
T
Tailwind CSS Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: declare zai manifest model catalog · openclaw/opencl...
shakkernerd · 2026-05-01 · via Recent Commits to openclaw:main

@@ -1,4 +1,6 @@

1+

import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";

12

import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-shared";

3+

import manifest from "./openclaw.plugin.json" with { type: "json" };

2435

export const ZAI_CODING_GLOBAL_BASE_URL = "https://api.z.ai/api/coding/paas/v4";

46

export const ZAI_CODING_CN_BASE_URL = "https://open.bigmodel.cn/api/coding/paas/v4";

@@ -7,130 +9,23 @@ export const ZAI_CN_BASE_URL = "https://open.bigmodel.cn/api/paas/v4";

79

export const ZAI_DEFAULT_MODEL_ID = "glm-5.1";

810

export const ZAI_DEFAULT_MODEL_REF = `zai/${ZAI_DEFAULT_MODEL_ID}`;

91110-

type ZaiCatalogEntry = {

11-

name: string;

12-

reasoning: boolean;

13-

input: ModelDefinitionConfig["input"];

14-

contextWindow: number;

15-

maxTokens: number;

16-

cost: ModelDefinitionConfig["cost"];

17-

};

12+

const ZAI_MANIFEST_CATALOG = manifest.modelCatalog.providers.zai;

13+

const ZAI_MANIFEST_PROVIDER = buildManifestModelProviderConfig({

14+

providerId: "zai",

15+

catalog: ZAI_MANIFEST_CATALOG,

16+

});

17+

const ZAI_MODEL_CATALOG = new Map(

18+

ZAI_MANIFEST_PROVIDER.models.map((model) => [model.id, model] as const),

19+

);

182019-

export const ZAI_DEFAULT_COST = {

20-

input: 1,

21-

output: 3.2,

22-

cacheRead: 0.2,

23-

cacheWrite: 0,

24-

} satisfies ModelDefinitionConfig["cost"];

25-26-

const ZAI_MODEL_CATALOG = {

27-

"glm-5.1": {

28-

name: "GLM-5.1",

29-

reasoning: true,

30-

input: ["text"],

31-

contextWindow: 202800,

32-

maxTokens: 131100,

33-

cost: { input: 1.2, output: 4, cacheRead: 0.24, cacheWrite: 0 },

34-

},

35-

"glm-5": {

36-

name: "GLM-5",

37-

reasoning: true,

38-

input: ["text"],

39-

contextWindow: 202800,

40-

maxTokens: 131100,

41-

cost: ZAI_DEFAULT_COST,

42-

},

43-

"glm-5-turbo": {

44-

name: "GLM-5 Turbo",

45-

reasoning: true,

46-

input: ["text"],

47-

contextWindow: 202800,

48-

maxTokens: 131100,

49-

cost: { input: 1.2, output: 4, cacheRead: 0.24, cacheWrite: 0 },

50-

},

51-

"glm-5v-turbo": {

52-

name: "GLM-5V Turbo",

53-

reasoning: true,

54-

input: ["text", "image"],

55-

contextWindow: 202800,

56-

maxTokens: 131100,

57-

cost: { input: 1.2, output: 4, cacheRead: 0.24, cacheWrite: 0 },

58-

},

59-

"glm-4.7": {

60-

name: "GLM-4.7",

61-

reasoning: true,

62-

input: ["text"],

63-

contextWindow: 204800,

64-

maxTokens: 131072,

65-

cost: { input: 0.6, output: 2.2, cacheRead: 0.11, cacheWrite: 0 },

66-

},

67-

"glm-4.7-flash": {

68-

name: "GLM-4.7 Flash",

69-

reasoning: true,

70-

input: ["text"],

71-

contextWindow: 200000,

72-

maxTokens: 131072,

73-

cost: { input: 0.07, output: 0.4, cacheRead: 0, cacheWrite: 0 },

74-

},

75-

"glm-4.7-flashx": {

76-

name: "GLM-4.7 FlashX",

77-

reasoning: true,

78-

input: ["text"],

79-

contextWindow: 200000,

80-

maxTokens: 128000,

81-

cost: { input: 0.06, output: 0.4, cacheRead: 0.01, cacheWrite: 0 },

82-

},

83-

"glm-4.6": {

84-

name: "GLM-4.6",

85-

reasoning: true,

86-

input: ["text"],

87-

contextWindow: 204800,

88-

maxTokens: 131072,

89-

cost: { input: 0.6, output: 2.2, cacheRead: 0.11, cacheWrite: 0 },

90-

},

91-

"glm-4.6v": {

92-

name: "GLM-4.6V",

93-

reasoning: true,

94-

input: ["text", "image"],

95-

contextWindow: 128000,

96-

maxTokens: 32768,

97-

cost: { input: 0.3, output: 0.9, cacheRead: 0, cacheWrite: 0 },

98-

},

99-

"glm-4.5": {

100-

name: "GLM-4.5",

101-

reasoning: true,

102-

input: ["text"],

103-

contextWindow: 131072,

104-

maxTokens: 98304,

105-

cost: { input: 0.6, output: 2.2, cacheRead: 0.11, cacheWrite: 0 },

106-

},

107-

"glm-4.5-air": {

108-

name: "GLM-4.5 Air",

109-

reasoning: true,

110-

input: ["text"],

111-

contextWindow: 131072,

112-

maxTokens: 98304,

113-

cost: { input: 0.2, output: 1.1, cacheRead: 0.03, cacheWrite: 0 },

114-

},

115-

"glm-4.5-flash": {

116-

name: "GLM-4.5 Flash",

117-

reasoning: true,

118-

input: ["text"],

119-

contextWindow: 131072,

120-

maxTokens: 98304,

121-

cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },

122-

},

123-

"glm-4.5v": {

124-

name: "GLM-4.5V",

125-

reasoning: true,

126-

input: ["text", "image"],

127-

contextWindow: 64000,

128-

maxTokens: 16384,

129-

cost: { input: 0.6, output: 1.8, cacheRead: 0, cacheWrite: 0 },

130-

},

131-

} as const satisfies Record<string, ZaiCatalogEntry>;

132-133-

type ZaiCatalogId = keyof typeof ZAI_MODEL_CATALOG;

21+

export const ZAI_DEFAULT_COST =

22+

ZAI_MODEL_CATALOG.get("glm-5")?.cost ??

23+

({

24+

input: 1,

25+

output: 3.2,

26+

cacheRead: 0.2,

27+

cacheWrite: 0,

28+

} satisfies ModelDefinitionConfig["cost"]);

1342913530

export function resolveZaiBaseUrl(endpoint?: string): string {

13631

switch (endpoint) {

@@ -147,6 +42,10 @@ export function resolveZaiBaseUrl(endpoint?: string): string {

14742

}

14843

}

1494445+

export function buildZaiCatalogModels(): ModelDefinitionConfig[] {

46+

return ZAI_MANIFEST_PROVIDER.models.map((model) => ({ ...model, input: [...model.input] }));

47+

}

48+15049

export function buildZaiModelDefinition(params: {

15150

id: string;

15251

name?: string;

@@ -156,7 +55,7 @@ export function buildZaiModelDefinition(params: {

15655

contextWindow?: number;

15756

maxTokens?: number;

15857

}): ModelDefinitionConfig {

159-

const catalog = ZAI_MODEL_CATALOG[params.id as ZaiCatalogId];

58+

const catalog = ZAI_MODEL_CATALOG.get(params.id);

16059

return {

16160

id: params.id,

16261

name: params.name ?? catalog?.name ?? `GLM ${params.id}`,