@qvac/sdk 0.12.2 → 0.13.0

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.
Files changed (216) hide show
  1. package/NOTICE +55 -1225
  2. package/README.md +12 -0
  3. package/dist/client/api/bci-transcribe.d.ts +57 -0
  4. package/dist/client/api/bci-transcribe.js +172 -0
  5. package/dist/client/api/get-model-info.d.ts +1 -1
  6. package/dist/client/api/index.d.ts +1 -0
  7. package/dist/client/api/index.js +1 -0
  8. package/dist/client/api/video.d.ts +26 -6
  9. package/dist/client/api/video.js +30 -7
  10. package/dist/client/api/vla.d.ts +11 -7
  11. package/dist/client/api/vla.js +11 -7
  12. package/dist/client/rpc/bare-client.js +2 -2
  13. package/dist/commands/bundle/constants.js +2 -0
  14. package/dist/examples/bci/bci-filesystem-streaming.d.ts +2 -0
  15. package/dist/examples/bci/bci-filesystem-streaming.js +77 -0
  16. package/dist/examples/bci/bci-filesystem.d.ts +2 -0
  17. package/dist/examples/bci/bci-filesystem.js +63 -0
  18. package/dist/examples/cache-management.js +0 -1
  19. package/dist/examples/cancel-by-request-id.js +0 -1
  20. package/dist/examples/classification/classify-image.js +1 -1
  21. package/dist/examples/completion-events.js +6 -2
  22. package/dist/examples/completion-stop-reason.d.ts +25 -0
  23. package/dist/examples/completion-stop-reason.js +65 -0
  24. package/dist/examples/concurrent-completion-collision.d.ts +2 -0
  25. package/dist/examples/concurrent-completion-collision.js +98 -0
  26. package/dist/examples/config-reload.js +1 -2
  27. package/dist/examples/default-config-usage.js +0 -1
  28. package/dist/examples/delegated-inference/composite.js +0 -1
  29. package/dist/examples/delegated-inference/consumer-profiled.js +0 -1
  30. package/dist/examples/delegated-inference/consumer.js +0 -1
  31. package/dist/examples/diffusion-esrgan-upscale.js +1 -3
  32. package/dist/examples/diffusion-flux2-klein-img2img.js +1 -1
  33. package/dist/examples/diffusion-flux2-klein.js +2 -2
  34. package/dist/examples/diffusion-img2img.js +1 -1
  35. package/dist/examples/diffusion-img2vid.d.ts +2 -0
  36. package/dist/examples/diffusion-img2vid.js +78 -0
  37. package/dist/examples/diffusion-simple.js +1 -1
  38. package/dist/examples/diffusion-txt2img.js +8 -3
  39. package/dist/examples/diffusion-txt2vid.js +2 -3
  40. package/dist/examples/download-with-blind-relays.js +0 -1
  41. package/dist/examples/embed-multi-gpu.js +1 -2
  42. package/dist/examples/embed-p2p.js +4 -2
  43. package/dist/examples/finetune/llamacpp-finetune.js +5 -3
  44. package/dist/examples/kv-cache-cleanup.js +0 -1
  45. package/dist/examples/kv-cache-custom-key.js +0 -1
  46. package/dist/examples/kv-cache-example.js +4 -2
  47. package/dist/examples/llamacpp-cache.js +0 -1
  48. package/dist/examples/llamacpp-dynamic-tools.js +4 -2
  49. package/dist/examples/llamacpp-filesystem.js +1 -1
  50. package/dist/examples/llamacpp-http.js +1 -1
  51. package/dist/examples/llamacpp-multi-gpu.js +2 -2
  52. package/dist/examples/llamacpp-multimodal.js +0 -1
  53. package/dist/examples/llamacpp-p2p.js +0 -1
  54. package/dist/examples/llamacpp-sharded.js +1 -1
  55. package/dist/examples/llamacpp-structured-output.js +0 -1
  56. package/dist/examples/logging-file-transport.js +0 -1
  57. package/dist/examples/logging-streaming.js +0 -2
  58. package/dist/examples/mcp-websearch.js +0 -1
  59. package/dist/examples/multi-model-demo.js +0 -2
  60. package/dist/examples/ocr-fasttext.js +0 -1
  61. package/dist/examples/plugins.js +1 -4
  62. package/dist/examples/profiling/basic.js +3 -2
  63. package/dist/examples/profiling/per-call.js +0 -1
  64. package/dist/examples/quickstart.js +0 -1
  65. package/dist/examples/rag/rag-chromadb.js +0 -1
  66. package/dist/examples/rag/rag-hyperdb/cancellation.js +0 -1
  67. package/dist/examples/rag/rag-hyperdb/ingest.js +0 -1
  68. package/dist/examples/rag/rag-hyperdb/pipeline.js +0 -1
  69. package/dist/examples/rag/rag-hyperdb/workspaces.js +0 -1
  70. package/dist/examples/rag/rag-lancedb.js +0 -1
  71. package/dist/examples/rag/rag-sqlite.js +0 -1
  72. package/dist/examples/suspend-resume.js +0 -1
  73. package/dist/examples/tools/llamacpp-native-tools.js +0 -1
  74. package/dist/examples/tools/llamacpp-tools-gemma4.js +1 -1
  75. package/dist/examples/tools/llamacpp-tools-pythonic.js +2 -2
  76. package/dist/examples/tools/llamacpp-tools-qwen35.js +1 -1
  77. package/dist/examples/transcription/parakeet-ctc-filesystem.js +1 -1
  78. package/dist/examples/transcription/parakeet-microphone-record.js +0 -1
  79. package/dist/examples/transcription/parakeet-microphone-stream.js +0 -1
  80. package/dist/examples/transcription/parakeet-sortformer.js +1 -2
  81. package/dist/examples/transcription/parakeet-tdt-filesystem.js +1 -1
  82. package/dist/examples/transcription/whispercpp-filesystem-streaming.js +10 -6
  83. package/dist/examples/transcription/whispercpp-filesystem.js +4 -2
  84. package/dist/examples/transcription/whispercpp-microphone-conversation.js +0 -1
  85. package/dist/examples/transcription/whispercpp-microphone-record.js +0 -1
  86. package/dist/examples/transcription/whispercpp-prompt.js +0 -1
  87. package/dist/examples/translation/translation-bergamot-batch.js +1 -2
  88. package/dist/examples/translation/translation-bergamot-pivot.js +3 -4
  89. package/dist/examples/translation/translation-bergamot.js +1 -2
  90. package/dist/examples/translation/translation-indic.js +1 -2
  91. package/dist/examples/translation/translation-llm-afriquegemma.js +3 -4
  92. package/dist/examples/translation/translation-llm-context.js +1 -2
  93. package/dist/examples/translation/translation-llm.js +2 -3
  94. package/dist/examples/translation/translation-stream.js +2 -3
  95. package/dist/examples/tts/chatterbox.js +1 -2
  96. package/dist/examples/tts/llm-to-tts-streaming.js +2 -4
  97. package/dist/examples/tts/supertonic-multilingual.js +1 -2
  98. package/dist/examples/tts/supertonic.js +1 -2
  99. package/dist/examples/vla-pi05.d.ts +2 -0
  100. package/dist/examples/vla-pi05.js +84 -0
  101. package/dist/examples/vla-smolvla.js +1 -1
  102. package/dist/examples/voice-assistant/voice-assistant.js +1 -4
  103. package/dist/index.d.ts +2 -2
  104. package/dist/index.js +9 -7
  105. package/dist/models/registry/models.d.ts +869 -186
  106. package/dist/models/registry/models.js +3160 -2453
  107. package/dist/models/update-models/companions.d.ts +7 -0
  108. package/dist/models/update-models/companions.js +56 -0
  109. package/dist/models/update-models/naming.js +10 -0
  110. package/dist/pear/pre.js +2 -0
  111. package/dist/schemas/bci-config.d.ts +36 -0
  112. package/dist/schemas/bci-config.js +56 -0
  113. package/dist/schemas/bci.d.ts +177 -0
  114. package/dist/schemas/bci.js +95 -0
  115. package/dist/schemas/common.d.ts +395 -51
  116. package/dist/schemas/common.js +5 -0
  117. package/dist/schemas/completion-event.d.ts +1 -0
  118. package/dist/schemas/download-asset.d.ts +7 -3
  119. package/dist/schemas/embed.d.ts +2 -0
  120. package/dist/schemas/embed.js +1 -0
  121. package/dist/schemas/engine-addon-map.d.ts +1 -0
  122. package/dist/schemas/engine-addon-map.js +4 -1
  123. package/dist/schemas/get-model-info.d.ts +2 -0
  124. package/dist/schemas/get-model-info.js +1 -0
  125. package/dist/schemas/index.d.ts +2 -0
  126. package/dist/schemas/index.js +2 -0
  127. package/dist/schemas/llamacpp-config.d.ts +6 -2
  128. package/dist/schemas/load-model.d.ts +1841 -267
  129. package/dist/schemas/load-model.js +34 -1
  130. package/dist/schemas/model-src-utils.d.ts +10 -2
  131. package/dist/schemas/model-types.d.ts +19 -1
  132. package/dist/schemas/model-types.js +11 -0
  133. package/dist/schemas/ocr.d.ts +2 -0
  134. package/dist/schemas/plugin.d.ts +13 -5
  135. package/dist/schemas/plugin.js +13 -4
  136. package/dist/schemas/registry.d.ts +18 -0
  137. package/dist/schemas/registry.js +2 -0
  138. package/dist/schemas/reload-config.d.ts +10 -2
  139. package/dist/schemas/sdcpp-config.d.ts +75 -8
  140. package/dist/schemas/sdcpp-config.js +56 -10
  141. package/dist/schemas/sdk-config.d.ts +342 -0
  142. package/dist/schemas/text-to-speech.d.ts +8 -0
  143. package/dist/schemas/transcription-config.d.ts +2 -0
  144. package/dist/schemas/transcription.d.ts +12 -0
  145. package/dist/schemas/transcription.js +8 -0
  146. package/dist/schemas/translation-config.d.ts +44 -16
  147. package/dist/schemas/translation-config.js +2 -0
  148. package/dist/schemas/vla.d.ts +14 -0
  149. package/dist/schemas/vla.js +26 -3
  150. package/dist/server/bare/delegate-connect-diagnostics.d.ts +9 -0
  151. package/dist/server/bare/delegate-connect-diagnostics.js +44 -0
  152. package/dist/server/bare/delegate-rpc-client.js +10 -12
  153. package/dist/server/bare/hyperswarm.js +1 -0
  154. package/dist/server/bare/ops/bci-transcribe.d.ts +13 -0
  155. package/dist/server/bare/ops/bci-transcribe.js +248 -0
  156. package/dist/server/bare/ops/embed.js +2 -1
  157. package/dist/server/bare/ops/kv-cache-utils.js +4 -3
  158. package/dist/server/bare/ops/transcribe.js +6 -2
  159. package/dist/server/bare/ops/translate.js +1 -1
  160. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +130 -0
  161. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +116 -0
  162. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +4 -0
  163. package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +7 -0
  164. package/dist/server/bare/plugins/ggml-vla/plugin.js +1 -1
  165. package/dist/server/bare/plugins/index.d.ts +1 -0
  166. package/dist/server/bare/plugins/index.js +1 -0
  167. package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +22 -29
  168. package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +2 -0
  169. package/dist/server/bare/plugins/llamacpp-completion/plugin.js +38 -7
  170. package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +1 -0
  171. package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +9 -1
  172. package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +14 -0
  173. package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +2 -0
  174. package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +8 -0
  175. package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +7 -1
  176. package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +58 -4
  177. package/dist/server/bare/plugins/sdcpp-generation/plugin.js +9 -4
  178. package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +10 -0
  179. package/dist/server/bare/registry/model-config-utils.js +3 -0
  180. package/dist/server/bare/runtime/request-registry-singleton.js +11 -4
  181. package/dist/server/bare/runtime/request-registry.d.ts +60 -16
  182. package/dist/server/bare/runtime/request-registry.js +258 -15
  183. package/dist/server/bare/runtime/with-request-context.d.ts +1 -1
  184. package/dist/server/bare/runtime/with-request-context.js +1 -1
  185. package/dist/server/bare/types/addon-responses.d.ts +5 -0
  186. package/dist/server/rpc/handler-registry.js +4 -0
  187. package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +3 -0
  188. package/dist/server/rpc/handlers/bci-transcribe-stream.js +4 -0
  189. package/dist/server/rpc/handlers/bci-transcribe.d.ts +3 -0
  190. package/dist/server/rpc/handlers/bci-transcribe.js +4 -0
  191. package/dist/server/rpc/handlers/download-asset.js +1 -1
  192. package/dist/server/rpc/handlers/get-model-info.js +3 -3
  193. package/dist/server/rpc/handlers/index.d.ts +4 -0
  194. package/dist/server/rpc/handlers/index.js +4 -0
  195. package/dist/server/rpc/handlers/load-model/download-manager.d.ts +1 -1
  196. package/dist/server/rpc/handlers/load-model/handler.js +1 -1
  197. package/dist/server/rpc/handlers/load-model/http.js +6 -6
  198. package/dist/server/rpc/handlers/load-model/hyperdrive.js +1 -0
  199. package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +1 -0
  200. package/dist/server/rpc/handlers/load-model/registry-companion-set.js +2 -2
  201. package/dist/server/rpc/handlers/load-model/registry.js +1 -0
  202. package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +1 -1
  203. package/dist/server/rpc/handlers/rag.js +5 -5
  204. package/dist/server/utils/checksum.js +2 -1
  205. package/dist/server/utils/formatting.js +2 -1
  206. package/dist/server/utils/multi-gpu-mobile.d.ts +5 -0
  207. package/dist/server/utils/multi-gpu-mobile.js +10 -0
  208. package/dist/server/worker.js +2 -1
  209. package/dist/utils/aggregate-events.d.ts +2 -1
  210. package/dist/utils/aggregate-events.js +11 -3
  211. package/dist/utils/errors-server.d.ts +6 -4
  212. package/dist/utils/errors-server.js +6 -4
  213. package/electron-forge/index.cjs +820 -0
  214. package/package.json +68 -35
  215. package/dist/scripts/run-security-tests-bare.d.ts +0 -2
  216. package/dist/scripts/run-security-tests-bare.js +0 -78
