@qvac/inference 0.22.0 → 0.23.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 (386) hide show
  1. package/NOTICE +59 -40
  2. package/README.md +1 -1
  3. package/dist/api/audio-gen.js +1 -1
  4. package/dist/api/completion-stream.d.ts +2 -1
  5. package/dist/api/completion-stream.js +3 -1
  6. package/dist/api/decide.js +1 -1
  7. package/dist/api/diffusion.d.ts +18 -1
  8. package/dist/api/diffusion.js +18 -1
  9. package/dist/api/download-asset.js +1 -1
  10. package/dist/api/finetune.js +1 -1
  11. package/dist/api/index.d.ts +39 -38
  12. package/dist/api/index.js +38 -37
  13. package/dist/api/load-model.js +2 -2
  14. package/dist/api/logging-stream-registry.js +11 -7
  15. package/dist/api/logging-stream.d.ts +11 -1
  16. package/dist/api/logging-stream.js +11 -2
  17. package/dist/api/registry.d.ts +2 -1
  18. package/dist/api/registry.js +5 -4
  19. package/dist/api/rerank.d.ts +17 -0
  20. package/dist/api/rerank.js +36 -0
  21. package/dist/api/subscribe-logs.js +5 -3
  22. package/dist/api/unload-model.js +1 -1
  23. package/dist/api/video.js +1 -1
  24. package/dist/api/vla.js +1 -1
  25. package/dist/api/world-result.js +1 -1
  26. package/dist/api/world.d.ts +1 -1
  27. package/dist/api/world.js +1 -1
  28. package/dist/config/resolve-config.d.ts +1 -1
  29. package/dist/config/resolve-config.js +1 -1
  30. package/dist/constants/index.d.ts +2 -2
  31. package/dist/constants/index.js +2 -2
  32. package/dist/dispatch.d.ts +3 -2
  33. package/dist/dispatch.js +16 -4
  34. package/dist/errors/index.d.ts +6 -0
  35. package/dist/errors/index.js +13 -1
  36. package/dist/handlers/assess-model-fit.d.ts +1 -1
  37. package/dist/handlers/assess-model-fit.js +4 -4
  38. package/dist/handlers/cancelHandler.js +1 -1
  39. package/dist/handlers/completion-orchestrate.js +2 -2
  40. package/dist/handlers/download-asset.js +2 -2
  41. package/dist/handlers/finetune.js +1 -1
  42. package/dist/handlers/get-loaded-model-info.js +2 -3
  43. package/dist/handlers/get-model-info.js +1 -1
  44. package/dist/handlers/load-model/coreml-sidecars.d.ts +15 -0
  45. package/dist/handlers/load-model/coreml-sidecars.js +71 -8
  46. package/dist/handlers/load-model/download-manager.d.ts +1 -1
  47. package/dist/handlers/load-model/download-stats.d.ts +2 -2
  48. package/dist/handlers/load-model/download-stats.js +3 -3
  49. package/dist/handlers/load-model/handler.js +10 -7
  50. package/dist/handlers/load-model/http-verify.d.ts +1 -1
  51. package/dist/handlers/load-model/http.d.ts +1 -1
  52. package/dist/handlers/load-model/http.js +3 -3
  53. package/dist/handlers/load-model/hyperdrive.d.ts +1 -1
  54. package/dist/handlers/load-model/hyperdrive.js +2 -2
  55. package/dist/handlers/load-model/index.d.ts +2 -2
  56. package/dist/handlers/load-model/index.js +2 -2
  57. package/dist/handlers/load-model/registry-companion-set.d.ts +1 -1
  58. package/dist/handlers/load-model/registry-companion-set.js +1 -1
  59. package/dist/handlers/load-model/registry-download-utils.d.ts +3 -3
  60. package/dist/handlers/load-model/registry-download-utils.js +2 -2
  61. package/dist/handlers/load-model/registry.d.ts +2 -2
  62. package/dist/handlers/load-model/registry.js +5 -5
  63. package/dist/handlers/load-model/resolve-session.d.ts +1 -1
  64. package/dist/handlers/load-model/resolve-session.js +11 -3
  65. package/dist/handlers/load-model/resolve.d.ts +1 -1
  66. package/dist/handlers/load-model/resolve.js +5 -5
  67. package/dist/handlers/logging-stream.d.ts +2 -1
  68. package/dist/handlers/logging-stream.js +23 -7
  69. package/dist/handlers/registry.js +4 -2
  70. package/dist/handlers/types.d.ts +7 -1
  71. package/dist/handlers/vector-index.js +2 -2
  72. package/dist/index.d.ts +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/logging/addon.d.ts +1 -1
  75. package/dist/logging/addon.js +1 -1
  76. package/dist/logging/index.d.ts +5 -5
  77. package/dist/logging/index.js +4 -4
  78. package/dist/logging/logger.d.ts +1 -1
  79. package/dist/logging/logger.js +3 -3
  80. package/dist/logging/utils.js +1 -1
  81. package/dist/{resources/model-fit → model-fit}/assess.d.ts +4 -4
  82. package/dist/{resources/model-fit → model-fit}/assess.js +3 -3
  83. package/dist/{resources/model-fit/native-probe/classify-fit.d.ts → model-fit/classify.d.ts} +2 -2
  84. package/dist/{resources/model-fit/native-probe/classify-fit.js → model-fit/classify.js} +4 -4
  85. package/dist/{resources/model-fit/fit-stub/fetch-fit-stub.d.ts → model-fit/description/fetch.d.ts} +1 -1
  86. package/dist/{resources/model-fit/fit-stub/fetch-fit-stub.js → model-fit/description/fetch.js} +5 -5
  87. package/dist/{resources/model-fit/fit-stub/project-fit-from-load.d.ts → model-fit/description/project.d.ts} +3 -3
  88. package/dist/{resources/model-fit/fit-stub/project-fit-from-load.js → model-fit/description/project.js} +2 -2
  89. package/dist/{resources/model-fit/fit-stub/resolve-load-from-stubs.d.ts → model-fit/description/resolve-load.d.ts} +3 -3
  90. package/dist/{resources/model-fit/fit-stub/resolve-load-from-stubs.js → model-fit/description/resolve-load.js} +6 -6
  91. package/dist/{resources/model-fit → model-fit}/floor.d.ts +2 -2
  92. package/dist/{resources/model-fit → model-fit}/floor.js +1 -1
  93. package/dist/{resources/model-fit → model-fit}/kv-cache.d.ts +1 -1
  94. package/dist/{resources/model-fit/native-probe/advisory-fit.d.ts → model-fit/load-check.d.ts} +8 -10
  95. package/dist/{resources/model-fit/native-probe/advisory-fit.js → model-fit/load-check.js} +14 -40
  96. package/dist/{resources/model-fit/types.d.ts → model-fit/platform.d.ts} +8 -0
  97. package/dist/{resources/model-fit/native-probe/create-fit-request.d.ts → model-fit/request/create.d.ts} +3 -3
  98. package/dist/{resources/model-fit/native-probe/create-fit-request.js → model-fit/request/create.js} +8 -8
  99. package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/asr.d.ts +2 -2
  100. package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/asr.js +9 -1
  101. package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/audiogen.d.ts +1 -1
  102. package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/audiogen.js +1 -1
  103. package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/diffusion.d.ts +1 -1
  104. package/dist/model-fit/request/engines/diffusion.js +93 -0
  105. package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/llama.d.ts +2 -2
  106. package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/llama.js +13 -10
  107. package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/nmt.d.ts +1 -1
  108. package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/nmt.js +1 -1
  109. package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/ocr.d.ts +1 -1
  110. package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/ocr.js +1 -1
  111. package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/tts.d.ts +2 -2
  112. package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/tts.js +1 -1
  113. package/dist/{resources/model-fit/native-probe/engine-fit.d.ts → model-fit/run/engine.d.ts} +3 -4
  114. package/dist/{resources/model-fit/native-probe/engine-fit.js → model-fit/run/engine.js} +1 -1
  115. package/dist/model-fit/run/run.d.ts +43 -0
  116. package/dist/model-fit/run/run.js +204 -0
  117. package/dist/models/registry/index.d.ts +1 -1
  118. package/dist/models/registry/index.js +2 -2
  119. package/dist/models/registry/models.d.ts +510 -0
  120. package/dist/models/registry/models.js +2946 -2410
  121. package/dist/models/registry/resource-profiles.js +203 -1
  122. package/dist/plugins/builtin/audiogen-ggml/ops/audio-edit-stream.js +2 -2
  123. package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +2 -2
  124. package/dist/plugins/builtin/audiogen-ggml/ops/audio-understand.js +2 -2
  125. package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +60 -54
  126. package/dist/plugins/builtin/audiogen-ggml/plugin.js +4 -4
  127. package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +26 -25
  128. package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +4 -4
  129. package/dist/plugins/builtin/ggml-classification/plugin.d.ts +4 -4
  130. package/dist/plugins/builtin/ggml-classification/plugin.js +1 -1
  131. package/dist/plugins/builtin/ggml-ocr/plugin.d.ts +11 -10
  132. package/dist/plugins/builtin/ggml-ocr/plugin.js +4 -4
  133. package/dist/plugins/builtin/ggml-vla/plugin.d.ts +12 -12
  134. package/dist/plugins/builtin/ggml-vla/plugin.js +3 -3
  135. package/dist/plugins/builtin/index.d.ts +15 -14
  136. package/dist/plugins/builtin/index.js +15 -14
  137. package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +5 -7
  138. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +2 -0
  139. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.js +6 -0
  140. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.d.ts +1 -0
  141. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +36 -19
  142. package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.d.ts +5 -3
  143. package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.js +9 -7
  144. package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +169 -78
  145. package/dist/plugins/builtin/llamacpp-completion/plugin.js +26 -17
  146. package/dist/plugins/builtin/llamacpp-completion/transform.js +4 -0
  147. package/dist/plugins/builtin/llamacpp-decision/helpers.d.ts +0 -1
  148. package/dist/plugins/builtin/llamacpp-decision/helpers.js +7 -15
  149. package/dist/plugins/builtin/llamacpp-decision/ops/decide.js +1 -1
  150. package/dist/plugins/builtin/llamacpp-decision/plugin.d.ts +39 -33
  151. package/dist/plugins/builtin/llamacpp-decision/plugin.js +4 -3
  152. package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +7 -6
  153. package/dist/plugins/builtin/llamacpp-embedding/plugin.js +16 -6
  154. package/dist/plugins/builtin/llamacpp-embedding/transform.js +6 -0
  155. package/dist/plugins/builtin/llamacpp-rerank/helpers.d.ts +3 -0
  156. package/dist/plugins/builtin/llamacpp-rerank/helpers.js +16 -0
  157. package/dist/plugins/builtin/llamacpp-rerank/ops/rerank.d.ts +5 -0
  158. package/dist/plugins/builtin/llamacpp-rerank/ops/rerank.js +117 -0
  159. package/dist/plugins/builtin/llamacpp-rerank/plugin.d.ts +91 -0
  160. package/dist/plugins/builtin/llamacpp-rerank/plugin.js +45 -0
  161. package/dist/plugins/builtin/moss-transcribe/plugin.d.ts +16 -16
  162. package/dist/plugins/builtin/moss-transcribe/plugin.js +4 -4
  163. package/dist/plugins/builtin/nmtcpp-translation/plugin.d.ts +18 -13
  164. package/dist/plugins/builtin/nmtcpp-translation/plugin.js +4 -4
  165. package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +29 -29
  166. package/dist/plugins/builtin/parakeet-transcription/plugin.js +4 -4
  167. package/dist/plugins/builtin/sdcpp-generation/ops/diffusion.d.ts +5 -2
  168. package/dist/plugins/builtin/sdcpp-generation/ops/diffusion.js +168 -52
  169. package/dist/plugins/builtin/sdcpp-generation/ops/video.d.ts +5 -2
  170. package/dist/plugins/builtin/sdcpp-generation/ops/video.js +19 -8
  171. package/dist/plugins/builtin/sdcpp-generation/ops/world.d.ts +2 -2
  172. package/dist/plugins/builtin/sdcpp-generation/ops/world.js +1 -1
  173. package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +90 -34
  174. package/dist/plugins/builtin/sdcpp-generation/plugin.js +45 -45
  175. package/dist/plugins/builtin/sdcpp-generation/upscaler-config.d.ts +15 -0
  176. package/dist/plugins/builtin/sdcpp-generation/upscaler-config.js +19 -0
  177. package/dist/plugins/builtin/sdcpp-generation/world-config.d.ts +8 -0
  178. package/dist/plugins/builtin/sdcpp-generation/world-config.js +9 -0
  179. package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.d.ts +1 -1
  180. package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.js +2 -2
  181. package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +2 -2
  182. package/dist/plugins/builtin/tts-ggml/plugin.d.ts +47 -32
  183. package/dist/plugins/builtin/tts-ggml/plugin.js +3 -3
  184. package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +34 -33
  185. package/dist/plugins/builtin/whispercpp-transcription/plugin.js +4 -4
  186. package/dist/plugins/index.d.ts +1 -1
  187. package/dist/plugins/index.js +2 -2
  188. package/dist/plugins/ops/kv-cache-utils.d.ts +4 -3
  189. package/dist/plugins/ops/kv-cache-utils.js +15 -8
  190. package/dist/plugins/ops/load-model.d.ts +8 -2
  191. package/dist/plugins/ops/load-model.js +14 -5
  192. package/dist/plugins/ops/transcribe.js +1 -1
  193. package/dist/plugins/ops/translate.js +3 -3
  194. package/dist/plugins/ops/unload-model.js +1 -1
  195. package/dist/plugins/turbovec-backend.js +5 -5
  196. package/dist/profiling/aggregator.d.ts +1 -1
  197. package/dist/profiling/aggregator.js +1 -1
  198. package/dist/profiling/controller.d.ts +1 -1
  199. package/dist/profiling/controller.js +2 -2
  200. package/dist/profiling/events.d.ts +1 -1
  201. package/dist/profiling/events.js +2 -2
  202. package/dist/profiling/exporters.d.ts +1 -1
  203. package/dist/profiling/exporters.js +3 -3
  204. package/dist/profiling/index.d.ts +13 -13
  205. package/dist/profiling/index.js +12 -12
  206. package/dist/profiling/operation-metrics.d.ts +1 -1
  207. package/dist/profiling/operation-metrics.js +2 -2
  208. package/dist/profiling/operation-wrappers.js +3 -3
  209. package/dist/profiling/profiler.js +1 -1
  210. package/dist/rag/handler.js +1 -1
  211. package/dist/rag/handlers/close-workspace.js +1 -1
  212. package/dist/rag/handlers/delete-embeddings.js +1 -1
  213. package/dist/rag/handlers/delete-workspace.js +1 -1
  214. package/dist/rag/handlers/ingest.js +1 -1
  215. package/dist/rag/handlers/list-workspaces.d.ts +1 -1
  216. package/dist/rag/handlers/list-workspaces.js +1 -1
  217. package/dist/rag/handlers/reindex.js +1 -1
  218. package/dist/rag/handlers/save-embeddings.js +1 -1
  219. package/dist/rag/handlers/search.js +1 -1
  220. package/dist/rag/index.d.ts +11 -11
  221. package/dist/rag/index.js +11 -11
  222. package/dist/rag/rag-workspace-manager.js +1 -1
  223. package/dist/registry.js +2 -1
  224. package/dist/resources/collector.d.ts +1 -1
  225. package/dist/resources/collector.js +1 -1
  226. package/dist/resources/instance.d.ts +1 -1
  227. package/dist/resources/instance.js +1 -1
  228. package/dist/resources/native.d.ts +1 -1
  229. package/dist/resources/normalize.d.ts +1 -1
  230. package/dist/rpc/inventory.js +3 -3
  231. package/dist/runtime/index.d.ts +5 -5
  232. package/dist/runtime/index.js +2 -2
  233. package/dist/runtime/lifecycle.js +7 -7
  234. package/dist/runtime/model-config-utils.js +3 -0
  235. package/dist/runtime/model-registry.d.ts +3 -1
  236. package/dist/runtime/model-registry.js +2 -1
  237. package/dist/runtime/registry-client.js +1 -1
  238. package/dist/runtime/request-context.d.ts +3 -3
  239. package/dist/runtime/request-context.js +14 -1
  240. package/dist/runtime/request-registry.d.ts +1 -1
  241. package/dist/runtime/request-registry.js +1 -1
  242. package/dist/runtime/state.d.ts +1 -1
  243. package/dist/runtime/state.js +2 -2
  244. package/dist/runtime/vector-index-backend.d.ts +2 -2
  245. package/dist/runtime/vector-index-registry.d.ts +5 -5
  246. package/dist/runtime/vector-index-registry.js +36 -13
  247. package/dist/schemas/assess-model-fit.d.ts +6 -0
  248. package/dist/schemas/assess-model-fit.js +4 -4
  249. package/dist/schemas/audio-gen.d.ts +13 -1
  250. package/dist/schemas/audio-gen.js +3 -3
  251. package/dist/schemas/batch-completion-stream.d.ts +8 -2
  252. package/dist/schemas/batch-completion-stream.js +3 -3
  253. package/dist/schemas/bci-config.d.ts +1 -0
  254. package/dist/schemas/bci-config.js +2 -2
  255. package/dist/schemas/bci.d.ts +1 -1
  256. package/dist/schemas/bci.js +2 -2
  257. package/dist/schemas/cancel.d.ts +5 -0
  258. package/dist/schemas/cancel.js +1 -0
  259. package/dist/schemas/common.d.ts +478 -100
  260. package/dist/schemas/common.js +35 -32
  261. package/dist/schemas/completion-event.d.ts +8 -2
  262. package/dist/schemas/completion-event.js +4 -1
  263. package/dist/schemas/completion-stream.d.ts +11 -2
  264. package/dist/schemas/completion-stream.js +37 -10
  265. package/dist/schemas/config.d.ts +849 -6
  266. package/dist/schemas/config.js +12 -10
  267. package/dist/schemas/decision.d.ts +8 -0
  268. package/dist/schemas/decision.js +14 -0
  269. package/dist/schemas/download-asset.d.ts +6 -4
  270. package/dist/schemas/download-asset.js +1 -1
  271. package/dist/schemas/engine-addon-map.d.ts +2 -1
  272. package/dist/schemas/engine-addon-map.js +4 -3
  273. package/dist/schemas/errors.d.ts +1 -0
  274. package/dist/schemas/errors.js +6 -1
  275. package/dist/schemas/index.d.ts +51 -50
  276. package/dist/schemas/index.js +50 -49
  277. package/dist/schemas/llamacpp-config.d.ts +182 -6
  278. package/dist/schemas/llamacpp-config.js +102 -7
  279. package/dist/schemas/load-model.d.ts +3176 -646
  280. package/dist/schemas/load-model.js +34 -1
  281. package/dist/schemas/mcp-adapter.d.ts +1 -1
  282. package/dist/schemas/model-config-schemas.d.ts +195 -1
  283. package/dist/schemas/model-config-schemas.js +14 -12
  284. package/dist/schemas/model-fit-policy.d.ts +1 -1
  285. package/dist/schemas/model-info.js +2 -2
  286. package/dist/schemas/model-resource-profile.d.ts +1 -0
  287. package/dist/schemas/model-resource-profile.js +1 -1
  288. package/dist/schemas/model-src-utils.d.ts +6 -2
  289. package/dist/schemas/model-src-utils.js +2 -2
  290. package/dist/schemas/model-types.d.ts +5 -1
  291. package/dist/schemas/model-types.js +1 -0
  292. package/dist/schemas/ocr.d.ts +2 -0
  293. package/dist/schemas/ocr.js +1 -1
  294. package/dist/schemas/plugin.d.ts +9 -3
  295. package/dist/schemas/plugin.js +6 -0
  296. package/dist/schemas/profiling.js +1 -1
  297. package/dist/schemas/rag.js +1 -1
  298. package/dist/schemas/registry.d.ts +8 -0
  299. package/dist/schemas/registry.js +2 -1
  300. package/dist/schemas/reload-config.d.ts +6 -2
  301. package/dist/schemas/reload-config.js +2 -2
  302. package/dist/schemas/rerank.d.ts +131 -0
  303. package/dist/schemas/rerank.js +102 -0
  304. package/dist/schemas/sdcpp-config.d.ts +56 -0
  305. package/dist/schemas/sdcpp-config.js +33 -15
  306. package/dist/schemas/text-to-speech.d.ts +61 -0
  307. package/dist/schemas/transcription-config.d.ts +5 -0
  308. package/dist/schemas/transcription-config.js +16 -1
  309. package/dist/schemas/transcription.d.ts +1 -1
  310. package/dist/schemas/transcription.js +1 -1
  311. package/dist/schemas/translate.d.ts +2 -2
  312. package/dist/schemas/translate.js +1 -1
  313. package/dist/schemas/translation-config.d.ts +20 -10
  314. package/dist/schemas/translation-config.js +1 -1
  315. package/dist/surface.d.ts +2 -1
  316. package/dist/surface.js +2 -1
  317. package/dist/utils/addon-responses.d.ts +2 -0
  318. package/dist/utils/aggregate-events.d.ts +1 -1
  319. package/dist/utils/aggregate-events.js +2 -2
  320. package/dist/utils/archive.js +2 -2
  321. package/dist/utils/audio/decoder.js +3 -1
  322. package/dist/utils/audio-input.js +1 -1
  323. package/dist/utils/cache/auto-history.d.ts +2 -1
  324. package/dist/utils/cache/auto-history.js +2 -2
  325. package/dist/utils/cache/paths.js +6 -6
  326. package/dist/utils/checksum.d.ts +2 -0
  327. package/dist/utils/checksum.js +41 -2
  328. package/dist/utils/completion-normalizer.js +1 -1
  329. package/dist/utils/gguf-architecture.d.ts +7 -0
  330. package/dist/utils/gguf-architecture.js +142 -0
  331. package/dist/utils/gguf-tensor-extractor.js +1 -1
  332. package/dist/utils/index.d.ts +13 -13
  333. package/dist/utils/index.js +13 -13
  334. package/dist/utils/mcp-adapter.d.ts +1 -1
  335. package/dist/utils/mcp-adapter.js +1 -1
  336. package/dist/utils/path-security.js +1 -1
  337. package/dist/utils/shard-utils.d.ts +5 -0
  338. package/dist/utils/shard-utils.js +19 -3
  339. package/dist/utils/tool-integration.d.ts +1 -0
  340. package/dist/utils/tool-integration.js +3 -6
  341. package/dist/utils/tools/defer.d.ts +16 -26
  342. package/dist/utils/tools/defer.js +50 -41
  343. package/dist/utils/tools/dialect.d.ts +15 -4
  344. package/dist/utils/tools/dialect.js +34 -5
  345. package/dist/utils/tools/index.d.ts +3 -3
  346. package/dist/utils/tools/index.js +3 -3
  347. package/dist/utils/tools/parser.js +8 -8
  348. package/dist/utils/tools/parsers/dsml.d.ts +1 -1
  349. package/dist/utils/tools/parsers/dsml.js +1 -1
  350. package/dist/utils/tools/parsers/gemma4native.d.ts +1 -1
  351. package/dist/utils/tools/parsers/gemma4native.js +1 -1
  352. package/dist/utils/tools/parsers/harmony.d.ts +1 -1
  353. package/dist/utils/tools/parsers/harmony.js +1 -1
  354. package/dist/utils/tools/parsers/hermes.d.ts +1 -1
  355. package/dist/utils/tools/parsers/hermes.js +1 -1
  356. package/dist/utils/tools/parsers/json.d.ts +1 -1
  357. package/dist/utils/tools/parsers/json.js +1 -1
  358. package/dist/utils/tools/parsers/pythonic.d.ts +1 -1
  359. package/dist/utils/tools/parsers/pythonic.js +1 -1
  360. package/dist/utils/tools/parsers/qwen35.d.ts +1 -1
  361. package/dist/utils/tools/parsers/qwen35.js +1 -1
  362. package/dist/utils/tts-stats.d.ts +1 -1
  363. package/dist/utils/until-aborted.d.ts +7 -0
  364. package/dist/utils/until-aborted.js +34 -0
  365. package/package.json +53 -45
  366. package/dist/resources/model-fit/native-probe/child-engine-fit.d.ts +0 -2
  367. package/dist/resources/model-fit/native-probe/child-engine-fit.js +0 -49
  368. package/dist/resources/model-fit/native-probe/engines/diffusion.js +0 -65
  369. package/dist/resources/model-fit/native-probe/fit-outcome.d.ts +0 -16
  370. package/dist/resources/model-fit/native-probe/fit-outcome.js +0 -1
  371. package/dist/resources/model-fit/native-probe/fit-process.d.ts +0 -27
  372. package/dist/resources/model-fit/native-probe/fit-process.js +0 -55
  373. package/dist/resources/model-fit/native-probe/fit-runner.d.ts +0 -1
  374. package/dist/resources/model-fit/native-probe/fit-runner.js +0 -58
  375. package/dist/resources/model-fit/native-probe/run-fit.d.ts +0 -24
  376. package/dist/resources/model-fit/native-probe/run-fit.js +0 -20
  377. package/dist/resources/model-fit/native-probe/run-in-process-fit.d.ts +0 -24
  378. package/dist/resources/model-fit/native-probe/run-in-process-fit.js +0 -123
  379. package/dist/resources/model-fit/native-probe/run-isolated-fit.d.ts +0 -63
  380. package/dist/resources/model-fit/native-probe/run-isolated-fit.js +0 -377
  381. package/dist/resources/model-fit/platform.d.ts +0 -9
  382. package/dist/resources/model-fit/types.js +0 -1
  383. /package/dist/{resources/model-fit → model-fit}/kv-cache.js +0 -0
  384. /package/dist/{resources/model-fit → model-fit}/platform.js +0 -0
  385. /package/dist/{resources/model-fit/native-probe/engines → model-fit/request}/gpu.d.ts +0 -0
  386. /package/dist/{resources/model-fit/native-probe/engines → model-fit/request}/gpu.js +0 -0
