@qvac/sdk 0.14.1 → 0.15.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 (796) hide show
  1. package/NOTICE +27 -11
  2. package/README.md +34 -35
  3. package/dist/client/api/batch-completion.d.ts +15 -0
  4. package/dist/client/api/batch-completion.js +332 -0
  5. package/dist/client/api/bci-transcribe.d.ts +1 -1
  6. package/dist/client/api/bci-transcribe.js +31 -31
  7. package/dist/client/api/cancel.d.ts +1 -1
  8. package/dist/client/api/cancel.js +18 -18
  9. package/dist/client/api/classify.d.ts +1 -1
  10. package/dist/client/api/classify.js +9 -6
  11. package/dist/client/api/client-request-id.js +1 -1
  12. package/dist/client/api/completion-stream.d.ts +3 -3
  13. package/dist/client/api/completion-stream.js +18 -18
  14. package/dist/client/api/delete-cache.js +9 -9
  15. package/dist/client/api/diffusion.d.ts +1 -1
  16. package/dist/client/api/diffusion.js +17 -11
  17. package/dist/client/api/download-asset.d.ts +1 -1
  18. package/dist/client/api/download-asset.js +11 -11
  19. package/dist/client/api/embed.d.ts +1 -1
  20. package/dist/client/api/embed.js +10 -10
  21. package/dist/client/api/finetune.d.ts +1 -1
  22. package/dist/client/api/finetune.js +25 -27
  23. package/dist/client/api/get-loaded-model-info.d.ts +2 -2
  24. package/dist/client/api/get-loaded-model-info.js +8 -8
  25. package/dist/client/api/get-model-info.d.ts +1 -1
  26. package/dist/client/api/get-model-info.js +7 -7
  27. package/dist/client/api/heartbeat.d.ts +2 -2
  28. package/dist/client/api/heartbeat.js +7 -7
  29. package/dist/client/api/index.d.ts +33 -32
  30. package/dist/client/api/index.js +33 -32
  31. package/dist/client/api/invoke-plugin.d.ts +1 -1
  32. package/dist/client/api/invoke-plugin.js +10 -10
  33. package/dist/client/api/load-model.d.ts +1 -1
  34. package/dist/client/api/load-model.js +32 -32
  35. package/dist/client/api/logging-stream.d.ts +1 -1
  36. package/dist/client/api/logging-stream.js +6 -6
  37. package/dist/client/api/ocr.d.ts +1 -1
  38. package/dist/client/api/ocr.js +11 -11
  39. package/dist/client/api/provide.d.ts +1 -1
  40. package/dist/client/api/provide.js +7 -7
  41. package/dist/client/api/rag.d.ts +1 -1
  42. package/dist/client/api/rag.js +65 -66
  43. package/dist/client/api/registry.d.ts +1 -1
  44. package/dist/client/api/registry.js +8 -8
  45. package/dist/client/api/resume.js +5 -5
  46. package/dist/client/api/state.d.ts +1 -1
  47. package/dist/client/api/state.js +5 -5
  48. package/dist/client/api/stop-provider.js +6 -6
  49. package/dist/client/api/subscribe-logs.d.ts +1 -1
  50. package/dist/client/api/subscribe-logs.js +3 -3
  51. package/dist/client/api/suspend.js +5 -5
  52. package/dist/client/api/text-to-speech.d.ts +1 -1
  53. package/dist/client/api/text-to-speech.js +37 -39
  54. package/dist/client/api/transcribe.d.ts +2 -2
  55. package/dist/client/api/transcribe.js +44 -45
  56. package/dist/client/api/translate.d.ts +1 -1
  57. package/dist/client/api/translate.js +14 -14
  58. package/dist/client/api/unload-model.d.ts +1 -1
  59. package/dist/client/api/unload-model.js +11 -11
  60. package/dist/client/api/upscale.d.ts +1 -1
  61. package/dist/client/api/upscale.js +9 -9
  62. package/dist/client/api/video.d.ts +1 -1
  63. package/dist/client/api/video.js +16 -14
  64. package/dist/client/api/vla-helpers.d.ts +2 -2
  65. package/dist/client/api/vla-helpers.js +6 -11
  66. package/dist/client/api/vla.d.ts +1 -1
  67. package/dist/client/api/vla.js +13 -13
  68. package/dist/client/config-loader/config-utils.d.ts +1 -1
  69. package/dist/client/config-loader/config-utils.js +3 -3
  70. package/dist/client/config-loader/resolve-config.bare.d.ts +1 -1
  71. package/dist/client/config-loader/resolve-config.bare.js +11 -11
  72. package/dist/client/config-loader/resolve-config.expo.d.ts +1 -1
  73. package/dist/client/config-loader/resolve-config.expo.js +6 -6
  74. package/dist/client/config-loader/resolve-config.node.d.ts +1 -1
  75. package/dist/client/config-loader/resolve-config.node.js +27 -27
  76. package/dist/client/index.d.ts +1 -1
  77. package/dist/client/index.js +1 -1
  78. package/dist/client/init-hooks.d.ts +1 -1
  79. package/dist/client/init-hooks.js +12 -12
  80. package/dist/client/logging-stream-registry.d.ts +1 -1
  81. package/dist/client/logging-stream-registry.js +6 -6
  82. package/dist/client/parse-input.d.ts +1 -1
  83. package/dist/client/parse-input.js +3 -3
  84. package/dist/client/plugins-factory.d.ts +2 -2
  85. package/dist/client/plugins-factory.js +2 -2
  86. package/dist/client/rpc/bare-client.d.ts +2 -1
  87. package/dist/client/rpc/bare-client.js +37 -39
  88. package/dist/client/rpc/ensure-worker-ready.js +4 -4
  89. package/dist/client/rpc/expo-device-info.d.ts +1 -1
  90. package/dist/client/rpc/expo-device-info.js +11 -11
  91. package/dist/client/rpc/expo-rpc-client.d.ts +2 -1
  92. package/dist/client/rpc/expo-rpc-client.js +38 -47
  93. package/dist/client/rpc/node-rpc-client.d.ts +2 -1
  94. package/dist/client/rpc/node-rpc-client.js +103 -75
  95. package/dist/client/rpc/profiling/index.d.ts +1 -1
  96. package/dist/client/rpc/profiling/index.js +1 -1
  97. package/dist/client/rpc/profiling/profiler.d.ts +2 -2
  98. package/dist/client/rpc/profiling/profiler.js +31 -34
  99. package/dist/client/rpc/rpc-client.d.ts +2 -2
  100. package/dist/client/rpc/rpc-client.js +113 -72
  101. package/dist/client/rpc/rpc-error.d.ts +1 -1
  102. package/dist/client/rpc/rpc-error.js +14 -14
  103. package/dist/commands/bundle/bare-pack.d.ts +1 -1
  104. package/dist/commands/bundle/bare-pack.js +20 -20
  105. package/dist/commands/bundle/constants.js +21 -21
  106. package/dist/commands/bundle/entry-gen.js +4 -4
  107. package/dist/commands/bundle/index.js +45 -47
  108. package/dist/commands/bundle/manifest.d.ts +1 -1
  109. package/dist/commands/bundle/manifest.js +44 -46
  110. package/dist/commands/bundle/plugins.d.ts +2 -2
  111. package/dist/commands/bundle/plugins.js +7 -7
  112. package/dist/commands/bundle/resolve-sdk-import.js +6 -13
  113. package/dist/commands/index.d.ts +4 -4
  114. package/dist/commands/index.js +2 -2
  115. package/dist/commands/verify/abi.d.ts +9 -9
  116. package/dist/commands/verify/abi.js +31 -31
  117. package/dist/commands/verify/addon-source.d.ts +1 -1
  118. package/dist/commands/verify/addon-source.js +13 -14
  119. package/dist/commands/verify/bundle-source.d.ts +1 -1
  120. package/dist/commands/verify/bundle-source.js +7 -7
  121. package/dist/commands/verify/index.d.ts +3 -3
  122. package/dist/commands/verify/index.js +18 -17
  123. package/dist/commands/verify/node-modules-source.d.ts +1 -1
  124. package/dist/commands/verify/node-modules-source.js +11 -11
  125. package/dist/commands/verify/prebuilds.d.ts +3 -3
  126. package/dist/commands/verify/prebuilds.js +8 -8
  127. package/dist/constants/audio.d.ts +1 -1
  128. package/dist/constants/audio.js +1 -1
  129. package/dist/constants/index.d.ts +2 -2
  130. package/dist/constants/index.js +2 -2
  131. package/dist/constants/registry.js +1 -1
  132. package/dist/examples/audio/mic-input.d.ts +1 -1
  133. package/dist/examples/audio/mic-input.js +31 -31
  134. package/dist/examples/batch-completion.d.ts +38 -0
  135. package/dist/examples/batch-completion.js +100 -0
  136. package/dist/examples/bci/bci-filesystem-streaming.js +20 -20
  137. package/dist/examples/bci/bci-filesystem.js +17 -17
  138. package/dist/examples/cache-management.js +32 -32
  139. package/dist/examples/cancel-by-request-id.js +11 -11
  140. package/dist/examples/classification/classify-image.js +5 -5
  141. package/dist/examples/completion-events.js +16 -18
  142. package/dist/examples/completion-stop-reason.js +13 -13
  143. package/dist/examples/concurrent-completion-collision.js +20 -20
  144. package/dist/examples/config/blind-relay/blind-relay.config.js +4 -4
  145. package/dist/examples/config/default/default.config.js +2 -2
  146. package/dist/examples/config/plugins/plugins.config.js +2 -2
  147. package/dist/examples/config-reload.js +14 -14
  148. package/dist/examples/default-config-usage.js +10 -13
  149. package/dist/examples/delegated-inference/composite.js +23 -23
  150. package/dist/examples/delegated-inference/consumer-profiled.js +19 -19
  151. package/dist/examples/delegated-inference/consumer.js +11 -11
  152. package/dist/examples/delegated-inference/provider.js +24 -24
  153. package/dist/examples/diffusion-esrgan-upscale.js +19 -19
  154. package/dist/examples/diffusion-flux2-klein-img2img.js +17 -17
  155. package/dist/examples/diffusion-flux2-klein.js +14 -14
  156. package/dist/examples/diffusion-img2img.js +13 -13
  157. package/dist/examples/diffusion-img2vid.js +22 -23
  158. package/dist/examples/diffusion-simple.js +7 -7
  159. package/dist/examples/diffusion-txt2img.js +13 -14
  160. package/dist/examples/diffusion-txt2vid.js +18 -18
  161. package/dist/examples/download-with-blind-relays.js +7 -8
  162. package/dist/examples/download-with-cancel.js +9 -9
  163. package/dist/examples/embed-multi-gpu.js +9 -9
  164. package/dist/examples/embed-p2p.js +24 -24
  165. package/dist/examples/finetune/llamacpp-finetune.js +21 -21
  166. package/dist/examples/kv-cache-cleanup.js +34 -34
  167. package/dist/examples/kv-cache-custom-key.js +30 -30
  168. package/dist/examples/kv-cache-example.js +18 -20
  169. package/dist/examples/llamacpp-cache.js +33 -33
  170. package/dist/examples/llamacpp-dynamic-tools.js +38 -38
  171. package/dist/examples/llamacpp-filesystem.js +13 -15
  172. package/dist/examples/llamacpp-http.js +12 -14
  173. package/dist/examples/llamacpp-multi-gpu.js +12 -12
  174. package/dist/examples/llamacpp-multimodal.js +16 -16
  175. package/dist/examples/llamacpp-p2p.js +11 -11
  176. package/dist/examples/llamacpp-sharded.js +12 -12
  177. package/dist/examples/llamacpp-structured-output.js +37 -37
  178. package/dist/examples/logging-file-transport.js +19 -21
  179. package/dist/examples/logging-global.js +8 -8
  180. package/dist/examples/logging-streaming.js +16 -18
  181. package/dist/examples/mcp-websearch.js +44 -44
  182. package/dist/examples/multi-model-demo.js +33 -33
  183. package/dist/examples/ocr-fasttext.js +17 -17
  184. package/dist/examples/parallel-download.js +11 -13
  185. package/dist/examples/plugins.js +43 -43
  186. package/dist/examples/profiling/basic.js +34 -36
  187. package/dist/examples/profiling/per-call.js +16 -16
  188. package/dist/examples/quickstart.bare.js +4 -6
  189. package/dist/examples/quickstart.js +7 -7
  190. package/dist/examples/rag/rag-chromadb.js +26 -26
  191. package/dist/examples/rag/rag-hyperdb/cancellation.js +19 -20
  192. package/dist/examples/rag/rag-hyperdb/ingest.js +19 -19
  193. package/dist/examples/rag/rag-hyperdb/pipeline.js +26 -26
  194. package/dist/examples/rag/rag-hyperdb/workspaces.js +46 -46
  195. package/dist/examples/rag/rag-lancedb.js +29 -32
  196. package/dist/examples/rag/rag-sqlite.js +25 -25
  197. package/dist/examples/registry-query.js +15 -15
  198. package/dist/examples/seed-p2p.js +8 -8
  199. package/dist/examples/suspend-resume.js +20 -20
  200. package/dist/examples/tools/llamacpp-native-tools.js +25 -25
  201. package/dist/examples/tools/llamacpp-tools-gemma4.js +14 -14
  202. package/dist/examples/tools/llamacpp-tools-harmony-multiturn.js +15 -15
  203. package/dist/examples/tools/llamacpp-tools-pythonic.js +15 -15
  204. package/dist/examples/tools/llamacpp-tools-qwen35.js +14 -14
  205. package/dist/examples/tools/shared.d.ts +2 -2
  206. package/dist/examples/tools/shared.js +17 -17
  207. package/dist/examples/transcription/parakeet-ctc-filesystem.js +12 -12
  208. package/dist/examples/transcription/parakeet-microphone-record.js +19 -19
  209. package/dist/examples/transcription/parakeet-microphone-stream.js +23 -23
  210. package/dist/examples/transcription/parakeet-sortformer-streaming.js +18 -28
  211. package/dist/examples/transcription/parakeet-sortformer.js +21 -21
  212. package/dist/examples/transcription/parakeet-tdt-filesystem.js +13 -13
  213. package/dist/examples/transcription/whispercpp-filesystem-streaming.js +34 -34
  214. package/dist/examples/transcription/whispercpp-filesystem.js +19 -19
  215. package/dist/examples/transcription/whispercpp-microphone-conversation.js +27 -27
  216. package/dist/examples/transcription/whispercpp-microphone-record.js +21 -21
  217. package/dist/examples/transcription/whispercpp-prompt.js +18 -18
  218. package/dist/examples/translation/translation-bergamot-batch.js +17 -17
  219. package/dist/examples/translation/translation-bergamot-pivot.js +16 -16
  220. package/dist/examples/translation/translation-bergamot.js +11 -11
  221. package/dist/examples/translation/translation-indic.js +10 -10
  222. package/dist/examples/translation/translation-llm-afriquegemma.js +10 -10
  223. package/dist/examples/translation/translation-llm-context.js +10 -10
  224. package/dist/examples/translation/translation-llm.js +13 -13
  225. package/dist/examples/translation/translation-stream.js +11 -11
  226. package/dist/examples/tts/chatterbox-enhanced.d.ts +2 -0
  227. package/dist/examples/tts/chatterbox-enhanced.js +55 -0
  228. package/dist/examples/tts/chatterbox-multilingual.d.ts +2 -0
  229. package/dist/examples/tts/chatterbox-multilingual.js +54 -0
  230. package/dist/examples/tts/chatterbox.js +18 -18
  231. package/dist/examples/tts/llm-to-tts-streaming.js +30 -30
  232. package/dist/examples/tts/supertonic-enhanced.d.ts +2 -0
  233. package/dist/examples/tts/supertonic-enhanced.js +57 -0
  234. package/dist/examples/tts/supertonic-multilingual.js +19 -19
  235. package/dist/examples/tts/supertonic.js +18 -18
  236. package/dist/examples/tts/utils.js +24 -32
  237. package/dist/examples/vla-pi05.js +14 -14
  238. package/dist/examples/vla-smolvla.js +14 -14
  239. package/dist/examples/voice-assistant/voice-assistant.js +46 -46
  240. package/dist/expo/plugins/find-in-ancestor-node-modules.js +3 -3
  241. package/dist/expo/plugins/get-project-root.d.ts +2 -2
  242. package/dist/expo/plugins/get-project-root.js +1 -1
  243. package/dist/expo/plugins/index.d.ts +11 -11
  244. package/dist/expo/plugins/index.js +10 -10
  245. package/dist/expo/plugins/resolve-sdk-package-dir.js +7 -11
  246. package/dist/expo/plugins/withAndroidArchitecture.d.ts +1 -1
  247. package/dist/expo/plugins/withAndroidArchitecture.js +12 -12
  248. package/dist/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
  249. package/dist/expo/plugins/withAndroidNdkVersion.js +9 -9
  250. package/dist/expo/plugins/withDeviceInfo.d.ts +1 -1
  251. package/dist/expo/plugins/withDeviceInfo.js +13 -13
  252. package/dist/expo/plugins/withMobileBundle.d.ts +1 -1
  253. package/dist/expo/plugins/withMobileBundle.js +34 -42
  254. package/dist/expo/plugins/withOpenCL.d.ts +1 -1
  255. package/dist/expo/plugins/withOpenCL.js +14 -16
  256. package/dist/expo/plugins/withQvacSDK.d.ts +1 -1
  257. package/dist/expo/plugins/withQvacSDK.js +12 -12
  258. package/dist/index.d.ts +16 -16
  259. package/dist/index.js +16 -17
  260. package/dist/logging/addon.d.ts +1 -1
  261. package/dist/logging/addon.js +13 -13
  262. package/dist/logging/base-logger.d.ts +2 -2
  263. package/dist/logging/base-logger.js +6 -6
  264. package/dist/logging/client-logger.d.ts +1 -1
  265. package/dist/logging/client-logger.js +3 -3
  266. package/dist/logging/index.d.ts +9 -9
  267. package/dist/logging/index.js +8 -8
  268. package/dist/logging/logger.d.ts +1 -1
  269. package/dist/logging/logger.js +4 -4
  270. package/dist/logging/namespaces.d.ts +1 -1
  271. package/dist/logging/namespaces.js +5 -5
  272. package/dist/logging/registry.d.ts +2 -2
  273. package/dist/logging/registry.js +3 -3
  274. package/dist/logging/server-logger.d.ts +1 -1
  275. package/dist/logging/server-logger.js +2 -2
  276. package/dist/logging/stream-logger.d.ts +1 -1
  277. package/dist/logging/stream-logger.js +4 -4
  278. package/dist/logging/transport.d.ts +1 -1
  279. package/dist/logging/types.d.ts +1 -1
  280. package/dist/logging/utils.d.ts +2 -2
  281. package/dist/logging/utils.js +40 -41
  282. package/dist/models/registry/index.d.ts +1 -1
  283. package/dist/models/registry/index.js +5 -5
  284. package/dist/models/registry/models.d.ts +429 -122
  285. package/dist/models/registry/models.js +13693 -13369
  286. package/dist/models/update-models/codegen.d.ts +1 -1
  287. package/dist/models/update-models/codegen.js +8 -8
  288. package/dist/models/update-models/companions.d.ts +6 -1
  289. package/dist/models/update-models/companions.js +104 -39
  290. package/dist/models/update-models/history.d.ts +1 -1
  291. package/dist/models/update-models/history.js +11 -11
  292. package/dist/models/update-models/index.js +32 -34
  293. package/dist/models/update-models/naming.d.ts +2 -2
  294. package/dist/models/update-models/naming.js +177 -186
  295. package/dist/models/update-models/processing.d.ts +2 -2
  296. package/dist/models/update-models/processing.js +17 -19
  297. package/dist/models/update-models/registry.d.ts +2 -2
  298. package/dist/models/update-models/registry.js +9 -9
  299. package/dist/models/update-models/shards.d.ts +1 -1
  300. package/dist/models/update-models/shards.js +3 -3
  301. package/dist/models/update-models/types.d.ts +1 -1
  302. package/dist/models/update-models/utils.js +5 -5
  303. package/dist/pear/pre.js +84 -84
  304. package/dist/profiling/aggregator.d.ts +1 -1
  305. package/dist/profiling/aggregator.js +6 -6
  306. package/dist/profiling/clock.d.ts +1 -1
  307. package/dist/profiling/clock.js +10 -10
  308. package/dist/profiling/controller.d.ts +2 -2
  309. package/dist/profiling/controller.js +11 -12
  310. package/dist/profiling/envelope.d.ts +1 -1
  311. package/dist/profiling/envelope.js +4 -6
  312. package/dist/profiling/events.d.ts +2 -2
  313. package/dist/profiling/events.js +8 -10
  314. package/dist/profiling/exporters.d.ts +1 -1
  315. package/dist/profiling/exporters.js +81 -79
  316. package/dist/profiling/index.d.ts +8 -8
  317. package/dist/profiling/index.js +7 -7
  318. package/dist/profiling/model-execution.js +2 -1
  319. package/dist/profiling/ring-buffer.js +2 -2
  320. package/dist/profiling/types.d.ts +3 -3
  321. package/dist/schemas/archive.d.ts +1 -1
  322. package/dist/schemas/archive.js +8 -14
  323. package/dist/schemas/batch-completion-stream.d.ts +463 -0
  324. package/dist/schemas/batch-completion-stream.js +124 -0
  325. package/dist/schemas/bci-config.d.ts +1 -1
  326. package/dist/schemas/bci-config.js +7 -7
  327. package/dist/schemas/bci.d.ts +3 -3
  328. package/dist/schemas/bci.js +25 -31
  329. package/dist/schemas/cancel.d.ts +6 -1
  330. package/dist/schemas/cancel.js +33 -34
  331. package/dist/schemas/classification.d.ts +1 -1
  332. package/dist/schemas/classification.js +7 -7
  333. package/dist/schemas/common.d.ts +194 -25
  334. package/dist/schemas/common.js +40 -37
  335. package/dist/schemas/completion-event.d.ts +11 -8
  336. package/dist/schemas/completion-event.js +27 -26
  337. package/dist/schemas/completion-stream.d.ts +4 -3
  338. package/dist/schemas/completion-stream.js +51 -67
  339. package/dist/schemas/delegate.d.ts +1 -1
  340. package/dist/schemas/delegate.js +7 -7
  341. package/dist/schemas/delete-cache.d.ts +1 -1
  342. package/dist/schemas/delete-cache.js +8 -8
  343. package/dist/schemas/download-asset.d.ts +2 -2
  344. package/dist/schemas/download-asset.js +21 -21
  345. package/dist/schemas/embed.d.ts +3 -3
  346. package/dist/schemas/embed.js +16 -27
  347. package/dist/schemas/engine-addon-map.d.ts +2 -2
  348. package/dist/schemas/engine-addon-map.js +24 -24
  349. package/dist/schemas/error.d.ts +1 -1
  350. package/dist/schemas/error.js +12 -13
  351. package/dist/schemas/finetune.d.ts +1 -1
  352. package/dist/schemas/finetune.js +35 -41
  353. package/dist/schemas/get-loaded-model-info.d.ts +1 -1
  354. package/dist/schemas/get-loaded-model-info.js +10 -10
  355. package/dist/schemas/get-model-info.d.ts +1 -1
  356. package/dist/schemas/get-model-info.js +48 -91
  357. package/dist/schemas/heartbeat.d.ts +1 -1
  358. package/dist/schemas/heartbeat.js +6 -6
  359. package/dist/schemas/index.d.ts +52 -51
  360. package/dist/schemas/index.js +52 -51
  361. package/dist/schemas/json-schema.d.ts +1 -1
  362. package/dist/schemas/llamacpp-config.d.ts +33 -25
  363. package/dist/schemas/llamacpp-config.js +43 -30
  364. package/dist/schemas/load-model.d.ts +160 -128
  365. package/dist/schemas/load-model.js +120 -126
  366. package/dist/schemas/logging-stream.d.ts +1 -1
  367. package/dist/schemas/logging-stream.js +6 -12
  368. package/dist/schemas/mcp-adapter.d.ts +1 -1
  369. package/dist/schemas/model-src-utils.d.ts +1 -1
  370. package/dist/schemas/model-src-utils.js +13 -13
  371. package/dist/schemas/model-types.d.ts +1 -1
  372. package/dist/schemas/model-types.js +27 -27
  373. package/dist/schemas/ocr.d.ts +1 -1
  374. package/dist/schemas/ocr.js +18 -18
  375. package/dist/schemas/path-validation.d.ts +1 -1
  376. package/dist/schemas/path-validation.js +4 -4
  377. package/dist/schemas/plugin.d.ts +9 -10
  378. package/dist/schemas/plugin.js +47 -47
  379. package/dist/schemas/profiling.d.ts +1 -1
  380. package/dist/schemas/profiling.js +16 -16
  381. package/dist/schemas/provide.d.ts +1 -1
  382. package/dist/schemas/provide.js +8 -8
  383. package/dist/schemas/rag.d.ts +3 -3
  384. package/dist/schemas/rag.js +65 -70
  385. package/dist/schemas/registry.d.ts +1 -1
  386. package/dist/schemas/registry.js +44 -66
  387. package/dist/schemas/reload-config.d.ts +1 -1
  388. package/dist/schemas/reload-config.js +14 -18
  389. package/dist/schemas/resume.d.ts +1 -1
  390. package/dist/schemas/resume.js +3 -3
  391. package/dist/schemas/runtime-context.d.ts +1 -1
  392. package/dist/schemas/runtime-context.js +4 -4
  393. package/dist/schemas/sdcpp-config.d.ts +9 -9
  394. package/dist/schemas/sdcpp-config.js +298 -300
  395. package/dist/schemas/sdk-config.d.ts +55 -43
  396. package/dist/schemas/sdk-config.js +25 -29
  397. package/dist/schemas/sdk-errors-client.d.ts +1 -1
  398. package/dist/schemas/sdk-errors-client.js +80 -80
  399. package/dist/schemas/sdk-errors-registry.js +1 -1
  400. package/dist/schemas/sdk-errors-server.d.ts +1 -1
  401. package/dist/schemas/sdk-errors-server.js +200 -199
  402. package/dist/schemas/shard.d.ts +1 -1
  403. package/dist/schemas/shard.js +4 -4
  404. package/dist/schemas/state.d.ts +1 -1
  405. package/dist/schemas/state.js +5 -10
  406. package/dist/schemas/stop-provide.d.ts +1 -1
  407. package/dist/schemas/stop-provide.js +4 -4
  408. package/dist/schemas/suspend.d.ts +1 -1
  409. package/dist/schemas/suspend.js +3 -3
  410. package/dist/schemas/text-to-speech.d.ts +455 -3
  411. package/dist/schemas/text-to-speech.js +146 -110
  412. package/dist/schemas/tools.d.ts +1 -1
  413. package/dist/schemas/tools.js +17 -24
  414. package/dist/schemas/transcription-config.d.ts +1 -1
  415. package/dist/schemas/transcription-config.js +18 -18
  416. package/dist/schemas/transcription.d.ts +5 -5
  417. package/dist/schemas/transcription.js +31 -33
  418. package/dist/schemas/translate.d.ts +3 -3
  419. package/dist/schemas/translate.js +38 -67
  420. package/dist/schemas/translation-config.d.ts +1 -1
  421. package/dist/schemas/translation-config.js +116 -123
  422. package/dist/schemas/unload-model.d.ts +1 -1
  423. package/dist/schemas/unload-model.js +6 -6
  424. package/dist/schemas/vla.d.ts +1 -1
  425. package/dist/schemas/vla.js +30 -30
  426. package/dist/scripts/run-security-tests.js +9 -10
  427. package/dist/scripts/run-unit-tests.js +11 -12
  428. package/dist/server/bare/delegate-connect-diagnostics.js +13 -19
  429. package/dist/server/bare/delegate-rpc-client.d.ts +2 -2
  430. package/dist/server/bare/delegate-rpc-client.js +32 -34
  431. package/dist/server/bare/hyperswarm.d.ts +3 -3
  432. package/dist/server/bare/hyperswarm.js +14 -14
  433. package/dist/server/bare/ops/bci-transcribe.d.ts +1 -1
  434. package/dist/server/bare/ops/bci-transcribe.js +44 -44
  435. package/dist/server/bare/ops/cancel.d.ts +2 -2
  436. package/dist/server/bare/ops/cancel.js +6 -6
  437. package/dist/server/bare/ops/embed.d.ts +1 -1
  438. package/dist/server/bare/ops/embed.js +26 -16
  439. package/dist/server/bare/ops/kv-cache-utils.d.ts +1 -1
  440. package/dist/server/bare/ops/kv-cache-utils.js +17 -19
  441. package/dist/server/bare/ops/load-model.d.ts +2 -2
  442. package/dist/server/bare/ops/load-model.js +14 -18
  443. package/dist/server/bare/ops/transcribe.d.ts +3 -3
  444. package/dist/server/bare/ops/transcribe.js +62 -62
  445. package/dist/server/bare/ops/translate.d.ts +1 -1
  446. package/dist/server/bare/ops/translate.js +39 -30
  447. package/dist/server/bare/ops/unload-model.d.ts +1 -1
  448. package/dist/server/bare/ops/unload-model.js +12 -12
  449. package/dist/server/bare/plugins/bci-whispercpp-transcription/args.d.ts +2 -2
  450. package/dist/server/bare/plugins/bci-whispercpp-transcription/args.js +3 -3
  451. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +2 -2
  452. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +33 -33
  453. package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.d.ts +1 -1
  454. package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.js +1 -1
  455. package/dist/server/bare/plugins/ggml-classification/ops/classify.d.ts +1 -1
  456. package/dist/server/bare/plugins/ggml-classification/ops/classify.js +8 -8
  457. package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +1 -1
  458. package/dist/server/bare/plugins/ggml-classification/plugin.js +14 -14
  459. package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.d.ts +1 -1
  460. package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.js +27 -26
  461. package/dist/server/bare/plugins/ggml-ocr/plugin.d.ts +1 -1
  462. package/dist/server/bare/plugins/ggml-ocr/plugin.js +38 -38
  463. package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.d.ts +1 -1
  464. package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.js +3 -3
  465. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.d.ts +1 -1
  466. package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +23 -23
  467. package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +1 -1
  468. package/dist/server/bare/plugins/ggml-vla/plugin.js +15 -15
  469. package/dist/server/bare/plugins/index.d.ts +11 -11
  470. package/dist/server/bare/plugins/index.js +11 -11
  471. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.d.ts +23 -0
  472. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.js +30 -0
  473. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.d.ts +32 -0
  474. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.js +99 -0
  475. package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.d.ts +1 -1
  476. package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +8 -8
  477. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +3 -2
  478. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +4 -1
  479. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +22 -4
  480. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +55 -59
  481. package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.js +5 -5
  482. package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.d.ts +2 -2
  483. package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +34 -34
  484. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +7 -7
  485. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +19 -23
  486. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +4 -6
  487. package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +186 -17
  488. package/dist/server/bare/plugins/llamacpp-completion/plugin.js +235 -70
  489. package/dist/server/bare/plugins/llamacpp-completion/transform.d.ts +1 -1
  490. package/dist/server/bare/plugins/llamacpp-completion/transform.js +15 -15
  491. package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +3 -3
  492. package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +27 -29
  493. package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +1 -1
  494. package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +38 -39
  495. package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.d.ts +1 -1
  496. package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.js +19 -22
  497. package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +1 -1
  498. package/dist/server/bare/plugins/parakeet-transcription/plugin.js +36 -36
  499. package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.d.ts +1 -1
  500. package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +15 -17
  501. package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.d.ts +1 -1
  502. package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.js +11 -11
  503. package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +1 -1
  504. package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +42 -44
  505. package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +4 -4
  506. package/dist/server/bare/plugins/sdcpp-generation/plugin.js +69 -63
  507. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.d.ts +2 -2
  508. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.js +19 -21
  509. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.d.ts +2 -2
  510. package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.js +22 -24
  511. package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +3 -2
  512. package/dist/server/bare/plugins/tts-ggml/plugin.js +95 -49
  513. package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +1 -1
  514. package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +52 -52
  515. package/dist/server/bare/rag-hyperdb/handlers/chunk.d.ts +1 -1
  516. package/dist/server/bare/rag-hyperdb/handlers/chunk.js +2 -2
  517. package/dist/server/bare/rag-hyperdb/handlers/close-workspace.d.ts +1 -1
  518. package/dist/server/bare/rag-hyperdb/handlers/close-workspace.js +2 -2
  519. package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.d.ts +1 -1
  520. package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.js +4 -4
  521. package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.d.ts +1 -1
  522. package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.js +3 -3
  523. package/dist/server/bare/rag-hyperdb/handlers/ingest.d.ts +2 -2
  524. package/dist/server/bare/rag-hyperdb/handlers/ingest.js +4 -4
  525. package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.d.ts +1 -1
  526. package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.js +1 -1
  527. package/dist/server/bare/rag-hyperdb/handlers/reindex.d.ts +2 -2
  528. package/dist/server/bare/rag-hyperdb/handlers/reindex.js +5 -5
  529. package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.d.ts +2 -2
  530. package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.js +3 -3
  531. package/dist/server/bare/rag-hyperdb/handlers/search.d.ts +1 -1
  532. package/dist/server/bare/rag-hyperdb/handlers/search.js +3 -3
  533. package/dist/server/bare/rag-hyperdb/index.d.ts +11 -11
  534. package/dist/server/bare/rag-hyperdb/index.js +11 -11
  535. package/dist/server/bare/rag-hyperdb/rag-operation-manager.js +3 -3
  536. package/dist/server/bare/rag-hyperdb/rag-workspace-manager.d.ts +1 -1
  537. package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +20 -20
  538. package/dist/server/bare/registry/config-registry.d.ts +1 -1
  539. package/dist/server/bare/registry/config-registry.js +13 -16
  540. package/dist/server/bare/registry/logging-stream-registry.d.ts +1 -1
  541. package/dist/server/bare/registry/logging-stream-registry.js +2 -2
  542. package/dist/server/bare/registry/model-config-registry.d.ts +2 -2
  543. package/dist/server/bare/registry/model-config-registry.js +6 -6
  544. package/dist/server/bare/registry/model-config-utils.d.ts +2 -2
  545. package/dist/server/bare/registry/model-config-utils.js +35 -35
  546. package/dist/server/bare/registry/model-registry.d.ts +3 -3
  547. package/dist/server/bare/registry/model-registry.js +11 -11
  548. package/dist/server/bare/registry/registry-client.d.ts +1 -1
  549. package/dist/server/bare/registry/registry-client.js +18 -18
  550. package/dist/server/bare/registry/runtime-context-registry.d.ts +1 -1
  551. package/dist/server/bare/registry/runtime-context-registry.js +3 -3
  552. package/dist/server/bare/runtime/disposable-scope.js +3 -3
  553. package/dist/server/bare/runtime/index.d.ts +7 -7
  554. package/dist/server/bare/runtime/index.js +3 -3
  555. package/dist/server/bare/runtime/request-context.d.ts +4 -4
  556. package/dist/server/bare/runtime/request-id.js +1 -1
  557. package/dist/server/bare/runtime/request-registry-singleton.d.ts +1 -1
  558. package/dist/server/bare/runtime/request-registry-singleton.js +23 -4
  559. package/dist/server/bare/runtime/request-registry.d.ts +27 -12
  560. package/dist/server/bare/runtime/request-registry.js +39 -34
  561. package/dist/server/bare/runtime/with-request-context.d.ts +1 -1
  562. package/dist/server/bare/runtime/with-request-context.js +11 -11
  563. package/dist/server/bare/runtime-lifecycle.d.ts +1 -1
  564. package/dist/server/bare/runtime-lifecycle.js +27 -31
  565. package/dist/server/bare/types/addon-responses.d.ts +5 -4
  566. package/dist/server/bare/utils/audio-input.d.ts +2 -2
  567. package/dist/server/bare/utils/audio-input.js +7 -7
  568. package/dist/server/bare/utils/transcribe-metadata.d.ts +1 -1
  569. package/dist/server/bare/utils/transcribe-metadata.js +4 -4
  570. package/dist/server/bare/utils/tts-stats.d.ts +1 -1
  571. package/dist/server/bare/utils/tts-stats.js +3 -3
  572. package/dist/server/env.js +8 -8
  573. package/dist/server/error-handlers.d.ts +3 -3
  574. package/dist/server/error-handlers.js +11 -11
  575. package/dist/server/plugins/index.d.ts +1 -1
  576. package/dist/server/plugins/index.js +1 -1
  577. package/dist/server/plugins/registry.d.ts +1 -1
  578. package/dist/server/plugins/registry.js +12 -14
  579. package/dist/server/rpc/create-server.d.ts +1 -1
  580. package/dist/server/rpc/create-server.js +11 -12
  581. package/dist/server/rpc/delegate-transport.d.ts +3 -3
  582. package/dist/server/rpc/delegate-transport.js +43 -44
  583. package/dist/server/rpc/handle-request.d.ts +1 -1
  584. package/dist/server/rpc/handle-request.js +28 -30
  585. package/dist/server/rpc/handler-registry.d.ts +1 -1
  586. package/dist/server/rpc/handler-registry.js +97 -92
  587. package/dist/server/rpc/handler-selection.d.ts +3 -3
  588. package/dist/server/rpc/handler-selection.js +3 -3
  589. package/dist/server/rpc/handler-utils.d.ts +7 -7
  590. package/dist/server/rpc/handler-utils.js +32 -35
  591. package/dist/server/rpc/handlers/batch-completion-stream.d.ts +78 -0
  592. package/dist/server/rpc/handlers/batch-completion-stream.js +4 -0
  593. package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +1 -1
  594. package/dist/server/rpc/handlers/bci-transcribe-stream.js +2 -2
  595. package/dist/server/rpc/handlers/bci-transcribe.d.ts +1 -1
  596. package/dist/server/rpc/handlers/bci-transcribe.js +2 -2
  597. package/dist/server/rpc/handlers/cancel-delegated.d.ts +2 -2
  598. package/dist/server/rpc/handlers/cancel-delegated.js +13 -13
  599. package/dist/server/rpc/handlers/cancelHandler.d.ts +1 -1
  600. package/dist/server/rpc/handlers/cancelHandler.js +11 -11
  601. package/dist/server/rpc/handlers/classify.d.ts +1 -1
  602. package/dist/server/rpc/handlers/classify.js +2 -2
  603. package/dist/server/rpc/handlers/completion-stream-delegated.d.ts +2 -2
  604. package/dist/server/rpc/handlers/completion-stream-delegated.js +14 -14
  605. package/dist/server/rpc/handlers/completion-stream.d.ts +1 -1
  606. package/dist/server/rpc/handlers/completion-stream.js +2 -2
  607. package/dist/server/rpc/handlers/delete-cache.d.ts +1 -1
  608. package/dist/server/rpc/handlers/delete-cache.js +10 -10
  609. package/dist/server/rpc/handlers/diffusion-stream.d.ts +1 -1
  610. package/dist/server/rpc/handlers/diffusion-stream.js +2 -2
  611. package/dist/server/rpc/handlers/download-asset.d.ts +1 -1
  612. package/dist/server/rpc/handlers/download-asset.js +20 -20
  613. package/dist/server/rpc/handlers/embed.d.ts +1 -1
  614. package/dist/server/rpc/handlers/embed.js +2 -2
  615. package/dist/server/rpc/handlers/finetune.d.ts +1 -1
  616. package/dist/server/rpc/handlers/finetune.js +8 -6
  617. package/dist/server/rpc/handlers/get-loaded-model-info.d.ts +1 -1
  618. package/dist/server/rpc/handlers/get-loaded-model-info.js +9 -9
  619. package/dist/server/rpc/handlers/get-model-info.d.ts +1 -1
  620. package/dist/server/rpc/handlers/get-model-info.js +20 -20
  621. package/dist/server/rpc/handlers/heartbeat-delegated.d.ts +2 -2
  622. package/dist/server/rpc/handlers/heartbeat-delegated.js +7 -7
  623. package/dist/server/rpc/handlers/heartbeat.d.ts +1 -1
  624. package/dist/server/rpc/handlers/heartbeat.js +1 -1
  625. package/dist/server/rpc/handlers/index.d.ts +33 -31
  626. package/dist/server/rpc/handlers/index.js +34 -32
  627. package/dist/server/rpc/handlers/load-model/download-manager.d.ts +4 -4
  628. package/dist/server/rpc/handlers/load-model/download-manager.js +19 -17
  629. package/dist/server/rpc/handlers/load-model/download-stats.d.ts +4 -3
  630. package/dist/server/rpc/handlers/load-model/download-stats.js +9 -11
  631. package/dist/server/rpc/handlers/load-model/handler.d.ts +1 -1
  632. package/dist/server/rpc/handlers/load-model/handler.js +42 -43
  633. package/dist/server/rpc/handlers/load-model/http.d.ts +2 -2
  634. package/dist/server/rpc/handlers/load-model/http.js +100 -107
  635. package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +2 -2
  636. package/dist/server/rpc/handlers/load-model/hyperdrive.js +72 -74
  637. package/dist/server/rpc/handlers/load-model/index.d.ts +2 -2
  638. package/dist/server/rpc/handlers/load-model/index.js +2 -2
  639. package/dist/server/rpc/handlers/load-model/registry-client-options.d.ts +2 -2
  640. package/dist/server/rpc/handlers/load-model/registry-client-options.js +2 -3
  641. package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +5 -5
  642. package/dist/server/rpc/handlers/load-model/registry-companion-set.js +19 -21
  643. package/dist/server/rpc/handlers/load-model/registry-download-utils.d.ts +6 -6
  644. package/dist/server/rpc/handlers/load-model/registry-download-utils.js +16 -18
  645. package/dist/server/rpc/handlers/load-model/registry-metadata.d.ts +11 -0
  646. package/dist/server/rpc/handlers/load-model/registry-metadata.js +23 -0
  647. package/dist/server/rpc/handlers/load-model/registry.d.ts +4 -3
  648. package/dist/server/rpc/handlers/load-model/registry.js +50 -56
  649. package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +3 -3
  650. package/dist/server/rpc/handlers/load-model/resolve-session.js +7 -7
  651. package/dist/server/rpc/handlers/load-model/resolve.d.ts +3 -3
  652. package/dist/server/rpc/handlers/load-model/resolve.js +36 -35
  653. package/dist/server/rpc/handlers/load-model/types.d.ts +3 -3
  654. package/dist/server/rpc/handlers/load-model/types.js +7 -7
  655. package/dist/server/rpc/handlers/load-model-delegated.d.ts +2 -2
  656. package/dist/server/rpc/handlers/load-model-delegated.js +31 -30
  657. package/dist/server/rpc/handlers/logging-stream.d.ts +1 -1
  658. package/dist/server/rpc/handlers/logging-stream.js +3 -3
  659. package/dist/server/rpc/handlers/ocr-stream.d.ts +1 -1
  660. package/dist/server/rpc/handlers/ocr-stream.js +2 -2
  661. package/dist/server/rpc/handlers/plugin-dispatch.js +9 -9
  662. package/dist/server/rpc/handlers/plugin-invoke.d.ts +1 -1
  663. package/dist/server/rpc/handlers/plugin-invoke.js +16 -16
  664. package/dist/server/rpc/handlers/provideHandler/connection.d.ts +1 -1
  665. package/dist/server/rpc/handlers/provideHandler/connection.js +16 -16
  666. package/dist/server/rpc/handlers/provideHandler/handler.d.ts +1 -1
  667. package/dist/server/rpc/handlers/provideHandler/handler.js +18 -18
  668. package/dist/server/rpc/handlers/provideHandler/proxy.d.ts +1 -1
  669. package/dist/server/rpc/handlers/provideHandler/proxy.js +11 -11
  670. package/dist/server/rpc/handlers/provideHandler.d.ts +1 -1
  671. package/dist/server/rpc/handlers/provideHandler.js +1 -1
  672. package/dist/server/rpc/handlers/rag.d.ts +1 -1
  673. package/dist/server/rpc/handlers/rag.js +50 -50
  674. package/dist/server/rpc/handlers/registry.d.ts +1 -1
  675. package/dist/server/rpc/handlers/registry.js +34 -36
  676. package/dist/server/rpc/handlers/resume.d.ts +1 -1
  677. package/dist/server/rpc/handlers/resume.js +3 -3
  678. package/dist/server/rpc/handlers/state.d.ts +1 -1
  679. package/dist/server/rpc/handlers/state.js +3 -3
  680. package/dist/server/rpc/handlers/stopProvideHandler.d.ts +1 -1
  681. package/dist/server/rpc/handlers/stopProvideHandler.js +7 -7
  682. package/dist/server/rpc/handlers/suspend.d.ts +1 -1
  683. package/dist/server/rpc/handlers/suspend.js +3 -3
  684. package/dist/server/rpc/handlers/text-to-speech-stream.d.ts +1 -1
  685. package/dist/server/rpc/handlers/text-to-speech-stream.js +2 -2
  686. package/dist/server/rpc/handlers/text-to-speech.d.ts +1 -1
  687. package/dist/server/rpc/handlers/text-to-speech.js +2 -2
  688. package/dist/server/rpc/handlers/transcribe-stream.d.ts +1 -1
  689. package/dist/server/rpc/handlers/transcribe-stream.js +2 -2
  690. package/dist/server/rpc/handlers/transcribe.d.ts +1 -1
  691. package/dist/server/rpc/handlers/transcribe.js +2 -2
  692. package/dist/server/rpc/handlers/translate.d.ts +1 -1
  693. package/dist/server/rpc/handlers/translate.js +2 -2
  694. package/dist/server/rpc/handlers/unload-model-delegated.d.ts +1 -1
  695. package/dist/server/rpc/handlers/unload-model-delegated.js +10 -10
  696. package/dist/server/rpc/handlers/unload-model.d.ts +1 -1
  697. package/dist/server/rpc/handlers/unload-model.js +10 -10
  698. package/dist/server/rpc/handlers/upscale-stream.d.ts +1 -1
  699. package/dist/server/rpc/handlers/upscale-stream.js +2 -2
  700. package/dist/server/rpc/handlers/video-stream.d.ts +1 -1
  701. package/dist/server/rpc/handlers/video-stream.js +2 -2
  702. package/dist/server/rpc/index.d.ts +2 -2
  703. package/dist/server/rpc/index.js +2 -2
  704. package/dist/server/rpc/profiling/context.d.ts +1 -1
  705. package/dist/server/rpc/profiling/context.js +9 -10
  706. package/dist/server/rpc/profiling/delegation-profiler.d.ts +2 -2
  707. package/dist/server/rpc/profiling/delegation-profiler.js +23 -24
  708. package/dist/server/rpc/profiling/index.d.ts +4 -4
  709. package/dist/server/rpc/profiling/index.js +4 -4
  710. package/dist/server/rpc/profiling/operation-metrics.d.ts +2 -2
  711. package/dist/server/rpc/profiling/operation-metrics.js +102 -102
  712. package/dist/server/rpc/profiling/operation-wrappers.d.ts +1 -1
  713. package/dist/server/rpc/profiling/operation-wrappers.js +16 -14
  714. package/dist/server/rpc/profiling/profiler.d.ts +2 -2
  715. package/dist/server/rpc/profiling/profiler.js +9 -13
  716. package/dist/server/rpc/rpc-utils.js +1 -4
  717. package/dist/server/rpc/transport-selector.d.ts +1 -1
  718. package/dist/server/rpc/transport-selector.js +4 -4
  719. package/dist/server/utils/archive.js +27 -29
  720. package/dist/server/utils/audio/decoder.d.ts +2 -2
  721. package/dist/server/utils/audio/decoder.js +11 -11
  722. package/dist/server/utils/cache/auto-history.d.ts +1 -1
  723. package/dist/server/utils/cache/auto-history.js +5 -5
  724. package/dist/server/utils/cache/paths.d.ts +2 -2
  725. package/dist/server/utils/cache/paths.js +14 -14
  726. package/dist/server/utils/checksum.d.ts +1 -1
  727. package/dist/server/utils/checksum.js +10 -12
  728. package/dist/server/utils/clear-storage.d.ts +1 -1
  729. package/dist/server/utils/clear-storage.js +8 -11
  730. package/dist/server/utils/completion-normalizer.d.ts +1 -1
  731. package/dist/server/utils/completion-normalizer.js +106 -113
  732. package/dist/server/utils/config-transform.d.ts +1 -1
  733. package/dist/server/utils/config-transform.js +2 -2
  734. package/dist/server/utils/expand-gguf-shards.js +4 -4
  735. package/dist/server/utils/formatting.js +6 -12
  736. package/dist/server/utils/gguf-tensor-extractor.js +17 -21
  737. package/dist/server/utils/index.d.ts +11 -11
  738. package/dist/server/utils/index.js +11 -11
  739. package/dist/server/utils/multi-gpu-mobile.js +1 -1
  740. package/dist/server/utils/path-security.d.ts +1 -1
  741. package/dist/server/utils/path-security.js +6 -6
  742. package/dist/server/utils/qvac-paths.js +3 -3
  743. package/dist/server/utils/response-format.d.ts +1 -1
  744. package/dist/server/utils/response-format.js +4 -4
  745. package/dist/server/utils/shard-utils.d.ts +1 -1
  746. package/dist/server/utils/shard-utils.js +14 -16
  747. package/dist/server/utils/tool-integration.d.ts +1 -1
  748. package/dist/server/utils/tool-integration.js +5 -9
  749. package/dist/server/utils/tools/dialect.d.ts +1 -1
  750. package/dist/server/utils/tools/dialect.js +7 -7
  751. package/dist/server/utils/tools/index.d.ts +2 -2
  752. package/dist/server/utils/tools/index.js +2 -2
  753. package/dist/server/utils/tools/parser.d.ts +1 -1
  754. package/dist/server/utils/tools/parser.js +14 -14
  755. package/dist/server/utils/tools/parsers/gemma4native.d.ts +2 -2
  756. package/dist/server/utils/tools/parsers/gemma4native.js +13 -8
  757. package/dist/server/utils/tools/parsers/harmony.d.ts +2 -2
  758. package/dist/server/utils/tools/parsers/harmony.js +9 -11
  759. package/dist/server/utils/tools/parsers/hermes.d.ts +2 -2
  760. package/dist/server/utils/tools/parsers/hermes.js +16 -16
  761. package/dist/server/utils/tools/parsers/json.d.ts +2 -2
  762. package/dist/server/utils/tools/parsers/json.js +14 -14
  763. package/dist/server/utils/tools/parsers/pythonic.d.ts +2 -2
  764. package/dist/server/utils/tools/parsers/pythonic.js +43 -43
  765. package/dist/server/utils/tools/parsers/qwen35.d.ts +2 -2
  766. package/dist/server/utils/tools/parsers/qwen35.js +20 -20
  767. package/dist/server/utils/tools/shared.d.ts +1 -1
  768. package/dist/server/utils/tools/shared.js +10 -12
  769. package/dist/server/utils/worker-lock.js +10 -10
  770. package/dist/server/worker-core.d.ts +1 -1
  771. package/dist/server/worker-core.js +44 -43
  772. package/dist/server/worker.js +9 -9
  773. package/dist/utils/aggregate-events.d.ts +2 -2
  774. package/dist/utils/aggregate-events.js +17 -19
  775. package/dist/utils/cache-normalize.js +1 -4
  776. package/dist/utils/encoding.js +1 -1
  777. package/dist/utils/errors-base.d.ts +1 -1
  778. package/dist/utils/errors-base.js +1 -1
  779. package/dist/utils/errors-client.d.ts +1 -1
  780. package/dist/utils/errors-client.js +5 -5
  781. package/dist/utils/errors-server.d.ts +3 -3
  782. package/dist/utils/errors-server.js +19 -18
  783. package/dist/utils/load-model-validation.js +3 -3
  784. package/dist/utils/mcp-adapter.d.ts +4 -4
  785. package/dist/utils/mcp-adapter.js +31 -38
  786. package/dist/utils/path-sanitize.js +14 -17
  787. package/dist/utils/tool-helpers.d.ts +2 -2
  788. package/dist/utils/tool-helpers.js +25 -26
  789. package/dist/utils/withTimeout.d.ts +7 -0
  790. package/dist/utils/withTimeout.js +11 -1
  791. package/dist/utils/zod-error.d.ts +1 -1
  792. package/dist/utils/zod-error.js +1 -1
  793. package/electron-forge/index.cjs +274 -317
  794. package/expo/plugins/patches/android-link.mjs +25 -30
  795. package/expo/plugins/patches/ios-link.mjs +25 -30
  796. package/package.json +17 -16