@@ -1,5 +1,5 @@
1
1
  import { type CreateModelParams, type PluginModelResult, type ResolveContext, type ResolveResult, type SdcppConfig } from "../../../../schemas/index";
2
- type DiffusionArtifactKey = "clipLModelPath" | "clipGModelPath" | "t5XxlModelPath" | "llmModelPath" | "vaeModelPath" | "highNoiseDiffusionModelPath" | "esrganModelPath";
2
+ type DiffusionArtifactKey = "clipLModelPath" | "clipGModelPath" | "clipVisionModelPath" | "t5XxlModelPath" | "llmModelPath" | "vaeModelPath" | "highNoiseDiffusionModelPath" | "esrganModelPath";
3
3
  /**
4
4
  * Stable-diffusion.cpp plugin for image diffusion, upscaling, and Wan video.
5
5
  *
@@ -88,6 +88,7 @@ export declare const diffusionPlugin: {
88
88
  vla: "vla";
89
89
  "llamacpp-completion": "llamacpp-completion";
90
90
  "whispercpp-transcription": "whispercpp-transcription";
91
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
91
92
  "llamacpp-embedding": "llamacpp-embedding";
92
93
  "nmtcpp-translation": "nmtcpp-translation";
93
94
  "onnx-tts": "onnx-tts";
@@ -99,6 +100,7 @@ export declare const diffusionPlugin: {
99
100
  "ggml-classification": "ggml-classification";
100
101
  llm: "llm";
101
102
  whisper: "whisper";
103
+ bci: "bci";
102
104
  nmt: "nmt";
103
105
  parakeet: "parakeet";
104
106
  classification: "classification";
@@ -123,6 +125,7 @@ export declare const diffusionPlugin: {
123
125
  vla: "vla";
124
126
  "llamacpp-completion": "llamacpp-completion";
125
127
  "whispercpp-transcription": "whispercpp-transcription";
128
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
126
129
  "llamacpp-embedding": "llamacpp-embedding";
127
130
  "nmtcpp-translation": "nmtcpp-translation";
128
131
  "onnx-tts": "onnx-tts";
@@ -134,6 +137,7 @@ export declare const diffusionPlugin: {
134
137
  "ggml-classification": "ggml-classification";
135
138
  llm: "llm";
136
139
  whisper: "whisper";
140
+ bci: "bci";
137
141
  nmt: "nmt";
138
142
  parakeet: "parakeet";
139
143
  classification: "classification";
@@ -158,6 +162,7 @@ export declare const diffusionPlugin: {
158
162
  vla: "vla";
159
163
  "llamacpp-completion": "llamacpp-completion";
160
164
  "whispercpp-transcription": "whispercpp-transcription";
165
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
161
166
  "llamacpp-embedding": "llamacpp-embedding";
162
167
  "nmtcpp-translation": "nmtcpp-translation";
163
168
  "onnx-tts": "onnx-tts";
@@ -169,6 +174,7 @@ export declare const diffusionPlugin: {
169
174
  "ggml-classification": "ggml-classification";
170
175
  llm: "llm";
171
176
  whisper: "whisper";
177
+ bci: "bci";
172
178
  nmt: "nmt";
173
179
  parakeet: "parakeet";
174
180
  classification: "classification";
@@ -193,6 +199,7 @@ export declare const diffusionPlugin: {
193
199
  vla: "vla";
194
200
  "llamacpp-completion": "llamacpp-completion";
195
201
  "whispercpp-transcription": "whispercpp-transcription";
202
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
196
203
  "llamacpp-embedding": "llamacpp-embedding";
197
204
  "nmtcpp-translation": "nmtcpp-translation";
198
205
  "onnx-tts": "onnx-tts";
@@ -204,6 +211,7 @@ export declare const diffusionPlugin: {
204
211
  "ggml-classification": "ggml-classification";
205
212
  llm: "llm";
206
213
  whisper: "whisper";
214
+ bci: "bci";
207
215
  nmt: "nmt";
208
216
  parakeet: "parakeet";
209
217
  classification: "classification";
@@ -228,6 +236,7 @@ export declare const diffusionPlugin: {
228
236
  vla: "vla";
229
237
  "llamacpp-completion": "llamacpp-completion";
230
238
  "whispercpp-transcription": "whispercpp-transcription";
239
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
231
240
  "llamacpp-embedding": "llamacpp-embedding";
232
241
  "nmtcpp-translation": "nmtcpp-translation";
233
242
  "onnx-tts": "onnx-tts";
@@ -239,6 +248,7 @@ export declare const diffusionPlugin: {
239
248
  "ggml-classification": "ggml-classification";
240
249
  llm: "llm";
241
250
  whisper: "whisper";
251
+ bci: "bci";
242
252
  nmt: "nmt";
243
253
  parakeet: "parakeet";
244
254
  classification: "classification";
@@ -263,6 +273,7 @@ export declare const diffusionPlugin: {
263
273
  vla: "vla";
264
274
  "llamacpp-completion": "llamacpp-completion";
265
275
  "whispercpp-transcription": "whispercpp-transcription";
276
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
266
277
  "llamacpp-embedding": "llamacpp-embedding";
267
278
  "nmtcpp-translation": "nmtcpp-translation";
268
279
  "onnx-tts": "onnx-tts";
@@ -274,6 +285,44 @@ export declare const diffusionPlugin: {
274
285
  "ggml-classification": "ggml-classification";
275
286
  llm: "llm";
276
287
  whisper: "whisper";
288
+ bci: "bci";
289
+ nmt: "nmt";
290
+ parakeet: "parakeet";
291
+ classification: "classification";
292
+ }>, import("zod").ZodLiteral<"vad">]>>;
293
+ }, import("zod/v4/core").$strip>]>>;
294
+ clipVisionModelSrc: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
295
+ src: import("zod").ZodString;
296
+ name: import("zod").ZodOptional<import("zod").ZodString>;
297
+ modelId: import("zod").ZodOptional<import("zod").ZodString>;
298
+ registryPath: import("zod").ZodOptional<import("zod").ZodString>;
299
+ registrySource: import("zod").ZodOptional<import("zod").ZodString>;
300
+ blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
301
+ blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
302
+ engine: import("zod").ZodOptional<import("zod").ZodString>;
303
+ expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
304
+ sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
305
+ addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
306
+ embeddings: "embeddings";
307
+ diffusion: "diffusion";
308
+ tts: "tts";
309
+ ocr: "ocr";
310
+ vla: "vla";
311
+ "llamacpp-completion": "llamacpp-completion";
312
+ "whispercpp-transcription": "whispercpp-transcription";
313
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
314
+ "llamacpp-embedding": "llamacpp-embedding";
315
+ "nmtcpp-translation": "nmtcpp-translation";
316
+ "onnx-tts": "onnx-tts";
317
+ "tts-ggml": "tts-ggml";
318
+ "parakeet-transcription": "parakeet-transcription";
319
+ "onnx-ocr": "onnx-ocr";
320
+ "sdcpp-generation": "sdcpp-generation";
321
+ "ggml-vla": "ggml-vla";
322
+ "ggml-classification": "ggml-classification";
323
+ llm: "llm";
324
+ whisper: "whisper";
325
+ bci: "bci";
277
326
  nmt: "nmt";
278
327
  parakeet: "parakeet";
279
328
  classification: "classification";
@@ -300,6 +349,7 @@ export declare const diffusionPlugin: {
300
349
  vla: "vla";
301
350
  "llamacpp-completion": "llamacpp-completion";
302
351
  "whispercpp-transcription": "whispercpp-transcription";
352
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
303
353
  "llamacpp-embedding": "llamacpp-embedding";
304
354
  "nmtcpp-translation": "nmtcpp-translation";
305
355
  "onnx-tts": "onnx-tts";
@@ -311,6 +361,7 @@ export declare const diffusionPlugin: {
311
361
  "ggml-classification": "ggml-classification";
312
362
  llm: "llm";
313
363
  whisper: "whisper";
364
+ bci: "bci";
314
365
  nmt: "nmt";
315
366
  parakeet: "parakeet";
316
367
  classification: "classification";
@@ -402,9 +453,6 @@ export declare const diffusionPlugin: {
402
453
  videoStream: import("../../../../schemas/index").PluginHandlerDefinition<import("zod").ZodObject<{
403
454
  modelId: import("zod").ZodString;
404
455
  requestId: import("zod").ZodOptional<import("zod").ZodString>;
405
- mode: import("zod").ZodEnum<{
406
- txt2vid: "txt2vid";
407
- }>;
408
456
  prompt: import("zod").ZodString;
409
457
  negative_prompt: import("zod").ZodOptional<import("zod").ZodString>;
410
458
  width: import("zod").ZodOptional<import("zod").ZodNumber>;
@@ -492,6 +540,12 @@ export declare const diffusionPlugin: {
492
540
  }>>;
493
541
  cache_preset: import("zod").ZodOptional<import("zod").ZodString>;
494
542
  cache_threshold: import("zod").ZodOptional<import("zod").ZodNumber>;
543
+ mode: import("zod").ZodEnum<{
544
+ txt2vid: "txt2vid";
545
+ img2vid: "img2vid";
546
+ }>;
547
+ init_image: import("zod").ZodOptional<import("zod").ZodString>;
548
+ strength: import("zod").ZodOptional<import("zod").ZodNumber>;
495
549
  }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
496
550
  type: import("zod").ZodLiteral<"videoStream">;
497
551
  step: import("zod").ZodOptional<import("zod").ZodNumber>;
@@ -58,7 +58,7 @@ export const diffusionPlugin = definePlugin({
58
58
  if (cfg.mode === "upscale") {
59
59
  return { config: cfg };
60
60
  }
61
- const { clipLModelSrc, clipGModelSrc, t5XxlModelSrc, llmModelSrc, vaeModelSrc, highNoiseDiffusionModelSrc, upscaler, ...rest } = cfg;
61
+ const { clipLModelSrc, clipGModelSrc, clipVisionModelSrc, t5XxlModelSrc, llmModelSrc, vaeModelSrc, highNoiseDiffusionModelSrc, upscaler, ...rest } = cfg;
62
62
  // Video jobs do not apply ESRGAN so we drop the whole `upscaler` object.
63
63
  const effectiveUpscaler = cfg.mode === "video" ? undefined : upscaler;
64
64
  const { model_src: esrganModelSrc, ...upscalerRuntime } = effectiveUpscaler ?? {};
@@ -67,7 +67,7 @@ export const diffusionPlugin = definePlugin({
67
67
  ...(effectiveUpscaler && { upscaler: upscalerRuntime }),
68
68
  };
69
69
  const sources = {
70
- clipLModelSrc, clipGModelSrc, t5XxlModelSrc,
70
+ clipLModelSrc, clipGModelSrc, clipVisionModelSrc, t5XxlModelSrc,
71
71
  llmModelSrc, vaeModelSrc, highNoiseDiffusionModelSrc, esrganModelSrc,
72
72
  };
73
73
  const hasSources = Object.values(sources).some(Boolean);
@@ -75,9 +75,10 @@ export const diffusionPlugin = definePlugin({
75
75
  return { config: runtimeConfig };
76
76
  }
77
77
  const resolve = ctx.resolveModelPath;
78
- const [clipLModelPath, clipGModelPath, t5XxlModelPath, llmModelPath, vaeModelPath, highNoiseDiffusionModelPath, esrganModelPath,] = await Promise.all([
78
+ const [clipLModelPath, clipGModelPath, clipVisionModelPath, t5XxlModelPath, llmModelPath, vaeModelPath, highNoiseDiffusionModelPath, esrganModelPath,] = await Promise.all([
79
79
  clipLModelSrc ? resolve(clipLModelSrc) : undefined,
80
80
  clipGModelSrc ? resolve(clipGModelSrc) : undefined,
81
+ clipVisionModelSrc ? resolve(clipVisionModelSrc) : undefined,
81
82
  t5XxlModelSrc ? resolve(t5XxlModelSrc) : undefined,
82
83
  llmModelSrc ? resolve(llmModelSrc) : undefined,
83
84
  vaeModelSrc ? resolve(vaeModelSrc) : undefined,
@@ -89,6 +90,7 @@ export const diffusionPlugin = definePlugin({
89
90
  artifacts: {
90
91
  ...(clipLModelPath && { clipLModelPath }),
91
92
  ...(clipGModelPath && { clipGModelPath }),
93
+ ...(clipVisionModelPath && { clipVisionModelPath }),
92
94
  ...(t5XxlModelPath && { t5XxlModelPath }),
93
95
  ...(llmModelPath && { llmModelPath }),
94
96
  ...(vaeModelPath && { vaeModelPath }),
@@ -140,10 +142,13 @@ export const diffusionPlugin = definePlugin({
140
142
  ...(artifacts?.["highNoiseDiffusionModelPath"] && {
141
143
  highNoiseDiffusionModel: artifacts["highNoiseDiffusionModelPath"],
142
144
  }),
145
+ ...(artifacts?.["clipVisionModelPath"] && {
146
+ clipVision: artifacts["clipVisionModelPath"],
147
+ }),
143
148
  ...(artifacts?.["esrganModelPath"] && { esrgan: artifacts["esrganModelPath"] }),
144
149
  };
145
150
  /* eslint-disable @typescript-eslint/no-unused-vars */