package/NOTICE CHANGED
@@ -159,6 +159,8 @@ Third-Party Model Licenses
159
159
  https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
160
160
  mmproj-unlimited-ocr-Q8_0
161
161
  https://huggingface.co/baidu/Unlimited-OCR
162
+ mobilenetv3_3class_v3_fp16
163
+ https://github.com/tetherto/qvac/tree/main/packages/classification-ggml
162
164
  model
163
165
  https://huggingface.co/Audio8/Audio8-TTS-Preview-0.6b
164
166
  moss-codec-decoder-f16
@@ -213,22 +215,36 @@ Third-Party Model Licenses
213
215
  https://huggingface.co/unsloth/Qwen3.5-0.8B-GGUF
214
216
  Qwen3.5-0.8B-GGUF
215
217
  https://huggingface.co/mradermacher/Qwen3.5-0.8B-GGUF
218
+ Qwen3.5-0.8B-MTP-GGUF
219
+ https://huggingface.co/unsloth/Qwen3.5-0.8B-MTP-GGUF
216
220
  Qwen3.5-2B-GGUF
217
221
  https://huggingface.co/unsloth/Qwen3.5-2B-GGUF
218
222
  Qwen3.5-2B-GGUF
219
223
  https://huggingface.co/mradermacher/Qwen3.5-2B-GGUF
