@openclaw/cerebras-provider 2026.8.1 → 2026.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.js +1 -1
- package/dist/index.js +5 -2
- package/dist/models.js +1 -1
- package/dist/onboard.js +3 -3
- package/dist/pricing-api.js +8 -0
- package/dist/{provider-catalog-DvAgfZ4t.js → provider-catalog-CngkMOQh.js} +52 -6
- package/dist/provider-catalog.js +2 -2
- package/openclaw.plugin.json +11 -5
- package/package.json +4 -4
package/dist/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as buildCerebrasProvider } from "./provider-catalog-CngkMOQh.js";
|
|
2
2
|
import { CEREBRAS_BASE_URL, CEREBRAS_MODEL_CATALOG, buildCerebrasCatalogModels } from "./models.js";
|
|
3
3
|
import { CEREBRAS_DEFAULT_MODEL_REF, applyCerebrasConfig } from "./onboard.js";
|
|
4
4
|
export { CEREBRAS_BASE_URL, CEREBRAS_DEFAULT_MODEL_REF, CEREBRAS_MODEL_CATALOG, applyCerebrasConfig, buildCerebrasCatalogModels, buildCerebrasProvider };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as openclaw_plugin_default, t as CEREBRAS_MODEL_DISCOVERY } from "./provider-catalog-CngkMOQh.js";
|
|
2
2
|
import { applyCerebrasConfig } from "./onboard.js";
|
|
3
3
|
import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
|
|
4
4
|
var cerebras_default = defineSingleProviderPluginEntry({
|
|
@@ -15,7 +15,10 @@ var cerebras_default = defineSingleProviderPluginEntry({
|
|
|
15
15
|
noteMessage: ["Cerebras provides high-speed OpenAI-compatible inference for GPT OSS and GLM models.", "Get your API key at: https://cloud.cerebras.ai"].join("\n"),
|
|
16
16
|
noteTitle: "Cerebras"
|
|
17
17
|
},
|
|
18
|
-
catalog: {
|
|
18
|
+
catalog: {
|
|
19
|
+
allowExplicitBaseUrl: true,
|
|
20
|
+
liveModelDiscovery: CEREBRAS_MODEL_DISCOVERY
|
|
21
|
+
}
|
|
19
22
|
}
|
|
20
23
|
});
|
|
21
24
|
//#endregion
|
package/dist/models.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { n as buildCerebrasProvider, r as openclaw_plugin_default } from "./provider-catalog-CngkMOQh.js";
|
|
2
2
|
//#region extensions/cerebras/models.ts
|
|
3
3
|
const CEREBRAS_MANIFEST_CATALOG = openclaw_plugin_default.modelCatalog.providers.cerebras;
|
|
4
4
|
/** Base URL for Cerebras OpenAI-compatible inference. */
|
package/dist/onboard.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as openclaw_plugin_default } from "./provider-catalog-CngkMOQh.js";
|
|
2
2
|
import { CEREBRAS_BASE_URL, buildCerebrasCatalogModels } from "./models.js";
|
|
3
3
|
import { readManifestProviderDefaultModelRef } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
4
4
|
import { createModelCatalogPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
|
|
@@ -6,11 +6,11 @@ import { createModelCatalogPresetAppliers } from "openclaw/plugin-sdk/provider-o
|
|
|
6
6
|
const CEREBRAS_DEFAULT_MODEL_REF = readManifestProviderDefaultModelRef(openclaw_plugin_default, "cerebras");
|
|
7
7
|
const { applyConfig: applyCerebrasConfig } = createModelCatalogPresetAppliers({
|
|
8
8
|
primaryModelRef: CEREBRAS_DEFAULT_MODEL_REF,
|
|
9
|
-
resolveParams: () => ({
|
|
9
|
+
resolveParams: (cfg) => ({
|
|
10
10
|
providerId: "cerebras",
|
|
11
11
|
api: "openai-completions",
|
|
12
12
|
baseUrl: CEREBRAS_BASE_URL,
|
|
13
|
-
catalogModels: buildCerebrasCatalogModels(),
|
|
13
|
+
catalogModels: cfg.models?.mode === "replace" ? buildCerebrasCatalogModels() : [],
|
|
14
14
|
aliases: [{
|
|
15
15
|
modelRef: CEREBRAS_DEFAULT_MODEL_REF,
|
|
16
16
|
alias: "Cerebras Gemma 4 31B"
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { normalizeModelPricingCatalog, normalizeOpenRouterModelPricing } from "openclaw/plugin-sdk/model-catalog-pricing";
|
|
2
|
+
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
+
//#region extensions/cerebras/pricing-api.ts
|
|
4
|
+
function parseCerebrasPricingCatalog(payload) {
|
|
5
|
+
return normalizeModelPricingCatalog(asOptionalRecord(payload)?.data, normalizeOpenRouterModelPricing);
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { parseCerebrasPricingCatalog };
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
2
|
+
import { normalizeOpenRouterModelPricing } from "openclaw/plugin-sdk/model-catalog-pricing";
|
|
3
|
+
import { asOptionalRecord, asPositiveSafeInteger, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
4
|
//#region extensions/cerebras/openclaw.plugin.json
|
|
3
5
|
var openclaw_plugin_default = {
|
|
4
6
|
id: "cerebras",
|
|
5
7
|
activation: { "onStartup": false },
|
|
6
8
|
enabledByDefault: true,
|
|
7
9
|
providers: ["cerebras"],
|
|
10
|
+
modelPricing: { "providers": { "cerebras": { "cerebras": { "provider": "cerebras" } } } },
|
|
8
11
|
providerEndpoints: [{
|
|
9
12
|
"endpointClass": "cerebras-native",
|
|
10
13
|
"hosts": ["api.cerebras.ai"]
|
|
@@ -19,6 +22,7 @@ var openclaw_plugin_default = {
|
|
|
19
22
|
{
|
|
20
23
|
"id": "zai-glm-4.7",
|
|
21
24
|
"name": "Z.ai GLM 4.7",
|
|
25
|
+
"status": "deprecated",
|
|
22
26
|
"input": ["text"],
|
|
23
27
|
"reasoning": true,
|
|
24
28
|
"contextWindow": 131072,
|
|
@@ -40,8 +44,8 @@ var openclaw_plugin_default = {
|
|
|
40
44
|
"cost": {
|
|
41
45
|
"input": .35,
|
|
42
46
|
"output": .75,
|
|
43
|
-
"cacheRead":
|
|
44
|
-
"cacheWrite":
|
|
47
|
+
"cacheRead": 0,
|
|
48
|
+
"cacheWrite": 0
|
|
45
49
|
}
|
|
46
50
|
},
|
|
47
51
|
{
|
|
@@ -54,13 +58,13 @@ var openclaw_plugin_default = {
|
|
|
54
58
|
"cost": {
|
|
55
59
|
"input": .99,
|
|
56
60
|
"output": 1.49,
|
|
57
|
-
"cacheRead":
|
|
58
|
-
"cacheWrite":
|
|
61
|
+
"cacheRead": 0,
|
|
62
|
+
"cacheWrite": 0
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
]
|
|
62
66
|
} },
|
|
63
|
-
"discovery": { "cerebras": "
|
|
67
|
+
"discovery": { "cerebras": "refreshable" }
|
|
64
68
|
},
|
|
65
69
|
setup: { "providers": [{
|
|
66
70
|
"id": "cerebras",
|
|
@@ -91,6 +95,48 @@ var openclaw_plugin_default = {
|
|
|
91
95
|
/**
|
|
92
96
|
* Cerebras model provider builder.
|
|
93
97
|
*/
|
|
98
|
+
function projectCerebrasModels(rows, fallback) {
|
|
99
|
+
const seeds = new Map(fallback.models.map((model) => [model.id, model]));
|
|
100
|
+
const models = /* @__PURE__ */ new Map();
|
|
101
|
+
for (const row of rows) {
|
|
102
|
+
const record = asOptionalRecord(row);
|
|
103
|
+
const id = normalizeOptionalString(record?.id);
|
|
104
|
+
const limits = asOptionalRecord(record?.limits);
|
|
105
|
+
const contextWindow = asPositiveSafeInteger(limits?.max_context_length);
|
|
106
|
+
const maxTokens = asPositiveSafeInteger(limits?.max_completion_tokens);
|
|
107
|
+
if (!record || !id || id.length > 512 || /[\s\p{Cc}]/u.test(id) || record.object !== void 0 && record.object !== "model" || record.deprecated === true || !contextWindow || !maxTokens) continue;
|
|
108
|
+
const seed = seeds.get(id);
|
|
109
|
+
const capabilities = asOptionalRecord(record.capabilities);
|
|
110
|
+
models.set(id, {
|
|
111
|
+
...seed,
|
|
112
|
+
id,
|
|
113
|
+
name: normalizeOptionalString(record.name) ?? id,
|
|
114
|
+
reasoning: capabilities?.reasoning === true,
|
|
115
|
+
input: capabilities?.vision === true ? ["text", "image"] : ["text"],
|
|
116
|
+
contextWindow,
|
|
117
|
+
maxTokens,
|
|
118
|
+
cost: normalizeOpenRouterModelPricing(record.pricing) ?? {
|
|
119
|
+
input: 0,
|
|
120
|
+
output: 0,
|
|
121
|
+
cacheRead: 0,
|
|
122
|
+
cacheWrite: 0
|
|
123
|
+
},
|
|
124
|
+
compat: {
|
|
125
|
+
...seed?.compat,
|
|
126
|
+
...typeof capabilities?.tools === "boolean" ? { supportsTools: capabilities.tools } : {}
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return [...models.values()].toSorted((left, right) => left.id.localeCompare(right.id));
|
|
131
|
+
}
|
|
132
|
+
const CEREBRAS_MODEL_DISCOVERY = {
|
|
133
|
+
endpointUrl: {
|
|
134
|
+
url: "https://api.cerebras.ai/public/v1/models",
|
|
135
|
+
requireBaseUrl: openclaw_plugin_default.modelCatalog.providers.cerebras.baseUrl
|
|
136
|
+
},
|
|
137
|
+
buildRequestHeaders: () => ({ Accept: "application/json" }),
|
|
138
|
+
projectRows: projectCerebrasModels
|
|
139
|
+
};
|
|
94
140
|
/** Builds the Cerebras OpenAI-compatible model provider config. */
|
|
95
141
|
function buildCerebrasProvider() {
|
|
96
142
|
return buildManifestModelProviderConfig({
|
|
@@ -99,4 +145,4 @@ function buildCerebrasProvider() {
|
|
|
99
145
|
});
|
|
100
146
|
}
|
|
101
147
|
//#endregion
|
|
102
|
-
export {
|
|
148
|
+
export { buildCerebrasProvider as n, openclaw_plugin_default as r, CEREBRAS_MODEL_DISCOVERY as t };
|
package/dist/provider-catalog.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { buildCerebrasProvider };
|
|
1
|
+
import { n as buildCerebrasProvider, t as CEREBRAS_MODEL_DISCOVERY } from "./provider-catalog-CngkMOQh.js";
|
|
2
|
+
export { CEREBRAS_MODEL_DISCOVERY, buildCerebrasProvider };
|
package/openclaw.plugin.json
CHANGED
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
},
|
|
6
6
|
"enabledByDefault": true,
|
|
7
7
|
"providers": ["cerebras"],
|
|
8
|
+
"modelPricing": {
|
|
9
|
+
"providers": {
|
|
10
|
+
"cerebras": { "cerebras": { "provider": "cerebras" } }
|
|
11
|
+
}
|
|
12
|
+
},
|
|
8
13
|
"providerEndpoints": [
|
|
9
14
|
{
|
|
10
15
|
"endpointClass": "cerebras-native",
|
|
@@ -28,6 +33,7 @@
|
|
|
28
33
|
{
|
|
29
34
|
"id": "zai-glm-4.7",
|
|
30
35
|
"name": "Z.ai GLM 4.7",
|
|
36
|
+
"status": "deprecated",
|
|
31
37
|
"input": ["text"],
|
|
32
38
|
"reasoning": true,
|
|
33
39
|
"contextWindow": 131072,
|
|
@@ -49,8 +55,8 @@
|
|
|
49
55
|
"cost": {
|
|
50
56
|
"input": 0.35,
|
|
51
57
|
"output": 0.75,
|
|
52
|
-
"cacheRead": 0
|
|
53
|
-
"cacheWrite": 0
|
|
58
|
+
"cacheRead": 0,
|
|
59
|
+
"cacheWrite": 0
|
|
54
60
|
}
|
|
55
61
|
},
|
|
56
62
|
{
|
|
@@ -63,15 +69,15 @@
|
|
|
63
69
|
"cost": {
|
|
64
70
|
"input": 0.99,
|
|
65
71
|
"output": 1.49,
|
|
66
|
-
"cacheRead": 0
|
|
67
|
-
"cacheWrite":
|
|
72
|
+
"cacheRead": 0,
|
|
73
|
+
"cacheWrite": 0
|
|
68
74
|
}
|
|
69
75
|
}
|
|
70
76
|
]
|
|
71
77
|
}
|
|
72
78
|
},
|
|
73
79
|
"discovery": {
|
|
74
|
-
"cerebras": "
|
|
80
|
+
"cerebras": "refreshable"
|
|
75
81
|
}
|
|
76
82
|
},
|
|
77
83
|
"setup": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/cerebras-provider",
|
|
3
|
-
"version": "2026.8.
|
|
3
|
+
"version": "2026.8.2",
|
|
4
4
|
"description": "OpenClaw Cerebras provider plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.6.8"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.8.
|
|
21
|
+
"pluginApi": ">=2026.8.2"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.8.
|
|
24
|
+
"openclawVersion": "2026.8.2",
|
|
25
25
|
"bundledDist": false
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"README.md"
|
|
39
39
|
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"openclaw": ">=2026.8.
|
|
41
|
+
"openclaw": ">=2026.8.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"openclaw": {
|