@qvac/inference 0.18.2 → 0.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/NOTICE +69 -36
  2. package/README.md +1 -5
  3. package/dist/api/assess-model-fit.d.ts +16 -0
  4. package/dist/api/assess-model-fit.js +27 -0
  5. package/dist/api/audio-gen.d.ts +4 -4
  6. package/dist/api/audio-gen.js +17 -6
  7. package/dist/api/completion-stream.d.ts +1 -1
  8. package/dist/api/completion-stream.js +1 -1
  9. package/dist/api/delete-cache.d.ts +7 -1
  10. package/dist/api/delete-cache.js +11 -1
  11. package/dist/api/download-asset.d.ts +1 -1
  12. package/dist/api/download-asset.js +2 -2
  13. package/dist/api/finetune.js +1 -1
  14. package/dist/api/get-loaded-model-info.d.ts +6 -10
  15. package/dist/api/get-loaded-model-info.js +6 -10
  16. package/dist/api/heartbeat.d.ts +5 -22
  17. package/dist/api/heartbeat.js +6 -23
  18. package/dist/api/index.d.ts +36 -35
  19. package/dist/api/index.js +35 -35
  20. package/dist/api/load-model.d.ts +5 -1
  21. package/dist/api/load-model.js +3 -5
  22. package/dist/api/logging-stream-registry.js +1 -1
  23. package/dist/api/resume.d.ts +0 -3
  24. package/dist/api/resume.js +0 -3
  25. package/dist/api/subscribe-logs.js +1 -1
  26. package/dist/api/suspend.d.ts +0 -4
  27. package/dist/api/suspend.js +0 -4
  28. package/dist/api/translate.d.ts +3 -1
  29. package/dist/api/translate.js +16 -8
  30. package/dist/api/unload-model.js +3 -5
  31. package/dist/api/video-request.d.ts +207 -0
  32. package/dist/api/video-request.js +18 -0
  33. package/dist/api/video.d.ts +22 -2
  34. package/dist/api/video.js +25 -15
  35. package/dist/api/vla-helpers.d.ts +1 -2
  36. package/dist/api/vla-helpers.js +1 -2
  37. package/dist/api/vla.js +1 -1
  38. package/dist/api/world-result.d.ts +71 -0
  39. package/dist/api/world-result.js +293 -0
  40. package/dist/api/world.d.ts +143 -0
  41. package/dist/api/world.js +71 -0
  42. package/dist/config/resolve-config.d.ts +1 -1
  43. package/dist/config/resolve-config.js +1 -1
  44. package/dist/constants/index.d.ts +2 -2
  45. package/dist/constants/index.js +2 -2
  46. package/dist/dispatch.js +15 -28
  47. package/dist/errors/index.d.ts +35 -31
  48. package/dist/errors/index.js +66 -56
  49. package/dist/handlers/assess-model-fit.d.ts +10 -0
  50. package/dist/handlers/assess-model-fit.js +75 -0
  51. package/dist/handlers/cancelHandler.js +1 -1
  52. package/dist/handlers/completion-orchestrate.js +1 -1
  53. package/dist/handlers/delete-cache.js +3 -0
  54. package/dist/handlers/download-asset.js +6 -5
  55. package/dist/handlers/finetune.js +1 -1
  56. package/dist/handlers/get-loaded-model-info.js +0 -12
  57. package/dist/handlers/get-model-info.js +1 -1
  58. package/dist/handlers/get-system-resources.js +8 -0
  59. package/dist/handlers/load-model/download-manager.d.ts +1 -1
  60. package/dist/handlers/load-model/download-stats.d.ts +3 -3
  61. package/dist/handlers/load-model/download-stats.js +5 -5
  62. package/dist/handlers/load-model/handler.js +6 -8
  63. package/dist/handlers/load-model/http-verify.d.ts +20 -0
  64. package/dist/handlers/load-model/http-verify.js +54 -0
  65. package/dist/handlers/load-model/http.d.ts +12 -2
  66. package/dist/handlers/load-model/http.js +119 -230
  67. package/dist/handlers/load-model/hyperdrive.d.ts +1 -1
  68. package/dist/handlers/load-model/hyperdrive.js +1 -1
  69. package/dist/handlers/load-model/index.d.ts +2 -2
  70. package/dist/handlers/load-model/index.js +2 -2
  71. package/dist/handlers/load-model/registry-companion-set.d.ts +1 -1
  72. package/dist/handlers/load-model/registry-companion-set.js +1 -1
  73. package/dist/handlers/load-model/registry-download-utils.d.ts +3 -3
  74. package/dist/handlers/load-model/registry-download-utils.js +2 -2
  75. package/dist/handlers/load-model/registry.d.ts +2 -2
  76. package/dist/handlers/load-model/registry.js +4 -4
  77. package/dist/handlers/load-model/resolve-session.d.ts +8 -1
  78. package/dist/handlers/load-model/resolve-session.js +12 -9
  79. package/dist/handlers/load-model/resolve.d.ts +4 -4
  80. package/dist/handlers/load-model/resolve.js +18 -16
  81. package/dist/handlers/load-model/safe-fetch.d.ts +44 -0
  82. package/dist/handlers/load-model/safe-fetch.js +143 -0
  83. package/dist/handlers/load-model/types.d.ts +9 -0
  84. package/dist/handlers/plugin-dispatch.js +1 -4
  85. package/dist/handlers/plugin-invoke.js +1 -4
  86. package/dist/handlers/types.d.ts +0 -2
  87. package/dist/handlers/unload-model.js +1 -4
  88. package/dist/index.d.ts +1 -1
  89. package/dist/index.js +1 -1
  90. package/dist/logging/addon.d.ts +1 -1
  91. package/dist/logging/addon.js +1 -1
  92. package/dist/logging/index.d.ts +5 -5
  93. package/dist/logging/index.js +4 -4
  94. package/dist/logging/logger.d.ts +1 -1
  95. package/dist/logging/logger.js +2 -2
  96. package/dist/models/registry/index.d.ts +1 -1
  97. package/dist/models/registry/index.js +2 -2
  98. package/dist/models/registry/models.d.ts +250 -0
  99. package/dist/models/registry/models.js +2071 -1806
  100. package/dist/models/registry/resource-profiles.d.ts +18 -0
  101. package/dist/models/registry/resource-profiles.js +4934 -0
  102. package/dist/plugins/builtin/audiogen-ggml/config.d.ts +14 -0
  103. package/dist/plugins/builtin/audiogen-ggml/config.js +23 -0
  104. package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +47 -5
  105. package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +134 -4
  106. package/dist/plugins/builtin/audiogen-ggml/plugin.js +47 -28
  107. package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +1 -1
  108. package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +3 -3
  109. package/dist/plugins/builtin/ggml-classification/plugin.js +1 -1
  110. package/dist/plugins/builtin/ggml-ocr/plugin.js +2 -2
  111. package/dist/plugins/builtin/ggml-vla/plugin.d.ts +1 -1
  112. package/dist/plugins/builtin/ggml-vla/plugin.js +3 -3
  113. package/dist/plugins/builtin/index.d.ts +12 -12
  114. package/dist/plugins/builtin/index.js +12 -12
  115. package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +2 -2
  116. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +1 -0
  117. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.js +3 -0
  118. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +37 -26
  119. package/dist/plugins/builtin/llamacpp-completion/ops/context-overflow.d.ts +12 -11
  120. package/dist/plugins/builtin/llamacpp-completion/ops/context-overflow.js +133 -41
  121. package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.d.ts +15 -4
  122. package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.js +79 -17
  123. package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +22 -8
  124. package/dist/plugins/builtin/llamacpp-completion/plugin.js +10 -13
  125. package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +4 -0
  126. package/dist/plugins/builtin/llamacpp-embedding/plugin.js +13 -2
  127. package/dist/plugins/builtin/nmtcpp-translation/plugin.js +2 -2
  128. package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +2 -2
  129. package/dist/plugins/builtin/parakeet-transcription/plugin.js +3 -3
  130. package/dist/plugins/builtin/sdcpp-generation/ops/upscale.js +1 -1
  131. package/dist/plugins/builtin/sdcpp-generation/ops/video.js +32 -2
  132. package/dist/plugins/builtin/sdcpp-generation/ops/world.d.ts +126 -0
  133. package/dist/plugins/builtin/sdcpp-generation/ops/world.js +820 -0
  134. package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +153 -4
  135. package/dist/plugins/builtin/sdcpp-generation/plugin.js +134 -13
  136. package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.js +1 -1
  137. package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +1 -1
  138. package/dist/plugins/builtin/tts-ggml/plugin.js +2 -2
  139. package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +2 -2
  140. package/dist/plugins/builtin/whispercpp-transcription/plugin.js +3 -3
  141. package/dist/plugins/index.d.ts +1 -1
  142. package/dist/plugins/index.js +2 -2
  143. package/dist/plugins/ops/kv-cache-utils.js +1 -1
  144. package/dist/plugins/ops/load-model.js +1 -1
  145. package/dist/plugins/ops/transcribe.js +2 -2
  146. package/dist/plugins/ops/translate.js +4 -12
  147. package/dist/plugins/ops/unload-model.js +19 -21
  148. package/dist/plugins/registry.d.ts +1 -0
  149. package/dist/plugins/registry.js +12 -0
  150. package/dist/profiling/aggregator.d.ts +1 -1
  151. package/dist/profiling/aggregator.js +1 -1
  152. package/dist/profiling/controller.d.ts +1 -1
  153. package/dist/profiling/controller.js +2 -2
  154. package/dist/profiling/envelope.d.ts +0 -1
  155. package/dist/profiling/envelope.js +0 -10
  156. package/dist/profiling/events.d.ts +2 -3
  157. package/dist/profiling/events.js +2 -9
  158. package/dist/profiling/exporters.d.ts +1 -1
  159. package/dist/profiling/exporters.js +3 -3
  160. package/dist/profiling/index.d.ts +13 -14
  161. package/dist/profiling/index.js +12 -13
  162. package/dist/profiling/operation-metrics.d.ts +1 -1
  163. package/dist/profiling/operation-metrics.js +35 -2
  164. package/dist/profiling/operation-wrappers.js +12 -15
  165. package/dist/profiling/profiler.d.ts +1 -2
  166. package/dist/profiling/profiler.js +7 -26
  167. package/dist/profiling/types.d.ts +1 -1
  168. package/dist/rag/handler.js +1 -1
  169. package/dist/rag/handlers/close-workspace.js +1 -1
  170. package/dist/rag/handlers/delete-embeddings.js +1 -1
  171. package/dist/rag/handlers/delete-workspace.js +2 -6
  172. package/dist/rag/handlers/ingest.js +1 -1
  173. package/dist/rag/handlers/list-workspaces.d.ts +1 -1
  174. package/dist/rag/handlers/list-workspaces.js +1 -1
  175. package/dist/rag/handlers/reindex.js +1 -1
  176. package/dist/rag/handlers/save-embeddings.js +1 -1
  177. package/dist/rag/handlers/search.js +1 -1
  178. package/dist/rag/index.d.ts +11 -11
  179. package/dist/rag/index.js +11 -11
  180. package/dist/rag/rag-workspace-manager.d.ts +4 -2
  181. package/dist/rag/rag-workspace-manager.js +268 -15
  182. package/dist/registry.js +8 -58
  183. package/dist/resources/collector.d.ts +3 -1
  184. package/dist/resources/collector.js +91 -9
  185. package/dist/resources/instance.d.ts +1 -1
  186. package/dist/resources/instance.js +1 -1
  187. package/dist/resources/model-fit/assess.d.ts +36 -0
  188. package/dist/resources/model-fit/assess.js +679 -0
  189. package/dist/resources/model-fit/calibration/darwin-arm64.d.ts +8 -0
  190. package/dist/resources/model-fit/calibration/darwin-arm64.js +36 -0
  191. package/dist/resources/model-fit/calibration/darwin-x64.d.ts +8 -0
  192. package/dist/resources/model-fit/calibration/darwin-x64.js +38 -0
  193. package/dist/resources/model-fit/calibration/fit.d.ts +73 -0
  194. package/dist/resources/model-fit/calibration/fit.js +152 -0
  195. package/dist/resources/model-fit/calibration/index.d.ts +37 -0
  196. package/dist/resources/model-fit/calibration/index.js +75 -0
  197. package/dist/resources/model-fit/calibration/linux-arm64.d.ts +8 -0
  198. package/dist/resources/model-fit/calibration/linux-arm64.js +38 -0
  199. package/dist/resources/model-fit/calibration/linux-x64-vulkan.d.ts +8 -0
  200. package/dist/resources/model-fit/calibration/linux-x64-vulkan.js +39 -0
  201. package/dist/resources/model-fit/calibration/linux-x64.d.ts +8 -0
  202. package/dist/resources/model-fit/calibration/linux-x64.js +38 -0
  203. package/dist/resources/model-fit/calibration/win32-x64-vulkan-shared.d.ts +8 -0
  204. package/dist/resources/model-fit/calibration/win32-x64-vulkan-shared.js +39 -0
  205. package/dist/resources/model-fit/calibration/win32-x64-vulkan.d.ts +8 -0
  206. package/dist/resources/model-fit/calibration/win32-x64-vulkan.js +36 -0
  207. package/dist/resources/model-fit/calibration/win32-x64.d.ts +8 -0
  208. package/dist/resources/model-fit/calibration/win32-x64.js +38 -0
  209. package/dist/resources/model-fit/estimators/llm.d.ts +46 -0
  210. package/dist/resources/model-fit/estimators/llm.js +222 -0
  211. package/dist/resources/model-fit/estimators/whisper.d.ts +10 -0
  212. package/dist/resources/model-fit/estimators/whisper.js +77 -0
  213. package/dist/resources/model-fit/floor.d.ts +31 -0
  214. package/dist/resources/model-fit/floor.js +65 -0
  215. package/dist/resources/model-fit/types.d.ts +120 -0
  216. package/dist/resources/model-fit/types.js +1 -0
  217. package/dist/resources/native.d.ts +1 -1
  218. package/dist/resources/native.js +15 -0
  219. package/dist/resources/normalize.d.ts +1 -1
  220. package/dist/resources/types.d.ts +14 -0
  221. package/dist/runtime/index.d.ts +5 -5
  222. package/dist/runtime/index.js +2 -2
  223. package/dist/runtime/lifecycle.js +5 -7
  224. package/dist/runtime/model-registry.d.ts +0 -14
  225. package/dist/runtime/model-registry.js +17 -40
  226. package/dist/runtime/registry-client.js +1 -1
  227. package/dist/runtime/request-context.d.ts +3 -3
  228. package/dist/runtime/request-context.js +13 -1
  229. package/dist/runtime/request-registry.d.ts +1 -1
  230. package/dist/runtime/request-registry.js +4 -5
  231. package/dist/runtime/state.d.ts +1 -1
  232. package/dist/runtime/state.js +18 -3
  233. package/dist/schemas/assess-model-fit.d.ts +311 -0
  234. package/dist/schemas/assess-model-fit.js +182 -0
  235. package/dist/schemas/audio-gen.d.ts +437 -7
  236. package/dist/schemas/audio-gen.js +131 -19
  237. package/dist/schemas/batch-completion-stream.d.ts +5 -2
  238. package/dist/schemas/batch-completion-stream.js +3 -3
  239. package/dist/schemas/bci-config.js +73 -27
  240. package/dist/schemas/bci.d.ts +3 -3
  241. package/dist/schemas/bci.js +5 -5
  242. package/dist/schemas/cancel.d.ts +5 -0
  243. package/dist/schemas/cancel.js +1 -0
  244. package/dist/schemas/classification.js +13 -6
  245. package/dist/schemas/common.d.ts +695 -335
  246. package/dist/schemas/common.js +33 -31
  247. package/dist/schemas/completion-event.d.ts +5 -2
  248. package/dist/schemas/completion-event.js +2 -1
  249. package/dist/schemas/completion-stream.d.ts +3 -5
  250. package/dist/schemas/completion-stream.js +4 -8
  251. package/dist/schemas/config.d.ts +640 -18
  252. package/dist/schemas/config.js +50 -8
  253. package/dist/schemas/download-asset.d.ts +19 -1
  254. package/dist/schemas/download-asset.js +20 -4
  255. package/dist/schemas/engine-addon-map.d.ts +1 -1
  256. package/dist/schemas/engine-addon-map.js +3 -3
  257. package/dist/schemas/error.d.ts +2 -2
  258. package/dist/schemas/error.js +2 -2
  259. package/dist/schemas/errors.d.ts +2 -6
  260. package/dist/schemas/errors.js +30 -40
  261. package/dist/schemas/heartbeat.d.ts +10 -0
  262. package/dist/schemas/heartbeat.js +8 -0
  263. package/dist/schemas/index.d.ts +46 -44
  264. package/dist/schemas/index.js +45 -43
  265. package/dist/schemas/llamacpp-config.d.ts +32 -10
  266. package/dist/schemas/llamacpp-config.js +11 -8
  267. package/dist/schemas/load-model.d.ts +2902 -1857
  268. package/dist/schemas/load-model.js +52 -52
  269. package/dist/schemas/mcp-adapter.d.ts +1 -1
  270. package/dist/schemas/model-config-schemas.d.ts +2354 -0
  271. package/dist/schemas/model-config-schemas.js +46 -0
  272. package/dist/schemas/model-info.d.ts +10 -20
  273. package/dist/schemas/model-info.js +4 -25
  274. package/dist/schemas/model-ops.d.ts +3 -1
  275. package/dist/schemas/model-ops.js +7 -2
  276. package/dist/schemas/model-resource-profile.d.ts +109 -0
  277. package/dist/schemas/model-resource-profile.js +83 -0
  278. package/dist/schemas/model-src-utils.d.ts +1 -0
  279. package/dist/schemas/model-src-utils.js +33 -13
  280. package/dist/schemas/ocr.js +48 -13
  281. package/dist/schemas/path-validation.js +8 -2
  282. package/dist/schemas/plugin.d.ts +23 -10
  283. package/dist/schemas/plugin.js +11 -0
  284. package/dist/schemas/profiling.d.ts +138 -43
  285. package/dist/schemas/profiling.js +1 -22
  286. package/dist/schemas/rag.js +1 -1
  287. package/dist/schemas/registry.js +1 -1
  288. package/dist/schemas/reload-config.d.ts +0 -2
  289. package/dist/schemas/reload-config.js +2 -3
  290. package/dist/schemas/sdcpp-config.d.ts +344 -4
  291. package/dist/schemas/sdcpp-config.js +504 -17
  292. package/dist/schemas/system-resources.d.ts +138 -0
  293. package/dist/schemas/system-resources.js +3 -1
  294. package/dist/schemas/text-to-speech.js +183 -76
  295. package/dist/schemas/transcription-config.js +253 -85
  296. package/dist/schemas/transcription.d.ts +3 -3
  297. package/dist/schemas/translate.d.ts +2 -2
  298. package/dist/schemas/translate.js +1 -1
  299. package/dist/schemas/translation-config.js +53 -25
  300. package/dist/schemas/vla.d.ts +1 -1
  301. package/dist/selection.d.ts +1 -5
  302. package/dist/selection.js +2 -6
  303. package/dist/surface.d.ts +1 -1
  304. package/dist/utils/addon-responses.d.ts +1 -0
  305. package/dist/utils/aggregate-events.d.ts +1 -1
  306. package/dist/utils/aggregate-events.js +2 -2
  307. package/dist/utils/archive.js +2 -2
  308. package/dist/utils/audio-input.js +1 -1
  309. package/dist/utils/cache/auto-history.d.ts +1 -1
  310. package/dist/utils/cache/auto-history.js +1 -1
  311. package/dist/utils/cache/paths.js +5 -5
  312. package/dist/utils/completion-normalizer.js +1 -1
  313. package/dist/utils/gguf-tensor-extractor.js +1 -1
  314. package/dist/utils/image-dimensions.d.ts +26 -0
  315. package/dist/utils/image-dimensions.js +46 -0
  316. package/dist/utils/index.d.ts +13 -10
  317. package/dist/utils/index.js +13 -10
  318. package/dist/utils/mcp-adapter.d.ts +1 -1
  319. package/dist/utils/mcp-adapter.js +1 -1
  320. package/dist/utils/path-sanitize.d.ts +7 -0
  321. package/dist/utils/path-sanitize.js +36 -0
  322. package/dist/utils/path-security.d.ts +0 -7
  323. package/dist/utils/path-security.js +1 -36
  324. package/dist/utils/shard-utils.js +3 -3
  325. package/dist/utils/tool-integration.js +1 -1
  326. package/dist/utils/tools/dialect.js +1 -1
  327. package/dist/utils/tools/index.d.ts +2 -2
  328. package/dist/utils/tools/index.js +2 -2
  329. package/dist/utils/tools/parser.js +8 -8
  330. package/dist/utils/tools/parsers/dsml.d.ts +1 -1
  331. package/dist/utils/tools/parsers/dsml.js +1 -1
  332. package/dist/utils/tools/parsers/gemma4native.d.ts +1 -1
  333. package/dist/utils/tools/parsers/gemma4native.js +1 -1
  334. package/dist/utils/tools/parsers/harmony.d.ts +1 -1
  335. package/dist/utils/tools/parsers/harmony.js +1 -1
  336. package/dist/utils/tools/parsers/hermes.d.ts +1 -1
  337. package/dist/utils/tools/parsers/hermes.js +1 -1
  338. package/dist/utils/tools/parsers/json.d.ts +1 -1
  339. package/dist/utils/tools/parsers/json.js +1 -1
  340. package/dist/utils/tools/parsers/pythonic.d.ts +1 -1
  341. package/dist/utils/tools/parsers/pythonic.js +1 -1
  342. package/dist/utils/tools/parsers/qwen35.d.ts +1 -1
  343. package/dist/utils/tools/parsers/qwen35.js +3 -3
  344. package/dist/utils/url-security.d.ts +17 -0
  345. package/dist/utils/url-security.js +75 -0
  346. package/package.json +31 -26
  347. package/dist/api/provide.d.ts +0 -23
  348. package/dist/api/provide.js +0 -32
  349. package/dist/api/stop-provider.d.ts +0 -20
  350. package/dist/api/stop-provider.js +0 -30
  351. package/dist/p2p/cancel-delegated.d.ts +0 -3
  352. package/dist/p2p/cancel-delegated.js +0 -64
  353. package/dist/p2p/completion-stream-delegated.d.ts +0 -4
  354. package/dist/p2p/completion-stream-delegated.js +0 -51
  355. package/dist/p2p/delegate-client.d.ts +0 -9
  356. package/dist/p2p/delegate-client.js +0 -219
  357. package/dist/p2p/delegate-connect-diagnostics.d.ts +0 -8
  358. package/dist/p2p/delegate-connect-diagnostics.js +0 -38
  359. package/dist/p2p/delegate-transport.d.ts +0 -18
  360. package/dist/p2p/delegate-transport.js +0 -237
  361. package/dist/p2p/error-handlers.d.ts +0 -4
  362. package/dist/p2p/error-handlers.js +0 -31
  363. package/dist/p2p/handle-request.d.ts +0 -2
  364. package/dist/p2p/handle-request.js +0 -171
  365. package/dist/p2p/handler-utils.d.ts +0 -19
  366. package/dist/p2p/handler-utils.js +0 -180
  367. package/dist/p2p/heartbeat-delegated.d.ts +0 -3
  368. package/dist/p2p/heartbeat-delegated.js +0 -32
  369. package/dist/p2p/load-model-delegated.d.ts +0 -6
  370. package/dist/p2p/load-model-delegated.js +0 -132
  371. package/dist/p2p/progress-throttle.d.ts +0 -7
  372. package/dist/p2p/progress-throttle.js +0 -47
  373. package/dist/p2p/provideHandler/connection.d.ts +0 -2
  374. package/dist/p2p/provideHandler/connection.js +0 -38
  375. package/dist/p2p/provideHandler/handler.d.ts +0 -2
  376. package/dist/p2p/provideHandler/handler.js +0 -66
  377. package/dist/p2p/provideHandler/proxy.d.ts +0 -2
  378. package/dist/p2p/provideHandler/proxy.js +0 -24
  379. package/dist/p2p/provideHandler.d.ts +0 -1
  380. package/dist/p2p/provideHandler.js +0 -2
  381. package/dist/p2p/rpc-utils.d.ts +0 -4
  382. package/dist/p2p/rpc-utils.js +0 -8
  383. package/dist/p2p/stopProvideHandler.d.ts +0 -2
  384. package/dist/p2p/stopProvideHandler.js +0 -29
  385. package/dist/p2p/swarm.d.ts +0 -9
  386. package/dist/p2p/swarm.js +0 -103
  387. package/dist/p2p/transport-selector.d.ts +0 -2
  388. package/dist/p2p/transport-selector.js +0 -18
  389. package/dist/p2p/unload-model-delegated.d.ts +0 -2
  390. package/dist/p2p/unload-model-delegated.js +0 -31
  391. package/dist/profiling/delegation-profiler.d.ts +0 -31
  392. package/dist/profiling/delegation-profiler.js +0 -155
  393. package/dist/schemas/delegate.d.ts +0 -29
  394. package/dist/schemas/delegate.js +0 -40
  395. package/dist/schemas/provide.d.ts +0 -50
  396. package/dist/schemas/provide.js +0 -32