224
+ Qwen3.5-2B-MTP-GGUF
225
+ https://huggingface.co/unsloth/Qwen3.5-2B-MTP-GGUF
226
+ Qwen3.5-4B-DFlash-GGUF
227
+ https://huggingface.co/AtomicChat/Qwen3.5-4B-DFlash-GGUF
220
228
  Qwen3.5-4B-GGUF
221
229
  https://huggingface.co/unsloth/Qwen3.5-4B-GGUF
222
230
  Qwen3.5-4B-GGUF
223
231
  https://huggingface.co/mradermacher/Qwen3.5-4B-GGUF
232
+ Qwen3.5-4B-MTP-GGUF
233
+ https://huggingface.co/unsloth/Qwen3.5-4B-MTP-GGUF
224
234
  Qwen3.5-9B-GGUF
225
235
  https://huggingface.co/unsloth/Qwen3.5-9B-GGUF
236
+ Qwen3.5-9B-MTP-GGUF
237
+ https://huggingface.co/unsloth/Qwen3.5-9B-MTP-GGUF
226
238
  Qwen3.6-27B-GGUF
227
239
  https://huggingface.co/unsloth/Qwen3.6-27B-GGUF
228
240
  Qwen3.6-35B-A3B-GGUF
229
241
  https://huggingface.co/unsloth/Qwen3.6-35B-A3B-GGUF