146
- const { clipLModelSrc, clipGModelSrc, t5XxlModelSrc, llmModelSrc, vaeModelSrc, highNoiseDiffusionModelSrc, upscaler, mode, ...rest } = config;
151
+ const { clipLModelSrc, clipGModelSrc, clipVisionModelSrc, t5XxlModelSrc, llmModelSrc, vaeModelSrc, highNoiseDiffusionModelSrc, upscaler, mode, ...rest } = config;
147
152
  /* eslint-enable @typescript-eslint/no-unused-vars */
148
153
  const model = new VideoStableDiffusion({
149
154
  files,
@@ -82,6 +82,7 @@ export declare const whisperPlugin: {
82
82
  vla: "vla";
83
83
  "llamacpp-completion": "llamacpp-completion";
84
84
  "whispercpp-transcription": "whispercpp-transcription";
85
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
85
86
  "llamacpp-embedding": "llamacpp-embedding";
86
87
  "nmtcpp-translation": "nmtcpp-translation";
87
88
  "onnx-tts": "onnx-tts";
@@ -93,6 +94,7 @@ export declare const whisperPlugin: {
93
94
  "ggml-classification": "ggml-classification";
94
95
  llm: "llm";
95
96
  whisper: "whisper";
97
+ bci: "bci";
96
98
  nmt: "nmt";
97
99
  parakeet: "parakeet";
98
100
  classification: "classification";
@@ -245,6 +247,10 @@ export declare const whisperPlugin: {
245
247
  encoderTime: import("zod").ZodOptional<import("zod").ZodNumber>;
246
248
  decoderTime: import("zod").ZodOptional<import("zod").ZodNumber>;
247
249
  melSpecTime: import("zod").ZodOptional<import("zod").ZodNumber>;
250
+ backendDevice: import("zod").ZodOptional<import("zod").ZodNumber>;
251
+ backendId: import("zod").ZodOptional<import("zod").ZodNumber>;
252
+ gpuMemTotalMb: import("zod").ZodOptional<import("zod").ZodNumber>;
253
+ gpuMemFreeMb: import("zod").ZodOptional<import("zod").ZodNumber>;
248
254
  }, import("zod/v4/core").$strip>>;
249
255
  error: import("zod").ZodOptional<import("zod").ZodString>;
250
256
  segment: import("zod").ZodOptional<import("zod").ZodObject<{
@@ -303,6 +309,10 @@ export declare const whisperPlugin: {
303
309
  encoderTime: import("zod").ZodOptional<import("zod").ZodNumber>;
304
310
  decoderTime: import("zod").ZodOptional<import("zod").ZodNumber>;
305
311
  melSpecTime: import("zod").ZodOptional<import("zod").ZodNumber>;
312
+ backendDevice: import("zod").ZodOptional<import("zod").ZodNumber>;
313
+ backendId: import("zod").ZodOptional<import("zod").ZodNumber>;
314
+ gpuMemTotalMb: import("zod").ZodOptional<import("zod").ZodNumber>;
315
+ gpuMemFreeMb: import("zod").ZodOptional<import("zod").ZodNumber>;
306
316
  }, import("zod/v4/core").$strip>>;
307
317
  error: import("zod").ZodOptional<import("zod").ZodString>;
308
318
  segment: import("zod").ZodOptional<import("zod").ZodObject<{
@@ -1,6 +1,7 @@
1
1
  import { ModelType, } from "../../../schemas/index.js";
2
2
  import { llmConfigSchema, embedConfigSchema } from "../../../schemas/llamacpp-config.js";
3
3
  import { whisperConfigSchema, parakeetRuntimeConfigSchema, } from "../../../schemas/transcription-config.js";
4
+ import { bciConfigSchema } from "../../../schemas/bci-config.js";
4
5
  import { ocrConfigSchema } from "../../../schemas/ocr.js";
5
6
  import { sdcppConfigSchema } from "../../../schemas/sdcpp-config.js";
6
7
  import { vlaConfigSchema } from "../../../schemas/vla.js";
@@ -9,6 +10,7 @@ export const CANONICAL_TO_ALIAS = {
9
10
  [ModelType.llamacppCompletion]: "llm",
10
11
  [ModelType.llamacppEmbedding]: "embeddings",
11
12
  [ModelType.whispercppTranscription]: "whisper",
13
+ [ModelType.bciWhispercppTranscription]: "bci",
12
14
  [ModelType.parakeetTranscription]: "parakeet",
13
15
  [ModelType.nmtcppTranslation]: "nmt",
14
16
  [ModelType.onnxTts]: "tts",
@@ -22,6 +24,7 @@ export const MODEL_CONFIG_SCHEMAS = {
22
24
  [ModelType.llamacppCompletion]: llmConfigSchema,
23
25
  [ModelType.llamacppEmbedding]: embedConfigSchema,
24
26
  [ModelType.whispercppTranscription]: whisperConfigSchema,
27
+ [ModelType.bciWhispercppTranscription]: bciConfigSchema,
25
28
  [ModelType.parakeetTranscription]: parakeetRuntimeConfigSchema.passthrough(),
26
29
  [ModelType.onnxOcr]: ocrConfigSchema,
27
30
  [ModelType.sdcppGeneration]: sdcppConfigSchema,
@@ -12,10 +12,17 @@ import { createRequestRegistry as createRegistry, } from "./request-registry.js"
12
12
  */
13
13
  let registry = null;
14
14
  function installDefaultPolicies(r) {
15
- // The llama.cpp addon owns one KV-cache + one decode loop per model,
16
- // so two concurrent `completionStream` requests on the same model
17
- // would interleave their token streams on the same logical session.
18
- r.policy({ kind: "completion", oneAtATimePerModel: true });
15
+ // A loaded model is a single native context (one KV-cache, single-slot
16
+ // decode), so two same-model completions can't run in parallel. Serialize
17
+ // rather than reject: the second waits FIFO. maxConcurrentPerModel: 1 is
18
+ // today's reality — raise it once continuous batching lands. The depth cap
19
+ // bounds queue memory.
20
+ r.policy({
21
+ kind: "completion",
22
+ maxConcurrentPerModel: 1,
23
+ onOverflow: "queue",
24
+ maxQueueDepthPerModel: 64,
25
+ });
19
26
  }
20
27
  export function getRequestRegistry() {
21
28
  if (!registry) {
@@ -34,22 +34,60 @@ export type CancelTarget = CancelByRequestId | CancelByModelId;
34
34
  * Per-kind admission rule. Kinds without a registered policy have no
35
35
  * admission control (every `begin(...)` is accepted as long as the
36
36
  * request id is unique).
37
+ *
38
+ * The policy turns admission into a per-`(kind, modelId)` FIFO queue with
39
+ * a configurable concurrency limit. A second concurrent request to the
40
+ * same `(kind, modelId)` *waits its turn* (default) rather than colliding
41
+ * on the single native llama.cpp context. The limit is forward-compatible
42
+ * with addon-side continuous batching: bump `maxConcurrentPerModel` to the
43
+ * addon's slot count to flip serial execution to N-way concurrent without
44
+ * any further SDK change.
45
+ *
46
+ * Requests without a `modelId` are never gated (there is no per-model
47
+ * identity to serialize against).
37
48
  */
38
49
  export interface ConcurrencyPolicy {
39
50
  kind: RequestKind;
40
51
  /**
41
- * When true, at most one in-flight request per `(kind, modelId)`
42
- * tuple — a second `begin(...)` rejects with
43
- * `RequestRejectedByPolicyError`. Requests without a `modelId` are
44
- * unaffected.
52
+ * Max simultaneously in-flight requests per `(kind, modelId)`.
53
+ * Default: `Infinity` (no admission limit). Set `1` to serialize, or
54
+ * `N` for N-way concurrency (the future continuous-batching slot
55
+ * count). Non-finite values disable gating entirely.
56
+ */
57
+ maxConcurrentPerModel?: number;
58
+ /**
59
+ * What a `begin(...)` does when the `(kind, modelId)` is at capacity:
60
+ * - `"queue"` (default): wait FIFO for a slot to free.
61
+ * - `"reject"`: throw `RequestRejectedByPolicyError` immediately
62
+ * (the legacy `oneAtATimePerModel` behavior).
63
+ */
64
+ onOverflow?: "queue" | "reject";
65
+ /**
66
+ * Max waiters allowed to queue per `(kind, modelId)` before further
67
+ * begins reject with `RequestRejectedByPolicyError`. Bounds memory so a
68
+ * runaway client can't grow the queue without limit. Default: `64`.
69
+ * Only consulted when `onOverflow` is `"queue"`.
45
70
  */
46
- oneAtATimePerModel: boolean;
71
+ maxQueueDepthPerModel?: number;
72
+ /**
73
+ * Reject a waiter that has waited longer than this many milliseconds
74
+ * with `RequestRejectedByPolicyError`. Default: `undefined` (wait
75
+ * indefinitely for a slot).
76
+ */
77
+ queueTimeoutMs?: number;
78
+ /**
79
+ * @deprecated Back-compat alias. `true` normalizes to
80
+ * `{ maxConcurrentPerModel: 1, onOverflow: "reject" }`; `false` (or
81
+ * omitted) leaves admission unlimited. Ignored when
82
+ * `maxConcurrentPerModel` is set explicitly.
83
+ */
84
+ oneAtATimePerModel?: boolean;
47
85
  }
48
86
  /**
49
- * `ManagedRequestContext` is the value `begin(...)` returns. It extends
87
+ * `ManagedRequestContext` is the value `begin(...)` resolves to. It extends
50
88
  * `RequestContext` with an async-dispose method so handlers can write:
51
89
  *
52
- * await using ctx = registry.begin({ ... });
90
+ * await using ctx = await registry.begin({ ... });
53
91
  *
54
92
  * On dispose the scope unwinds (LIFO cleanup) and the registry slot is
55
93
  * freed. If the handler doesn't override `ctx.state` before unwinding,
@@ -61,17 +99,22 @@ export interface ManagedRequestContext extends RequestContext {
61
99
  }
62
100
  export interface RequestRegistry {
63
101
  /**
64
- * Open a new request. Throws:
102
+ * Open a new request. Returns a promise because admission may *queue*:
103
+ * when a concurrency policy caps the `(kind, modelId)` and it's at
104
+ * capacity with `onOverflow: "queue"`, the promise resolves once a slot
105
+ * frees (FIFO). Callers write `await using ctx = await registry.begin(...)`.
106
+ *
107
+ * Rejects with:
65
108
  * - `RequestIdConflictError` if `requestId` is already present
66
109
  * (UUIDv4 collision is astronomically unlikely; the guard exists
67
110
  * so a buggy client retry sending the same id can't silently
68
111
  * overwrite an in-flight request).
69
112
  * - `RequestRejectedByPolicyError` if a concurrency policy was
70
- * registered for `opts.kind` and the new request would violate
71
- * it (e.g. `oneAtATimePerModel` rejects when another request
72
- * with the same `(kind, modelId)` pair is already in flight).
113
+ * registered for `opts.kind` and the new request can't be admitted:
114
+ * `onOverflow: "reject"` at capacity, the queue depth cap is
115
+ * exceeded, or the waiter's `queueTimeoutMs` elapsed.
73
116
  */
74
- begin(opts: BeginOpts): ManagedRequestContext;
117
+ begin(opts: BeginOpts): Promise<ManagedRequestContext>;
75
118
  /**
76
119
  * Register or replace the concurrency policy for a `RequestKind`.
77
120
  * Subsequent `begin(...)` calls for that kind run the policy before
@@ -79,10 +122,10 @@ export interface RequestRegistry {
79
122
  * twice replaces the previous declaration.
80
123
  *
81
124
  * @example
82
- * r.policy({ kind: "completion", oneAtATimePerModel: true });
83
- * await using a = r.begin({ requestId: "r-1", kind: "completion", modelId: "m1" });
84
- * r.begin({ requestId: "r-2", kind: "completion", modelId: "m1" });
85
- * // → throws RequestRejectedByPolicyError (code 52420)
125
+ * r.policy({ kind: "completion", maxConcurrentPerModel: 1, onOverflow: "reject" });
126
+ * await using a = await r.begin({ requestId: "r-1", kind: "completion", modelId: "m1" });
127
+ * await r.begin({ requestId: "r-2", kind: "completion", modelId: "m1" });
128
+ * // → rejects with RequestRejectedByPolicyError (code 52420)
86
129
  */
87
130
  policy(opts: ConcurrencyPolicy): void;
88
131
  /** Look up an in-flight request by id. */
@@ -132,5 +175,6 @@ export declare function createRequestRegistry(options?: {
132
175
  export declare const __requestRegistryTestHooks: {
133
176
  cancelBeforeBeginMaxEntries: number;
134
177
  cancelBeforeBeginTtlMs: number;
178
+ defaultMaxQueueDepthPerModel: number;
135
179
  };
136
180
  //# sourceMappingURL=request-registry.d.ts.map