@@ -1,78 +1,78 @@
1
- import { completion, LLAMA_3_2_1B_INST_Q4_0, loadModel, QWEN3_1_7B_INST_Q4, unloadModel, } from "@qvac/sdk";
1
+ import { completion, LLAMA_3_2_1B_INST_Q4_0, loadModel, QWEN3_1_7B_INST_Q4, unloadModel } from '@qvac/sdk';
2
2
  try {
3
3
  const alice = await loadModel({
4
4
  modelSrc: QWEN3_1_7B_INST_Q4,
5
5
  modelConfig: {
6
- ctx_size: 4096,
7
- },
6
+ ctx_size: 4096
7
+ }
8
8
  });
9
9
  const bob = await loadModel({
10
10
  modelSrc: LLAMA_3_2_1B_INST_Q4_0,
11
11
  modelConfig: {
12
- ctx_size: 4096,
12
+ ctx_size: 4096
13
13
  },
14
14
  onProgress: (p) => {
15
15
  const mb = (n) => (n / 1e6).toFixed(1);
16
16
  const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
17
17
  process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
18
18
  if (p.percentage >= 100)
19
- process.stderr.write("\n");
20
- },
19
+ process.stderr.write('\n');
20
+ }
21
21
  });
22
22
  const aliceHistory = [
23
23
  {
24
- role: "system",
25
- content: "You answer questions about.",
24
+ role: 'system',
25
+ content: 'You answer questions about.'
26
26
  },
27
- { role: "user", content: "What is Bitcoin?" },
27
+ { role: 'user', content: 'What is Bitcoin?' }
28
28
  ];