242
+ Qwen3.8-27B-DFlash2-GGUF
243
+ https://huggingface.co/incoai/Qwen3.8-27B-DFlash2-GGUF
230
244
  Qwen3.8-27B-GGUF
231
245
  https://huggingface.co/unsloth/Qwen3.8-27B-GGUF
246
+ Qwen3.8-Flash-Next-DFlash2-GGUF
247
+ https://huggingface.co/incoai/Qwen3.8-Flash-Next-DFlash2-GGUF
232
248
  ru-base-ggml-model-f16
233
249
  https://huggingface.co/CheeLi03/whisper-base-rus-8
234
250
  ru-tiny-ggml-model-f16
@@ -247,6 +263,10 @@ Third-Party Model Licenses
247
263
  https://huggingface.co/ggml-org/SmolVLM2-500M-Video-Instruct-GGUF
248
264
  Ternary-Bonsai-2-27B-gguf
249
265
  https://huggingface.co/prism-ml/Ternary-Bonsai-2-27B-gguf
266
+ TranscribePsy-250M-EU-sub-coreml
267
+ https://huggingface.co/qvac/TranscribePsy-250M-EU-sub-coreml
268
+ TranscribePsy-250M-EU-sub-gguf
269
+ https://huggingface.co/qvac/TranscribePsy-250M-EU-sub-gguf
250
270
  TranslatePsy-AfriSLM-0.8B-Q4-GGUF
251
271
  https://huggingface.co/qvac/TranslatePsy-AfriSLM-0.8B-Q4-GGUF
252
272
  TranslatePsy-AfriSLM-0.8B-Q8-GGUF
@@ -315,18 +335,18 @@ Third-Party Model Licenses
315
335
 
316
336
  AfriqueGemma-4B-GGUF
317
337
  https://huggingface.co/mradermacher/AfriqueGemma-4B-GGUF
318
- coremldata
319
- https://huggingface.co/nvidia/parakeet-ctc-0.6b
320
338
  coremldata
321
339
  https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3
340
+ coremldata
341
+ https://huggingface.co/nvidia/parakeet-ctc-0.6b
322
342
  coremldata
323
343
  https://huggingface.co/nvidia/parakeet-tdt-1.1b
324
344
  coremldata
325
345
  https://huggingface.co/nvidia/parakeet_realtime_eou_120m-v1
326
- model
327
- https://huggingface.co/nvidia/parakeet-ctc-0.6b
328
346
  model
329
347
  https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3
348
+ model
349
+ https://huggingface.co/nvidia/parakeet-ctc-0.6b
330
350
  model
331
351
  https://huggingface.co/nvidia/parakeet-tdt-1.1b
332
352
  model
@@ -343,6 +363,10 @@ Third-Party Model Licenses
343
363
  https://huggingface.co/nvidia/parakeet-ctc-0.6b
344
364
  parakeet-ctc-0.6b.q8_0
345
365
  https://huggingface.co/nvidia/parakeet-ctc-0.6b
366
+ parakeet-mosaic
367
+ https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3
368
+ parakeet-mosaic-compact
369
+ https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3
346
370
  parakeet-tdt-0.6b-v3.f16
347
371
  https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3
348
372
  parakeet-tdt-0.6b-v3.q4_0
@@ -359,10 +383,10 @@ Third-Party Model Licenses
359
383
  https://huggingface.co/nvidia/diar_sortformer_4spk-v1
360
384
  sortformer-4spk-v1.q8_0
361
385
  https://huggingface.co/nvidia/diar_sortformer_4spk-v1
362
- weight
363
- https://huggingface.co/nvidia/parakeet-ctc-0.6b
364
386
  weight
365
387
  https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3
388
+ weight
389
+ https://huggingface.co/nvidia/parakeet-ctc-0.6b
366
390
  weight
367
391
  https://huggingface.co/nvidia/parakeet-tdt-1.1b
368
392
  weight
@@ -733,6 +757,8 @@ Third-Party Model Licenses
733
757
 
734
758
  --- openmdw-1.1 ---
735
759
 
760
+ Nemotron-3-Diarization.converted.q4_k
761
+ https://huggingface.co/nvidia/Nemotron-3-Diarization
736
762
  Nemotron-3-Diarization.q8_0
737
763
  https://huggingface.co/nvidia/Nemotron-3-Diarization