package/NOTICE CHANGED
@@ -63,14 +63,24 @@ Third-Party Model Licenses
63
63
 
64
64
  abot-world-0-5b-lf-dit-q8_0
65
65
  https://huggingface.co/acvlab/ABot-World-0-5B-LF
66
+ audio8-codec-decoder-f16
67
+ https://huggingface.co/Audio8/Audio8-TTS-Preview-0.6b
68
+ audio8-codec-encoder-f16
69
+ https://huggingface.co/Audio8/Audio8-TTS-Preview-0.6b
70
+ audio8-lm-f16
71
+ https://huggingface.co/Audio8/Audio8-TTS-Preview-0.6b
66
72
  bci-embedder
67
73
  https://github.com/tetherto/qvac/releases/download/bci-test-assets-v0.1.0/bci-embedder.bin
74
+ cosyvoice3-campplus-f32
75
+ https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
68
76
  cosyvoice3-flow-f32
69
77
  https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
70
78
  cosyvoice3-hift-f32
71
79
  https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
72
80
  cosyvoice3-llm-q8_0
73
81
  https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
82
+ cosyvoice3-s3tok-f16
83
+ https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
74
84
  craft_mlt_25k
75
85
  https://www.jaided.ai/easyocr/modelhub/
76
86
  crnn_mobilenet_v3_small