29
29
  const bobHistory = [
30
30
  {
31
- role: "system",
32
- content: "You ask questions about Bitcoin in one sentence.",
33
- },
31
+ role: 'system',
32
+ content: 'You ask questions about Bitcoin in one sentence.'
33
+ }
34
34
  ];
35
- console.log("Bob: ", "What is Bitcoin?");
35
+ console.log('Bob: ', 'What is Bitcoin?');
36
36
  const aliceResponse = completion({
37
37
  modelId: alice,
38
38
  history: [...aliceHistory],
39
- stream: false,
39
+ stream: false
40
40
  });
41
41
  const aliceText = await aliceResponse.text;
42
- aliceHistory.push({ role: "assistant", content: aliceText });
43
- console.log("Alice: ", aliceText);
44
- console.log("▸ Alice Stats: ", await aliceResponse.stats);
42
+ aliceHistory.push({ role: 'assistant', content: aliceText });
43
+ console.log('Alice: ', aliceText);
44
+ console.log('▸ Alice Stats: ', await aliceResponse.stats);
45
45
  const bobResponse = completion({
46
46
  modelId: bob,
47
- history: [...bobHistory, { role: "user", content: aliceText }],
48
- stream: false,
47
+ history: [...bobHistory, { role: 'user', content: aliceText }],
48
+ stream: false
49
49
  });