738
764
 
@@ -789,23 +815,24 @@ JavaScript Dependencies
789
815
  @qvac/error@0.1.1
790
816
  @qvac/logging@0.1.1
791
817
  https://github.com/tetherto/qvac
792
- @qvac/rag@0.8.1
818
+ @qvac/rag@0.9.0
793
819
  https://github.com/tetherto/qvac
794
820
  @qvac/registry-client@0.7.0
795
821
  https://github.com/tetherto/qvac
796
822
  @qvac/registry-schema@0.4.0
797
823
  https://github.com/tetherto/qvac
824
+ @qvac/response@0.1.2
798
825
  adaptive-timeout@1.0.1
799
826
  https://github.com/holepunchto/adaptive-timeout
800
827
  b4a@1.9.0
801
828
  https://github.com/holepunchto/b4a
802
- bare-abort@2.0.13
829
+ bare-abort@2.0.14
803
830
  https://github.com/holepunchto/bare-abort
804
831
  bare-abort-controller@1.1.2
805
832
  https://github.com/holepunchto/bare-abort-controller
806
833
  bare-addon-resolve@1.11.0
807
834
  https://github.com/holepunchto/bare-addon-resolve
808
- bare-ansi-escapes@2.2.3
835
+ bare-ansi-escapes@2.2.4
809
836
  https://github.com/holepunchto/bare-ansi-escapes
810
837
  bare-assert@1.3.0
811
838
  https://github.com/holepunchto/bare-assert
@@ -815,13 +842,15 @@ JavaScript Dependencies
815
842
  https://github.com/holepunchto/bare-cpu-info
816
843
  bare-crypto@1.15.4
817
844
  https://github.com/holepunchto/bare-crypto
818
- bare-dns@2.3.0
845
+ bare-dns@2.3.1
819
846
  https://github.com/holepunchto/bare-dns
820
847
  bare-env@3.0.1
821
848
  https://github.com/holepunchto/bare-env
849
+ bare-events@2.4.2
850
+ https://github.com/holepunchto/bare-events
822
851
  bare-events@2.9.2
823
852
  https://github.com/holepunchto/bare-events
824
- bare-fetch@3.4.0
853
+ bare-fetch@3.4.1
825
854
  https://github.com/holepunchto/bare-fetch
826
855
  bare-form-data@1.2.2
827
856
  https://github.com/holepunchto/bare-form-data
@@ -833,7 +862,7 @@ JavaScript Dependencies
833
862
  https://github.com/holepunchto/bare-hrtime
834
863
  bare-http-parser@2.1.4
835
864
  https://github.com/holepunchto/bare-http-parser
836
- bare-http1@4.6.2
865
+ bare-http1@4.6.3
837
866
  https://github.com/holepunchto/bare-http1
838
867
  bare-https@3.1.0
839
868
  https://github.com/holepunchto/bare-https
@@ -859,10 +888,6 @@ JavaScript Dependencies
859
888
  https://github.com/holepunchto/bare-process
860
889
  bare-rpc@1.3.8
861
890
  https://github.com/holepunchto/bare-rpc
862
- bare-runtime@1.35.0
863
- https://github.com/holepunchto/bare-runtime
864
- bare-runtime-darwin-arm64@1.35.0
865
- https://github.com/holepunchto/bare-runtime
866
891
  bare-semver@1.1.0
867
892
  https://github.com/holepunchto/bare-semver
868
893
  bare-signals@5.0.0
@@ -871,13 +896,9 @@ JavaScript Dependencies
871
896
  https://github.com/holepunchto/bare-stdio
872
897
  bare-stream@2.13.4
873
898
  https://github.com/holepunchto/bare-stream
874
- bare-structured-clone@2.0.1
875
- https://github.com/holepunchto/bare-structured-clone
876
- bare-subprocess@6.2.2
877
- https://github.com/holepunchto/bare-subprocess
878
899
  bare-tcp@2.6.1
879
900
  https://github.com/holepunchto/bare-tcp
880
- bare-tls@3.1.11
901
+ bare-tls@3.2.0
881
902
  https://github.com/holepunchto/bare-tls
882
903
  bare-tty@5.2.1
883
904
  https://github.com/holepunchto/bare-tty
@@ -901,7 +922,7 @@ JavaScript Dependencies
901
922
  https://github.com/holepunchto/events-universal
902
923
  fd-lock@2.2.0
903
924
  https://github.com/holepunchto/fd-lock
904
- fs-native-extensions@1.5.1
925
+ fs-native-extensions@1.5.2
905
926
  https://github.com/holepunchto/fs-native-extensions
906
927
  hyperblobs@2.13.0
907
928
  https://github.com/holepunchto/hyperblobs
@@ -909,7 +930,7 @@ JavaScript Dependencies
909
930
  https://github.com/holepunchto/hypercore-errors
910
931
  hypercore-id-encoding@1.3.0
911
932
  https://github.com/holepunchto/hypercore-id-encoding
912
- hypercore-stats@2.5.1
933
+ hypercore-stats@2.5.2
913
934
  https://github.com/holepunchto/hypercore-stats
914
935
  hypercore-storage@3.4.0
915
936
  https://github.com/holepunchto/hypercore-storage
@@ -917,7 +938,7 @@ JavaScript Dependencies
917
938
  https://github.com/holepunchto/hyperdb
918
939
  hyperdht-address@1.1.1
919
940
  https://github.com/holepunchto/hyperdht-address
920
- hyperdht-stats@1.11.0
941
+ hyperdht-stats@1.11.1
921
942
  https://github.com/holepunchto/hyperdht-stats
922
943
  hyperdispatch@1.6.0
923
944
  https://github.com/holepunchto/hyperdispatch
@@ -925,7 +946,7 @@ JavaScript Dependencies
925
946
  https://github.com/holepunchto/hyperdrive
926
947
  hyperschema@1.26.2
927
948
  https://github.com/holepunchto/hyperschema
928
- hyperswarm-stats@1.3.1
949
+ hyperswarm-stats@1.3.3
929
950
  https://github.com/holepunchto/hyperswarm-stats
930
951
  index-encoder@3.5.0
931
952
  https://github.com/holepunchto/index-encoder
@@ -935,37 +956,35 @@ JavaScript Dependencies
935
956
  https://github.com/holepunchto/noise-handshake
936
957
  paparam@1.14.0
937
958
  https://github.com/holepunchto/paparam
938
- passive-core-watcher@1.0.1
959
+ passive-core-watcher@1.0.2
939
960
  https://github.com/holepunchto/passive-core-watcher
940
961
  quickbit-native@2.4.9
941
962
  https://github.com/holepunchto/quickbit-native
942
- rabin-native@2.0.0
963
+ rabin-native@2.0.1
943
964
  https://github.com/holepunchto/rabin-native
944
965
  rabin-stream@2.0.0
945
966
  https://github.com/holepunchto/rabin-stream
946
- rache@1.0.0
967
+ rache@1.0.1
947
968
  https://github.com/holepunchto/rache
948
969
  refcounter@1.0.0
949
970
  https://github.com/holepunchto/refcounter
950
971
  require-addon@1.3.0
951
972
  https://github.com/holepunchto/require-addon
952
- require-asset@1.2.4
953
- https://github.com/holepunchto/require-asset
954
973
  resource-on-exit@1.0.0
955
974
  https://github.com/holepunchto/bare-teardown
956
975
  rocksdb-native@3.19.1
957
976
  https://github.com/holepunchto/rocksdb-native
958
977
  scope-lock@1.2.4
959
978
  https://github.com/holepunchto/scope-lock
960
- simdle-native@1.3.9
979
+ simdle-native@1.3.10
961
980
  https://github.com/holepunchto/simdle-native
962
981
  sub-encoder@2.1.3
963
982
  https://github.com/holepunchto/sub-encoder
964
983
  text-decoder@1.2.7
965
984
  https://github.com/holepunchto/text-decoder
966
- udx-native@1.21.3
985
+ udx-native@1.22.0
967
986
  https://github.com/holepunchto/udx-native
968
- unslab@1.3.0
987
+ unslab@1.3.1
969
988
  https://github.com/holepunchto/unslab
970
989
  which-runtime@1.4.0
971
990
  https://github.com/holepunchto/which-runtime
@@ -978,11 +997,11 @@ JavaScript Dependencies
978
997
  https://github.com/emilbayes/nanoassert
