@openclaw/venice-provider 2026.7.2-beta.7 → 2026.7.33

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.
@@ -1,449 +0,0 @@
1
- import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
2
- import { buildManifestModelDefinition, readManifestProviderDefaultModelRef } from "openclaw/plugin-sdk/provider-catalog-shared";
3
- //#region extensions/venice/openclaw.plugin.json
4
- var openclaw_plugin_default = {
5
- id: "venice",
6
- activation: { "onStartup": false },
7
- enabledByDefault: true,
8
- providers: ["venice"],
9
- contracts: { "usageProviders": ["venice"] },
10
- providerAuthChoices: [{
11
- "provider": "venice",
12
- "method": "api-key",
13
- "choiceId": "venice-api-key",
14
- "appGuidedSecret": true,
15
- "choiceLabel": "Venice AI API key",
16
- "groupId": "venice",
17
- "groupLabel": "Venice AI",
18
- "groupHint": "Privacy-focused (uncensored models)",
19
- "optionKey": "veniceApiKey",
20
- "cliFlag": "--venice-api-key",
21
- "cliOption": "--venice-api-key <key>",
22
- "cliDescription": "Venice API key"
23
- }],
24
- configSchema: {
25
- "type": "object",
26
- "additionalProperties": false,
27
- "properties": {}
28
- },
29
- setup: { "providers": [{
30
- "id": "venice",
31
- "authMethods": ["api-key"],
32
- "envVars": ["VENICE_API_KEY"]
33
- }] },
34
- modelCatalog: {
35
- "providers": { "venice": {
36
- "baseUrl": "https://api.venice.ai/api/v1",
37
- "api": "openai-completions",
38
- "defaultModel": "zai-org-glm-4.7",
39
- "models": [
40
- {
41
- "id": "zai-org-glm-5-2",
42
- "name": "GLM 5.2",
43
- "reasoning": true,
44
- "input": ["text"],
45
- "contextWindow": 1e6,
46
- "maxTokens": 131072,
47
- "cost": {
48
- "input": 1.4,
49
- "output": 4.4,
50
- "cacheRead": .26,
51
- "cacheWrite": 0
52
- },
53
- "compat": { "supportsUsageInStreaming": false }
54
- },
55
- {
56
- "id": "zai-org-glm-4.7",
57
- "name": "GLM 4.7",
58
- "reasoning": true,
59
- "input": ["text"],
60
- "contextWindow": 198e3,
61
- "maxTokens": 16384,
62
- "cost": {
63
- "input": .55,
64
- "output": 2.65,
65
- "cacheRead": .11,
66
- "cacheWrite": 0
67
- },
68
- "compat": { "supportsUsageInStreaming": false }
69
- },
70
- {
71
- "id": "venice-uncensored-1-2",
72
- "name": "Venice Uncensored 1.2",
73
- "reasoning": false,
74
- "input": ["text", "image"],
75
- "contextWindow": 128e3,
76
- "maxTokens": 8192,
77
- "cost": {
78
- "input": .2,
79
- "output": .9,
80
- "cacheRead": 0,
81
- "cacheWrite": 0
82
- },
83
- "compat": { "supportsUsageInStreaming": false }
84
- },
85
- {
86
- "id": "google-gemma-4-31b-it",
87
- "name": "Google Gemma 4 31B Instruct",
88
- "reasoning": true,
89
- "input": ["text", "image"],
90
- "contextWindow": 256e3,
91
- "maxTokens": 8192,
92
- "cost": {
93
- "input": .12,
94
- "output": .36,
95
- "cacheRead": .09,
96
- "cacheWrite": 0
97
- },
98
- "compat": { "supportsUsageInStreaming": false }
99
- },
100
- {
101
- "id": "kimi-k2-6",
102
- "name": "Kimi K2.6",
103
- "reasoning": true,
104
- "input": ["text", "image"],
105
- "contextWindow": 256e3,
106
- "maxTokens": 65536,
107
- "cost": {
108
- "input": .75,
109
- "output": 3.5,
110
- "cacheRead": .16,
111
- "cacheWrite": 0
112
- },
113
- "compat": { "supportsUsageInStreaming": false }
114
- },
115
- {
116
- "id": "deepseek-v3.2",
117
- "name": "DeepSeek V3.2",
118
- "reasoning": true,
119
- "input": ["text"],
120
- "contextWindow": 16e4,
121
- "maxTokens": 32768,
122
- "cost": {
123
- "input": .33,
124
- "output": .48,
125
- "cacheRead": .16,
126
- "cacheWrite": 0
127
- },
128
- "compat": { "supportsUsageInStreaming": false }
129
- },
130
- {
131
- "id": "qwen3-235b-a22b-thinking-2507",
132
- "name": "Qwen3 235B Thinking",
133
- "reasoning": true,
134
- "input": ["text"],
135
- "contextWindow": 128e3,
136
- "maxTokens": 16384,
137
- "cost": {
138
- "input": .45,
139
- "output": 3.5,
140
- "cacheRead": 0,
141
- "cacheWrite": 0
142
- },
143
- "compat": { "supportsUsageInStreaming": false }
144
- },
145
- {
146
- "id": "qwen3-coder-480b-a35b-instruct-turbo",
147
- "name": "Qwen3 Coder 480B Turbo",
148
- "reasoning": false,
149
- "input": ["text"],
150
- "contextWindow": 256e3,
151
- "maxTokens": 65536,
152
- "cost": {
153
- "input": .35,
154
- "output": 1.5,
155
- "cacheRead": .04,
156
- "cacheWrite": 0
157
- },
158
- "compat": { "supportsUsageInStreaming": false }
159
- },
160
- {
161
- "id": "qwen3-vl-235b-a22b",
162
- "name": "Qwen3 VL 235B (Vision)",
163
- "reasoning": false,
164
- "input": ["text", "image"],
165
- "contextWindow": 128e3,
166
- "maxTokens": 16384,
167
- "cost": {
168
- "input": .21,
169
- "output": 1.9,
170
- "cacheRead": .1,
171
- "cacheWrite": 0
172
- },
173
- "compat": { "supportsUsageInStreaming": false }
174
- },
175
- {
176
- "id": "grok-4-5",
177
- "name": "Grok 4.5",
178
- "reasoning": true,
179
- "input": ["text", "image"],
180
- "contextWindow": 5e5,
181
- "maxTokens": 32e3,
182
- "cost": {
183
- "input": 2.27,
184
- "output": 6.8,
185
- "cacheRead": .34,
186
- "cacheWrite": 0
187
- },
188
- "compat": { "supportsUsageInStreaming": false }
189
- },
190
- {
191
- "id": "qwen-3-7-max",
192
- "name": "Qwen 3.7 Max (via Venice)",
193
- "reasoning": true,
194
- "input": ["text", "image"],
195
- "contextWindow": 1e6,
196
- "maxTokens": 65536,
197
- "cost": {
198
- "input": 2.7,
199
- "output": 8.05,
200
- "cacheRead": .27,
201
- "cacheWrite": 3.35
202
- },
203
- "compat": { "supportsUsageInStreaming": false }
204
- },
205
- {
206
- "id": "qwen-3-7-plus",
207
- "name": "Qwen 3.7 Plus (via Venice)",
208
- "reasoning": true,
209
- "input": ["text", "image"],
210
- "contextWindow": 1e6,
211
- "maxTokens": 65536,
212
- "cost": {
213
- "input": .5,
214
- "output": 2,
215
- "cacheRead": .05,
216
- "cacheWrite": .625
217
- },
218
- "compat": { "supportsUsageInStreaming": false }
219
- },
220
- {
221
- "id": "claude-fable-5",
222
- "name": "Claude Fable 5 (via Venice)",
223
- "reasoning": true,
224
- "input": ["text", "image"],
225
- "contextWindow": 1e6,
226
- "maxTokens": 128e3,
227
- "cost": {
228
- "input": 12,
229
- "output": 60,
230
- "cacheRead": 1.2,
231
- "cacheWrite": 15
232
- },
233
- "compat": {
234
- "supportsUsageInStreaming": false,
235
- "codeMode": "capable"
236
- }
237
- },
238
- {
239
- "id": "claude-opus-5",
240
- "name": "Claude Opus 5 (via Venice)",
241
- "reasoning": true,
242
- "input": ["text", "image"],
243
- "contextWindow": 1e6,
244
- "maxTokens": 128e3,
245
- "cost": {
246
- "input": 6,
247
- "output": 30,
248
- "cacheRead": .6,
249
- "cacheWrite": 7.5
250
- },
251
- "compat": {
252
- "supportsUsageInStreaming": false,
253
- "codeMode": "capable"
254
- }
255
- },
256
- {
257
- "id": "claude-sonnet-4-6",
258
- "name": "Claude Sonnet 4.6 (via Venice)",
259
- "reasoning": true,
260
- "input": ["text", "image"],
261
- "contextWindow": 1e6,
262
- "maxTokens": 64e3,
263
- "cost": {
264
- "input": 3.6,
265
- "output": 18,
266
- "cacheRead": .36,
267
- "cacheWrite": 4.5
268
- },
269
- "compat": { "supportsUsageInStreaming": false }
270
- },
271
- {
272
- "id": "openai-gpt-56-sol",
273
- "name": "GPT-5.6 Sol (via Venice)",
274
- "reasoning": true,
275
- "input": ["text", "image"],
276
- "contextWindow": 1e6,
277
- "maxTokens": 128e3,
278
- "cost": {
279
- "input": 6.25,
280
- "output": 37.5,
281
- "cacheRead": .625,
282
- "cacheWrite": 7.8125
283
- },
284
- "compat": { "supportsUsageInStreaming": false }
285
- },
286
- {
287
- "id": "zai-org-glm-4.6",
288
- "name": "GLM 4.6",
289
- "status": "deprecated",
290
- "replacedBy": "zai-org-glm-4.7",
291
- "reasoning": true,
292
- "input": ["text"],
293
- "contextWindow": 198e3,
294
- "maxTokens": 16384,
295
- "cost": {
296
- "input": .43,
297
- "output": 1.75,
298
- "cacheRead": .08,
299
- "cacheWrite": 0
300
- },
301
- "compat": { "supportsUsageInStreaming": false }
302
- },
303
- {
304
- "id": "google-gemma-3-27b-it",
305
- "name": "Google Gemma 3 27B Instruct",
306
- "status": "deprecated",
307
- "replacedBy": "google-gemma-4-31b-it",
308
- "reasoning": false,
309
- "input": ["text", "image"],
310
- "contextWindow": 198e3,
311
- "maxTokens": 16384,
312
- "cost": {
313
- "input": .12,
314
- "output": .2,
315
- "cacheRead": 0,
316
- "cacheWrite": 0
317
- },
318
- "compat": { "supportsUsageInStreaming": false }
319
- },
320
- {
321
- "id": "kimi-k2-5",
322
- "name": "Kimi K2.5",
323
- "status": "deprecated",
324
- "replacedBy": "kimi-k2-6",
325
- "reasoning": true,
326
- "input": ["text", "image"],
327
- "contextWindow": 256e3,
328
- "maxTokens": 65536,
329
- "cost": {
330
- "input": .56,
331
- "output": 3.5,
332
- "cacheRead": .22,
333
- "cacheWrite": 0
334
- },
335
- "compat": { "supportsUsageInStreaming": false }
336
- }
337
- ]
338
- } },
339
- "discovery": { "venice": "refreshable" }
340
- }
341
- };
342
- //#endregion
343
- //#region extensions/venice/models.ts
344
- const VENICE_MANIFEST_CATALOG = openclaw_plugin_default.modelCatalog.providers.venice;
345
- const VENICE_BASE_URL = VENICE_MANIFEST_CATALOG.baseUrl;
346
- const VENICE_DEFAULT_MODEL_REF = readManifestProviderDefaultModelRef(openclaw_plugin_default, "venice");
347
- const VENICE_DEFAULT_COST = {
348
- input: 0,
349
- output: 0,
350
- cacheRead: 0,
351
- cacheWrite: 0
352
- };
353
- const VENICE_DEFAULT_CONTEXT_WINDOW = 128e3;
354
- const VENICE_DEFAULT_MAX_TOKENS = 4096;
355
- const VENICE_DISCOVERY_HARD_MAX_TOKENS = 131072;
356
- const VENICE_DISCOVERY_TIMEOUT_MS = 1e4;
357
- const VENICE_DISCOVERY_CACHE_TTL_MS = 6e4;
358
- function decorateVeniceModelDefinition(entry) {
359
- return {
360
- id: entry.id,
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,
367
- compat: {
368
- supportsUsageInStreaming: false,
369
- ...entry.compat
370
- }
371
- };
372
- }
373
- /** Venice's decorated network-free fallback catalog. */
374
- const VENICE_MODEL_CATALOG = VENICE_MANIFEST_CATALOG.models.map(buildManifestModelDefinition({
375
- providerId: "venice",
376
- catalog: VENICE_MANIFEST_CATALOG,
377
- decorate: decorateVeniceModelDefinition
378
- }));
379
- function normalizePositiveInt(value) {
380
- if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return;
381
- return Math.floor(value);
382
- }
383
- function resolveApiMaxCompletionTokens(params) {
384
- const raw = normalizePositiveInt(params.apiModel.model_spec?.maxCompletionTokens);
385
- if (!raw) return;
386
- const contextWindow = normalizePositiveInt(params.apiModel.model_spec?.availableContextTokens);
387
- const knownMaxTokens = typeof params.knownMaxTokens === "number" && Number.isFinite(params.knownMaxTokens) ? Math.floor(params.knownMaxTokens) : void 0;
388
- return Math.min(raw, contextWindow ?? knownMaxTokens ?? VENICE_DEFAULT_CONTEXT_WINDOW, knownMaxTokens ?? VENICE_DISCOVERY_HARD_MAX_TOKENS);
389
- }
390
- function resolveApiSupportsTools(apiModel) {
391
- const supportsFunctionCalling = apiModel.model_spec?.capabilities?.supportsFunctionCalling;
392
- return typeof supportsFunctionCalling === "boolean" ? supportsFunctionCalling : void 0;
393
- }
394
- function projectVeniceModels(rows, fallback) {
395
- const catalogById = new Map(fallback.models.map((model) => [model.id, model]));
396
- const models = [];
397
- for (const row of rows) {
398
- if (!row || typeof row !== "object" || Array.isArray(row)) continue;
399
- const apiModel = row;
400
- if (typeof apiModel.id !== "string" || !apiModel.id.trim()) continue;
401
- const catalogEntry = catalogById.get(apiModel.id);
402
- const apiMaxTokens = resolveApiMaxCompletionTokens({
403
- apiModel,
404
- knownMaxTokens: catalogEntry?.maxTokens
405
- });
406
- const apiSupportsTools = resolveApiSupportsTools(apiModel);
407
- if (catalogEntry) {
408
- const definition = {
409
- ...catalogEntry,
410
- input: [...catalogEntry.input],
411
- cost: { ...catalogEntry.cost },
412
- ...catalogEntry.compat ? { compat: { ...catalogEntry.compat } } : {}
413
- };
414
- if (apiMaxTokens !== void 0) definition.maxTokens = apiMaxTokens;
415
- if (apiSupportsTools === false) definition.compat = {
416
- ...definition.compat,
417
- supportsTools: false
418
- };
419
- models.push(definition);
420
- } else {
421
- const apiSpec = apiModel.model_spec;
422
- const lowerModelId = normalizeLowercaseStringOrEmpty(apiModel.id);
423
- const isReasoning = apiSpec?.capabilities?.supportsReasoning || lowerModelId.includes("thinking") || lowerModelId.includes("reason") || lowerModelId.includes("r1");
424
- const hasVision = apiSpec?.capabilities?.supportsVision === true;
425
- models.push({
426
- id: apiModel.id,
427
- name: apiSpec?.name || apiModel.id,
428
- reasoning: isReasoning,
429
- input: hasVision ? ["text", "image"] : ["text"],
430
- cost: VENICE_DEFAULT_COST,
431
- contextWindow: normalizePositiveInt(apiSpec?.availableContextTokens) ?? VENICE_DEFAULT_CONTEXT_WINDOW,
432
- maxTokens: apiMaxTokens ?? VENICE_DEFAULT_MAX_TOKENS,
433
- compat: {
434
- supportsUsageInStreaming: false,
435
- ...apiSupportsTools === false ? { supportsTools: false } : {}
436
- }
437
- });
438
- }
439
- }
440
- return models;
441
- }
442
- const VENICE_MODEL_DISCOVERY_OPTIONS = {
443
- timeoutMs: VENICE_DISCOVERY_TIMEOUT_MS,
444
- ttlMs: VENICE_DISCOVERY_CACHE_TTL_MS,
445
- buildRequestHeaders: () => ({ Accept: "application/json" }),
446
- projectRows: projectVeniceModels
447
- };
448
- //#endregion
449
- export { openclaw_plugin_default as a, VENICE_MODEL_DISCOVERY_OPTIONS as i, VENICE_DEFAULT_MODEL_REF as n, VENICE_MODEL_CATALOG as r, VENICE_BASE_URL as t };