@@ -179,6 +189,8 @@ Third-Party Model Licenses
179
189
  https://huggingface.co/unsloth/Qwen3.6-27B-GGUF
180
190
  Qwen3.6-35B-A3B-GGUF
181
191
  https://huggingface.co/unsloth/Qwen3.6-35B-A3B-GGUF
192
+ Qwen3.8-27B-GGUF
193
+ https://huggingface.co/unsloth/Qwen3.8-27B-GGUF
182
194
  ru-base-ggml-model-f16
183
195
  https://huggingface.co/CheeLi03/whisper-base-rus-8
184
196
  ru-tiny-ggml-model-f16
@@ -199,6 +211,10 @@ Third-Party Model Licenses
199
211
  https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged
200
212
  unlimited-ocr-gguf
201
213
  https://huggingface.co/vimalnakrani/unlimited-ocr-gguf
214
+ VisionPsy-Nano-460M-Flash-GGUFs
215
+ https://huggingface.co/qvac/VisionPsy-Nano-460M-Flash-GGUFs
216
+ VisionPsy-Nano-460M-GGUFs
217
+ https://huggingface.co/qvac/VisionPsy-Nano-460M-GGUFs
202
218
  voice-en
203
219
  https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
204
220
  voice-zh-2
@@ -348,6 +364,12 @@ Third-Party Model Licenses
348
364
  https://huggingface.co/ChristianAzinn/gte-large-gguf