50
50
  const bobText = await bobResponse.text;
51
- bobHistory.push({ role: "assistant", content: bobText });
52
- console.log("Bob: ", bobText);
53
- console.log("▸ Bob Stats: ", await bobResponse.stats);
51
+ bobHistory.push({ role: 'assistant', content: bobText });
52
+ console.log('Bob: ', bobText);
53
+ console.log('▸ Bob Stats: ', await bobResponse.stats);
54
54
  const aliceResponse2 = completion({
55
55
  modelId: alice,
56
- history: [...aliceHistory, { role: "user", content: bobText }],
57
- stream: false,
56
+ history: [...aliceHistory, { role: 'user', content: bobText }],
57
+ stream: false
58
58
  });
59
59
  const aliceText2 = await aliceResponse2.text;
60
- aliceHistory.push({ role: "assistant", content: aliceText2 });
61
- console.log("Alice: ", aliceText2);
62
- console.log("▸ Alice Stats: ", await aliceResponse2.stats);
60
+ aliceHistory.push({ role: 'assistant', content: aliceText2 });
61
+ console.log('Alice: ', aliceText2);
62
+ console.log('▸ Alice Stats: ', await aliceResponse2.stats);
63
63
  const bobResponse2 = completion({
64
64
  modelId: bob,
65
- history: [...bobHistory, { role: "user", content: aliceText2 }],
66
- stream: false,
65
+ history: [...bobHistory, { role: 'user', content: aliceText2 }],
66
+ stream: false
67
67
  });
