@openclaw/deepinfra-provider 2026.9.7 → 2026.10.1-beta.1

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.
@@ -125,6 +125,12 @@ function createLegacyWebhookListenerDoctorContract(params) {
125
125
  };
126
126
  const prefix = `channels.${params.channelKey}`;
127
127
  return {
128
+ historicalWebhookListener: {
129
+ channelId: params.channelKey,
130
+ port: params.defaultPort,
131
+ preserveAuthoredActivation: params.preserveAuthoredActivation,
132
+ ...params.defaultHost === void 0 ? {} : { host: params.defaultHost }
133
+ },
128
134
  legacyConfigRules: [{
129
135
  path: ["channels", params.channelKey],
130
136
  message: `${prefix} webhook listeners moved to Gateway routes. Run "openclaw doctor --fix" to preserve explicitly configured listener settings as legacyWebhook.`,
@@ -12,7 +12,7 @@ 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
+ const defaultModel = ids[0];
16
16
  return createOpenAiCompatibleImageGenerationProvider({
17
17
  id: "deepinfra",
18
18
  label: "DeepInfra",
package/dist/index.js CHANGED
@@ -34,11 +34,6 @@ var deepinfra_default = defineSingleProviderPluginEntry({
34
34
  run: buildDeepInfraApiKeyCatalog,
35
35
  staticRun: async () => ({ provider: buildStaticDeepInfraProvider() })
36
36
  },
37
- normalizeConfig: ({ providerConfig }) => providerConfig,
38
- normalizeTransport: ({ api, baseUrl }) => baseUrl === "https://api.deepinfra.com/v1/openai" ? {
39
- api,
40
- baseUrl
41
- } : void 0,
42
37
  ...buildProviderReplayFamilyHooks({ family: "passthrough-gemini" }),
43
38
  wrapStreamFn: (ctx) => {
44
39
  const thinkingLevel = isProxyReasoningUnsupported(ctx.modelId) ? void 0 : ctx.thinkingLevel;
@@ -12,12 +12,37 @@ const DEEPINFRA_VIDEO_ASPECT_RATIOS = [
12
12
  "9:16"
13
13
  ];
14
14
  const DEEPINFRA_VIDEO_DURATIONS = [5, 8];
15
- const DEEPINFRA_IMAGE_FALLBACK_MODELS = [
16
- "black-forest-labs/FLUX-1-schnell",
17
- "black-forest-labs/FLUX-1-dev",
18
- "Qwen/Qwen-Image-Max",
19
- "stabilityai/sdxl-turbo"
20
- ];
15
+ const DEEPINFRA_IMAGE_FALLBACK_CATALOG = [
16
+ {
17
+ id: "black-forest-labs/FLUX-1-schnell",
18
+ price: .003,
19
+ iterations: 4
20
+ },
21
+ {
22
+ id: "black-forest-labs/FLUX-1-dev",
23
+ price: .025,
24
+ iterations: 28
25
+ },
26
+ {
27
+ id: "Qwen/Qwen-Image-Max",
28
+ price: .075,
29
+ iterations: 28
30
+ },
31
+ {
32
+ id: "stabilityai/sdxl-turbo",
33
+ price: 2e-4,
34
+ iterations: 4
35
+ }
36
+ ].map(({ id, price, iterations }) => ({
37
+ id,
38
+ name: id,
39
+ tags: ["image-gen"],
40
+ pricing: { per_image_unit: price },
41
+ defaultWidth: 1024,
42
+ defaultHeight: 1024,
43
+ defaultIterations: iterations
44
+ }));
45
+ const DEEPINFRA_IMAGE_FALLBACK_MODELS = DEEPINFRA_IMAGE_FALLBACK_CATALOG.map(({ id }) => id);
21
46
  const DEEPINFRA_TTS_FALLBACK_CATALOG = [
22
47
  {
23
48
  id: "hexgrad/Kokoro-82M",
@@ -62,4 +87,4 @@ function normalizeDeepInfraBaseUrl(value, fallback = DEEPINFRA_BASE_URL) {
62
87
  return (normalizeOptionalString(value) ?? fallback).replace(/\/+$/u, "");
63
88
  }
64
89
  //#endregion
65
- export { DEEPINFRA_BASE_URL, DEEPINFRA_EMBED_FALLBACK_MODELS, DEEPINFRA_IMAGE_FALLBACK_MODELS, DEEPINFRA_STT_FALLBACK_MODELS, DEEPINFRA_TTS_FALLBACK_CATALOG, 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 };
90
+ export { DEEPINFRA_BASE_URL, DEEPINFRA_EMBED_FALLBACK_MODELS, DEEPINFRA_IMAGE_FALLBACK_CATALOG, DEEPINFRA_IMAGE_FALLBACK_MODELS, DEEPINFRA_STT_FALLBACK_MODELS, DEEPINFRA_TTS_FALLBACK_CATALOG, 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,30 +1,24 @@
1
1
  import { DEEPINFRA_BASE_URL, DEEPINFRA_STT_FALLBACK_MODELS, DEEPINFRA_VLM_FALLBACK_MODELS } from "./media-models.js";
2
2
  import { describeImageWithModel, describeImagesWithModel, transcribeOpenAiCompatibleAudio } from "openclaw/plugin-sdk/media-understanding";
3
3
  //#region extensions/deepinfra/media-understanding-provider.ts
4
- function resolveDefault(surfaceModels, fallback) {
5
- return surfaceModels?.[0]?.id ?? fallback[0] ?? "";
6
- }
7
- async function transcribeDeepInfraAudio(params) {
8
- return await transcribeOpenAiCompatibleAudio({
9
- ...params,
10
- provider: "deepinfra",
11
- defaultBaseUrl: DEEPINFRA_BASE_URL,
12
- defaultModel: resolveDefault(void 0, DEEPINFRA_STT_FALLBACK_MODELS)
13
- });
14
- }
15
4
  function buildDeepInfraMediaUnderstandingProvider(options) {
16
5
  return {
17
6
  id: "deepinfra",
18
7
  capabilities: ["image", "audio"],
19
8
  defaultModels: {
20
- image: resolveDefault(options?.vlmModels, DEEPINFRA_VLM_FALLBACK_MODELS),
21
- audio: resolveDefault(options?.sttModels, DEEPINFRA_STT_FALLBACK_MODELS)
9
+ image: options?.vlmModels?.[0]?.id ?? DEEPINFRA_VLM_FALLBACK_MODELS[0],
10
+ audio: options?.sttModels?.[0]?.id ?? DEEPINFRA_STT_FALLBACK_MODELS[0]
22
11
  },
23
12
  autoPriority: {
24
13
  image: 45,
25
14
  audio: 45
26
15
  },
27
- transcribeAudio: transcribeDeepInfraAudio,
16
+ transcribeAudio: (params) => transcribeOpenAiCompatibleAudio({
17
+ ...params,
18
+ provider: "deepinfra",
19
+ defaultBaseUrl: DEEPINFRA_BASE_URL,
20
+ defaultModel: DEEPINFRA_STT_FALLBACK_MODELS[0]
21
+ }),
28
22
  describeImage: describeImageWithModel,
29
23
  describeImages: describeImagesWithModel
30
24
  };
@@ -1,5 +1,4 @@
1
- import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-D7BLeoIa.mjs";
2
- import { DEEPINFRA_BASE_URL, DEEPINFRA_TTS_FALLBACK_CATALOG } from "./media-models.js";
1
+ import { DEEPINFRA_BASE_URL, DEEPINFRA_IMAGE_FALLBACK_CATALOG, DEEPINFRA_TTS_FALLBACK_CATALOG } from "./media-models.js";
3
2
  import { DEEPINFRA_MODEL_CATALOG, buildDeepInfraModelDefinition } from "./provider-static-catalog.js";
4
3
  import { parseDeepInfraPricingCatalog } from "./pricing-api.js";
5
4
  import { asPositiveSafeInteger, isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -17,15 +16,6 @@ const DEEPINFRA_DEFAULT_CONTEXT_WINDOW = 128e3;
17
16
  const DEEPINFRA_DEFAULT_MAX_TOKENS = 8192;
18
17
  const DISCOVERY_TIMEOUT_MS = 5e3;
19
18
  const DISCOVERY_CACHE_TTL_MS = 3e5;
20
- const SURFACE_FOR_TAG = {
21
- chat: "chat",
22
- vlm: "vlm",
23
- embed: "embed",
24
- "image-gen": "image-gen",
25
- "video-gen": "video-gen",
26
- tts: "tts",
27
- stt: "stt"
28
- };
29
19
  function entryToSurfaceModel(entry) {
30
20
  const id = typeof entry?.id === "string" ? entry.id.trim() : "";
31
21
  if (!id) return null;
@@ -57,39 +47,31 @@ function bucketBySurface(models) {
57
47
  stt: [],
58
48
  live: true
59
49
  };
60
- const buckets = {
61
- chat: catalog.chat,
62
- vlm: catalog.vlm,
63
- embed: catalog.embed,
64
- "image-gen": catalog.imageGen,
65
- "video-gen": catalog.videoGen,
66
- tts: catalog.tts,
67
- stt: catalog.stt
68
- };
69
- for (const model of models) {
70
- const seen = /* @__PURE__ */ new Set();
71
- for (const tag of model.tags) {
72
- const surface = SURFACE_FOR_TAG[tag];
73
- if (surface && !seen.has(surface)) {
74
- seen.add(surface);
75
- buckets[surface].push(model);
76
- }
77
- }
78
- }
50
+ const buckets = /* @__PURE__ */ new Map([
51
+ ["chat", catalog.chat],
52
+ ["vlm", catalog.vlm],
53
+ ["embed", catalog.embed],
54
+ ["image-gen", catalog.imageGen],
55
+ ["video-gen", catalog.videoGen],
56
+ ["tts", catalog.tts],
57
+ ["stt", catalog.stt]
58
+ ]);
59
+ for (const model of models) for (const tag of new Set(model.tags)) buckets.get(tag)?.push(model);
79
60
  return catalog;
80
61
  }
81
62
  function manifestChatEntryToSurfaceModel(entry) {
82
- const cost = entry.cost ?? {};
83
- const pricing = {};
84
- if (typeof cost.input === "number") pricing.input_tokens = cost.input;
85
- if (typeof cost.output === "number") pricing.output_tokens = cost.output;
86
- if (typeof cost.cacheRead === "number" && cost.cacheRead > 0) pricing.cache_read_tokens = cost.cacheRead;
63
+ const { cost } = entry;
64
+ const pricing = {
65
+ input_tokens: cost.input,
66
+ output_tokens: cost.output,
67
+ ...cost.cacheRead > 0 ? { cache_read_tokens: cost.cacheRead } : {}
68
+ };
87
69
  const tags = ["chat"];
88
- if (entry.input?.includes("image")) tags.push("vlm");
70
+ if (entry.input.includes("image")) tags.push("vlm");
89
71
  if (entry.reasoning) tags.push("reasoning");
90
72
  return {
91
73
  id: entry.id,
92
- name: entry.name ?? entry.id,
74
+ name: entry.name,
93
75
  tags,
94
76
  contextWindow: entry.contextWindow,
95
77
  maxTokens: entry.maxTokens,
@@ -97,42 +79,7 @@ function manifestChatEntryToSurfaceModel(entry) {
97
79
  };
98
80
  }
99
81
  const STATIC_NON_CHAT_FALLBACK = [
100
- {
101
- id: "black-forest-labs/FLUX-1-schnell",
102
- name: "black-forest-labs/FLUX-1-schnell",
103
- tags: ["image-gen"],
104
- pricing: { per_image_unit: .003 },
105
- defaultWidth: 1024,
106
- defaultHeight: 1024,
107
- defaultIterations: 4
108
- },
109
- {
110
- id: "black-forest-labs/FLUX-1-dev",
111
- name: "black-forest-labs/FLUX-1-dev",
112
- tags: ["image-gen"],
113
- pricing: { per_image_unit: .025 },
114
- defaultWidth: 1024,
115
- defaultHeight: 1024,
116
- defaultIterations: 28
117
- },
118
- {
119
- id: "Qwen/Qwen-Image-Max",
120
- name: "Qwen/Qwen-Image-Max",
121
- tags: ["image-gen"],
122
- pricing: { per_image_unit: .075 },
123
- defaultWidth: 1024,
124
- defaultHeight: 1024,
125
- defaultIterations: 28
126
- },
127
- {
128
- id: "stabilityai/sdxl-turbo",
129
- name: "stabilityai/sdxl-turbo",
130
- tags: ["image-gen"],
131
- pricing: { per_image_unit: 2e-4 },
132
- defaultWidth: 1024,
133
- defaultHeight: 1024,
134
- defaultIterations: 4
135
- },
82
+ ...DEEPINFRA_IMAGE_FALLBACK_CATALOG,
136
83
  ...DEEPINFRA_TTS_FALLBACK_CATALOG,
137
84
  {
138
85
  id: "openai/whisper-large-v3-turbo",
@@ -150,7 +97,7 @@ const STATIC_NON_CHAT_FALLBACK = [
150
97
  }
151
98
  ];
152
99
  function getDeepInfraSurfaceFallbackCatalog() {
153
- const catalog = bucketBySurface([...(openclaw_plugin_default.modelCatalog.providers.deepinfra.models ?? []).map(manifestChatEntryToSurfaceModel), ...STATIC_NON_CHAT_FALLBACK]);
100
+ const catalog = bucketBySurface([...DEEPINFRA_MODEL_CATALOG.map(manifestChatEntryToSurfaceModel), ...STATIC_NON_CHAT_FALLBACK]);
154
101
  catalog.live = false;
155
102
  return catalog;
156
103
  }
@@ -197,7 +144,6 @@ async function loadDeepInfraSurfaces() {
197
144
  providerId: "deepinfra",
198
145
  endpoint: DEEPINFRA_MODELS_URL,
199
146
  timeoutMs: DISCOVERY_TIMEOUT_MS,
200
- buildRequestHeaders: () => ({ Accept: "application/json" }),
201
147
  auditContext: "deepinfra-model-discovery",
202
148
  fetchGuard: (params) => fetchWithSsrFGuard(withTrustedEnvProxyGuardedFetchMode(params))
203
149
  });
@@ -227,7 +173,6 @@ async function discoverDeepInfraPricing() {
227
173
  providerId: "deepinfra",
228
174
  endpoint: DEEPINFRA_PRICING_URL,
229
175
  timeoutMs: DISCOVERY_TIMEOUT_MS,
230
- buildRequestHeaders: () => ({ Accept: "application/json" }),
231
176
  auditContext: "deepinfra-pricing-discovery",
232
177
  fetchGuard: (params) => fetchWithSsrFGuard(withTrustedEnvProxyGuardedFetchMode(params)),
233
178
  readRows: (body) => {
@@ -1,17 +1,4 @@
1
1
  //#region extensions/deepinfra/provider-policy-api.ts
2
- /**
3
- * Passthrough normalization for DeepInfra provider config.
4
- *
5
- * DeepInfra's OpenAI-compatible base URL is `https://api.deepinfra.com/v1/openai`
6
- * with the `/v1` segment mid-path, not at the end. The generic
7
- * openai-completions config normalizer strips a trailing `/v1` and re-appends
8
- * one, which is idempotent for providers like OpenRouter (`.../api/v1`) but
9
- * doubles to `.../v1/openai/v1` here and breaks inference (404).
10
- *
11
- * Shipping this bundled policy surface short-circuits the fallback normalizer
12
- * chain (see `src/plugins/provider-runtime.ts:normalizeProviderConfigWithPlugin`)
13
- * and preserves the DeepInfra-declared baseUrl as-is.
14
- */
15
2
  function normalizeConfig(params) {
16
3
  return params.providerConfig;
17
4
  }
@@ -2,25 +2,6 @@ import { DEEPINFRA_VIDEO_ASPECT_RATIOS, DEEPINFRA_VIDEO_DURATIONS } from "./medi
2
2
  import { discoverDeepInfraSurfaces } from "./provider-models.js";
3
3
  //#region extensions/deepinfra/surface-model-catalogs.ts
4
4
  const PROVIDER_ID = "deepinfra";
5
- function surfaceModelToImageGenEntry(model) {
6
- return {
7
- kind: "image_generation",
8
- provider: PROVIDER_ID,
9
- model: model.id,
10
- source: "live",
11
- ...model.name ? { label: model.name } : {}
12
- };
13
- }
14
- function surfaceModelToVideoGenEntry(model) {
15
- return {
16
- kind: "video_generation",
17
- provider: PROVIDER_ID,
18
- model: model.id,
19
- source: "live",
20
- ...model.name ? { label: model.name } : {},
21
- capabilities: buildDeepInfraVideoModelCapabilities()
22
- };
23
- }
24
5
  function buildDeepInfraVideoModelCapabilities() {
25
6
  return {
26
7
  providerOptions: {
@@ -40,25 +21,32 @@ function buildDeepInfraVideoModelCapabilities() {
40
21
  videoToVideo: { enabled: false }
41
22
  };
42
23
  }
43
- async function listDeepInfraImageGenCatalog(ctx) {
24
+ async function listDeepInfraGenerationCatalog(ctx, kind) {
44
25
  const { discoveryApiKey } = ctx.resolveProviderApiKey(PROVIDER_ID);
45
26
  if (!discoveryApiKey) return null;
46
27
  const catalog = await discoverDeepInfraSurfaces({
47
28
  hasApiKey: true,
48
29
  env: ctx.env
49
30
  });
50
- if (!catalog.live || catalog.imageGen.length === 0) return null;
51
- return catalog.imageGen.map(surfaceModelToImageGenEntry);
52
- }
53
- async function listDeepInfraVideoGenCatalog(ctx) {
54
- const { discoveryApiKey } = ctx.resolveProviderApiKey(PROVIDER_ID);
55
- if (!discoveryApiKey) return null;
56
- const catalog = await discoverDeepInfraSurfaces({
57
- hasApiKey: true,
58
- env: ctx.env
31
+ const models = kind === "image_generation" ? catalog.imageGen : catalog.videoGen;
32
+ if (!catalog.live || models.length === 0) return null;
33
+ return models.map((model) => {
34
+ const entry = {
35
+ kind,
36
+ provider: PROVIDER_ID,
37
+ model: model.id,
38
+ source: "live"
39
+ };
40
+ if (model.name) entry.label = model.name;
41
+ if (kind === "video_generation") entry.capabilities = buildDeepInfraVideoModelCapabilities();
42
+ return entry;
59
43
  });
60
- if (!catalog.live || catalog.videoGen.length === 0) return null;
61
- return catalog.videoGen.map(surfaceModelToVideoGenEntry);
44
+ }
45
+ function listDeepInfraImageGenCatalog(ctx) {
46
+ return listDeepInfraGenerationCatalog(ctx, "image_generation");
47
+ }
48
+ function listDeepInfraVideoGenCatalog(ctx) {
49
+ return listDeepInfraGenerationCatalog(ctx, "video_generation");
62
50
  }
63
51
  async function resolveDeepInfraVideoModelCapabilities(ctx) {
64
52
  const rawId = typeof ctx.model === "string" ? ctx.model : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/deepinfra-provider",
3
- "version": "2026.9.7",
3
+ "version": "2026.10.1-beta.1",
4
4
  "description": "OpenClaw DeepInfra 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.9.7"
21
+ "pluginApi": ">=2026.10.1-beta.1"
22
22
  },
23
23
  "build": {
24
- "openclawVersion": "2026.9.7",
24
+ "openclawVersion": "2026.10.1-beta.1",
25
25
  "bundledDist": false
26
26
  },
27
27
  "release": {
@@ -40,7 +40,7 @@
40
40
  "assets/activity.svg"
41
41
  ],
42
42
  "peerDependencies": {
43
- "openclaw": ">=2026.9.7"
43
+ "openclaw": ">=2026.10.1-beta.1"
44
44
  },
45
45
  "peerDependenciesMeta": {
46
46
  "openclaw": {