349
365
  gte-large-gguf
350
366
  https://huggingface.co/ChristianAzinn/gte-large-gguf
367
+ indic-conformer-ctc.f16
368
+ https://huggingface.co/ai4bharat/indic-conformer-600m-multilingual
369
+ indic-conformer-ctc.q4_0
370
+ https://huggingface.co/ai4bharat/indic-conformer-600m-multilingual
371
+ indic-conformer-ctc.q8_0
372
+ https://huggingface.co/ai4bharat/indic-conformer-600m-multilingual
351
373
  lavasr-denoiser-f16
352
374
  https://huggingface.co/spaces/YatharthS
353
375
  lavasr-enhancer-f16
@@ -586,6 +608,12 @@ Third-Party Model Licenses
586
608
  https://huggingface.co/nvidia/GR00T-N1.7-LIBERO
587
609
  groot-q8_vf16
588
610
  https://huggingface.co/nvidia/GR00T-N1.7-3B
611
+ parakeet-unified-en-0.6b.f16
612
+ https://huggingface.co/nvidia/parakeet-unified-en-0.6b
613
+ parakeet-unified-en-0.6b.q4_0
614
+ https://huggingface.co/nvidia/parakeet-unified-en-0.6b
615
+ parakeet-unified-en-0.6b.q8_0
616
+ https://huggingface.co/nvidia/parakeet-unified-en-0.6b
589
617
 