979
998
  noise-curve-ed@2.1.0
980
999
  https://github.com/chm-diederichs/noise-curve-ed
981
- quickbit-universal@2.2.0
1000
+ quickbit-universal@2.2.1
982
1001
  https://github.com/holepunchto/quickbit-universal
983
1002
  semver@7.8.5
984
1003
  https://github.com/npm/node-semver
985
- simdle-universal@1.1.2
1004
+ simdle-universal@1.1.3
986
1005
  https://github.com/holepunchto/simdle-universal
987
1006
 
988
1007
  --- mit (MIT License) ---
@@ -995,11 +1014,11 @@ JavaScript Dependencies
995
1014
  https://github.com/mafintosh/bogon
996
1015
  codecs@3.1.0
997
1016
  https://github.com/mafintosh/codecs
998
- corestore@7.15.0
1017
+ corestore@7.16.1
999
1018
  https://github.com/holepunchto/corestore
1000
1019
  debounceify@1.1.0
1001
1020
  https://github.com/mafintosh/debounceify
1002
- dht-rpc@6.27.0
1021
+ dht-rpc@6.28.0
1003
1022
  https://github.com/holepunchto/dht-rpc
1004
1023
  fast-fifo@1.3.2
1005
1024
  https://github.com/mafintosh/fast-fifo
@@ -1013,11 +1032,11 @@ JavaScript Dependencies
1013
1032
  https://github.com/mafintosh/generate-string
1014
1033
  hyperbee@2.27.3
1015
1034
  https://github.com/holepunchto/hyperbee
1016
- hypercore@11.39.0
1035
+ hypercore@11.39.5
1017
1036
  https://github.com/holepunchto/hypercore
1018
1037
  hypercore-crypto@3.7.0
1019
1038
  https://github.com/mafintosh/hypercore-crypto
1020
- hyperdht@6.34.1
1039
+ hyperdht@6.35.0
1021
1040
  https://github.com/holepunchto/hyperdht
1022
1041
  hyperswarm@4.17.2
1023
1042
  https://github.com/holepunchto/hyperswarm
@@ -1057,7 +1076,7 @@ JavaScript Dependencies
1057
1076
  https://github.com/mafintosh/signal-promise
1058
1077
  signed-varint@2.0.1
1059
1078
  https://github.com/dominictarr/signed-varint
1060
- sodium-native@5.1.1
1079
+ sodium-native@5.2.0
1061
1080
  https://github.com/holepunchto/sodium-native
1062
1081
  sodium-secretstream@1.2.0
1063
1082
  https://github.com/mafintosh/sodium-secretstream
package/README.md CHANGED
@@ -60,7 +60,7 @@ const run = completion({ modelId, history: [{ role: 'user', content: 'Hi' }] })
60
60
  Model operations require a registered model plugin. RPC discovery needs no model plugin or server provider; serving requires an explicitly registered server provider.
61
61
 
62
62
  The [Bare serving example](examples/rpc-server.ts)
63
- shows explicit registration and cleanup with `@qvac/ggml-rpc-server@0.5.1`.
63
+ shows explicit registration and cleanup with `@qvac/ggml-rpc-server`.
64
64
 
65
65
  ## Capability to addon package
66
66
 
@@ -1,6 +1,6 @@
1
1
  import { audioEditClientParamsSchema, audioEditStreamResponseSchema, audioGenClientParamsSchema, audioGenStreamResponseSchema, audioUnderstandClientParamsSchema, audioUnderstandResponseSchema } from '../schemas/index.js';
2
2
  import { stream } from '../dispatch.js';
3
- import { parseClientInput } from './parse-input.js';
3
+ import { parseClientInput } from '../api/parse-input.js';
4
4
  import { generateRandomRequestId } from '../runtime/request-id.js';
5
5
  import { decodeBase64 } from '../utils/encoding.js';
6
6
  import { InvalidResponseError, InferenceCancelledError } from '../errors/index.js';
