@openclaw/venice-provider 2026.9.1-beta.1 → 2026.9.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 +1 -1
- package/dist/{models-B-tcQZD0.js → models-BVQ3Z5-U.js} +39 -16
- package/dist/models.js +1 -1
- package/dist/onboard.js +3 -3
- package/dist/pricing-api.js +54 -0
- package/dist/provider-catalog.js +1 -1
- package/dist/usage.js +1 -1
- package/openclaw.plugin.json +52 -2
- package/package.json +4 -4
package/dist/api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./models-
|
|
1
|
+
import { n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./models-BVQ3Z5-U.js";
|
|
2
2
|
export { VENICE_BASE_URL, VENICE_DEFAULT_MODEL_REF, VENICE_MODEL_CATALOG };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as openclaw_plugin_default, i as VENICE_MODEL_DISCOVERY_OPTIONS } from "./models-
|
|
1
|
+
import { a as openclaw_plugin_default, i as VENICE_MODEL_DISCOVERY_OPTIONS } from "./models-BVQ3Z5-U.js";
|
|
2
2
|
import { applyVeniceConfig } from "./onboard.js";
|
|
3
3
|
import { buildStaticVeniceProvider } from "./provider-catalog.js";
|
|
4
4
|
import { createVeniceStreamWrapper } from "./stream.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { parseVeniceModelPricing } from "./pricing-api.js";
|
|
1
2
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
-
import {
|
|
3
|
+
import { buildManifestModelProviderConfig, readManifestProviderDefaultModelRef } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
3
4
|
//#region extensions/venice/openclaw.plugin.json
|
|
4
5
|
var openclaw_plugin_default = {
|
|
5
6
|
id: "venice",
|
|
@@ -7,6 +8,7 @@ var openclaw_plugin_default = {
|
|
|
7
8
|
enabledByDefault: true,
|
|
8
9
|
providers: ["venice"],
|
|
9
10
|
contracts: { "usageProviders": ["venice"] },
|
|
11
|
+
modelPricing: { "providers": { "venice": { "venice": { "provider": "venice" } } } },
|
|
10
12
|
providerAuthChoices: [{
|
|
11
13
|
"provider": "venice",
|
|
12
14
|
"method": "api-key",
|
|
@@ -32,6 +34,7 @@ var openclaw_plugin_default = {
|
|
|
32
34
|
"envVars": ["VENICE_API_KEY"]
|
|
33
35
|
}] },
|
|
34
36
|
modelCatalog: {
|
|
37
|
+
"modelsDev": { "venice": "venice" },
|
|
35
38
|
"providers": { "venice": {
|
|
36
39
|
"baseUrl": "https://api.venice.ai/api/v1",
|
|
37
40
|
"api": "openai-completions",
|
|
@@ -183,7 +186,20 @@ var openclaw_plugin_default = {
|
|
|
183
186
|
"input": 2.27,
|
|
184
187
|
"output": 6.8,
|
|
185
188
|
"cacheRead": .34,
|
|
186
|
-
"cacheWrite": 0
|
|
189
|
+
"cacheWrite": 0,
|
|
190
|
+
"tieredPricing": [{
|
|
191
|
+
"input": 2.27,
|
|
192
|
+
"output": 6.8,
|
|
193
|
+
"cacheRead": .34,
|
|
194
|
+
"cacheWrite": 0,
|
|
195
|
+
"range": [0, 200001]
|
|
196
|
+
}, {
|
|
197
|
+
"input": 4.53,
|
|
198
|
+
"output": 13.6,
|
|
199
|
+
"cacheRead": .68,
|
|
200
|
+
"cacheWrite": 0,
|
|
201
|
+
"range": [200001]
|
|
202
|
+
}]
|
|
187
203
|
},
|
|
188
204
|
"compat": { "supportsUsageInStreaming": false }
|
|
189
205
|
},
|
|
@@ -213,7 +229,20 @@ var openclaw_plugin_default = {
|
|
|
213
229
|
"input": .5,
|
|
214
230
|
"output": 2,
|
|
215
231
|
"cacheRead": .05,
|
|
216
|
-
"cacheWrite": .625
|
|
232
|
+
"cacheWrite": .625,
|
|
233
|
+
"tieredPricing": [{
|
|
234
|
+
"input": .5,
|
|
235
|
+
"output": 2,
|
|
236
|
+
"cacheRead": .05,
|
|
237
|
+
"cacheWrite": .625,
|
|
238
|
+
"range": [0, 256001]
|
|
239
|
+
}, {
|
|
240
|
+
"input": 1.5,
|
|
241
|
+
"output": 6,
|
|
242
|
+
"cacheRead": .15,
|
|
243
|
+
"cacheWrite": 1.875,
|
|
244
|
+
"range": [256001]
|
|
245
|
+
}]
|
|
217
246
|
},
|
|
218
247
|
"compat": { "supportsUsageInStreaming": false }
|
|
219
248
|
},
|
|
@@ -357,13 +386,7 @@ const VENICE_DISCOVERY_TIMEOUT_MS = 1e4;
|
|
|
357
386
|
const VENICE_DISCOVERY_CACHE_TTL_MS = 6e4;
|
|
358
387
|
function decorateVeniceModelDefinition(entry) {
|
|
359
388
|
return {
|
|
360
|
-
|
|
361
|
-
name: entry.name,
|
|
362
|
-
reasoning: entry.reasoning,
|
|
363
|
-
input: [...entry.input],
|
|
364
|
-
cost: VENICE_DEFAULT_COST,
|
|
365
|
-
contextWindow: entry.contextWindow,
|
|
366
|
-
maxTokens: entry.maxTokens,
|
|
389
|
+
...entry,
|
|
367
390
|
compat: {
|
|
368
391
|
supportsUsageInStreaming: false,
|
|
369
392
|
...entry.compat
|
|
@@ -371,11 +394,10 @@ function decorateVeniceModelDefinition(entry) {
|
|
|
371
394
|
};
|
|
372
395
|
}
|
|
373
396
|
/** Venice's decorated network-free fallback catalog. */
|
|
374
|
-
const VENICE_MODEL_CATALOG =
|
|
397
|
+
const VENICE_MODEL_CATALOG = buildManifestModelProviderConfig({
|
|
375
398
|
providerId: "venice",
|
|
376
|
-
catalog: VENICE_MANIFEST_CATALOG
|
|
377
|
-
|
|
378
|
-
}));
|
|
399
|
+
catalog: VENICE_MANIFEST_CATALOG
|
|
400
|
+
}).models.map(decorateVeniceModelDefinition);
|
|
379
401
|
function normalizePositiveInt(value) {
|
|
380
402
|
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return;
|
|
381
403
|
return Math.floor(value);
|
|
@@ -399,6 +421,7 @@ function projectVeniceModels(rows, fallback) {
|
|
|
399
421
|
const apiModel = row;
|
|
400
422
|
if (typeof apiModel.id !== "string" || !apiModel.id.trim()) continue;
|
|
401
423
|
const catalogEntry = catalogById.get(apiModel.id);
|
|
424
|
+
const liveCost = parseVeniceModelPricing(apiModel.model_spec?.pricing);
|
|
402
425
|
const apiMaxTokens = resolveApiMaxCompletionTokens({
|
|
403
426
|
apiModel,
|
|
404
427
|
knownMaxTokens: catalogEntry?.maxTokens
|
|
@@ -408,7 +431,7 @@ function projectVeniceModels(rows, fallback) {
|
|
|
408
431
|
const definition = {
|
|
409
432
|
...catalogEntry,
|
|
410
433
|
input: [...catalogEntry.input],
|
|
411
|
-
cost: { ...catalogEntry.cost },
|
|
434
|
+
cost: liveCost ?? { ...catalogEntry.cost },
|
|
412
435
|
...catalogEntry.compat ? { compat: { ...catalogEntry.compat } } : {}
|
|
413
436
|
};
|
|
414
437
|
if (apiMaxTokens !== void 0) definition.maxTokens = apiMaxTokens;
|
|
@@ -427,7 +450,7 @@ function projectVeniceModels(rows, fallback) {
|
|
|
427
450
|
name: apiSpec?.name || apiModel.id,
|
|
428
451
|
reasoning: isReasoning,
|
|
429
452
|
input: hasVision ? ["text", "image"] : ["text"],
|
|
430
|
-
cost: VENICE_DEFAULT_COST,
|
|
453
|
+
cost: liveCost ?? VENICE_DEFAULT_COST,
|
|
431
454
|
contextWindow: normalizePositiveInt(apiSpec?.availableContextTokens) ?? VENICE_DEFAULT_CONTEXT_WINDOW,
|
|
432
455
|
maxTokens: apiMaxTokens ?? VENICE_DEFAULT_MAX_TOKENS,
|
|
433
456
|
compat: {
|
package/dist/models.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as VENICE_MODEL_DISCOVERY_OPTIONS, n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./models-
|
|
1
|
+
import { i as VENICE_MODEL_DISCOVERY_OPTIONS, n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./models-BVQ3Z5-U.js";
|
|
2
2
|
export { VENICE_BASE_URL, VENICE_DEFAULT_MODEL_REF, VENICE_MODEL_CATALOG, VENICE_MODEL_DISCOVERY_OPTIONS };
|
package/dist/onboard.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./models-
|
|
1
|
+
import { n as VENICE_DEFAULT_MODEL_REF, r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./models-BVQ3Z5-U.js";
|
|
2
2
|
import "./api.js";
|
|
3
3
|
import { createModelCatalogPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
|
|
4
4
|
//#region extensions/venice/onboard.ts
|
|
5
5
|
const { applyConfig: applyVeniceConfig } = createModelCatalogPresetAppliers({
|
|
6
6
|
primaryModelRef: VENICE_DEFAULT_MODEL_REF,
|
|
7
|
-
resolveParams: () => ({
|
|
7
|
+
resolveParams: (cfg) => ({
|
|
8
8
|
providerId: "venice",
|
|
9
9
|
api: "openai-completions",
|
|
10
10
|
baseUrl: VENICE_BASE_URL,
|
|
11
|
-
catalogModels: structuredClone(VENICE_MODEL_CATALOG),
|
|
11
|
+
catalogModels: cfg.models?.mode === "replace" ? structuredClone(VENICE_MODEL_CATALOG) : [],
|
|
12
12
|
aliases: [{
|
|
13
13
|
modelRef: VENICE_DEFAULT_MODEL_REF,
|
|
14
14
|
alias: "GLM 4.7"
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { asFiniteNumberInRange, asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
+
import { normalizeModelPricingCatalog } from "openclaw/plugin-sdk/model-catalog-pricing";
|
|
3
|
+
//#region extensions/venice/pricing-api.ts
|
|
4
|
+
function readVeniceRates(value) {
|
|
5
|
+
const row = asOptionalRecord(value);
|
|
6
|
+
const [input, output, cacheRead, cacheWrite] = [
|
|
7
|
+
"input",
|
|
8
|
+
"output",
|
|
9
|
+
"cache_input",
|
|
10
|
+
"cache_write"
|
|
11
|
+
].map((field, index) => {
|
|
12
|
+
if (index >= 2 && row?.[field] === void 0) return 0;
|
|
13
|
+
return asFiniteNumberInRange(asOptionalRecord(row?.[field])?.usd, { min: 0 });
|
|
14
|
+
});
|
|
15
|
+
if (input === void 0 || output === void 0 || cacheRead === void 0 || cacheWrite === void 0) return;
|
|
16
|
+
return {
|
|
17
|
+
input,
|
|
18
|
+
output,
|
|
19
|
+
cacheRead,
|
|
20
|
+
cacheWrite
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** Venice's public /models prices are USD per million tokens, for the whole request. */
|
|
24
|
+
function parseVeniceModelPricing(value) {
|
|
25
|
+
const row = asOptionalRecord(value);
|
|
26
|
+
const base = readVeniceRates(row);
|
|
27
|
+
if (!base || row?.extended === void 0) return base;
|
|
28
|
+
const extended = asOptionalRecord(row.extended);
|
|
29
|
+
const rates = readVeniceRates(extended);
|
|
30
|
+
const threshold = asFiniteNumberInRange(extended?.context_token_threshold, {
|
|
31
|
+
min: 0,
|
|
32
|
+
max: Number.MAX_SAFE_INTEGER,
|
|
33
|
+
maxExclusive: true
|
|
34
|
+
});
|
|
35
|
+
if (!rates || threshold === void 0) return;
|
|
36
|
+
if (["cache_input", "cache_write"].some((field) => row[field] !== void 0 && extended?.[field] === void 0)) return;
|
|
37
|
+
const start = Math.floor(threshold) + 1;
|
|
38
|
+
return {
|
|
39
|
+
...base,
|
|
40
|
+
tieredPricing: [{
|
|
41
|
+
...base,
|
|
42
|
+
range: [0, start]
|
|
43
|
+
}, {
|
|
44
|
+
...rates,
|
|
45
|
+
range: [start]
|
|
46
|
+
}]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Public lightweight publisher entrypoint; vendor payload interpretation stays in this plugin. */
|
|
50
|
+
function parseVenicePricingCatalog(payload) {
|
|
51
|
+
return normalizeModelPricingCatalog(asOptionalRecord(payload)?.data, parseVeniceModelPricing, { readPricing: (model) => model.type === "text" ? asOptionalRecord(model.model_spec)?.pricing : void 0 });
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { parseVeniceModelPricing, parseVenicePricingCatalog };
|
package/dist/provider-catalog.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./models-
|
|
1
|
+
import { r as VENICE_MODEL_CATALOG, t as VENICE_BASE_URL } from "./models-BVQ3Z5-U.js";
|
|
2
2
|
//#region extensions/venice/provider-catalog.ts
|
|
3
3
|
function buildStaticVeniceProvider() {
|
|
4
4
|
return {
|
package/dist/usage.js
CHANGED
|
@@ -2,7 +2,7 @@ import { readProviderJsonObjectResponse } from "openclaw/plugin-sdk/provider-htt
|
|
|
2
2
|
import { buildUsageHttpErrorSnapshot, parseProviderUsageNonNegativeNumber } from "openclaw/plugin-sdk/provider-usage";
|
|
3
3
|
//#region extensions/venice/usage.ts
|
|
4
4
|
const VENICE_BALANCE_URL = "https://api.venice.ai/api/v1/billing/balance";
|
|
5
|
-
const VENICE_USAGE_RESPONSE_MAX_BYTES =
|
|
5
|
+
const VENICE_USAGE_RESPONSE_MAX_BYTES = 1048576;
|
|
6
6
|
async function readPayload(response, timeoutMs) {
|
|
7
7
|
return await readProviderJsonObjectResponse(response, "Venice usage", {
|
|
8
8
|
maxBytes: VENICE_USAGE_RESPONSE_MAX_BYTES,
|
package/openclaw.plugin.json
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
"contracts": {
|
|
9
9
|
"usageProviders": ["venice"]
|
|
10
10
|
},
|
|
11
|
+
"modelPricing": {
|
|
12
|
+
"providers": {
|
|
13
|
+
"venice": { "venice": { "provider": "venice" } }
|
|
14
|
+
}
|
|
15
|
+
},
|
|
11
16
|
"providerAuthChoices": [
|
|
12
17
|
{
|
|
13
18
|
"provider": "venice",
|
|
@@ -39,6 +44,9 @@
|
|
|
39
44
|
]
|
|
40
45
|
},
|
|
41
46
|
"modelCatalog": {
|
|
47
|
+
"modelsDev": {
|
|
48
|
+
"venice": "venice"
|
|
49
|
+
},
|
|
42
50
|
"providers": {
|
|
43
51
|
"venice": {
|
|
44
52
|
"baseUrl": "https://api.venice.ai/api/v1",
|
|
@@ -160,7 +168,28 @@
|
|
|
160
168
|
"input": ["text", "image"],
|
|
161
169
|
"contextWindow": 500000,
|
|
162
170
|
"maxTokens": 32000,
|
|
163
|
-
"cost": {
|
|
171
|
+
"cost": {
|
|
172
|
+
"input": 2.27,
|
|
173
|
+
"output": 6.8,
|
|
174
|
+
"cacheRead": 0.34,
|
|
175
|
+
"cacheWrite": 0,
|
|
176
|
+
"tieredPricing": [
|
|
177
|
+
{
|
|
178
|
+
"input": 2.27,
|
|
179
|
+
"output": 6.8,
|
|
180
|
+
"cacheRead": 0.34,
|
|
181
|
+
"cacheWrite": 0,
|
|
182
|
+
"range": [0, 200001]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"input": 4.53,
|
|
186
|
+
"output": 13.6,
|
|
187
|
+
"cacheRead": 0.68,
|
|
188
|
+
"cacheWrite": 0,
|
|
189
|
+
"range": [200001]
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
},
|
|
164
193
|
"compat": {
|
|
165
194
|
"supportsUsageInStreaming": false
|
|
166
195
|
}
|
|
@@ -184,7 +213,28 @@
|
|
|
184
213
|
"input": ["text", "image"],
|
|
185
214
|
"contextWindow": 1000000,
|
|
186
215
|
"maxTokens": 65536,
|
|
187
|
-
"cost": {
|
|
216
|
+
"cost": {
|
|
217
|
+
"input": 0.5,
|
|
218
|
+
"output": 2,
|
|
219
|
+
"cacheRead": 0.05,
|
|
220
|
+
"cacheWrite": 0.625,
|
|
221
|
+
"tieredPricing": [
|
|
222
|
+
{
|
|
223
|
+
"input": 0.5,
|
|
224
|
+
"output": 2,
|
|
225
|
+
"cacheRead": 0.05,
|
|
226
|
+
"cacheWrite": 0.625,
|
|
227
|
+
"range": [0, 256001]
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"input": 1.5,
|
|
231
|
+
"output": 6,
|
|
232
|
+
"cacheRead": 0.15,
|
|
233
|
+
"cacheWrite": 1.875,
|
|
234
|
+
"range": [256001]
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
},
|
|
188
238
|
"compat": {
|
|
189
239
|
"supportsUsageInStreaming": false
|
|
190
240
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/venice-provider",
|
|
3
|
-
"version": "2026.9.
|
|
3
|
+
"version": "2026.9.2",
|
|
4
4
|
"description": "OpenClaw Venice provider plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"openclaw": {
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"minHostVersion": ">=2026.6.9"
|
|
15
15
|
},
|
|
16
16
|
"compat": {
|
|
17
|
-
"pluginApi": ">=2026.9.
|
|
17
|
+
"pluginApi": ">=2026.9.2"
|
|
18
18
|
},
|
|
19
19
|
"build": {
|
|
20
|
-
"openclawVersion": "2026.9.
|
|
20
|
+
"openclawVersion": "2026.9.2",
|
|
21
21
|
"bundledDist": false
|
|
22
22
|
},
|
|
23
23
|
"release": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"README.md"
|
|
39
39
|
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"openclaw": ">=2026.9.
|
|
41
|
+
"openclaw": ">=2026.9.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"openclaw": {
|