590
618
  --- openrail ---
591
619
 
@@ -611,6 +639,11 @@ Third-Party Model Licenses
611
639
  stable-diffusion-xl-base-1.0-GGUF
612
640
  https://huggingface.co/gpustack/stable-diffusion-xl-base-1.0-GGUF
613
641
 
642
+ --- qwen-community-1.0 ---
643
+
644
+ Qwen3.8-Flash-Next-GGUF
645
+ https://huggingface.co/unsloth/Qwen3.8-Flash-Next-GGUF
646
+
614
647
  =========================================================================
615
648
  Modification Notice
616
649
  =========================================================================
@@ -635,7 +668,7 @@ JavaScript Dependencies
635
668
  @qvac/error@0.1.1
636
669
  @qvac/logging@0.1.1
637
670
  https://github.com/tetherto/qvac
638
- @qvac/rag@0.6.4
671
+ @qvac/rag@0.8.1
639
672
  https://github.com/tetherto/qvac
640
673
  @qvac/registry-client@0.6.1
641
674
  https://github.com/tetherto/qvac
@@ -655,49 +688,49 @@ JavaScript Dependencies
655
688
  https://github.com/holepunchto/bare-ansi-escapes
656
689
  bare-assert@1.2.0
657
690
  https://github.com/holepunchto/bare-assert
658
- bare-buffer@3.7.0
691
+ bare-buffer@3.7.1
659
692
  https://github.com/holepunchto/bare-buffer
660
693
  bare-cpu-info@0.1.1
661
694
  https://github.com/holepunchto/bare-cpu-info
662
695
  bare-crypto@1.15.3
663
696
  https://github.com/holepunchto/bare-crypto
664
- bare-dns@2.1.4
697
+ bare-dns@2.2.0
665
698
  https://github.com/holepunchto/bare-dns
666
699
  bare-env@3.0.1
667
700
  https://github.com/holepunchto/bare-env
668
- bare-events@2.9.1
701
+ bare-events@2.9.2
669
702
  https://github.com/holepunchto/bare-events
670
- bare-fetch@3.2.0
703
+ bare-fetch@3.2.1
671
704
  https://github.com/holepunchto/bare-fetch
672
705
  bare-form-data@1.2.2
673
706
  https://github.com/holepunchto/bare-form-data
674
- bare-fs@4.8.0
707
+ bare-fs@4.8.1
675
708
  https://github.com/holepunchto/bare-fs
676
709
  bare-gpu-info@0.1.1
677
710
  https://github.com/holepunchto/bare-gpu-info
678
- bare-hrtime@2.1.1
711
+ bare-hrtime@2.1.2
679
712
  https://github.com/holepunchto/bare-hrtime
680
- bare-http-parser@1.1.5
713
+ bare-http-parser@2.1.4
681
714
  https://github.com/holepunchto/bare-http-parser
682
- bare-http1@4.5.8
715
+ bare-http1@4.6.1
683
716
  https://github.com/holepunchto/bare-http1
684
- bare-https@3.0.0
717
+ bare-https@3.1.0
685
718
  https://github.com/holepunchto/bare-https
686
- bare-inspect@3.1.5
719
+ bare-inspect@3.1.10
687
720
  https://github.com/holepunchto/bare-inspect
688
721
  bare-mime@1.0.0
689
722
  https://github.com/holepunchto/bare-mime
690
- bare-module-resolve@1.12.4
723
+ bare-module-resolve@1.12.5
691
724
  https://github.com/holepunchto/bare-module-resolve
692
725
  bare-net@2.3.3
693
726
  https://github.com/holepunchto/bare-net
694
727
  bare-os@3.9.3
695
728
  https://github.com/holepunchto/bare-os
696
- bare-path@3.1.1
729
+ bare-path@3.1.2
697
730
  https://github.com/holepunchto/bare-path
698
731
  bare-performance@2.1.1
699
732
  https://github.com/holepunchto/bare-performance
700
- bare-pipe@4.2.3
733
+ bare-pipe@4.3.1
701
734
  https://github.com/holepunchto/bare-pipe
702
735
  bare-posix@1.0.1
703
736
  https://github.com/holepunchto/bare-posix
@@ -711,23 +744,23 @@ JavaScript Dependencies
711
744
  https://github.com/holepunchto/bare-signals
712
745
  bare-stdio@1.0.3
713
746
  https://github.com/holepunchto/bare-stdio
714
- bare-stream@2.13.3
747
+ bare-stream@2.13.4
715
748
  https://github.com/holepunchto/bare-stream
716
- bare-tcp@2.5.4
749
+ bare-tcp@2.6.1
717
750
  https://github.com/holepunchto/bare-tcp
718
- bare-tls@3.1.8
751
+ bare-tls@3.1.10
719
752
  https://github.com/holepunchto/bare-tls
720
- bare-tty@5.1.2
753
+ bare-tty@5.2.1
721
754
  https://github.com/holepunchto/bare-tty
722
- bare-type@1.1.0
755
+ bare-type@1.1.1
723
756
  https://github.com/holepunchto/bare-type
724
- bare-url@2.5.2
757
+ bare-url@2.5.4
725
758
  https://github.com/holepunchto/bare-url
726
759
  bare-zlib@1.4.1
727
760
  https://github.com/holepunchto/bare-zlib
728
761
  blind-relay@1.6.1
729
762
  https://github.com/holepunchto/blind-relay
730
- compact-encoding@3.3.0
763
+ compact-encoding@3.5.0
731
764
  https://github.com/holepunchto/compact-encoding
732
765
  compact-encoding-bitfield@1.1.0
733
766
  https://github.com/compact-encoding/compact-encoding-bitfield
@@ -739,7 +772,7 @@ JavaScript Dependencies
739
772
  https://github.com/holepunchto/events-universal
740
773
  fd-lock@2.2.0
741
774
  https://github.com/holepunchto/fd-lock
742
- fs-native-extensions@1.5.0
775
+ fs-native-extensions@1.5.1
743
776
  https://github.com/holepunchto/fs-native-extensions
744
777
  hyperblobs@2.12.1
745
778
  https://github.com/holepunchto/hyperblobs
@@ -751,17 +784,17 @@ JavaScript Dependencies
751
784
  https://github.com/holepunchto/hypercore-stats