@@ -28,7 +28,7 @@ type CompletionParams = Omit<CompletionClientParams, 'tools'> & {
28
28
  * @param params.mcp - Optional array of MCP client inputs for tool integration
29
29
  * @param params.captureThinking - Best-effort parsing of `<think>` blocks into `thinkingDelta` events; `final.raw.fullText` always preserves the original output
30
30
  * @param params.emitRawDeltas - When true, every raw model token is also emitted as a `rawDelta` event
31
- * @param params.toolDialect - Override name-based dialect detection. Supported values: `"hermes"`, `"pythonic"`, `"json"`, `"harmony"`, `"qwen35"` (Qwen3.5/3.6/3.8), `"gemma4"`, `"dsml"` (DeepSeek V3.2/V4). Use when the auto-router doesn't recognise your model name. Drives both streaming frame detection and finalization parsing.
31
+ * @param params.toolDialect - Override dialect detection, which uses the model name, then the GGUF `general.architecture`, then `"hermes"`. Supported values: `"hermes"`, `"pythonic"`, `"json"`, `"harmony"`, `"qwen35"` (Qwen3.5/3.6/3.8), `"gemma4"`, `"dsml"` (DeepSeek V3.2/V4). Use when detection picks the wrong dialect for your model. Drives both streaming frame detection and finalization parsing.
32
32
  * Common override case: Llama 3.x tool-calling fine-tunes that emit the native pythonic header (`<|start_header_id|>tool_call<|end_header_id|>...<|eot_id|>`).
33
33
  * @param params.responseFormat - Optional structured-output constraint applied to the model's output:
34
34
  * - `{ type: "text" }` — no constraint (default behavior)
@@ -45,6 +45,7 @@ type CompletionParams = Omit<CompletionClientParams, 'tools'> & {
45
45
  * validation must encode it explicitly in `schema`.
46
46
  *
47
47
  * Cannot be combined with `tools` (tools already constrain output via their parameter schema).
48
+ * @param params.prefill - Evaluate the prompt and tools without generating an answer. Requires an enabled kvCache; cannot force tool_choice. Await final before sending the question with the same prefix.
48
49
  * @param params.kvCache - Optional KV cache configuration. Cache files are organized hierarchically:
49
50
  * - Structure: `{kvCacheKey}/{modelId}/{configHash}.bin`
50
51
  * - The configHash includes model config + system prompt to ensure cache isolation
@@ -28,7 +28,7 @@ const logger = getAppLogger();
28
28
  * @param params.mcp - Optional array of MCP client inputs for tool integration
29
29
  * @param params.captureThinking - Best-effort parsing of `<think>` blocks into `thinkingDelta` events; `final.raw.fullText` always preserves the original output
30
30
  * @param params.emitRawDeltas - When true, every raw model token is also emitted as a `rawDelta` event
31
- * @param params.toolDialect - Override name-based dialect detection. Supported values: `"hermes"`, `"pythonic"`, `"json"`, `"harmony"`, `"qwen35"` (Qwen3.5/3.6/3.8), `"gemma4"`, `"dsml"` (DeepSeek V3.2/V4). Use when the auto-router doesn't recognise your model name. Drives both streaming frame detection and finalization parsing.
31
+ * @param params.toolDialect - Override dialect detection, which uses the model name, then the GGUF `general.architecture`, then `"hermes"`. Supported values: `"hermes"`, `"pythonic"`, `"json"`, `"harmony"`, `"qwen35"` (Qwen3.5/3.6/3.8), `"gemma4"`, `"dsml"` (DeepSeek V3.2/V4). Use when detection picks the wrong dialect for your model. Drives both streaming frame detection and finalization parsing.
32
32
  * Common override case: Llama 3.x tool-calling fine-tunes that emit the native pythonic header (`<|start_header_id|>tool_call<|end_header_id|>...<|eot_id|>`).
33
33
  * @param params.responseFormat - Optional structured-output constraint applied to the model's output:
34
34
  * - `{ type: "text" }` — no constraint (default behavior)
@@ -45,6 +45,7 @@ const logger = getAppLogger();
45
45
  * validation must encode it explicitly in `schema`.
46
46
  *
47
47
  * Cannot be combined with `tools` (tools already constrain output via their parameter schema).
48
+ * @param params.prefill - Evaluate the prompt and tools without generating an answer. Requires an enabled kvCache; cannot force tool_choice. Await final before sending the question with the same prefix.
48
49
  * @param params.kvCache - Optional KV cache configuration. Cache files are organized hierarchically:
49
50
  * - Structure: `{kvCacheKey}/{modelId}/{configHash}.bin`
50
51
  * - The configHash includes model config + system prompt to ensure cache isolation
@@ -183,6 +184,7 @@ export function completion(params) {
183
184
  modelId: params.modelId,
184
185
  history: params.history.map((message) => ({ ...message, content: message.content ?? '' })),
185
186
  kvCache: params.kvCache,
187
+ prefill: params.prefill,
186
188
  tools: allTools.length > 0 ? allTools : undefined,
187
189
  stream: params.stream ?? true,
188
190
  generationParams: params.generationParams,
@@ -3,7 +3,7 @@ import { decideParamsSchema, decideResponseSchema } from '../schemas/index.js';
3
3
  import { InvalidResponseError } from '../errors/index.js';
4
4
  import { decoratePromise } from '../utils/decorate-promise.js';
5
5
  import { generateRequestId } from '../runtime/request-id.js';
6
- import { parseClientInput } from './parse-input.js';
6
+ import { parseClientInput } from '../api/parse-input.js';
7
7
  export function decide(params, options) {
8
8
  const requestId = generateRequestId();
9
9
  return decoratePromise(runDecide(params, requestId, options), { requestId });
@@ -14,8 +14,11 @@ interface DiffusionResult {
14
14
  *
15
15
  * @param params - Diffusion request parameters (model, prompt, dimensions, sampler, seed, etc.).
16
16
  * @returns A result object exposing `progressStream` (async iterator of `{ step, totalSteps, elapsedMs }`), `outputs` (promise of the generated image buffers), and `stats` (promise of generation statistics).
17
+ * @throws {InferenceCancelledError} The run's promises reject and progress stream throws when an active generation is cancelled.
18
+ * @throws {RequestRejectedByPolicyError} The run rejects when another image or video generation owns the model.
17
19
  *
18
- * Supports both txt2img (no `init_image`) and img2img (with `init_image`).
20
+ * Supports txt2img without input images, img2img via `init_image`,
21
+ * and ordered multi-reference editing via `init_images` on supported models.
19
22
  *
20
23
  * @example
21
24
  * ```typescript
@@ -49,6 +52,20 @@ interface DiffusionResult {
49
52
  * height: 768,
50
53
  * });
51
54
  *
55
+ * // Qwen-Image-2.1 reference editing. Load the matching Qwen3-VL encoder,
56
+ * // vision projector, and 2.1 VAE from your local files first.
57
+ * const { outputs: edited } = diffusion({
58
+ * modelId,
59
+ * prompt: "Place the two referenced people together in one office.",
60
+ * init_images: [refA, refB],
61
+ * width: 512,
62
+ * height: 512,
63
+ * steps: 30,
64
+ * cfg_scale: 6,
65
+ * sampling_method: "euler",
66
+ * seed: 42,
67
+ * });
68
+ *
52
69
  * // LoRA adapter for this generation (absolute path required).
53
70
  * // Persistence across subsequent diffusion() calls is controlled at
54
71
  * // loadModel time via `modelConfig.lora_apply_mode`.
@@ -6,8 +6,11 @@ import { decodeBase64, encodeBase64 } from '../utils/encoding.js';
6
6
  *
7
7
  * @param params - Diffusion request parameters (model, prompt, dimensions, sampler, seed, etc.).
8
8
  * @returns A result object exposing `progressStream` (async iterator of `{ step, totalSteps, elapsedMs }`), `outputs` (promise of the generated image buffers), and `stats` (promise of generation statistics).
9
+ * @throws {InferenceCancelledError} The run's promises reject and progress stream throws when an active generation is cancelled.
10
+ * @throws {RequestRejectedByPolicyError} The run rejects when another image or video generation owns the model.
9
11
  *
10
- * Supports both txt2img (no `init_image`) and img2img (with `init_image`).
12
+ * Supports txt2img without input images, img2img via `init_image`,
13
+ * and ordered multi-reference editing via `init_images` on supported models.
11
14
  *
12
15
  * @example
13
16
  * ```typescript
@@ -41,6 +44,20 @@ import { decodeBase64, encodeBase64 } from '../utils/encoding.js';
41
44
  * height: 768,
42
45
  * });
43
46
  *
47
+ * // Qwen-Image-2.1 reference editing. Load the matching Qwen3-VL encoder,
48
+ * // vision projector, and 2.1 VAE from your local files first.
49
+ * const { outputs: edited } = diffusion({
50
+ * modelId,
51
+ * prompt: "Place the two referenced people together in one office.",
52
+ * init_images: [refA, refB],
53
+ * width: 512,
54
+ * height: 512,
55
+ * steps: 30,
56
+ * cfg_scale: 6,
57
+ * sampling_method: "euler",
58
+ * seed: 42,
59
+ * });
60
+ *
44
61
  * // LoRA adapter for this generation (absolute path required).
45
62
  * // Persistence across subsequent diffusion() calls is controlled at
46
63
  * // loadModel time via `modelConfig.lora_apply_mode`.
@@ -2,7 +2,7 @@ import { send, stream } from '../dispatch.js';
2
2
  import { downloadAssetOptionsToRequestSchema } from '../schemas/index.js';
3
3
  import { DownloadAssetFailedError, StreamEndedError, InvalidResponseError } from '../errors/index.js';
4
4
  import { decoratePromise } from '../utils/decorate-promise.js';
5
- import { parseClientInput } from './parse-input.js';
5
+ import { parseClientInput } from '../api/parse-input.js';
6
6
  import { generateRequestId } from '../runtime/request-id.js';
7
7
  /**
8
8
  * Downloads an asset (model file) without loading it into memory.
@@ -1,7 +1,7 @@
1
1
  import { send, stream as streamRpc } from '../dispatch.js';
2
2
  import { finetuneRunParamsSchema, finetuneRunRequestSchema, finetuneStopRequestSchema, finetuneGetStateParamsSchema, finetuneGetStateRequestSchema, finetuneProgressResponseSchema, finetuneResponseSchema } from '../schemas/index.js';
3
3
  import { InvalidResponseError, StreamEndedError } from '../errors/index.js';
4
- import { parseClientInput } from './parse-input.js';
4
+ import { parseClientInput } from '../api/parse-input.js';
5
5
  function isFinetuneReplyParams(params) {
6
6
  return (params.operation === 'pause' || params.operation === 'cancel' || params.operation === 'getState');
7
7
  }
@@ -1,39 +1,40 @@
1
- export { loadModel } from './load-model.js';
2
- export { downloadAsset } from './download-asset.js';
3
- export { completion } from './completion-stream.js';
4
- export { batchCompletion } from './batch-completion.js';
5
- export { deleteCache } from './delete-cache.js';
6
- export { unloadModel } from './unload-model.js';
7
- export { loggingStream } from './logging-stream.js';
8
- export { subscribeServerLogs, type ServerLogHandler } from './subscribe-logs.js';
9
- export { heartbeat } from './heartbeat.js';
10
- export { transcribe, transcribeStream } from './transcribe.js';
11
- export { bciTranscribe, bciTranscribeStream } from './bci-transcribe.js';
12
- export { embed } from './embed.js';
13
- export { finetune, type FinetuneHandle } from './finetune.js';
14
- export { translate } from './translate.js';
15
- export { cancel } from './cancel.js';
16
- export { ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace } from './rag.js';
17
- export { createVectorIndex, loadVectorIndex, type VectorIndex } from './vector-index.js';
18
- export { textToSpeech, textToSpeechStream } from './text-to-speech.js';
19
- export { getModelInfo } from './get-model-info.js';
20
- export { getLoadedModelInfo } from './get-loaded-model-info.js';
21
- export { getSystemResources } from './get-system-resources.js';
22
- export { assessModelFit } from './assess-model-fit.js';
23
- export { ocr } from './ocr.js';
24
- export { invokePlugin, invokePluginStream } from './invoke-plugin.js';
25
- export { diffusion, type DiffusionProgressTick } from './diffusion.js';
26
- export { audioGen, audioEdit, audioUnderstand } from './audio-gen.js';
27
- export { classify } from './classify.js';
28
- export { video, type VideoProgressTick } from './video.js';
29
- export { upscale } from './upscale.js';
30
- export { worldCreateScene, worldStep } from './world.js';
31
- export { type WorldStepResult, type WorldStepProgressTick, type WorldSceneResult, type WorldSceneResultWithPack } from './world-result.js';
32
- export { modelRegistryList, modelRegistrySearch, modelRegistryGetModel, type ModelRegistrySearchParams } from './registry.js';
33
- export { suspend } from './suspend.js';
34
- export { resume } from './resume.js';
35
- export { state } from './state.js';
36
- export { vla, vlaHparams, vlaSetEmbodiment } from './vla.js';
37
- export { vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE } from './vla-helpers.js';
1
+ export { loadModel } from '../api/load-model.js';
2
+ export { downloadAsset } from '../api/download-asset.js';
3
+ export { completion } from '../api/completion-stream.js';
4
+ export { batchCompletion } from '../api/batch-completion.js';
5
+ export { deleteCache } from '../api/delete-cache.js';
6
+ export { unloadModel } from '../api/unload-model.js';
7
+ export { loggingStream } from '../api/logging-stream.js';
8
+ export { subscribeServerLogs, type ServerLogHandler } from '../api/subscribe-logs.js';
9
+ export { heartbeat } from '../api/heartbeat.js';
10
+ export { transcribe, transcribeStream } from '../api/transcribe.js';
11
+ export { bciTranscribe, bciTranscribeStream } from '../api/bci-transcribe.js';
12
+ export { embed } from '../api/embed.js';
13
+ export { finetune, type FinetuneHandle } from '../api/finetune.js';
14
+ export { translate } from '../api/translate.js';
15
+ export { cancel } from '../api/cancel.js';
16
+ export { ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace } from '../api/rag.js';
17
+ export { createVectorIndex, loadVectorIndex, type VectorIndex } from '../api/vector-index.js';
18
+ export { textToSpeech, textToSpeechStream } from '../api/text-to-speech.js';
19
+ export { getModelInfo } from '../api/get-model-info.js';
20
+ export { getLoadedModelInfo } from '../api/get-loaded-model-info.js';
21
+ export { getSystemResources } from '../api/get-system-resources.js';
22
+ export { assessModelFit } from '../api/assess-model-fit.js';
23
+ export { ocr } from '../api/ocr.js';
24
+ export { invokePlugin, invokePluginStream } from '../api/invoke-plugin.js';
25
+ export { diffusion, type DiffusionProgressTick } from '../api/diffusion.js';
26
+ export { audioGen, audioEdit, audioUnderstand } from '../api/audio-gen.js';
27
+ export { classify } from '../api/classify.js';
28
+ export { video, type VideoProgressTick } from '../api/video.js';
29
+ export { upscale } from '../api/upscale.js';
30
+ export { worldCreateScene, worldStep } from '../api/world.js';
31
+ export { type WorldStepResult, type WorldStepProgressTick, type WorldSceneResult, type WorldSceneResultWithPack } from '../api/world-result.js';
32
+ export { modelRegistryList, modelRegistrySearch, modelRegistryGetModel, type ModelRegistrySearchParams } from '../api/registry.js';
33
+ export { suspend } from '../api/suspend.js';
34
+ export { resume } from '../api/resume.js';
35
+ export { state } from '../api/state.js';
36
+ export { vla, vlaHparams, vlaSetEmbodiment } from '../api/vla.js';
37
+ export { vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE } from '../api/vla-helpers.js';
38
38
  export { startRpcServer, stopRpcServer, discoverRpcServers } from './rpc-server.js';
39
- export { decide } from './decide.js';
39
+ export { decide } from '../api/decide.js';
40
+ export { rerank } from '../api/rerank.js';
package/dist/api/index.js CHANGED
@@ -1,38 +1,39 @@
1
- export { loadModel } from './load-model.js';
2
- export { downloadAsset } from './download-asset.js';
3
- export { completion } from './completion-stream.js';
4
- export { batchCompletion } from './batch-completion.js';
5
- export { deleteCache } from './delete-cache.js';
6
- export { unloadModel } from './unload-model.js';
7
- export { loggingStream } from './logging-stream.js';
8
- export { subscribeServerLogs } from './subscribe-logs.js';
9
- export { heartbeat } from './heartbeat.js';
10
- export { transcribe, transcribeStream } from './transcribe.js';
11
- export { bciTranscribe, bciTranscribeStream } from './bci-transcribe.js';
12
- export { embed } from './embed.js';
13
- export { finetune } from './finetune.js';
14
- export { translate } from './translate.js';
15
- export { cancel } from './cancel.js';
16
- export { ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace } from './rag.js';
17
- export { createVectorIndex, loadVectorIndex } from './vector-index.js';
18
- export { textToSpeech, textToSpeechStream } from './text-to-speech.js';
19
- export { getModelInfo } from './get-model-info.js';
20
- export { getLoadedModelInfo } from './get-loaded-model-info.js';
21
- export { getSystemResources } from './get-system-resources.js';
22
- export { assessModelFit } from './assess-model-fit.js';
23
- export { ocr } from './ocr.js';
24
- export { invokePlugin, invokePluginStream } from './invoke-plugin.js';
25
- export { diffusion } from './diffusion.js';
26
- export { audioGen, audioEdit, audioUnderstand } from './audio-gen.js';
27
- export { classify } from './classify.js';
28
- export { video } from './video.js';
29
- export { upscale } from './upscale.js';
30
- export { worldCreateScene, worldStep } from './world.js';
31
- export { modelRegistryList, modelRegistrySearch, modelRegistryGetModel } from './registry.js';
32
- export { suspend } from './suspend.js';
33
- export { resume } from './resume.js';
34
- export { state } from './state.js';
35
- export { vla, vlaHparams, vlaSetEmbodiment } from './vla.js';
36
- export { vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE } from './vla-helpers.js';
1
+ export { loadModel } from '../api/load-model.js';
2
+ export { downloadAsset } from '../api/download-asset.js';
3
+ export { completion } from '../api/completion-stream.js';
4
+ export { batchCompletion } from '../api/batch-completion.js';
5
+ export { deleteCache } from '../api/delete-cache.js';
6
+ export { unloadModel } from '../api/unload-model.js';
7
+ export { loggingStream } from '../api/logging-stream.js';
8
+ export { subscribeServerLogs } from '../api/subscribe-logs.js';
9
+ export { heartbeat } from '../api/heartbeat.js';
10
+ export { transcribe, transcribeStream } from '../api/transcribe.js';
11
+ export { bciTranscribe, bciTranscribeStream } from '../api/bci-transcribe.js';
12
+ export { embed } from '../api/embed.js';
13
+ export { finetune } from '../api/finetune.js';
14
+ export { translate } from '../api/translate.js';
15
+ export { cancel } from '../api/cancel.js';
16
+ export { ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace } from '../api/rag.js';
17
+ export { createVectorIndex, loadVectorIndex } from '../api/vector-index.js';
18
+ export { textToSpeech, textToSpeechStream } from '../api/text-to-speech.js';
19
+ export { getModelInfo } from '../api/get-model-info.js';
20
+ export { getLoadedModelInfo } from '../api/get-loaded-model-info.js';
21
+ export { getSystemResources } from '../api/get-system-resources.js';
22
+ export { assessModelFit } from '../api/assess-model-fit.js';
23
+ export { ocr } from '../api/ocr.js';
24
+ export { invokePlugin, invokePluginStream } from '../api/invoke-plugin.js';
25
+ export { diffusion } from '../api/diffusion.js';
26
+ export { audioGen, audioEdit, audioUnderstand } from '../api/audio-gen.js';
27
+ export { classify } from '../api/classify.js';
28
+ export { video } from '../api/video.js';
29
+ export { upscale } from '../api/upscale.js';
30
+ export { worldCreateScene, worldStep } from '../api/world.js';
31
+ export { modelRegistryList, modelRegistrySearch, modelRegistryGetModel } from '../api/registry.js';
32
+ export { suspend } from '../api/suspend.js';
33
+ export { resume } from '../api/resume.js';
34
+ export { state } from '../api/state.js';
35
+ export { vla, vlaHparams, vlaSetEmbodiment } from '../api/vla.js';
36
+ export { vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE } from '../api/vla-helpers.js';
37
37
  export { startRpcServer, stopRpcServer, discoverRpcServers } from './rpc-server.js';
38
- export { decide } from './decide.js';
38
+ export { decide } from '../api/decide.js';
39
+ export { rerank } from '../api/rerank.js';