68
68
  const bobText2 = await bobResponse2.text;
69
- bobHistory.push({ role: "assistant", content: bobText2 });
70
- console.log("Bob: ", bobText2);
71
- console.log("▸ Bob Stats: ", await bobResponse2.stats);
69
+ bobHistory.push({ role: 'assistant', content: bobText2 });
70
+ console.log('Bob: ', bobText2);
71
+ console.log('▸ Bob Stats: ', await bobResponse2.stats);
72
72
  await unloadModel({ modelId: alice, clearStorage: false });
73
73
  await unloadModel({ modelId: bob, clearStorage: false });
74
74
  }
75
75
  catch (error) {
76
- console.error("✖", error);
76
+ console.error('✖', error);
77
77
  process.exit(1);
78
78
  }
@@ -9,23 +9,23 @@
9
9
  * Pass a custom image path, or download the default image into examples/image/:
10
10
  * https://github.com/tetherto/qvac/blob/main/packages/sdk/examples/image/basic_test.bmp
11
11
  */
12
- import { close, loadModel, ocr, OCR_LATIN, unloadModel, } from "@qvac/sdk";
13
- import path from "path";
14
- import { fileURLToPath } from "url";
12
+ import { close, loadModel, ocr, OCR_LATIN, unloadModel } from '@qvac/sdk';
13
+ import path from 'path';
14
+ import { fileURLToPath } from 'url';
15
15
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
16
- const imagePath = process.argv[2] || path.join(__dirname, "image/basic_test.bmp");
16
+ const imagePath = process.argv[2] || path.join(__dirname, 'image/basic_test.bmp');
17
17
  try {
18
- console.log("▸ Loading OCR model...");
18
+ console.log('▸ Loading OCR model...');
19
19
  const modelId = await loadModel({
20
20
  modelSrc: OCR_LATIN,
21
21
  modelConfig: {
22
- langList: ["en"],
22
+ langList: ['en'],
23
23
  magRatio: 1.5,
24
24
  defaultRotationAngles: [90, 180, 270],
25
25
  contrastRetry: false,
26
26
  lowConfidenceThreshold: 0.5,
27
- recognizerBatchSize: 1,
28
- },
27
+ recognizerBatchSize: 1
28
+ }
29
29
  });