752
785
  hypercore-storage@3.2.1
753
786
  https://github.com/holepunchto/hypercore-storage
754
- hyperdb@6.8.0
787
+ hyperdb@6.9.0
755
788
  https://github.com/holepunchto/hyperdb
756
789
  hyperdht-address@1.1.1
757
790
  https://github.com/holepunchto/hyperdht-address
758
- hyperdht-stats@1.10.0
791
+ hyperdht-stats@1.11.0
759
792
  https://github.com/holepunchto/hyperdht-stats
760
793
  hyperdispatch@1.6.0
761
794
  https://github.com/holepunchto/hyperdispatch
762
795
  hyperdrive@13.3.3
763
796
  https://github.com/holepunchto/hyperdrive
764
- hyperschema@1.22.0
797
+ hyperschema@1.24.0
765
798
  https://github.com/holepunchto/hyperschema
766
799
  hyperswarm-stats@1.3.1
767
800
  https://github.com/holepunchto/hyperswarm-stats
@@ -771,7 +804,7 @@ JavaScript Dependencies
771
804
  https://github.com/holepunchto/mirror-drive
772
805
  noise-handshake@4.2.0
773
806
  https://github.com/holepunchto/noise-handshake
774
- paparam@1.12.0
807
+ paparam@1.13.0
775
808
  https://github.com/holepunchto/paparam
776
809
  passive-core-watcher@1.0.1
777
810
  https://github.com/holepunchto/passive-core-watcher
@@ -785,7 +818,7 @@ JavaScript Dependencies
785
818
  https://github.com/holepunchto/rache
786
819
  refcounter@1.0.0
787
820
  https://github.com/holepunchto/refcounter
788
- require-addon@1.2.0
821
+ require-addon@1.3.0
789
822
  https://github.com/holepunchto/require-addon
790
823
  resource-on-exit@1.0.0
791
824
  https://github.com/holepunchto/bare-teardown
@@ -799,7 +832,7 @@ JavaScript Dependencies
799
832
  https://github.com/holepunchto/sub-encoder
800
833
  text-decoder@1.2.7
801
834
  https://github.com/holepunchto/text-decoder
802
- udx-native@1.21.0
835
+ udx-native@1.21.1
803
836
  https://github.com/holepunchto/udx-native
804
837
  unslab@1.3.0
805
838
  https://github.com/holepunchto/unslab
@@ -831,7 +864,7 @@ JavaScript Dependencies
831
864
  https://github.com/mafintosh/bogon
832
865
  codecs@3.1.0
833
866
  https://github.com/mafintosh/codecs
834
- corestore@7.12.0
867
+ corestore@7.12.4
835
868
  https://github.com/holepunchto/corestore
836
869
  debounceify@1.1.0
837
870
  https://github.com/mafintosh/debounceify
@@ -849,13 +882,13 @@ JavaScript Dependencies
849
882
  https://github.com/mafintosh/generate-string
850
883
  hyperbee@2.27.3
851
884
  https://github.com/holepunchto/hyperbee
852
- hypercore@11.35.1
885
+ hypercore@11.35.5
853
886
  https://github.com/holepunchto/hypercore
854
887
  hypercore-crypto@3.7.0
855
888
  https://github.com/mafintosh/hypercore-crypto
856
- hyperdht@6.33.1
889
+ hyperdht@6.34.0
857
890
  https://github.com/holepunchto/hyperdht
858
- hyperswarm@4.17.0
891
+ hyperswarm@4.17.1
859
892
  https://github.com/holepunchto/hyperswarm
860
893
  is-options@1.0.2
861
894
  https://github.com/mafintosh/is-options
@@ -871,7 +904,7 @@ JavaScript Dependencies
871
904
  https://github.com/mafintosh/nat-sampler
872
905
  protocol-buffers-encodings@1.2.0
873
906
  https://github.com/mafintosh/protocol-buffers-encodings
874
- protomux@3.11.0
907
+ protomux@3.12.0
875
908
  https://github.com/holepunchto/protomux
876
909
  queue-tick@1.0.1
877
910
  https://github.com/mafintosh/queue-tick
@@ -901,9 +934,9 @@ JavaScript Dependencies
901
934
  https://github.com/holepunchto/sodium-universal
902
935
  speedometer@1.1.0
903
936
  https://github.com/mafintosh/speedometer
904
- streamx@2.28.0
937
+ streamx@2.28.1
905
938
  https://github.com/mafintosh/streamx
906
- tar-stream@3.2.0
939
+ tar-stream@3.2.1
907
940
  https://github.com/mafintosh/tar-stream
908
941
  teex@1.0.1
909
942
  https://github.com/mafintosh/teex
@@ -923,6 +956,6 @@ JavaScript Dependencies
923
956
  https://github.com/mafintosh/xache
924
957
  z32@1.1.0
925
958
  https://github.com/mafintosh/z32
926
- zod@4.4.3
959
+ zod@4.6.1
927
960
  https://github.com/colinhacks/zod
928
961
 
