@openclaw/deepinfra-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.
- package/dist/.setup/provider-models-DheMSw06.mjs +413 -0
- package/dist/api.js +3 -3
- package/dist/embedding-provider.js +1 -1
- package/dist/image-generation-provider.js +4 -3
- package/dist/index.js +5 -5
- package/dist/media-models.js +4 -2
- package/dist/media-understanding-provider.js +2 -2
- package/dist/memory-embedding-adapter.js +36 -0
- package/dist/onboard.js +2 -2
- package/dist/provider-catalog.js +3 -2
- package/dist/provider-models.js +2 -288
- package/dist/speech-provider.js +1 -1
- package/dist/surface-model-catalogs.js +4 -2
- package/dist/video-generation-provider.js +51 -66
- package/openclaw.plugin.json +108 -145
- package/package.json +4 -4
- package/dist/doctor-contract-api.js +0 -84
- package/dist/embedding-adapter.js +0 -58
- package/dist/openclaw.plugin-DomWf43f.js +0 -212
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
2
|
+
import { asPositiveSafeInteger } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
+
import { isProviderApiKeyConfigured } from "openclaw/plugin-sdk/provider-auth";
|
|
4
|
+
import { LiveModelCatalogHttpError, clearLiveCatalogCacheForTests, getCachedLiveProviderModelRows } from "openclaw/plugin-sdk/provider-catalog-live-runtime";
|
|
5
|
+
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
6
|
+
import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input";
|
|
7
|
+
//#region extensions/deepinfra/openclaw.plugin.json
|
|
8
|
+
var modelCatalog = {
|
|
9
|
+
"providers": { "deepinfra": {
|
|
10
|
+
"baseUrl": "https://api.deepinfra.com/v1/openai",
|
|
11
|
+
"api": "openai-completions",
|
|
12
|
+
"models": [
|
|
13
|
+
{
|
|
14
|
+
"id": "deepseek-ai/DeepSeek-V4-Flash",
|
|
15
|
+
"name": "DeepSeek V4 Flash",
|
|
16
|
+
"reasoning": true,
|
|
17
|
+
"input": ["text"],
|
|
18
|
+
"contextWindow": 1048576,
|
|
19
|
+
"maxTokens": 1048576,
|
|
20
|
+
"cost": {
|
|
21
|
+
"input": .1,
|
|
22
|
+
"output": .2,
|
|
23
|
+
"cacheRead": .02,
|
|
24
|
+
"cacheWrite": 0
|
|
25
|
+
},
|
|
26
|
+
"compat": { "supportsUsageInStreaming": true }
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "deepseek-ai/DeepSeek-V3.2",
|
|
30
|
+
"name": "DeepSeek V3.2",
|
|
31
|
+
"reasoning": false,
|
|
32
|
+
"input": ["text"],
|
|
33
|
+
"contextWindow": 163840,
|
|
34
|
+
"maxTokens": 163840,
|
|
35
|
+
"cost": {
|
|
36
|
+
"input": .26,
|
|
37
|
+
"output": .38,
|
|
38
|
+
"cacheRead": .13,
|
|
39
|
+
"cacheWrite": 0
|
|
40
|
+
},
|
|
41
|
+
"compat": { "supportsUsageInStreaming": true }
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "zai-org/GLM-5.1",
|
|
45
|
+
"name": "GLM-5.1",
|
|
46
|
+
"reasoning": true,
|
|
47
|
+
"input": ["text"],
|
|
48
|
+
"contextWindow": 202752,
|
|
49
|
+
"maxTokens": 202752,
|
|
50
|
+
"cost": {
|
|
51
|
+
"input": 1.05,
|
|
52
|
+
"output": 3.5,
|
|
53
|
+
"cacheRead": .205000005,
|
|
54
|
+
"cacheWrite": 0
|
|
55
|
+
},
|
|
56
|
+
"compat": { "supportsUsageInStreaming": true }
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "stepfun-ai/Step-3.5-Flash",
|
|
60
|
+
"name": "Step 3.5 Flash",
|
|
61
|
+
"reasoning": false,
|
|
62
|
+
"input": ["text"],
|
|
63
|
+
"contextWindow": 262144,
|
|
64
|
+
"maxTokens": 262144,
|
|
65
|
+
"cost": {
|
|
66
|
+
"input": .1,
|
|
67
|
+
"output": .3,
|
|
68
|
+
"cacheRead": .02,
|
|
69
|
+
"cacheWrite": 0
|
|
70
|
+
},
|
|
71
|
+
"compat": { "supportsUsageInStreaming": true }
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "MiniMaxAI/MiniMax-M2.5",
|
|
75
|
+
"name": "MiniMax M2.5",
|
|
76
|
+
"reasoning": true,
|
|
77
|
+
"input": ["text"],
|
|
78
|
+
"contextWindow": 196608,
|
|
79
|
+
"maxTokens": 196608,
|
|
80
|
+
"cost": {
|
|
81
|
+
"input": .15,
|
|
82
|
+
"output": 1.15,
|
|
83
|
+
"cacheRead": .03,
|
|
84
|
+
"cacheWrite": 0
|
|
85
|
+
},
|
|
86
|
+
"compat": { "supportsUsageInStreaming": true }
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"id": "moonshotai/Kimi-K2.5",
|
|
90
|
+
"name": "Kimi K2.5",
|
|
91
|
+
"reasoning": true,
|
|
92
|
+
"input": ["text", "image"],
|
|
93
|
+
"contextWindow": 262144,
|
|
94
|
+
"maxTokens": 262144,
|
|
95
|
+
"cost": {
|
|
96
|
+
"input": .45,
|
|
97
|
+
"output": 2.25,
|
|
98
|
+
"cacheRead": .070000002,
|
|
99
|
+
"cacheWrite": 0
|
|
100
|
+
},
|
|
101
|
+
"compat": { "supportsUsageInStreaming": true }
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "nvidia/NVIDIA-Nemotron-3-Super-120B-A12B",
|
|
105
|
+
"name": "NVIDIA Nemotron 3 Super 120B A12B",
|
|
106
|
+
"reasoning": true,
|
|
107
|
+
"input": ["text"],
|
|
108
|
+
"contextWindow": 262144,
|
|
109
|
+
"maxTokens": 262144,
|
|
110
|
+
"cost": {
|
|
111
|
+
"input": .1,
|
|
112
|
+
"output": .5,
|
|
113
|
+
"cacheRead": 0,
|
|
114
|
+
"cacheWrite": 0
|
|
115
|
+
},
|
|
116
|
+
"compat": { "supportsUsageInStreaming": true }
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": "meta-llama/Llama-3.3-70B-Instruct-Turbo",
|
|
120
|
+
"name": "Llama 3.3 70B Instruct Turbo",
|
|
121
|
+
"reasoning": false,
|
|
122
|
+
"input": ["text"],
|
|
123
|
+
"contextWindow": 131072,
|
|
124
|
+
"maxTokens": 131072,
|
|
125
|
+
"cost": {
|
|
126
|
+
"input": .1,
|
|
127
|
+
"output": .32,
|
|
128
|
+
"cacheRead": 0,
|
|
129
|
+
"cacheWrite": 0
|
|
130
|
+
},
|
|
131
|
+
"compat": { "supportsUsageInStreaming": true }
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
} },
|
|
135
|
+
"discovery": { "deepinfra": "refreshable" }
|
|
136
|
+
};
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region extensions/deepinfra/provider-models.ts
|
|
139
|
+
const log = createSubsystemLogger("deepinfra-models");
|
|
140
|
+
const DEEPINFRA_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
|
141
|
+
providerId: "deepinfra",
|
|
142
|
+
catalog: modelCatalog.providers.deepinfra
|
|
143
|
+
});
|
|
144
|
+
const DEEPINFRA_BASE_URL = DEEPINFRA_MANIFEST_PROVIDER.baseUrl;
|
|
145
|
+
const DEEPINFRA_MODELS_URL = `${DEEPINFRA_BASE_URL}/models?sort_by=openclaw&filter=with_meta`;
|
|
146
|
+
const DEEPINFRA_DEFAULT_MODEL_ID = "deepseek-ai/DeepSeek-V4-Flash";
|
|
147
|
+
const DEEPINFRA_DEFAULT_MODEL_REF = `deepinfra/${DEEPINFRA_DEFAULT_MODEL_ID}`;
|
|
148
|
+
const DEEPINFRA_DEFAULT_CONTEXT_WINDOW = 128e3;
|
|
149
|
+
const DEEPINFRA_DEFAULT_MAX_TOKENS = 8192;
|
|
150
|
+
const DEEPINFRA_MODEL_CATALOG = DEEPINFRA_MANIFEST_PROVIDER.models;
|
|
151
|
+
const DISCOVERY_TIMEOUT_MS = 5e3;
|
|
152
|
+
const DISCOVERY_CACHE_TTL_MS = 3e5;
|
|
153
|
+
function resetDeepInfraModelCacheForTest() {
|
|
154
|
+
clearLiveCatalogCacheForTests();
|
|
155
|
+
}
|
|
156
|
+
const SURFACE_FOR_TAG = {
|
|
157
|
+
chat: "chat",
|
|
158
|
+
vlm: "vlm",
|
|
159
|
+
embed: "embed",
|
|
160
|
+
"image-gen": "image-gen",
|
|
161
|
+
"video-gen": "video-gen",
|
|
162
|
+
tts: "tts",
|
|
163
|
+
stt: "stt"
|
|
164
|
+
};
|
|
165
|
+
function entryToSurfaceModel(entry) {
|
|
166
|
+
const id = typeof entry?.id === "string" ? entry.id.trim() : "";
|
|
167
|
+
if (!id) return null;
|
|
168
|
+
const metadata = entry.metadata;
|
|
169
|
+
if (!metadata) return null;
|
|
170
|
+
const tags = Array.isArray(metadata.tags) ? metadata.tags.filter((t) => typeof t === "string") : [];
|
|
171
|
+
const pricing = metadata.pricing ?? {};
|
|
172
|
+
return {
|
|
173
|
+
id,
|
|
174
|
+
name: id,
|
|
175
|
+
description: metadata.description ?? void 0,
|
|
176
|
+
tags,
|
|
177
|
+
contextWindow: asPositiveSafeInteger(metadata.context_length),
|
|
178
|
+
maxTokens: asPositiveSafeInteger(metadata.max_tokens),
|
|
179
|
+
pricing,
|
|
180
|
+
defaultWidth: asPositiveSafeInteger(metadata.default_width),
|
|
181
|
+
defaultHeight: asPositiveSafeInteger(metadata.default_height),
|
|
182
|
+
defaultIterations: asPositiveSafeInteger(metadata.default_iterations)
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function bucketBySurface(models) {
|
|
186
|
+
const catalog = {
|
|
187
|
+
chat: [],
|
|
188
|
+
vlm: [],
|
|
189
|
+
embed: [],
|
|
190
|
+
imageGen: [],
|
|
191
|
+
videoGen: [],
|
|
192
|
+
tts: [],
|
|
193
|
+
stt: [],
|
|
194
|
+
live: true
|
|
195
|
+
};
|
|
196
|
+
const buckets = {
|
|
197
|
+
chat: catalog.chat,
|
|
198
|
+
vlm: catalog.vlm,
|
|
199
|
+
embed: catalog.embed,
|
|
200
|
+
"image-gen": catalog.imageGen,
|
|
201
|
+
"video-gen": catalog.videoGen,
|
|
202
|
+
tts: catalog.tts,
|
|
203
|
+
stt: catalog.stt
|
|
204
|
+
};
|
|
205
|
+
for (const model of models) {
|
|
206
|
+
const seen = /* @__PURE__ */ new Set();
|
|
207
|
+
for (const tag of model.tags) {
|
|
208
|
+
const surface = SURFACE_FOR_TAG[tag];
|
|
209
|
+
if (surface && !seen.has(surface)) {
|
|
210
|
+
seen.add(surface);
|
|
211
|
+
buckets[surface].push(model);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return catalog;
|
|
216
|
+
}
|
|
217
|
+
function hasDeepInfraSurfaceModelRows(rows) {
|
|
218
|
+
return rows.some((entry) => entryToSurfaceModel(entry) !== null);
|
|
219
|
+
}
|
|
220
|
+
function manifestChatEntryToSurfaceModel(entry) {
|
|
221
|
+
const cost = entry.cost ?? {};
|
|
222
|
+
const pricing = {};
|
|
223
|
+
if (typeof cost.input === "number") pricing.input_tokens = cost.input;
|
|
224
|
+
if (typeof cost.output === "number") pricing.output_tokens = cost.output;
|
|
225
|
+
if (typeof cost.cacheRead === "number" && cost.cacheRead > 0) pricing.cache_read_tokens = cost.cacheRead;
|
|
226
|
+
const tags = ["chat"];
|
|
227
|
+
if (entry.input?.includes("image")) tags.push("vlm");
|
|
228
|
+
if (entry.reasoning) tags.push("reasoning");
|
|
229
|
+
return {
|
|
230
|
+
id: entry.id,
|
|
231
|
+
name: entry.name ?? entry.id,
|
|
232
|
+
tags,
|
|
233
|
+
contextWindow: entry.contextWindow,
|
|
234
|
+
maxTokens: entry.maxTokens,
|
|
235
|
+
pricing
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
const STATIC_NON_CHAT_FALLBACK = [
|
|
239
|
+
{
|
|
240
|
+
id: "black-forest-labs/FLUX-1-schnell",
|
|
241
|
+
name: "black-forest-labs/FLUX-1-schnell",
|
|
242
|
+
tags: ["image-gen"],
|
|
243
|
+
pricing: { per_image_unit: .003 },
|
|
244
|
+
defaultWidth: 1024,
|
|
245
|
+
defaultHeight: 1024,
|
|
246
|
+
defaultIterations: 4
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
id: "black-forest-labs/FLUX-1-dev",
|
|
250
|
+
name: "black-forest-labs/FLUX-1-dev",
|
|
251
|
+
tags: ["image-gen"],
|
|
252
|
+
pricing: { per_image_unit: .025 },
|
|
253
|
+
defaultWidth: 1024,
|
|
254
|
+
defaultHeight: 1024,
|
|
255
|
+
defaultIterations: 28
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
id: "Qwen/Qwen-Image-Max",
|
|
259
|
+
name: "Qwen/Qwen-Image-Max",
|
|
260
|
+
tags: ["image-gen"],
|
|
261
|
+
pricing: { per_image_unit: .075 },
|
|
262
|
+
defaultWidth: 1024,
|
|
263
|
+
defaultHeight: 1024,
|
|
264
|
+
defaultIterations: 28
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
id: "stabilityai/sdxl-turbo",
|
|
268
|
+
name: "stabilityai/sdxl-turbo",
|
|
269
|
+
tags: ["image-gen"],
|
|
270
|
+
pricing: { per_image_unit: 2e-4 },
|
|
271
|
+
defaultWidth: 1024,
|
|
272
|
+
defaultHeight: 1024,
|
|
273
|
+
defaultIterations: 4
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
id: "hexgrad/Kokoro-82M",
|
|
277
|
+
name: "hexgrad/Kokoro-82M",
|
|
278
|
+
tags: ["tts"],
|
|
279
|
+
pricing: { input_characters: .65 }
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
id: "Qwen/Qwen3-TTS",
|
|
283
|
+
name: "Qwen/Qwen3-TTS",
|
|
284
|
+
tags: ["tts"],
|
|
285
|
+
pricing: { input_characters: .65 }
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
id: "ResembleAI/chatterbox-turbo",
|
|
289
|
+
name: "ResembleAI/chatterbox-turbo",
|
|
290
|
+
tags: ["tts"],
|
|
291
|
+
pricing: { input_characters: 1 }
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
id: "sesame/csm-1b",
|
|
295
|
+
name: "sesame/csm-1b",
|
|
296
|
+
tags: ["tts"],
|
|
297
|
+
pricing: { input_characters: 7 }
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
id: "openai/whisper-large-v3-turbo",
|
|
301
|
+
name: "openai/whisper-large-v3-turbo",
|
|
302
|
+
tags: ["stt"],
|
|
303
|
+
pricing: { input_seconds: 4e-5 }
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
id: "BAAI/bge-m3",
|
|
307
|
+
name: "BAAI/bge-m3",
|
|
308
|
+
tags: ["embed"],
|
|
309
|
+
pricing: { input_tokens: .01 },
|
|
310
|
+
maxTokens: 8192,
|
|
311
|
+
contextWindow: 8192
|
|
312
|
+
}
|
|
313
|
+
];
|
|
314
|
+
function manifestFallbackCatalog() {
|
|
315
|
+
const catalog = bucketBySurface([...(modelCatalog.providers.deepinfra.models ?? []).map(manifestChatEntryToSurfaceModel), ...STATIC_NON_CHAT_FALLBACK]);
|
|
316
|
+
catalog.live = false;
|
|
317
|
+
return catalog;
|
|
318
|
+
}
|
|
319
|
+
function getDeepInfraSurfaceFallbackCatalog() {
|
|
320
|
+
return manifestFallbackCatalog();
|
|
321
|
+
}
|
|
322
|
+
function buildDeepInfraModelDefinition(model) {
|
|
323
|
+
return {
|
|
324
|
+
...model,
|
|
325
|
+
compat: {
|
|
326
|
+
...model.compat,
|
|
327
|
+
supportsUsageInStreaming: model.compat?.supportsUsageInStreaming ?? true
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
function chatSurfaceModelToModelDefinition(model) {
|
|
332
|
+
const input = model.tags.includes("vlm") ? ["text", "image"] : ["text"];
|
|
333
|
+
const reasoning = model.tags.includes("reasoning") || model.tags.includes("reasoning_effort");
|
|
334
|
+
return buildDeepInfraModelDefinition({
|
|
335
|
+
id: model.id,
|
|
336
|
+
name: model.name,
|
|
337
|
+
reasoning,
|
|
338
|
+
input,
|
|
339
|
+
contextWindow: model.contextWindow ?? DEEPINFRA_DEFAULT_CONTEXT_WINDOW,
|
|
340
|
+
maxTokens: model.maxTokens ?? DEEPINFRA_DEFAULT_MAX_TOKENS,
|
|
341
|
+
cost: {
|
|
342
|
+
input: model.pricing.input_tokens ?? 0,
|
|
343
|
+
output: model.pricing.output_tokens ?? 0,
|
|
344
|
+
cacheRead: model.pricing.cache_read_tokens ?? 0,
|
|
345
|
+
cacheWrite: 0
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
function hasDeepInfraApiKey(options) {
|
|
350
|
+
const fromEnv = (options?.env ?? process.env).DEEPINFRA_API_KEY;
|
|
351
|
+
if (typeof fromEnv === "string" && fromEnv.trim() !== "") return true;
|
|
352
|
+
const providers = options?.config?.models?.providers;
|
|
353
|
+
for (const [providerId, provider] of Object.entries(providers ?? {})) if (providerId.trim().toLowerCase() === "deepinfra" && hasConfiguredSecretInput(provider?.apiKey, options?.config?.secrets?.defaults)) return true;
|
|
354
|
+
return isProviderApiKeyConfigured({
|
|
355
|
+
provider: "deepinfra",
|
|
356
|
+
agentDir: options?.agentDir
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
async function discoverDeepInfraSurfaces(options) {
|
|
360
|
+
if (process.env.VITEST) return manifestFallbackCatalog();
|
|
361
|
+
const env = options?.env ?? process.env;
|
|
362
|
+
if (!(options?.hasApiKey ?? hasDeepInfraApiKey({
|
|
363
|
+
env,
|
|
364
|
+
agentDir: options?.agentDir
|
|
365
|
+
}))) return manifestFallbackCatalog();
|
|
366
|
+
try {
|
|
367
|
+
const data = await getCachedLiveProviderModelRows({
|
|
368
|
+
providerId: "deepinfra",
|
|
369
|
+
endpoint: DEEPINFRA_MODELS_URL,
|
|
370
|
+
timeoutMs: DISCOVERY_TIMEOUT_MS,
|
|
371
|
+
ttlMs: DISCOVERY_CACHE_TTL_MS,
|
|
372
|
+
buildRequestHeaders: () => ({ Accept: "application/json" }),
|
|
373
|
+
auditContext: "deepinfra-model-discovery",
|
|
374
|
+
shouldCacheRows: hasDeepInfraSurfaceModelRows
|
|
375
|
+
});
|
|
376
|
+
if (data.length === 0) {
|
|
377
|
+
log.warn("No models found from DeepInfra agent-projection endpoint, using static catalog");
|
|
378
|
+
return manifestFallbackCatalog();
|
|
379
|
+
}
|
|
380
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
381
|
+
const surfaceModels = [];
|
|
382
|
+
for (const entry of data) {
|
|
383
|
+
const model = entryToSurfaceModel(entry);
|
|
384
|
+
if (!model || seenIds.has(model.id)) continue;
|
|
385
|
+
seenIds.add(model.id);
|
|
386
|
+
surfaceModels.push(model);
|
|
387
|
+
}
|
|
388
|
+
if (surfaceModels.length === 0) return manifestFallbackCatalog();
|
|
389
|
+
return bucketBySurface(surfaceModels);
|
|
390
|
+
} catch (error) {
|
|
391
|
+
if (error instanceof LiveModelCatalogHttpError) {
|
|
392
|
+
log.warn(`Failed to discover models: HTTP ${error.status}, using static catalog`);
|
|
393
|
+
return manifestFallbackCatalog();
|
|
394
|
+
}
|
|
395
|
+
log.warn(`Discovery failed: ${String(error)}, using static catalog`);
|
|
396
|
+
return manifestFallbackCatalog();
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
async function discoverDeepInfraModels(options) {
|
|
400
|
+
const catalog = await discoverDeepInfraSurfaces(options);
|
|
401
|
+
const chatModels = catalog.chat.length > 0 ? catalog.chat : [...catalog.chat, ...catalog.vlm];
|
|
402
|
+
if (chatModels.length === 0) return DEEPINFRA_MODEL_CATALOG.map(buildDeepInfraModelDefinition);
|
|
403
|
+
const liveModels = chatModels.map(chatSurfaceModelToModelDefinition);
|
|
404
|
+
const seen = new Set(liveModels.map((model) => model.id));
|
|
405
|
+
const manifestModels = DEEPINFRA_MODEL_CATALOG.map(buildDeepInfraModelDefinition).filter((model) => {
|
|
406
|
+
if (seen.has(model.id)) return false;
|
|
407
|
+
seen.add(model.id);
|
|
408
|
+
return true;
|
|
409
|
+
});
|
|
410
|
+
return [...liveModels, ...manifestModels];
|
|
411
|
+
}
|
|
412
|
+
//#endregion
|
|
413
|
+
export { DEEPINFRA_MODEL_CATALOG as a, discoverDeepInfraSurfaces as c, resetDeepInfraModelCacheForTest as d, DEEPINFRA_MODELS_URL as i, getDeepInfraSurfaceFallbackCatalog as l, DEEPINFRA_DEFAULT_MODEL_ID as n, buildDeepInfraModelDefinition as o, DEEPINFRA_DEFAULT_MODEL_REF as r, discoverDeepInfraModels as s, DEEPINFRA_BASE_URL as t, hasDeepInfraApiKey as u };
|
package/dist/api.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DEEPINFRA_DEFAULT_MODEL_REF } from "
|
|
2
|
-
import { deepinfraEmbeddingProviderAdapter } from "./embedding-adapter.js";
|
|
1
|
+
import { r as DEEPINFRA_DEFAULT_MODEL_REF } from "./.setup/provider-models-DheMSw06.mjs";
|
|
3
2
|
import { buildDeepInfraImageGenerationProvider } from "./image-generation-provider.js";
|
|
4
3
|
import { deepinfraMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
4
|
+
import { deepinfraMemoryEmbeddingProviderAdapter } from "./memory-embedding-adapter.js";
|
|
5
5
|
import { applyDeepInfraConfig } from "./onboard.js";
|
|
6
6
|
import { buildDeepInfraProvider, buildStaticDeepInfraProvider } from "./provider-catalog.js";
|
|
7
7
|
import { buildDeepInfraSpeechProvider } from "./speech-provider.js";
|
|
8
8
|
import { buildDeepInfraVideoGenerationProvider } from "./video-generation-provider.js";
|
|
9
|
-
export { DEEPINFRA_DEFAULT_MODEL_REF, applyDeepInfraConfig, buildDeepInfraImageGenerationProvider, buildDeepInfraProvider, buildDeepInfraSpeechProvider, buildDeepInfraVideoGenerationProvider, buildStaticDeepInfraProvider,
|
|
9
|
+
export { DEEPINFRA_DEFAULT_MODEL_REF, applyDeepInfraConfig, buildDeepInfraImageGenerationProvider, buildDeepInfraProvider, buildDeepInfraSpeechProvider, buildDeepInfraVideoGenerationProvider, buildStaticDeepInfraProvider, deepinfraMediaUnderstandingProvider, deepinfraMemoryEmbeddingProviderAdapter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEEPINFRA_BASE_URL } from "
|
|
1
|
+
import { t as DEEPINFRA_BASE_URL } from "./.setup/provider-models-DheMSw06.mjs";
|
|
2
2
|
import { DEEPINFRA_EMBED_FALLBACK_MODELS, normalizeDeepInfraModelRef } from "./media-models.js";
|
|
3
3
|
import { createRemoteEmbeddingProvider, resolveRemoteEmbeddingClient } from "openclaw/plugin-sdk/memory-core-host-engine-embeddings";
|
|
4
4
|
//#region extensions/deepinfra/embedding-provider.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DEEPINFRA_BASE_URL } from "
|
|
1
|
+
import { t as DEEPINFRA_BASE_URL } from "./.setup/provider-models-DheMSw06.mjs";
|
|
2
2
|
import { DEEPINFRA_IMAGE_FALLBACK_MODELS, normalizeDeepInfraBaseUrl, normalizeDeepInfraModelRef } from "./media-models.js";
|
|
3
|
-
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
3
|
import { createOpenAiCompatibleImageGenerationProvider, imageSourceUploadFileName } from "openclaw/plugin-sdk/image-generation";
|
|
4
|
+
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/deepinfra/image-generation-provider.ts
|
|
6
6
|
const DEEPINFRA_IMAGE_SIZES = [
|
|
7
7
|
"512x512",
|
|
@@ -12,10 +12,11 @@ const DEEPINFRA_IMAGE_SIZES = [
|
|
|
12
12
|
const MAX_DEEPINFRA_INPUT_IMAGES = 1;
|
|
13
13
|
function buildDeepInfraImageGenerationProvider(options) {
|
|
14
14
|
const ids = options?.imageGenModels && options.imageGenModels.length > 0 ? options.imageGenModels.map((model) => model.id) : [...DEEPINFRA_IMAGE_FALLBACK_MODELS];
|
|
15
|
+
const defaultModel = ids[0] ?? DEEPINFRA_IMAGE_FALLBACK_MODELS[0];
|
|
15
16
|
return createOpenAiCompatibleImageGenerationProvider({
|
|
16
17
|
id: "deepinfra",
|
|
17
18
|
label: "DeepInfra",
|
|
18
|
-
defaultModel
|
|
19
|
+
defaultModel,
|
|
19
20
|
models: ids,
|
|
20
21
|
capabilities: {
|
|
21
22
|
generate: {
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createDeepInfraAnthropicCacheWrapper } from "./cache-wrapper.js";
|
|
2
|
-
import { DEEPINFRA_DEFAULT_MODEL_REF, discoverDeepInfraModels,
|
|
3
|
-
import { buildDeepInfraEmbeddingAdapter } from "./embedding-adapter.js";
|
|
2
|
+
import { l as getDeepInfraSurfaceFallbackCatalog, r as DEEPINFRA_DEFAULT_MODEL_REF, s as discoverDeepInfraModels, u as hasDeepInfraApiKey } from "./.setup/provider-models-DheMSw06.mjs";
|
|
4
3
|
import { buildDeepInfraImageGenerationProvider } from "./image-generation-provider.js";
|
|
5
4
|
import { buildDeepInfraMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
5
|
+
import { buildDeepInfraMemoryEmbeddingAdapter } from "./memory-embedding-adapter.js";
|
|
6
6
|
import { applyDeepInfraConfig } from "./onboard.js";
|
|
7
7
|
import { buildDeepInfraApiKeyCatalog, buildStaticDeepInfraProvider } from "./provider-catalog.js";
|
|
8
8
|
import { buildDeepInfraSpeechProvider } from "./speech-provider.js";
|
|
@@ -10,7 +10,7 @@ import { listDeepInfraImageGenCatalog, listDeepInfraVideoGenCatalog } from "./su
|
|
|
10
10
|
import { buildDeepInfraVideoGenerationProvider } from "./video-generation-provider.js";
|
|
11
11
|
import { readConfiguredProviderCatalogEntries } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
12
12
|
import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
|
|
13
|
-
import {
|
|
13
|
+
import { PASSTHROUGH_GEMINI_REPLAY_HOOKS } from "openclaw/plugin-sdk/provider-model-shared";
|
|
14
14
|
import { createOpenRouterWrapper, isProxyReasoningUnsupported } from "openclaw/plugin-sdk/provider-stream";
|
|
15
15
|
//#region extensions/deepinfra/index.ts
|
|
16
16
|
const PROVIDER_ID = "deepinfra";
|
|
@@ -84,7 +84,7 @@ var deepinfra_default = defineSingleProviderPluginEntry({
|
|
|
84
84
|
api,
|
|
85
85
|
baseUrl
|
|
86
86
|
} : void 0,
|
|
87
|
-
...
|
|
87
|
+
...PASSTHROUGH_GEMINI_REPLAY_HOOKS,
|
|
88
88
|
wrapStreamFn: (ctx) => {
|
|
89
89
|
const thinkingLevel = isProxyReasoningUnsupported(ctx.modelId) ? void 0 : ctx.thinkingLevel;
|
|
90
90
|
return createDeepInfraAnthropicCacheWrapper(createOpenRouterWrapper(ctx.streamFn, thinkingLevel));
|
|
@@ -104,7 +104,7 @@ var deepinfra_default = defineSingleProviderPluginEntry({
|
|
|
104
104
|
vlmModels: catalog.vlm,
|
|
105
105
|
sttModels: catalog.stt
|
|
106
106
|
}));
|
|
107
|
-
api.
|
|
107
|
+
api.registerMemoryEmbeddingProvider(buildDeepInfraMemoryEmbeddingAdapter({ embedModels: catalog.embed }));
|
|
108
108
|
api.registerSpeechProvider(buildDeepInfraSpeechProvider({ ttsModels: catalog.tts }));
|
|
109
109
|
api.registerVideoGenerationProvider(buildDeepInfraVideoGenerationProvider({ videoGenModels: catalog.videoGen }));
|
|
110
110
|
api.registerModelCatalogProvider({
|
package/dist/media-models.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { DEEPINFRA_BASE_URL } from "
|
|
1
|
+
import { t as DEEPINFRA_BASE_URL } from "./.setup/provider-models-DheMSw06.mjs";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/deepinfra/media-models.ts
|
|
4
|
+
const DEEPINFRA_NATIVE_BASE_URL = "https://api.deepinfra.com/v1/inference";
|
|
4
5
|
const DEFAULT_DEEPINFRA_IMAGE_SIZE = "1024x1024";
|
|
5
6
|
const DEFAULT_DEEPINFRA_TTS_VOICE = "af_bella";
|
|
6
7
|
const DEEPINFRA_VIDEO_ASPECT_RATIOS = [
|
|
@@ -13,6 +14,7 @@ const DEEPINFRA_VIDEO_ASPECT_RATIOS = [
|
|
|
13
14
|
const DEEPINFRA_VIDEO_DURATIONS = [5, 8];
|
|
14
15
|
const DEEPINFRA_IMAGE_FALLBACK_MODELS = [
|
|
15
16
|
"black-forest-labs/FLUX-1-schnell",
|
|
17
|
+
"run-diffusion/Juggernaut-Lightning-Flux",
|
|
16
18
|
"black-forest-labs/FLUX-1-dev",
|
|
17
19
|
"Qwen/Qwen-Image-Max",
|
|
18
20
|
"stabilityai/sdxl-turbo"
|
|
@@ -40,4 +42,4 @@ function normalizeDeepInfraBaseUrl(value, fallback = DEEPINFRA_BASE_URL) {
|
|
|
40
42
|
return (normalizeOptionalString(value) ?? fallback).replace(/\/+$/u, "");
|
|
41
43
|
}
|
|
42
44
|
//#endregion
|
|
43
|
-
export { DEEPINFRA_BASE_URL, DEEPINFRA_EMBED_FALLBACK_MODELS, DEEPINFRA_IMAGE_FALLBACK_MODELS, DEEPINFRA_STT_FALLBACK_MODELS, DEEPINFRA_TTS_FALLBACK_MODELS, DEEPINFRA_VIDEO_ASPECT_RATIOS, DEEPINFRA_VIDEO_DURATIONS, DEEPINFRA_VIDEO_FALLBACK_MODELS, DEEPINFRA_VLM_FALLBACK_MODELS, DEFAULT_DEEPINFRA_IMAGE_SIZE, DEFAULT_DEEPINFRA_TTS_VOICE, normalizeDeepInfraBaseUrl, normalizeDeepInfraModelRef };
|
|
45
|
+
export { DEEPINFRA_BASE_URL, DEEPINFRA_EMBED_FALLBACK_MODELS, DEEPINFRA_IMAGE_FALLBACK_MODELS, DEEPINFRA_NATIVE_BASE_URL, DEEPINFRA_STT_FALLBACK_MODELS, DEEPINFRA_TTS_FALLBACK_MODELS, DEEPINFRA_VIDEO_ASPECT_RATIOS, DEEPINFRA_VIDEO_DURATIONS, DEEPINFRA_VIDEO_FALLBACK_MODELS, DEEPINFRA_VLM_FALLBACK_MODELS, DEFAULT_DEEPINFRA_IMAGE_SIZE, DEFAULT_DEEPINFRA_TTS_VOICE, normalizeDeepInfraBaseUrl, normalizeDeepInfraModelRef };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEEPINFRA_BASE_URL } from "
|
|
1
|
+
import { t as DEEPINFRA_BASE_URL } from "./.setup/provider-models-DheMSw06.mjs";
|
|
2
2
|
import { DEEPINFRA_STT_FALLBACK_MODELS, DEEPINFRA_VLM_FALLBACK_MODELS } from "./media-models.js";
|
|
3
3
|
import { describeImageWithModel, describeImagesWithModel, transcribeOpenAiCompatibleAudio } from "openclaw/plugin-sdk/media-understanding";
|
|
4
4
|
//#region extensions/deepinfra/media-understanding-provider.ts
|
|
@@ -32,4 +32,4 @@ function buildDeepInfraMediaUnderstandingProvider(options) {
|
|
|
32
32
|
}
|
|
33
33
|
const deepinfraMediaUnderstandingProvider = buildDeepInfraMediaUnderstandingProvider();
|
|
34
34
|
//#endregion
|
|
35
|
-
export { buildDeepInfraMediaUnderstandingProvider, deepinfraMediaUnderstandingProvider };
|
|
35
|
+
export { buildDeepInfraMediaUnderstandingProvider, deepinfraMediaUnderstandingProvider, transcribeDeepInfraAudio };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DEFAULT_DEEPINFRA_EMBEDDING_MODEL, createDeepInfraEmbeddingProvider } from "./embedding-provider.js";
|
|
2
|
+
import { isMissingEmbeddingApiKeyError } from "openclaw/plugin-sdk/memory-core-host-engine-embeddings";
|
|
3
|
+
//#region extensions/deepinfra/memory-embedding-adapter.ts
|
|
4
|
+
function buildDeepInfraMemoryEmbeddingAdapter(options) {
|
|
5
|
+
const defaultModel = options?.embedModels?.[0]?.id ?? DEFAULT_DEEPINFRA_EMBEDDING_MODEL;
|
|
6
|
+
return {
|
|
7
|
+
id: "deepinfra",
|
|
8
|
+
defaultModel,
|
|
9
|
+
transport: "remote",
|
|
10
|
+
authProviderId: "deepinfra",
|
|
11
|
+
autoSelectPriority: 55,
|
|
12
|
+
allowExplicitWhenConfiguredAuto: true,
|
|
13
|
+
shouldContinueAutoSelection: isMissingEmbeddingApiKeyError,
|
|
14
|
+
create: async (createOptions) => {
|
|
15
|
+
const { provider, client } = await createDeepInfraEmbeddingProvider({
|
|
16
|
+
...createOptions,
|
|
17
|
+
provider: "deepinfra",
|
|
18
|
+
fallback: "none",
|
|
19
|
+
defaultModel
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
provider,
|
|
23
|
+
runtime: {
|
|
24
|
+
id: "deepinfra",
|
|
25
|
+
cacheKeyData: {
|
|
26
|
+
provider: "deepinfra",
|
|
27
|
+
model: client.model
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const deepinfraMemoryEmbeddingProviderAdapter = buildDeepInfraMemoryEmbeddingAdapter();
|
|
35
|
+
//#endregion
|
|
36
|
+
export { buildDeepInfraMemoryEmbeddingAdapter, deepinfraMemoryEmbeddingProviderAdapter };
|
package/dist/onboard.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEEPINFRA_DEFAULT_MODEL_REF } from "
|
|
1
|
+
import { r as DEEPINFRA_DEFAULT_MODEL_REF, t as DEEPINFRA_BASE_URL } from "./.setup/provider-models-DheMSw06.mjs";
|
|
2
2
|
import { applyAgentDefaultModelPrimary } from "openclaw/plugin-sdk/provider-onboard";
|
|
3
3
|
//#region extensions/deepinfra/onboard.ts
|
|
4
4
|
function applyDeepInfraConfig(cfg, modelRef = DEEPINFRA_DEFAULT_MODEL_REF) {
|
|
@@ -19,4 +19,4 @@ function applyDeepInfraConfig(cfg, modelRef = DEEPINFRA_DEFAULT_MODEL_REF) {
|
|
|
19
19
|
}, modelRef);
|
|
20
20
|
}
|
|
21
21
|
//#endregion
|
|
22
|
-
export { applyDeepInfraConfig };
|
|
22
|
+
export { DEEPINFRA_BASE_URL, DEEPINFRA_DEFAULT_MODEL_REF, applyDeepInfraConfig };
|
package/dist/provider-catalog.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as DEEPINFRA_MODEL_CATALOG, o as buildDeepInfraModelDefinition, s as discoverDeepInfraModels, t as DEEPINFRA_BASE_URL } from "./.setup/provider-models-DheMSw06.mjs";
|
|
2
2
|
import { buildSingleProviderApiKeyCatalog } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
3
3
|
//#region extensions/deepinfra/provider-catalog.ts
|
|
4
4
|
function buildStaticDeepInfraProvider() {
|
|
@@ -9,10 +9,11 @@ function buildStaticDeepInfraProvider() {
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
async function buildDeepInfraProvider(options) {
|
|
12
|
+
const models = await discoverDeepInfraModels(options);
|
|
12
13
|
return {
|
|
13
14
|
baseUrl: DEEPINFRA_BASE_URL,
|
|
14
15
|
api: "openai-completions",
|
|
15
|
-
models
|
|
16
|
+
models
|
|
16
17
|
};
|
|
17
18
|
}
|
|
18
19
|
function buildDeepInfraApiKeyCatalog(ctx) {
|