30
30
  console.log(`▸ Model loaded successfully! Model ID: ${modelId}`);
31
31
  console.log(`\n▸ Running OCR on: ${imagePath}`);
@@ -33,28 +33,28 @@ try {
33
33
  modelId,
34
34
  image: imagePath,
35
35
  options: {
36
- paragraph: false,
37
- },
36
+ paragraph: false
37
+ }
38
38
  });
39
39
  const result = await blocks;
40
- console.log("\n▸ OCR Results:");
41
- console.log("▸ ================================");
40
+ console.log('\n▸ OCR Results:');
41
+ console.log('▸ ================================');
42
42
  for (const block of result) {
43
43
  console.log(block.text);
44
44
  if (block.bbox) {
45
- console.log(`▸ BBox: [${block.bbox.join(", ")}]`);
45
+ console.log(`▸ BBox: [${block.bbox.join(', ')}]`);
46
46
  }
47
47
  if (block.confidence !== undefined) {
48
48
  console.log(`▸ Confidence: ${block.confidence}`);
49
49
  }
50
50
  }
51
- console.log("\n▸ ================================");
52
- console.log("\n▸ Unloading model...");
51
+ console.log('\n▸ ================================');
52
+ console.log('\n▸ Unloading model...');
53
53
  await unloadModel({ modelId, clearStorage: false });
54
- console.log("▸ Model unloaded successfully.");
54
+ console.log('▸ Model unloaded successfully.');
55
55
  process.exit(0);
56
56
  }
57
57
  catch (error) {
58
- console.error("✖", error);
58
+ console.error('✖', error);
59
59
  await close();
60
60
  }
@@ -1,12 +1,12 @@
1
- import { LLAMA_3_2_1B_INST_Q4_0, WHISPER_TINY, VAD_SILERO_5_1_2, GTE_LARGE_FP16, downloadAsset, close, } from "@qvac/sdk";
1
+ import { LLAMA_3_2_1B_INST_Q4_0, WHISPER_TINY, VAD_SILERO_5_1_2, GTE_LARGE_FP16, downloadAsset, close } from '@qvac/sdk';
2
2
  function now() {
3
3
  return Date.now();
4
4
  }
5
5
  const assets = [
6
- { name: "Llama 3.2 1B", src: LLAMA_3_2_1B_INST_Q4_0 },
7
- { name: "Whisper Tiny", src: WHISPER_TINY },
8
- { name: "VAD Silero", src: VAD_SILERO_5_1_2 },
9
- { name: "GTE Large FP16", src: GTE_LARGE_FP16 },
6
+ { name: 'Llama 3.2 1B', src: LLAMA_3_2_1B_INST_Q4_0 },
7
+ { name: 'Whisper Tiny', src: WHISPER_TINY },
8
+ { name: 'VAD Silero', src: VAD_SILERO_5_1_2 },
9
+ { name: 'GTE Large FP16', src: GTE_LARGE_FP16 }
10
10
  ];
11
11
  const timers = {};
12
12
  console.log(`\n▸ Parallel Download (${assets.length} assets)\n`);
@@ -26,7 +26,7 @@ try {
26
26
  t.end = now();
27
27
  console.log(`▸ [${asset.name}] done at ${((t.end - wallStart) / 1000).toFixed(1)}s`);
28
28
  }
29
- },
29
+ }
30
30
  });
31
31
  });
32
32
  const results = await Promise.allSettled(promises);