package/README.md CHANGED
@@ -11,7 +11,7 @@ The Bare-only engine of the QVAC SDK. It runs inference directly on the [Bare ru
11
11
 
12
12
  ## Why this exists
13
13
 
14
- `@qvac/inference` is the pure-Bare layer of the SDK, written in TypeScript: the client API, the request engine, the plugin system, and the P2P/delegation stack, all running in one Bare process. `@qvac/sdk` builds on top of it to reach Node, Electron, Expo, and Pear by launching this engine as a worker; on Bare you use it directly.
14
+ `@qvac/inference` is the pure-Bare layer of the SDK, written in TypeScript: the client API, the request engine, and the plugin system, all running in one Bare process. `@qvac/sdk` builds on top of it to reach Node, Electron, Expo, and Pear by launching this engine as a worker; on Bare you use it directly. It replaces the deprecated `@qvac/bare-sdk` package (last release 0.18.2).
15
15
 
16
16
  `@qvac/inference` ships no plugins by default and no addon dependencies. You install only the addon packages your app registers, so the resulting binary scales with the engines you actually assemble.
17
17
 
@@ -129,10 +129,6 @@ const myPlugin = definePlugin({
129
129
  registerPlugin(myPlugin)
130
130
  ```
131
131
 
132
- ## Delegation (P2P)
133
-
134
- `@qvac/inference` includes the QVAC provider and delegation stack: start a provider with `startQVACProvider()` and run models on a remote peer by passing `delegate: { providerPublicKey }` to `loadModel`. Delegation talks peer-to-peer over Hyperswarm — it is independent of the in-process engine.
135
-
136
132
  ## License
137
133
 
138
134
  Apache-2.0
@@ -0,0 +1,16 @@
1
+ import { type AssessModelFitInput, type AssessModelFitResult } from '../schemas/index.js';
2
+ /**
3
+ * Assesses, before anything is downloaded, whether the given models are likely
4
+ * to fit in this device's memory.
5
+ *
6
+ * Advisory only: it does not download weights, run a native fit probe, block
7
+ * `loadModel`, reserve memory, or make a performance claim. `unknown` is a real
8
+ * answer — it means the available evidence does not support a verdict either
9
+ * way, and callers should treat it as "cannot say", not "no".
10
+ *
11
+ * @param input - Candidates with their intended workloads, the declared
12
+ * execution mode, and the headroom policy.
13
+ * @returns Per-model and combined verdicts, with the budget and bounds they came
14
+ * from, plus every assumption that was made.
15
+ */
16
+ export declare function assessModelFit(input: AssessModelFitInput): Promise<AssessModelFitResult>;
@@ -0,0 +1,27 @@
1
+ import { assessModelFitInputSchema } from '../schemas/index.js';
2
+ import { send } from '../dispatch.js';
3
+ import { InvalidResponseError } from '../errors/index.js';
4
+ /**
5
+ * Assesses, before anything is downloaded, whether the given models are likely
6
+ * to fit in this device's memory.
7
+ *
8
+ * Advisory only: it does not download weights, run a native fit probe, block
9
+ * `loadModel`, reserve memory, or make a performance claim. `unknown` is a real
10
+ * answer — it means the available evidence does not support a verdict either
11
+ * way, and callers should treat it as "cannot say", not "no".
12
+ *
13
+ * @param input - Candidates with their intended workloads, the declared
14
+ * execution mode, and the headroom policy.
15
+ * @returns Per-model and combined verdicts, with the budget and bounds they came
16
+ * from, plus every assumption that was made.
17
+ */
18
+ export async function assessModelFit(input) {
19
+ const parsed = assessModelFitInputSchema.parse(input);
20
+ const request = { type: 'assessModelFit', ...parsed };
21
+ const response = await send(request);
22
+ if (response.type !== 'assessModelFit') {
23
+ throw new InvalidResponseError('assessModelFit');
24
+ }
25
+ const { type: _type, ...result } = response;
26
+ return result;
27
+ }
@@ -1,16 +1,16 @@
1
1
  import { type AudioGenClientParams, type AudioGenResult } from '../schemas/index.js';
2
2
  /**
3
- * Generates audio (music / speech) from a caption using a loaded AudioGen
4
- * (ACE-Step) model.
3
+ * Generates audio (music / speech) from a caption using a loaded ACE-Step or
4
+ * MiniMax-Music3 AudioGen model.
5
5
  *
6
6
  * @param params - AudioGen request parameters (model, caption, optional lyrics, seed, bpm, etc.).
7
- * @returns A result object exposing `requestId`, `progressStream` (async iterator of `{ stage, step, total }`), `audio` (promise of the generated PCM and its format), and `stats` (promise of generation statistics).
7
+ * @returns A result object exposing `requestId`, `progressStream` (async iterator of `{ stage, step, total }`), `audio` (promise of the generated PCM and its format), `stats` (promise of generation statistics), and `diagnostics` (promise of the backend selection detail for the run).
8
8
  *
9
9
  * @example
10
10
  * ```typescript
11
11
  * const { progressStream, audio } = audioGen({ modelId, caption: "lo-fi hip hop, mellow piano" });
12
12
  * for await (const { stage, step, total } of progressStream) {
13
- * console.log(`${stage} ${step}/${total}`);
13
+ * console.log(total > 0 ? `${stage} ${step}/${total}` : `${stage} ${step} (indeterminate)`);
14
14
  * }
15
15
  * const { pcm, sampleRate, channels, bitsPerSample } = await audio;
16
16
  * ```
@@ -1,6 +1,6 @@
1
1
  import { audioGenClientParamsSchema, audioGenStreamResponseSchema } from '../schemas/index.js';
2
2
  import { stream } from '../dispatch.js';
3
- import { parseClientInput } from '../api/parse-input.js';
3
+ import { parseClientInput } from './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';
@@ -15,17 +15,17 @@ function concatenateChunks(chunks) {
15
15
  return pcm;
16
16
  }
17
17
  /**
18
- * Generates audio (music / speech) from a caption using a loaded AudioGen
19
- * (ACE-Step) model.
18
+ * Generates audio (music / speech) from a caption using a loaded ACE-Step or
19
+ * MiniMax-Music3 AudioGen model.
20
20
  *
21
21
  * @param params - AudioGen request parameters (model, caption, optional lyrics, seed, bpm, etc.).
22
- * @returns A result object exposing `requestId`, `progressStream` (async iterator of `{ stage, step, total }`), `audio` (promise of the generated PCM and its format), and `stats` (promise of generation statistics).
22
+ * @returns A result object exposing `requestId`, `progressStream` (async iterator of `{ stage, step, total }`), `audio` (promise of the generated PCM and its format), `stats` (promise of generation statistics), and `diagnostics` (promise of the backend selection detail for the run).
23
23
  *
24
24
  * @example
25
25
  * ```typescript
26
26
  * const { progressStream, audio } = audioGen({ modelId, caption: "lo-fi hip hop, mellow piano" });
27
27
  * for await (const { stage, step, total } of progressStream) {
28
- * console.log(`${stage} ${step}/${total}`);
28
+ * console.log(total > 0 ? `${stage} ${step}/${total}` : `${stage} ${step} (indeterminate)`);
29
29
  * }
30
30
  * const { pcm, sampleRate, channels, bitsPerSample } = await audio;
31
31
  * ```
@@ -60,6 +60,13 @@ export function audioGen(params) {
60
60
  rejectStats = reject;
61
61
  });
62
62
  stats.catch(() => { });
63
+ let resolveDiagnostics = () => { };
64
+ let rejectDiagnostics = () => { };
65
+ const diagnostics = new Promise((resolve, reject) => {
66
+ resolveDiagnostics = resolve;
67
+ rejectDiagnostics = reject;
68
+ });
69
+ diagnostics.catch(() => { });
63
70
  function notifyProgress() {
64
71
  progressResolve?.();
65
72
  progressResolve = undefined;
@@ -91,6 +98,7 @@ export function audioGen(params) {
91
98
  const error = new InferenceCancelledError(requestId);
92
99
  rejectAudio(error);
93
100
  rejectStats(error);
101
+ rejectDiagnostics(error);
94
102
  break;
95
103
  }
96
104
  if (sampleRate === undefined || channels === undefined || bitsPerSample === undefined) {
@@ -103,6 +111,7 @@ export function audioGen(params) {
103
111
  bitsPerSample
104
112
  });
105
113
  resolveStats(chunk.stats);
114
+ resolveDiagnostics(chunk.diagnostics);
106
115
  break;
107
116
  }
108
117
  }
@@ -115,6 +124,7 @@ export function audioGen(params) {
115
124
  error instanceof Error ? error : new InvalidResponseError('audioGenStream', error);
116
125
  rejectAudio(progressError);
117
126
  rejectStats(progressError);
127
+ rejectDiagnostics(progressError);
118
128
  }
119
129
  finally {
120
130
  progressDone = true;
@@ -143,6 +153,7 @@ export function audioGen(params) {
143
153
  requestId,
144
154
  progressStream: progressStream(),
145
155
  audio,
146
- stats
156
+ stats,
157
+ diagnostics
147
158
  };
148
159
  }
@@ -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), `"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 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.
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)
@@ -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), `"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 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.
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)
@@ -2,7 +2,8 @@
2
2
  * Deletes KV cache files.
3
3
  *
4
4
  * @param params - The delete cache parameters
5
- * @param params.all - If true, deletes all cache files
5
+ * @param params.all - If true, deletes all cache files, including caller-owned named caches
6
+ * @param params.auto - If true, reclaims only automatic caches (`completion({ kvCache: true })`) that no request is using. Named caches are untouched. Covers the whole cache directory, which is shared by every QVAC process using the same home directory
6
7
  * @param params.kvCacheKey - The cache key to delete
7
8
  * @param params.modelId - Optional: specific model ID to delete within the cache key. If not provided, deletes entire cache key.
8
9
  * @returns Promise resolving to success status
@@ -12,6 +13,9 @@
12
13
  * // Delete all caches
13
14
  * await deleteCache({ all: true });
14
15
  *
16
+ * // Reclaim disk from automatic caches, leaving named caches alone
17
+ * await deleteCache({ auto: true });
18
+ *
15
19
  * // Delete entire cache key (all models)
16
20
  * await deleteCache({ kvCacheKey: "my-session" });
17
21
  *
@@ -21,6 +25,8 @@
21
25
  */
22
26
  export declare function deleteCache(params: {
23
27
  all: true;
28
+ } | {
29
+ auto: true;
24
30
  } | {
25
31
  kvCacheKey: string;
26
32
  modelId?: string;
@@ -4,7 +4,8 @@ import { InvalidDeleteCacheParamsError, DeleteCacheFailedError } from '../errors
4
4
  * Deletes KV cache files.
5
5
  *
6
6
  * @param params - The delete cache parameters
7
- * @param params.all - If true, deletes all cache files
7
+ * @param params.all - If true, deletes all cache files, including caller-owned named caches
8
+ * @param params.auto - If true, reclaims only automatic caches (`completion({ kvCache: true })`) that no request is using. Named caches are untouched. Covers the whole cache directory, which is shared by every QVAC process using the same home directory
8
9
  * @param params.kvCacheKey - The cache key to delete
9
10
  * @param params.modelId - Optional: specific model ID to delete within the cache key. If not provided, deletes entire cache key.
10
11
  * @returns Promise resolving to success status
@@ -14,6 +15,9 @@ import { InvalidDeleteCacheParamsError, DeleteCacheFailedError } from '../errors
14
15
  * // Delete all caches
15
16
  * await deleteCache({ all: true });
16
17
  *
18
+ * // Reclaim disk from automatic caches, leaving named caches alone
19
+ * await deleteCache({ auto: true });
20
+ *
17
21
  * // Delete entire cache key (all models)
18
22
  * await deleteCache({ kvCacheKey: "my-session" });
19
23
  *
@@ -29,6 +33,12 @@ export async function deleteCache(params) {
29
33
  all: true
30
34
  };
31
35
  }
36
+ else if ('auto' in params && params.auto) {
37
+ req = {
38
+ type: 'deleteCache',
39
+ auto: true
40
+ };
41
+ }
32
42
  else if ('kvCacheKey' in params) {
33
43
  req = {
34
44
  type: 'deleteCache',
@@ -4,7 +4,7 @@ export type DownloadAssetOptions = BaseDownloadAssetOptions;
4
4
  * Downloads an asset (model file) without loading it into memory.
5
5
  *
6
6
  * This function is specifically designed for download-only operations and
7
- * doesn't accept runtime configuration options like modelConfig or delegate.
7
+ * doesn't accept runtime configuration options like modelConfig.
8
8
  * Use this for download-only operations instead of loadModel for better semantic clarity.
9
9
  *
10
10
  * @param options - Download configuration including:
@@ -2,13 +2,13 @@ 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 '../api/parse-input.js';
5
+ import { parseClientInput } from './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.
9
9
  *
10
10
  * This function is specifically designed for download-only operations and
11
- * doesn't accept runtime configuration options like modelConfig or delegate.
11
+ * doesn't accept runtime configuration options like modelConfig.
12
12
  * Use this for download-only operations instead of loadModel for better semantic clarity.
13
13
  *
14
14
  * @param options - Download configuration including:
@@ -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 '../api/parse-input.js';
4
+ import { parseClientInput } from './parse-input.js';
5
5
  function isFinetuneReplyParams(params) {
6
6
  return (params.operation === 'pause' || params.operation === 'cancel' || params.operation === 'getState');
7
7
  }
@@ -1,23 +1,19 @@
1
1
  import { type GetLoadedModelInfoParams, type LoadedModelInfo } from '../schemas/index.js';
2
2
  import { type RPCOptions } from '../schemas/common.js';
3
3
  /**
4
- * Returns introspection info for a loaded `modelId` (local or delegated).
4
+ * Returns introspection info for a loaded `modelId`.
5
5
  *
6
- * For local models, `info.modelType` and `info.handlers` are authoritative.
7
- * Use them to preflight a call before making the actual request, e.g.
8
- * confirm that a model supports `transcribeStream` before calling `transcribe()`.
9
- *
10
- * For delegated models, only `modelId`, `isDelegated: true`, `providerInfo`,
11
- * and `handlers: []` are populated. Preflight against a delegated model is
12
- * best-effort and falls through to the provider's error response.
6
+ * `info.modelType` and `info.handlers` are authoritative. Use them to preflight
7
+ * a call before making the actual request, e.g. confirm that a model supports
8
+ * `transcribeStream` before calling `transcribe()`.
13
9
  *
14
10
  * Throws `ModelNotFoundError` if no entry exists for `modelId`.
15
11
  *
16
12
  * @example
17
13
  * ```typescript
18
14
  * const info = await getLoadedModelInfo({ modelId });
19
- * if (info.isDelegated || info.handlers.includes("completionStream")) {
20
- * // safe to call completion(); delegated path defers to provider
15
+ * if (info.handlers.includes("completionStream")) {
16
+ * // safe to call completion()
21
17
  * }
22
18
  * ```
23
19
  */
@@ -1,23 +1,19 @@
1
1
  import { send } from '../dispatch.js';
2
2
  import { InvalidResponseError } from '../errors/index.js';
3
3
  /**
4
- * Returns introspection info for a loaded `modelId` (local or delegated).
4
+ * Returns introspection info for a loaded `modelId`.
5
5
  *
6
- * For local models, `info.modelType` and `info.handlers` are authoritative.
7
- * Use them to preflight a call before making the actual request, e.g.
8
- * confirm that a model supports `transcribeStream` before calling `transcribe()`.
9
- *
10
- * For delegated models, only `modelId`, `isDelegated: true`, `providerInfo`,
11
- * and `handlers: []` are populated. Preflight against a delegated model is
12
- * best-effort and falls through to the provider's error response.
6
+ * `info.modelType` and `info.handlers` are authoritative. Use them to preflight
7
+ * a call before making the actual request, e.g. confirm that a model supports
8
+ * `transcribeStream` before calling `transcribe()`.
13
9
  *
14
10
  * Throws `ModelNotFoundError` if no entry exists for `modelId`.
15
11
  *
16
12
  * @example
17
13
  * ```typescript
18
14
  * const info = await getLoadedModelInfo({ modelId });
19
- * if (info.isDelegated || info.handlers.includes("completionStream")) {
20
- * // safe to call completion(); delegated path defers to provider
15
+ * if (info.handlers.includes("completionStream")) {
16
+ * // safe to call completion()
21
17
  * }
22
18
  * ```
23
19
  */