@@ -36,18 +36,16 @@ try {
36
36
  const asset = assets[i];
37
37
  const result = results[i];
38
38
  const t = timers[asset.name];
39
- const status = result.status === "fulfilled" ? "OK" : "FAILED";
40
- const reason = result.status === "rejected" ? ` — ${result.reason}` : "";
41
- const timeToFirst = t.firstProgress != null
42
- ? `${((t.firstProgress - t.start) / 1000).toFixed(1)}s`
43
- : "N/A";
44
- const total = t.end != null ? `${((t.end - t.start) / 1000).toFixed(1)}s` : "N/A";
39
+ const status = result.status === 'fulfilled' ? 'OK' : 'FAILED';
40
+ const reason = result.status === 'rejected' ? ` — ${result.reason}` : '';
41
+ const timeToFirst = t.firstProgress != null ? `${((t.firstProgress - t.start) / 1000).toFixed(1)}s` : 'N/A';
42
+ const total = t.end != null ? `${((t.end - t.start) / 1000).toFixed(1)}s` : 'N/A';
45
43
  console.log(`▸ ${status} ${asset.name}: first-progress=${timeToFirst}, total=${total}${reason}`);
46
44
  }
47
45
  console.log(`\n▸ Wall time: ${((wallEnd - wallStart) / 1000).toFixed(1)}s`);
48
46
  void close();
49
47
  }
50
48
  catch (error) {
51
- console.error("✖", error);
49
+ console.error('✖', error);
52
50
  process.exit(1);
53
51
  }
@@ -10,27 +10,27 @@
10
10
  * 3. Embeddings -> fails (plugin not selected)
11
11
  *
12
12
  */
13
- import { bundleSdk } from "../commands/index.js";
14
- import { existsSync, rmSync } from "fs";
15
- import path from "path";
13
+ import { bundleSdk } from '../commands/index.js';
14
+ import { existsSync, rmSync } from 'fs';
15
+ import path from 'path';
16
16
  const configDir = import.meta.dirname ?? process.cwd();
17
17
  const configPath = `${configDir}/config/plugins/plugins.config.json`;
18
- const projectRoot = path.resolve(configDir, "..");
19
- const qvacOutputDir = path.join(projectRoot, "qvac");
18
+ const projectRoot = path.resolve(configDir, '..');
19
+ const qvacOutputDir = path.join(projectRoot, 'qvac');
20
20
  // ─── Generate the worker bundle from the plugins config ─────────────────────
21
21
  console.log(`▸ Config: ${configPath}`);
22
22
  console.log(`▸ This example will generate a worker bundle in ${qvacOutputDir} and delete it on exit.`);
23
- console.log("▸ If you have an existing qvac/ folder with bundled files, they will be overwritten and removed.\n");
24
- console.log("▸ Generating worker bundle from plugins config...\n");
23
+ console.log('▸ If you have an existing qvac/ folder with bundled files, they will be overwritten and removed.\n');
24
+ console.log('▸ Generating worker bundle from plugins config...\n');
25
25
  try {
26
26
  await bundleSdk({ projectRoot, configPath, quiet: true });
27
27
  }
28
28
  catch (error) {
29
- console.error("✖ Failed to generate worker bundle.");
30
- console.error("✖", error);
29
+ console.error('✖ Failed to generate worker bundle.');
30
+ console.error('✖', error);
31
31
  process.exit(1);
32
32
  }
33
- console.log("");
33
+ console.log('');
34
34
  // Cleanup generated qvac/ folder on exit
35
35
  function cleanup() {
36
36
  if (existsSync(qvacOutputDir)) {
@@ -38,12 +38,12 @@ function cleanup() {
38
38
  console.log(`\n▸ Cleaned up ${qvacOutputDir}`);
39
39
  }
40
40
  }
41
- process.on("exit", cleanup);
41
+ process.on('exit', cleanup);
42
42
  // Point config before importing the SDK.
43
43
  // In a real app, place qvac.config.json (or .js/.ts) in your project root (auto-discovered).
44
- process.env["QVAC_CONFIG_PATH"] = configPath;
45
- const { completion, translate, embed, loadModel, unloadModel, LLAMA_3_2_1B_INST_Q4_0, BERGAMOT_EN_ES, GTE_LARGE_FP16, } = await import("@qvac/sdk");
46
- console.log("▸ 1. LLM Completion (llamacpp-completion plugin)");
44
+ process.env['QVAC_CONFIG_PATH'] = configPath;
45
+ const { completion, translate, embed, loadModel, unloadModel, LLAMA_3_2_1B_INST_Q4_0, BERGAMOT_EN_ES, GTE_LARGE_FP16 } = await import('@qvac/sdk');
46
+ console.log('▸ 1. LLM Completion (llamacpp-completion plugin)');
47
47
  try {
48
48
  const llmModelId = await loadModel({
49
49
  modelSrc: LLAMA_3_2_1B_INST_Q4_0,
@@ -53,82 +53,82 @@ try {
53
53
  const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
54
54
  process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
55
55
  if (p.percentage >= 100)
56
- process.stderr.write("\n");
57
- },
56
+ process.stderr.write('\n');
57
+ }
58
58
  });
59
59
  console.log(`▸ Model loaded: ${llmModelId}`);
60
- const question = "What is 2 + 2? Answer in one word.";
60
+ const question = 'What is 2 + 2? Answer in one word.';
61
61
  console.log(`▸ Question: ${question}`);
62
62
  const result = completion({
63
63
  modelId: llmModelId,
64
- history: [{ role: "user", content: question }],
65
- stream: true,
64
+ history: [{ role: 'user', content: question }],
65
+ stream: true
66
66
  });
67
- console.log("▸ Response:");
67
+ console.log('▸ Response:');
68
68
  for await (const token of result.tokenStream) {
69
69
  process.stdout.write(token);
70
70
  }
71
- console.log("");
71
+ console.log('');
72
72
  await unloadModel({ modelId: llmModelId });
73
- console.log("▸ LLM unloaded\n");
73
+ console.log('▸ LLM unloaded\n');
74
74
  }
75
75
  catch (error) {
76
- console.error("✖ LLM failed:", error);
76
+ console.error('✖ LLM failed:', error);
77
77
  process.exit(1);
78
78
  }
79
- console.log("▸ 2. Translation (nmtcpp-translation plugin)");
79
+ console.log('▸ 2. Translation (nmtcpp-translation plugin)');
80
80
  try {
81
81
  const nmtModelId = await loadModel({
82
82
  modelSrc: BERGAMOT_EN_ES,
83
83
  modelConfig: {
84
- engine: "Bergamot",
85
- from: "en",
86
- to: "es",
84
+ engine: 'Bergamot',
85
+ from: 'en',
86
+ to: 'es'
87
87
  },
88
88
  onProgress: (p) => {
89
89
  const mb = (n) => (n / 1e6).toFixed(1);
90
90
  const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
91
91
  process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
92
92
  if (p.percentage >= 100)
93
- process.stderr.write("\n");
94
- },
93
+ process.stderr.write('\n');
94
+ }
95
95
  });
96
96
  console.log(`▸ Model loaded: ${nmtModelId}`);
97
- const text = "Hello, how are you?";
97
+ const text = 'Hello, how are you?';
98
98
  const result = translate({
99
99
  modelId: nmtModelId,
100
100
  text,
101
- modelType: "nmtcpp-translation",
102
- stream: false,
101
+ modelType: 'nmtcpp-translation',
102
+ stream: false
103
103
  });
104
104
  const translated = await result.text;
105
105
  console.log(`"${text}" -> "${translated}"`);
106
106
  await unloadModel({ modelId: nmtModelId });
107
- console.log("▸ NMT unloaded\n");
107
+ console.log('▸ NMT unloaded\n');
108
108
  }
109
109
  catch (error) {
110
- console.error("✖ Translation failed:", error);
110
+ console.error('✖ Translation failed:', error);
111
111
  process.exit(1);
112
112
  }
113
- console.log("▸ 3. Embeddings (llamacpp-embedding plugin NOT in config)");
114
- console.log("▸ Attempting to load an embeddings model...\n");
113
+ console.log('▸ 3. Embeddings (llamacpp-embedding plugin NOT in config)');
114
+ console.log('▸ Attempting to load an embeddings model...\n');
115
115
  try {
116
116
  const embedModelId = await loadModel({
117
- modelSrc: GTE_LARGE_FP16,
117
+ modelSrc: GTE_LARGE_FP16
118
118
  });
119
- await embed({ modelId: embedModelId, text: "test" });
120
- console.error("✖ Unexpected: embed succeeded without the plugin!");
119
+ await embed({ modelId: embedModelId, text: 'test' });
120
+ console.error('✖ Unexpected: embed succeeded without the plugin!');
121
121
  process.exit(1);
122
122
  }
123
123
  catch (error) {
124
124
  const message = error instanceof Error ? error.message : String(error);
125
- if (message.includes("Plugin not found")) {
126
- console.log("▸ Expected PLUGIN_NOT_FOUND error:");
125
+ if (message.includes('Plugin not found')) {
126
+ console.log('▸ Expected PLUGIN_NOT_FOUND error:');
127
127
  console.log(`▸ ${message}\n`);
128
128
  }
129
129
  else {
130
- console.error("✖ Unexpected error:", error);
130
+ console.error('✖ Unexpected error:', error);
131
131
  process.exit(1);
132
132
  }
133
133
  }
134
- console.log("▸ Done! Only the selected plugins were available.");
134
+ console.log('▸ Done! Only the selected plugins were available.');
@@ -1,11 +1,11 @@
1
- import { completion, loadModel, unloadModel, LLAMA_3_2_1B_INST_Q4_0, profiler, } from "@qvac/sdk";
1
+ import { completion, loadModel, unloadModel, LLAMA_3_2_1B_INST_Q4_0, profiler } from '@qvac/sdk';
2
2
  try {
3
3
  // Enable profiling globally
4
4
  profiler.enable({
5
- mode: "verbose",
6
- includeServerBreakdown: true,
5
+ mode: 'verbose',
6
+ includeServerBreakdown: true
7
7
  });
8
- console.log("▸ Profiler enabled:", profiler.isEnabled());
8
+ console.log('▸ Profiler enabled:', profiler.isEnabled());
9
9
  const modelId = await loadModel({
10
10
  modelSrc: LLAMA_3_2_1B_INST_Q4_0,
11
11
  onProgress: (p) => {
@@ -13,15 +13,15 @@ try {
13
13
  const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
14
14
  process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
15
15
  if (p.percentage >= 100)
16
- process.stderr.write("\n");
17
- },
16
+ process.stderr.write('\n');
17
+ }
18
18
  });
19
- console.log("▸ Model loaded:", modelId);
20
- console.log("\n▸ Running completion...");
19
+ console.log('▸ Model loaded:', modelId);
20
+ console.log('\n▸ Running completion...');
21
21
  const result = completion({
22
22
  modelId,
23
- history: [{ role: "user", content: "Say hello in one sentence." }],
24
- stream: true,
23
+ history: [{ role: 'user', content: 'Say hello in one sentence.' }],
24
+ stream: true
25
25
  });
26
26
  for await (const token of result.tokenStream) {
27
27
  process.stdout.write(token);
@@ -29,50 +29,48 @@ try {
29
29
  console.log();
30
30
  await unloadModel({ modelId });
31
31
  // Export profiling data
32
- console.log("\n▸ Profiler Summary");
32
+ console.log('\n▸ Profiler Summary');
33
33
  console.log(profiler.exportSummary());
34
- console.log("\n▸ Profiler Table");
34
+ console.log('\n▸ Profiler Table');
35
35
  console.log(profiler.exportTable());
36
36
  const json = profiler.exportJSON();
37
- console.log("\n▸ Load Model Metrics");
37
+ console.log('\n▸ Load Model Metrics');
38
38
  // Filter for operation-level event (kind: "handler"), not RPC phase events
39
- const loadModelEvent = json.recentEvents?.find((e) => e.op === "loadModel" && e.kind === "handler");
39
+ const loadModelEvent = json.recentEvents?.find((e) => e.op === 'loadModel' && e.kind === 'handler');
40
40
  if (loadModelEvent) {
41
41
  const tags = loadModelEvent.tags ?? {};
42
42
  const gauges = loadModelEvent.gauges ?? {};
43
- console.log(" sourceType:", tags["sourceType"] ?? "(not set)");
44
- console.log(" cacheHit:", tags["cacheHit"] ?? "(not set)");
45
- console.log(" totalLoadTime:", gauges["totalLoadTime"], "ms");
46
- console.log(" modelInitializationTime:", gauges["modelInitializationTime"], "ms");
47
- if (tags["cacheHit"] !== "true") {
48
- console.log(" downloadTime:", gauges["downloadTime"] ?? "(cached)", "ms");
49
- console.log(" totalBytesDownloaded:", gauges["totalBytesDownloaded"] ?? "(cached)");
50
- console.log(" downloadSpeedBps:", gauges["downloadSpeedBps"] ?? "(cached)");
43
+ console.log(' sourceType:', tags['sourceType'] ?? '(not set)');
44
+ console.log(' cacheHit:', tags['cacheHit'] ?? '(not set)');
45
+ console.log(' totalLoadTime:', gauges['totalLoadTime'], 'ms');
46
+ console.log(' modelInitializationTime:', gauges['modelInitializationTime'], 'ms');
47
+ if (tags['cacheHit'] !== 'true') {
48
+ console.log(' downloadTime:', gauges['downloadTime'] ?? '(cached)', 'ms');
49
+ console.log(' totalBytesDownloaded:', gauges['totalBytesDownloaded'] ?? '(cached)');
50
+ console.log(' downloadSpeedBps:', gauges['downloadSpeedBps'] ?? '(cached)');
51
51
  }
52
52
  else {
53
- console.log(" (download metrics omitted - cache hit)");
53
+ console.log(' (download metrics omitted - cache hit)');
54
54
  }
55
- if (gauges["checksumValidationTime"] !== undefined) {
56
- console.log(" checksumValidationTime:", gauges["checksumValidationTime"], "ms");
55
+ if (gauges['checksumValidationTime'] !== undefined) {
56
+ console.log(' checksumValidationTime:', gauges['checksumValidationTime'], 'ms');
57
57
  }
58
58
  }
59
59
  else {
60
- console.log(" (no loadModel handler event captured)");
60
+ console.log(' (no loadModel handler event captured)');
61
61
  // Debug: show what ops are available
62
- const ops = [
63
- ...new Set(json.recentEvents?.map((e) => `${e.op}:${e.kind}`) ?? []),
64
- ];
65
- console.log(" Available ops:", ops.join(", "));
62
+ const ops = [...new Set(json.recentEvents?.map((e) => `${e.op}:${e.kind}`) ?? [])];
63
+ console.log(' Available ops:', ops.join(', '));
66
64
  }
67
- console.log("\n▸ Profiler JSON (structure)");
68
- console.log(" aggregates:", Object.keys(json.aggregates).length, "metrics");
69
- console.log(" recentEvents:", json.recentEvents?.length ?? 0, "events");
70
- console.log(" config:", json.config);
65
+ console.log('\n▸ Profiler JSON (structure)');
66
+ console.log(' aggregates:', Object.keys(json.aggregates).length, 'metrics');
67
+ console.log(' recentEvents:', json.recentEvents?.length ?? 0, 'events');
68
+ console.log(' config:', json.config);
71
69
  // Disable profiling
72
70
  profiler.disable();
73
- console.log("\n▸ Profiler disabled:", !profiler.isEnabled());
71
+ console.log('\n▸ Profiler disabled:', !profiler.isEnabled());
74
72
  }
75
73
  catch (error) {
76
- console.error("✖", error);
74
+ console.error('✖', error);
77
75
  process.exit(1);
78
76
  }
@@ -1,7 +1,7 @@
1
- import { embed, loadModel, unloadModel, GTE_LARGE_FP16, profiler, } from "@qvac/sdk";
1
+ import { embed, loadModel, unloadModel, GTE_LARGE_FP16, profiler } from '@qvac/sdk';
2
2
  try {
3
3
  profiler.disable();
4
- console.log("▸ Profiler globally enabled:", profiler.isEnabled());
4
+ console.log('▸ Profiler globally enabled:', profiler.isEnabled());
5
5
  const modelId = await loadModel({
6
6
  modelSrc: GTE_LARGE_FP16,
7
7
  onProgress: (p) => {
@@ -9,27 +9,27 @@ try {
9
9
  const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
10
10
  process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
11
11
  if (p.percentage >= 100)
12
- process.stderr.write("\n");
13
- },
12
+ process.stderr.write('\n');
13
+ }
14
14
  });
15
- console.log("▸ Model loaded:", modelId);
16
- console.log("\n▸ Embed with per-call profiling");
17
- const { embedding: embedding1 } = await embed({ modelId, text: "Profile this specific call" }, { profiling: { enabled: true, includeServerBreakdown: true } });
18
- console.log("▸ Embedding dimensions:", embedding1.length);
19
- console.log("\n▸ Embed without profiling");
15
+ console.log('▸ Model loaded:', modelId);
16
+ console.log('\n▸ Embed with per-call profiling');
17
+ const { embedding: embedding1 } = await embed({ modelId, text: 'Profile this specific call' }, { profiling: { enabled: true, includeServerBreakdown: true } });
18
+ console.log('▸ Embedding dimensions:', embedding1.length);
19
+ console.log('\n▸ Embed without profiling');
20
20
  const { embedding: embedding2 } = await embed({
21
21
  modelId,
22
- text: "This call is not profiled",
22
+ text: 'This call is not profiled'
23
23
  });
24
- console.log("▸ Embedding dimensions:", embedding2.length);
25
- console.log("\n▸ Embed with profiling explicitly disabled");
26
- const { embedding: embedding3 } = await embed({ modelId, text: "Profiling explicitly disabled for this call" }, { profiling: { enabled: false } });
27
- console.log("▸ Embedding dimensions:", embedding3.length);
24
+ console.log('▸ Embedding dimensions:', embedding2.length);
25
+ console.log('\n▸ Embed with profiling explicitly disabled');
26
+ const { embedding: embedding3 } = await embed({ modelId, text: 'Profiling explicitly disabled for this call' }, { profiling: { enabled: false } });
27
+ console.log('▸ Embedding dimensions:', embedding3.length);
28
28
  await unloadModel({ modelId });
29
- console.log("\n▸ Profiler Summary (per-call data only)");
29
+ console.log('\n▸ Profiler Summary (per-call data only)');
30
30
  console.log(profiler.exportSummary());
31
31
  }
32
32
  catch (error) {
33
- console.error("✖", error);
33
+ console.error('✖', error);
34
34
  process.exit(1);
35
35
  }
@@ -1,16 +1,14 @@
1
1
  // The Bare quickstart. Bare has no `process` global and does not spawn a worker,
2
2
  // so two setup steps come first: install bare-process as the `process` global,
3
3
  // then register the plugins this example uses via `plugins([...])`.
4
- import bareProcess from "bare-process";
5
- import { plugins, LLAMA_3_2_1B_INST_Q4_0 } from "@qvac/sdk";
6
- import { llmPlugin } from "@qvac/sdk/llamacpp-completion/plugin.js";
4
+ import bareProcess from 'bare-process';
5
+ import { plugins, LLAMA_3_2_1B_INST_Q4_0 } from '@qvac/sdk';
6
+ import { llmPlugin } from '@qvac/sdk/llamacpp-completion/plugin.js';
7
7
  globalThis.process = bareProcess;
8
8
  const { loadModel, completion, unloadModel } = plugins([llmPlugin]);
9
9
  // From here it is the same as the Node quickstart.
10
10
  const modelId = await loadModel({ modelSrc: LLAMA_3_2_1B_INST_Q4_0 });
11
- const history = [
12
- { role: "user", content: "Explain quantum computing in one sentence" },
13
- ];
11
+ const history = [{ role: 'user', content: 'Explain quantum computing in one sentence' }];
14
12
  const result = completion({ modelId, history, stream: true });
15
13
  for await (const token of result.tokenStream) {
16
14
  process.stdout.write(token);
@@ -1,7 +1,7 @@
1
1
  // The SDK prints no logs by default. To see its client and server logs, run with
2
2
  // QVAC_CONFIG_PATH pointing at a config that sets "loggerConsoleOutput": true
3
3
  // (see the Quickstart docs).
4
- import { loadModel, LLAMA_3_2_1B_INST_Q4_0, completion, unloadModel, } from "@qvac/sdk";
4
+ import { loadModel, LLAMA_3_2_1B_INST_Q4_0, completion, unloadModel } from '@qvac/sdk';
5
5
  try {
6
6
  // Load a model into memory
7
7
  const modelId = await loadModel({
@@ -11,15 +11,15 @@ try {
11
11
  const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
12
12
  process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
13
13
  if (p.percentage >= 100)
14
- process.stderr.write("\n");
15
- },
14
+ process.stderr.write('\n');
15
+ }
16
16
  });
17
17
  // You can use the loaded model multiple times
18
18
  const history = [
19
19
  {
20
- role: "user",
21
- content: "Explain quantum computing in one sentence",
22
- },
20
+ role: 'user',
21
+ content: 'Explain quantum computing in one sentence'
22
+ }
23
23
  ];
24
24
  const result = completion({ modelId, history, stream: true });
25
25
  for await (const token of result.tokenStream) {
@@ -29,6 +29,6 @@ try {
29
29
  await unloadModel({ modelId });
30
30
  }
31
31
  catch (error) {
32
- console.error("✖", error);
32
+ console.error('✖', error);
33
33
  process.exit(1);
34
34
  }