@qvac/sdk 0.23.0 → 0.24.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 (239) hide show
  1. package/NOTICE +115 -58
  2. package/README.md +10 -13
  3. package/dist/examples/asr/parakeet-sortformer.js +24 -14
  4. package/dist/examples/asr/parakeet-transcribepsy-filesystem.js +40 -11
  5. package/dist/examples/asr/parakeet-unified-coreml.js +14 -9
  6. package/dist/examples/asr/whispercpp-prompt.js +9 -5
  7. package/dist/examples/assess-model-fit.d.ts +7 -9
  8. package/dist/examples/assess-model-fit.js +22 -43
  9. package/dist/examples/calc-tokens.d.ts +2 -0
  10. package/dist/examples/calc-tokens.js +21 -0
  11. package/dist/examples/classification/classify-image.js +11 -5
  12. package/dist/examples/completion-stop-reason.d.ts +3 -3
  13. package/dist/examples/completion-stop-reason.js +4 -4
  14. package/dist/examples/diffusion-flux3-klein.d.ts +2 -0
  15. package/dist/examples/diffusion-flux3-klein.js +102 -0
  16. package/dist/examples/diffusion-moss-image.d.ts +2 -0
  17. package/dist/examples/diffusion-moss-image.js +126 -0
  18. package/dist/examples/diffusion-qwen-image-21.js +15 -4
  19. package/dist/examples/embed-multimodal.d.ts +2 -0
  20. package/dist/examples/embed-multimodal.js +80 -0
  21. package/dist/examples/embed-p2p.js +2 -2
  22. package/dist/examples/image/megaloc.d.ts +2 -0
  23. package/dist/examples/image/megaloc.js +37 -0
  24. package/dist/examples/llamacpp-multimodal.js +18 -0
  25. package/dist/examples/rag/rag-hyperdb/pipeline.js +2 -2
  26. package/dist/examples/rag/rag-turbovec.js +2 -2
  27. package/dist/examples/sessions.d.ts +17 -0
  28. package/dist/examples/sessions.js +63 -0
  29. package/dist/examples/tools/llamacpp-deferred-tools.js +8 -4
  30. package/dist/scripts/check-resource-collectors-packaging.js +7 -6
  31. package/dist/scripts/contract/build-contract.d.ts +2 -1
  32. package/dist/scripts/contract/build-contract.js +13 -1
  33. package/dist/scripts/contract/constants-registry.d.ts +17 -0
  34. package/dist/scripts/contract/constants-registry.js +8 -2
  35. package/dist/scripts/contract/method-shapes.d.ts +4 -0
  36. package/dist/scripts/contract/method-shapes.js +4 -0
  37. package/dist/scripts/enforce-inference-versions.d.ts +1 -1
  38. package/dist/scripts/enforce-inference-versions.js +28 -18
  39. package/dist/scripts/generate-bare-kit-runtimes.js +101 -69
  40. package/dist/src/client/api/assess-model-fit.d.ts +17 -17
  41. package/dist/src/client/api/assess-model-fit.js +18 -31
  42. package/dist/src/client/api/audio-edit.d.ts +5 -3
  43. package/dist/src/client/api/audio-edit.js +5 -3
  44. package/dist/src/client/api/audio-gen-result.js +134 -45
  45. package/dist/src/client/api/audio-gen.d.ts +40 -3
  46. package/dist/src/client/api/audio-gen.js +40 -3
  47. package/dist/src/client/api/audio-understand.d.ts +2 -2
  48. package/dist/src/client/api/audio-understand.js +2 -2
  49. package/dist/src/client/api/batch-completion.js +2 -1
  50. package/dist/src/client/api/calc-tokens.d.ts +33 -0
  51. package/dist/src/client/api/calc-tokens.js +44 -0
  52. package/dist/src/client/api/cancel.d.ts +2 -2
  53. package/dist/src/client/api/cancel.js +2 -2
  54. package/dist/src/client/api/classify.d.ts +12 -5
  55. package/dist/src/client/api/classify.js +17 -5
  56. package/dist/src/client/api/client-request-id.d.ts +0 -15
  57. package/dist/src/client/api/client-request-id.js +15 -12
  58. package/dist/src/client/api/completion-stream.d.ts +8 -1
  59. package/dist/src/client/api/completion-stream.js +10 -1
  60. package/dist/src/client/api/delete-cache.d.ts +9 -2
  61. package/dist/src/client/api/delete-cache.js +13 -3
  62. package/dist/src/client/api/diffusion.d.ts +20 -4
  63. package/dist/src/client/api/diffusion.js +23 -5
  64. package/dist/src/client/api/embed.d.ts +82 -29
  65. package/dist/src/client/api/embed.js +64 -19
  66. package/dist/src/client/api/get-model-info.d.ts +2 -2
  67. package/dist/src/client/api/get-model-info.js +2 -2
  68. package/dist/src/client/api/get-system-resources.d.ts +2 -2
  69. package/dist/src/client/api/get-system-resources.js +2 -2
  70. package/dist/src/client/api/heartbeat.d.ts +3 -2
  71. package/dist/src/client/api/heartbeat.js +3 -2
  72. package/dist/src/client/api/index.d.ts +4 -3
  73. package/dist/src/client/api/index.js +2 -1
  74. package/dist/src/client/api/invoke-plugin.d.ts +8 -2
  75. package/dist/src/client/api/invoke-plugin.js +17 -2
  76. package/dist/src/client/api/load-model.js +5 -2
  77. package/dist/src/client/api/ocr.d.ts +5 -3
  78. package/dist/src/client/api/ocr.js +44 -21
  79. package/dist/src/client/api/rag.d.ts +1 -1
  80. package/dist/src/client/api/rag.js +1 -1
  81. package/dist/src/client/api/registry.d.ts +17 -7
  82. package/dist/src/client/api/registry.js +37 -12
  83. package/dist/src/client/api/resume.d.ts +2 -1
  84. package/dist/src/client/api/resume.js +2 -2
  85. package/dist/src/client/api/rpc-server.d.ts +4 -4
  86. package/dist/src/client/api/rpc-server.js +10 -10
  87. package/dist/src/client/api/state.d.ts +2 -2
  88. package/dist/src/client/api/state.js +2 -2
  89. package/dist/src/client/api/subscribe-logs.d.ts +2 -2
  90. package/dist/src/client/api/subscribe-logs.js +2 -2
  91. package/dist/src/client/api/suspend.d.ts +4 -2
  92. package/dist/src/client/api/suspend.js +4 -3
  93. package/dist/src/client/api/text-to-speech.d.ts +14 -5
  94. package/dist/src/client/api/text-to-speech.js +83 -29
  95. package/dist/src/client/api/transcribe.d.ts +6 -2
  96. package/dist/src/client/api/transcribe.js +7 -1
  97. package/dist/src/client/api/unload-model.d.ts +19 -7
  98. package/dist/src/client/api/unload-model.js +29 -11
  99. package/dist/src/client/api/upscale.d.ts +6 -3
  100. package/dist/src/client/api/upscale.js +9 -4
  101. package/dist/src/client/api/vector-index.d.ts +50 -16
  102. package/dist/src/client/api/vector-index.js +100 -48
  103. package/dist/src/client/api/video-request.d.ts +5 -5
  104. package/dist/src/client/api/video.d.ts +3 -2
  105. package/dist/src/client/api/video.js +3 -2
  106. package/dist/src/client/api/vla.d.ts +9 -5
  107. package/dist/src/client/api/vla.js +17 -8
  108. package/dist/src/client/api/world.d.ts +5 -5
  109. package/dist/src/client/api/world.js +4 -4
  110. package/dist/src/client/init-hooks.d.ts +6 -4
  111. package/dist/src/client/init-hooks.js +12 -15
  112. package/dist/src/client/logging-stream-registry.d.ts +6 -3
  113. package/dist/src/client/logging-stream-registry.js +31 -12
  114. package/dist/src/client/rpc/bundle-stamp.d.ts +29 -0
  115. package/dist/src/client/rpc/bundle-stamp.js +75 -0
  116. package/dist/src/client/rpc/expo-home-dir.d.ts +2 -0
  117. package/dist/src/client/rpc/expo-home-dir.js +4 -0
  118. package/dist/src/client/rpc/expo-rpc-client.js +189 -135
  119. package/dist/src/client/rpc/node-rpc-client.js +322 -413
  120. package/dist/src/client/rpc/pear-runtime.d.ts +12 -0
  121. package/dist/src/client/rpc/pear-runtime.js +12 -0
  122. package/dist/src/client/rpc/rpc-client.d.ts +5 -4
  123. package/dist/src/client/rpc/rpc-client.js +126 -23
  124. package/dist/src/client/rpc/rpc-error.js +21 -2
  125. package/dist/src/client/rpc/unbundled-harness.d.ts +16 -0
  126. package/dist/src/client/rpc/unbundled-harness.js +27 -0
  127. package/dist/src/client/rpc/worker-failure.d.ts +27 -0
  128. package/dist/src/client/rpc/worker-failure.js +61 -0
  129. package/dist/src/client/session-registry.d.ts +75 -0
  130. package/dist/src/client/session-registry.js +149 -0
  131. package/dist/src/client/session.d.ts +125 -0
  132. package/dist/src/client/session.js +148 -0
  133. package/dist/src/commands/bundle/addons.d.ts +14 -0
  134. package/dist/src/commands/bundle/addons.js +65 -0
  135. package/dist/src/commands/bundle/constants.js +1 -0
  136. package/dist/src/commands/bundle/entry-gen.d.ts +1 -5
  137. package/dist/src/commands/bundle/entry-gen.js +17 -50
  138. package/dist/src/commands/bundle/index.d.ts +59 -13
  139. package/dist/src/commands/bundle/index.js +345 -121
  140. package/dist/src/commands/bundle/link.d.ts +58 -0
  141. package/dist/src/commands/bundle/link.js +135 -0
  142. package/dist/src/commands/bundle/node-support.d.ts +13 -0
  143. package/dist/src/commands/bundle/node-support.js +23 -0
  144. package/dist/src/commands/bundle/read-bundle.d.ts +9 -0
  145. package/dist/src/commands/bundle/read-bundle.js +27 -0
  146. package/dist/src/commands/bundle/resolve-sdk-import.d.ts +6 -0
  147. package/dist/src/commands/bundle/resolve-sdk-import.js +24 -28
  148. package/dist/src/commands/bundle/scratch.d.ts +35 -0
  149. package/dist/src/commands/bundle/scratch.js +178 -0
  150. package/dist/src/commands/bundle/targets.d.ts +14 -0
  151. package/dist/src/commands/bundle/targets.js +37 -0
  152. package/dist/src/commands/host-prebuilds/index.d.ts +5 -4
  153. package/dist/src/commands/host-prebuilds/index.js +9 -7
  154. package/dist/src/commands/index.d.ts +4 -3
  155. package/dist/src/commands/verify/abi.d.ts +20 -14
  156. package/dist/src/commands/verify/abi.js +11 -79
  157. package/dist/src/commands/verify/bare-kit-runtime.d.ts +20 -22
  158. package/dist/src/commands/verify/bare-kit-runtime.js +102 -150
  159. package/dist/src/commands/verify/bare-kit-runtimes.d.ts +10 -9
  160. package/dist/src/commands/verify/bare-kit-runtimes.js +21 -21
  161. package/dist/src/commands/verify/bundle-source.js +25 -21
  162. package/dist/src/commands/verify/engines-advice.d.ts +2 -8
  163. package/dist/src/commands/verify/engines-advice.js +7 -54
  164. package/dist/src/commands/verify/index.d.ts +30 -29
  165. package/dist/src/commands/verify/index.js +92 -200
  166. package/dist/src/commands/verify/prebuilds.d.ts +3 -5
  167. package/dist/src/commands/verify/prebuilds.js +1 -2
  168. package/dist/src/commands/verify/resource-collectors.d.ts +0 -6
  169. package/dist/src/commands/verify/resource-collectors.js +1 -50
  170. package/dist/src/commands/verify/sidecar-runtime.d.ts +6 -0
  171. package/dist/src/commands/verify/sidecar-runtime.js +51 -0
  172. package/dist/src/expo/plugins/withBareKit.d.ts +59 -0
  173. package/dist/src/expo/plugins/withBareKit.js +204 -0
  174. package/dist/src/expo/plugins/withMobileBundle.d.ts +4 -11
  175. package/dist/src/expo/plugins/withMobileBundle.js +36 -57
  176. package/dist/src/expo/plugins/withQvacSDK.d.ts +1 -0
  177. package/dist/src/expo/plugins/withQvacSDK.js +3 -0
  178. package/dist/src/index.d.ts +6 -5
  179. package/dist/src/index.js +10 -14
  180. package/dist/src/logging/utils.js +10 -2
  181. package/dist/src/plugin-ids.d.ts +2 -1
  182. package/dist/src/plugin-ids.js +2 -0
  183. package/dist/src/schemas/public.d.ts +1 -1
  184. package/dist/src/schemas/public.js +1 -1
  185. package/dist/src/schemas/sdk-errors-client.d.ts +5 -6
  186. package/dist/src/schemas/sdk-errors-client.js +30 -36
  187. package/dist/src/schemas/sdk-errors-server.d.ts +11 -1
  188. package/dist/src/schemas/sdk-errors-server.js +60 -2
  189. package/dist/src/server/rpc/rpc-utils.d.ts +25 -4
  190. package/dist/src/server/rpc/rpc-utils.js +39 -5
  191. package/dist/src/utils/errors-client.d.ts +37 -29
  192. package/dist/src/utils/errors-client.js +50 -41
  193. package/dist/src/utils/errors-server.d.ts +59 -1
  194. package/dist/src/utils/errors-server.js +110 -1
  195. package/dist/src/utils/withTimeout.js +34 -17
  196. package/dist/src/worker/handle-request.js +25 -22
  197. package/dist/src/worker/handler-utils.d.ts +2 -6
  198. package/dist/src/worker/handler-utils.js +2 -20
  199. package/dist/src/worker/index.d.ts +2 -4
  200. package/dist/src/worker/index.js +23 -35
  201. package/dist/src/worker/plugins/ggml-image-embedding.d.ts +2 -0
  202. package/dist/src/worker/plugins/ggml-image-embedding.js +1 -0
  203. package/dist/src/worker/shim.d.ts +4 -0
  204. package/dist/src/worker/shim.js +7 -0
  205. package/dist/src/worker/start.d.ts +9 -0
  206. package/dist/src/worker/start.js +16 -0
  207. package/dist/src/worker/unbundled-shim.d.ts +2 -0
  208. package/dist/src/worker/unbundled-shim.js +4 -0
  209. package/docs/system-resources-support-matrix.md +27 -19
  210. package/package.json +62 -51
  211. package/src/electron-forge/index.cjs +65 -91
  212. package/dist/examples/model-fit-ui/server.d.ts +0 -24
  213. package/dist/examples/model-fit-ui/server.js +0 -221
  214. package/dist/src/client/rpc/ensure-worker-ready.d.ts +0 -9
  215. package/dist/src/client/rpc/ensure-worker-ready.js +0 -17
  216. package/dist/src/client/rpc/init-timeout.d.ts +0 -26
  217. package/dist/src/client/rpc/init-timeout.js +0 -25
  218. package/dist/src/client/rpc/ipc-socket-path.d.ts +0 -11
  219. package/dist/src/client/rpc/ipc-socket-path.js +0 -30
  220. package/dist/src/client/rpc/worker-startup-error.d.ts +0 -12
  221. package/dist/src/client/rpc/worker-startup-error.js +0 -13
  222. package/dist/src/commands/bundle/bare-pack.d.ts +0 -21
  223. package/dist/src/commands/bundle/bare-pack.js +0 -77
  224. package/dist/src/commands/bundle/manifest.d.ts +0 -25
  225. package/dist/src/commands/bundle/manifest.js +0 -192
  226. package/dist/src/expo/plugins/link-addons.d.ts +0 -18
  227. package/dist/src/expo/plugins/link-addons.js +0 -65
  228. package/dist/src/pear/pre.d.ts +0 -21
  229. package/dist/src/pear/pre.js +0 -450
  230. package/dist/src/server/env.d.ts +0 -22
  231. package/dist/src/server/env.js +0 -59
  232. package/dist/src/server/utils/qvac-paths.d.ts +0 -2
  233. package/dist/src/server/utils/qvac-paths.js +0 -5
  234. package/dist/src/server/utils/worker-lock.d.ts +0 -3
  235. package/dist/src/server/utils/worker-lock.js +0 -67
  236. package/dist/src/worker/create-server.d.ts +0 -8
  237. package/dist/src/worker/create-server.js +0 -51
  238. package/dist/src/worker/lifecycle.d.ts +0 -23
  239. package/dist/src/worker/lifecycle.js +0 -149
package/NOTICE CHANGED
@@ -97,6 +97,8 @@ Third-Party Model Licenses
97
97
  https://huggingface.co/primeline/whisper-tiny-german-1224
98
98
  dolphin-mixtral-2x7b-dop-Q2_K-00001-of-00005
99
99
  https://huggingface.co/jmb95/laser-dolphin-mixtral-2x7b-dpo-GGUF
100
+ embeddinggemma-2-GGUF
101
+ https://huggingface.co/ggml-org/embeddinggemma-2-GGUF
100
102
  en-base-ggml-model-f16
101
103
  https://huggingface.co/openai/whisper-base
102
104
  FLUX.2-klein-4B
@@ -167,6 +169,10 @@ Third-Party Model Licenses
167
169
  https://huggingface.co/OpenMOSS-Team/MOSS-TTS
168
170
  moss-codec-encoder-f16
169
171
  https://huggingface.co/OpenMOSS-Team/MOSS-TTS
172
+ MOSS-Image
173
+ https://huggingface.co/Comfy-Org/MOSS-Image
174
+ MOSS-Image-SFT
175
+ https://huggingface.co/OpenMOSS-Team/MOSS-Image-SFT
170
176
  moss-sfx-v2-f16
171
177
  https://huggingface.co/OpenMOSS-Team/MOSS-SoundEffect-v2.0
172
178
  moss-speech-bf16
@@ -263,6 +269,8 @@ Third-Party Model Licenses
263
269
  https://huggingface.co/ggml-org/SmolVLM2-500M-Video-Instruct-GGUF
264
270
  Ternary-Bonsai-2-27B-gguf
265
271
  https://huggingface.co/prism-ml/Ternary-Bonsai-2-27B-gguf
272
+ transcribepsy-250m-eu
273
+ https://huggingface.co/qvac/TranscribePsy-250M-EU
266
274
  TranscribePsy-250M-EU-sub-coreml
267
275
  https://huggingface.co/qvac/TranscribePsy-250M-EU-sub-coreml
268
276
  TranscribePsy-250M-EU-sub-gguf
@@ -394,8 +402,12 @@ Third-Party Model Licenses
394
402
 
395
403
  --- gemma (Gemma Terms of Use) ---
396
404
 
397
- embeddinggemma-300m-GGUF
398
- https://huggingface.co/unsloth/embeddinggemma-300m-GGUF
405
+ embeddinggemma-300M-BF16
406
+ https://huggingface.co/google/embeddinggemma-300m
407
+ embeddinggemma-300M-Q4_0
408
+ https://huggingface.co/google/embeddinggemma-300m
409
+ embeddinggemma-300M-Q8_0
410
+ https://huggingface.co/google/embeddinggemma-300m
399
411
  gemma-3-12b-it-GGUF
400
412
  https://huggingface.co/unsloth/gemma-3-12b-it-GGUF
401
413
 
@@ -432,6 +444,10 @@ Third-Party Model Licenses
432
444
  https://huggingface.co/ACE-Step/acestep-v15-base
433
445
  acestep-v15-sft-Q8_0
434
446
  https://huggingface.co/ACE-Step/acestep-v15-sft
447
+ acestep-v15-turbo-BF16
448
+ https://huggingface.co/ACE-Step/Ace-Step1.5
449
+ acestep-v15-turbo-F16
450
+ https://huggingface.co/ACE-Step/Ace-Step1.5
435
451
  acestep-v15-turbo-Q4_K_M
436
452
  https://huggingface.co/ACE-Step/Ace-Step1.5
437
453
  acestep-v15-turbo-Q8_0
@@ -454,10 +470,14 @@ Third-Party Model Licenses
454
470
  https://huggingface.co/ResembleAI/chatterbox-turbo
455
471
  coremldata
456
472
  https://huggingface.co/ai4bharat/indic-conformer-600m-multilingual
473
+ coremldata
474
+ https://huggingface.co/ACE-Step/Ace-Step1.5
457
475
  de-base-ggml-model-f16
458
476
  https://huggingface.co/aware-ai/whisper-base-german
459
477
  DeepSeek-V4-Flash-0731-GGUF
460
478
  https://huggingface.co/unsloth/DeepSeek-V4-Flash-0731-GGUF
479
+ DeepSeek-V4.1-Flash-1017-GGUF
480
+ https://huggingface.co/unsloth/DeepSeek-V4.1-Flash-1017-GGUF
461
481
  es-tiny-ggml-model-f16
462
482
  https://huggingface.co/JaepaX/whisper-tiny-es
463
483
  ggml-indictrans2-en-indic-1B-f16
@@ -472,6 +492,8 @@ Third-Party Model Licenses
472
492
  https://huggingface.co/ai4bharat/indictrans2-indic-indic-1B
473
493
  ggml-indictrans2-indic-indic-dist-320M-f16
474
494
  https://huggingface.co/ai4bharat/indictrans2-indic-indic-dist-320M
495
+ GLM-5.3-Flash-BF16-GGUF
496
+ https://huggingface.co/bartowski/GLM-5.3-Flash-BF16-GGUF
475
497
  gte-large_fp16-00001-of-00005
476
498
  https://huggingface.co/ChristianAzinn/gte-large-gguf
477
499
  gte-large-gguf
@@ -486,8 +508,16 @@ Third-Party Model Licenses
486
508
  https://huggingface.co/spaces/YatharthS
487
509
  lavasr-enhancer-f16
488
510
  https://huggingface.co/spaces/YatharthS
511
+ Manifest
512
+ https://huggingface.co/ACE-Step/Ace-Step1.5
513
+ megaloc-f16
514
+ https://huggingface.co/gberton/MegaLoc
515
+ megaloc-mixed
516
+ https://huggingface.co/gberton/MegaLoc
489
517
  model
490
518
  https://huggingface.co/ai4bharat/indic-conformer-600m-multilingual
519
+ model
520
+ https://huggingface.co/ACE-Step/Ace-Step1.5
491
521
  pt-tiny-ggml-model-f16
492
522
  https://huggingface.co/DavyCosta701/whisper-tiny-pt-bpra
493
523
  taew2_2_f16
@@ -500,6 +530,8 @@ Third-Party Model Licenses
500
530
  https://huggingface.co/ACE-Step/Ace-Step1.5
501
531
  weight
502
532
  https://huggingface.co/ai4bharat/indic-conformer-600m-multilingual
533
+ weight
534
+ https://huggingface.co/ACE-Step/Ace-Step1.5
503
535
  whisper-vad
504
536
  https://huggingface.co/ggml-org/whisper-vad
505
537
  whisper.cpp
@@ -812,60 +844,61 @@ JavaScript Dependencies
812
844
 
813
845
  @hyperswarm/secret-stream@6.9.2
814
846
  https://github.com/holepunchto/hyperswarm-secret-stream
815
- @qvac/asr-ggml@0.11.2
847
+ @qvac/asr-ggml@0.12.1
816
848
  https://github.com/tetherto/qvac
817
- @qvac/asr-ggml-darwin-arm64@0.11.2
849
+ @qvac/asr-ggml-darwin-arm64@0.12.1
818
850
  https://github.com/tetherto/qvac
819
- @qvac/audiogen-ggml@0.9.1
851
+ @qvac/audiogen-ggml@0.10.1
820
852
  https://github.com/tetherto/qvac
821
- @qvac/audiogen-ggml-darwin-arm64@0.9.1
853
+ @qvac/audiogen-ggml-darwin-arm64@0.10.1
822
854
  https://github.com/tetherto/qvac
823
- @qvac/bci-whispercpp@0.14.1
855
+ @qvac/bci-whispercpp@0.15.1
824
856
  https://github.com/tetherto/qvac
825
- @qvac/classification-ggml@0.34.0
857
+ @qvac/classification-ggml@0.36.1
826
858
  https://github.com/tetherto/qvac
827
- @qvac/decoder-audio@0.8.1
859
+ @qvac/decoder-audio@0.9.0
828
860
  https://github.com/tetherto/qvac
829
- @qvac/diffusion-cpp@0.31.0
861
+ @qvac/diffusion-cpp@0.35.1
830
862
  https://github.com/tetherto/qvac
831
- @qvac/diffusion-cpp-darwin-arm64@0.31.0
863
+ @qvac/diffusion-cpp-darwin-arm64@0.35.1
832
864
  https://github.com/tetherto/qvac
833
- @qvac/embed-llamacpp@0.53.0
865
+ @qvac/embed-llamacpp@0.56.1
834
866
  https://github.com/tetherto/qvac
835
867
  @qvac/error@0.1.1
836
- @qvac/fabric@0.24.0
868
+ @qvac/fabric@0.29.1
837
869
  https://github.com/tetherto/qvac
838
- @qvac/fabric-darwin-arm64@0.24.0
870
+ @qvac/fabric-darwin-arm64@0.29.1
839
871
  https://github.com/tetherto/qvac
840
- @qvac/ggml-rpc-server@0.7.0
872
+ @qvac/ggml-rpc-server@0.9.1
841
873
  https://github.com/tetherto/qvac
842
874
  @qvac/infer-base@0.8.0
843
875
  https://github.com/tetherto/qvac
844
- @qvac/inference@0.22.0
876
+ @qvac/inference@0.24.0
845
877
  https://github.com/tetherto/qvac
846
878
  @qvac/langdetect-text@0.1.3
847
879
  https://github.com/tetherto/qvac
848
- @qvac/llm-llamacpp@0.65.0
880
+ @qvac/llm-llamacpp@0.70.1
849
881
  https://github.com/tetherto/qvac
850
882
  @qvac/logging@0.1.1
851
883
  https://github.com/tetherto/qvac
852
- @qvac/ocr-ggml@0.31.0
884
+ @qvac/ocr-ggml@0.33.1
853
885
  https://github.com/tetherto/qvac
854
- @qvac/rag@0.8.1
886
+ @qvac/rag@0.9.0
855
887
  https://github.com/tetherto/qvac
856
- @qvac/registry-client@0.7.0
888
+ @qvac/registry-client@0.8.0
857
889
  https://github.com/tetherto/qvac
858
890
  @qvac/registry-schema@0.4.0
859
891
  https://github.com/tetherto/qvac
860
- @qvac/translation-nmtcpp@0.23.0
892
+ @qvac/response@0.1.2
893
+ @qvac/translation-nmtcpp@0.25.1
861
894
  https://github.com/tetherto/qvac
862
- @qvac/tts-ggml@0.14.1
895
+ @qvac/tts-ggml@0.15.1
863
896
  https://github.com/tetherto/qvac
864
- @qvac/tts-ggml-darwin-arm64@0.14.1
897
+ @qvac/tts-ggml-darwin-arm64@0.15.1
865
898
  https://github.com/tetherto/qvac
866
- @qvac/turbovec-ggml@0.3.0
899
+ @qvac/turbovec-ggml@0.5.1
867
900
  https://github.com/tetherto/qvac
868
- @qvac/vla-ggml@0.34.0
901
+ @qvac/vla-ggml@0.36.1
869
902
  https://github.com/tetherto/qvac
870
903
  adaptive-timeout@1.0.1
871
904
  https://github.com/holepunchto/adaptive-timeout
@@ -875,13 +908,13 @@ JavaScript Dependencies
875
908
  https://github.com/holepunchto/bare-abort
876
909
  bare-abort-controller@1.1.2
877
910
  https://github.com/holepunchto/bare-abort-controller
878
- bare-addon-resolve@1.11.0
911
+ bare-addon-resolve@1.12.0
879
912
  https://github.com/holepunchto/bare-addon-resolve
880
913
  bare-ansi-escapes@2.2.4
881
914
  https://github.com/holepunchto/bare-ansi-escapes
882
915
  bare-assert@1.3.0
883
916
  https://github.com/holepunchto/bare-assert
884
- bare-buffer@3.7.1
917
+ bare-buffer@3.7.2
885
918
  https://github.com/holepunchto/bare-buffer
886
919
  bare-bundle@1.11.0
887
920
  https://github.com/holepunchto/bare-bundle
@@ -895,17 +928,19 @@ JavaScript Dependencies
895
928
  https://github.com/holepunchto/bare-crypto
896
929
  bare-debug-log@2.0.1
897
930
  https://github.com/holepunchto/bare-debug-log
898
- bare-dns@2.3.1
931
+ bare-dns@2.3.2
899
932
  https://github.com/holepunchto/bare-dns
900
933
  bare-encoding@1.0.3
901
934
  https://github.com/holepunchto/bare-encoding
902
935
  bare-env@3.0.1
903
936
  https://github.com/holepunchto/bare-env
937
+ bare-events@2.4.2
938
+ https://github.com/holepunchto/bare-events
904
939
  bare-events@2.9.1
905
940
  https://github.com/holepunchto/bare-events
906
941
  bare-fetch@3.4.1
907
942
  https://github.com/holepunchto/bare-fetch
908
- bare-ffmpeg@1.6.2
943
+ bare-ffmpeg@1.7.1
909
944
  https://github.com/holepunchto/bare-ffmpeg
910
945
  bare-form-data@1.2.2
911
946
  https://github.com/holepunchto/bare-form-data
@@ -913,8 +948,10 @@ JavaScript Dependencies
913
948
  https://github.com/holepunchto/bare-format
914
949
  bare-fs@4.8.4
915
950
  https://github.com/holepunchto/bare-fs
916
- bare-gpu-info@0.1.1
951
+ bare-gpu-info@0.1.3
917
952
  https://github.com/holepunchto/bare-gpu-info
953
+ bare-host-parser@1.0.0
954
+ https://github.com/holepunchto/bare-host-parser
918
955
  bare-hrtime@2.1.2
919
956
  https://github.com/holepunchto/bare-hrtime
920
957
  bare-http-parser@2.1.4
@@ -927,27 +964,29 @@ JavaScript Dependencies
927
964
  https://github.com/holepunchto/bare-inspect
928
965
  bare-inspector@6.1.0
929
966
  https://github.com/holepunchto/bare-inspector
930
- bare-lief@0.2.10
967
+ bare-lief@0.2.11
931
968
  https://github.com/holepunchto/bare-lief
932
- bare-link@4.1.0
969
+ bare-link@4.3.0
933
970
  https://github.com/holepunchto/bare-link
934
971
  bare-mime@1.0.0
935
972
  https://github.com/holepunchto/bare-mime
936
973
  bare-module@6.4.0
937
974
  https://github.com/holepunchto/bare-module
975
+ bare-module@7.5.2
976
+ https://github.com/holepunchto/bare-module
938
977
  bare-module-lexer@1.7.0
939
978
  https://github.com/holepunchto/bare-module-lexer
940
979
  bare-module-resolve@1.12.6
941
980
  https://github.com/holepunchto/bare-module-resolve
942
- bare-module-traverse@2.7.2
981
+ bare-module-traverse@2.7.6
943
982
  https://github.com/holepunchto/bare-module-traverse
944
983
  bare-net@2.3.3
945
984
  https://github.com/holepunchto/bare-net
946
- bare-os@3.9.3
985
+ bare-os@3.9.4
947
986
  https://github.com/holepunchto/bare-os
948
- bare-pack@3.0.2
987
+ bare-pack@3.1.0
949
988
  https://github.com/holepunchto/bare-pack
950
- bare-path@3.1.2
989
+ bare-path@3.1.3
951
990
  https://github.com/holepunchto/bare-path
952
991
  bare-performance@2.1.1
953
992
  https://github.com/holepunchto/bare-performance
@@ -957,18 +996,28 @@ JavaScript Dependencies
957
996
  https://github.com/holepunchto/bare-posix
958
997
  bare-process@4.5.1
959
998
  https://github.com/holepunchto/bare-process
960
- bare-rpc@1.3.8
999
+ bare-rpc@2.0.0
961
1000
  https://github.com/holepunchto/bare-rpc
962
- bare-runtime@1.36.0
963
- https://github.com/holepunchto/bare-runtime
964
- bare-runtime-darwin-arm64@1.36.0
965
- https://github.com/holepunchto/bare-runtime
966
1001
  bare-semver@1.1.0
967
1002
  https://github.com/holepunchto/bare-semver
1003
+ bare-sidecar@0.5.16
1004
+ https://github.com/holepunchto/bare-sidecar
968
1005
  bare-signals@5.0.0
969
1006
  https://github.com/holepunchto/bare-signals
1007
+ bare-sleep@1.0.1
1008
+ https://github.com/holepunchto/bare-sleep
970
1009
  bare-stdio@1.0.3
971
1010
  https://github.com/holepunchto/bare-stdio
1011
+ bare-stow@0.3.6
1012
+ https://github.com/holepunchto/bare-stow
1013
+ bare-stow-host@0.2.0
1014
+ https://github.com/holepunchto/bare-stow-host
1015
+ bare-stow-protocol@0.1.1
1016
+ https://github.com/holepunchto/bare-stow-protocol
1017
+ bare-stow-runtime@0.1.2
1018
+ https://github.com/holepunchto/bare-stow-runtime
1019
+ bare-stow-target-react-native@0.3.0
1020
+ https://github.com/holepunchto/bare-stow-target-react-native
972
1021
  bare-stream@2.13.3
973
1022
  https://github.com/holepunchto/bare-stream
974
1023
  bare-structured-clone@2.0.1
@@ -981,20 +1030,28 @@ JavaScript Dependencies
981
1030
  https://github.com/holepunchto/bare-subprocess
982
1031
  bare-tcp@2.6.1
983
1032
  https://github.com/holepunchto/bare-tcp
984
- bare-tls@3.2.0
1033
+ bare-tls@3.2.1
985
1034
  https://github.com/holepunchto/bare-tls
986
- bare-tty@5.2.1
1035
+ bare-tty@5.2.2
987
1036
  https://github.com/holepunchto/bare-tty
988
1037
  bare-type@1.4.0
989
1038
  https://github.com/holepunchto/bare-type
990
1039
  bare-type-stripper@0.1.7
991
1040
  https://github.com/holepunchto/bare-type-stripper
992
- bare-url@2.5.5
1041
+ bare-unpack@1.1.4
1042
+ https://github.com/holepunchto/bare-unpack
1043
+ bare-url@2.5.7
993
1044
  https://github.com/holepunchto/bare-url
994
1045
  bare-utils@1.6.1
995
1046
  https://github.com/holepunchto/bare-utils
996
1047
  bare-v8-to-istanbul@1.0.4
997
1048
  https://github.com/holepunchto/bare-v8-to-istanbul
1049
+ bare-wasi@0.1.3
1050
+ https://github.com/holepunchto/bare-wasi
1051
+ bare-wasm@0.1.1
1052
+ https://github.com/holepunchto/bare-wasm
1053
+ bare-wasm-abi@0.1.2
1054
+ https://github.com/holepunchto/bare-wasm-abi
998
1055
  bare-ws@3.2.0
999
1056
  https://github.com/holepunchto/bare-ws
1000
1057
  bare-zlib@1.4.1
@@ -1003,7 +1060,7 @@ JavaScript Dependencies
1003
1060
  https://github.com/holepunchto/blind-relay
1004
1061
  brittle@3.19.1
1005
1062
  https://github.com/holepunchto/brittle
1006
- compact-encoding@3.5.2
1063
+ compact-encoding@3.7.0
1007
1064
  https://github.com/holepunchto/compact-encoding
1008
1065
  compact-encoding-bitfield@1.1.0
1009
1066
  https://github.com/compact-encoding/compact-encoding-bitfield
@@ -1015,7 +1072,7 @@ JavaScript Dependencies
1015
1072
  https://github.com/holepunchto/events-universal
1016
1073
  fd-lock@2.2.0
1017
1074
  https://github.com/holepunchto/fd-lock
1018
- fs-native-extensions@1.5.2
1075
+ fs-native-extensions@1.5.3
1019
1076
  https://github.com/holepunchto/fs-native-extensions
1020
1077
  globbie@1.0.6
1021
1078
  https://github.com/holepunchto/globbie
@@ -1029,7 +1086,7 @@ JavaScript Dependencies
1029
1086
  https://github.com/holepunchto/hypercore-stats
1030
1087
  hypercore-storage@3.4.0
1031
1088
  https://github.com/holepunchto/hypercore-storage
1032
- hyperdb@6.11.0
1089
+ hyperdb@6.11.1
1033
1090
  https://github.com/holepunchto/hyperdb
1034
1091
  hyperdht-address@1.1.1
1035
1092
  https://github.com/holepunchto/hyperdht-address
@@ -1041,15 +1098,15 @@ JavaScript Dependencies
1041
1098
  https://github.com/holepunchto/hyperdrive
1042
1099
  hyperschema@1.26.2
1043
1100
  https://github.com/holepunchto/hyperschema
1044
- hyperswarm-stats@1.3.3
1101
+ hyperswarm-stats@1.3.4
1045
1102
  https://github.com/holepunchto/hyperswarm-stats
1046
1103
  index-encoder@3.5.0
1047
1104
  https://github.com/holepunchto/index-encoder
1048
1105
  mirror-drive@1.14.2
1049
1106
  https://github.com/holepunchto/mirror-drive
1050
- noise-handshake@4.2.0
1107
+ noise-handshake@4.2.1
1051
1108
  https://github.com/holepunchto/noise-handshake
1052
- paparam@1.14.0
1109
+ paparam@1.15.0
1053
1110
  https://github.com/holepunchto/paparam
1054
1111
  passive-core-watcher@1.0.2
1055
1112
  https://github.com/holepunchto/passive-core-watcher
@@ -1069,7 +1126,7 @@ JavaScript Dependencies
1069
1126
  https://github.com/holepunchto/require-asset
1070
1127
  resource-on-exit@1.0.0
1071
1128
  https://github.com/holepunchto/bare-teardown
1072
- rocksdb-native@3.19.1
1129
+ rocksdb-native@3.19.5
1073
1130
  https://github.com/holepunchto/rocksdb-native
1074
1131
  scope-lock@1.2.4
1075
1132
  https://github.com/holepunchto/scope-lock
@@ -1079,7 +1136,7 @@ JavaScript Dependencies
1079
1136
  https://github.com/holepunchto/sub-encoder
1080
1137
  text-decoder@1.2.7
1081
1138
  https://github.com/holepunchto/text-decoder
1082
- udx-native@1.22.0
1139
+ udx-native@1.22.1
1083
1140
  https://github.com/holepunchto/udx-native
1084
1141
  unslab@1.3.1
1085
1142
  https://github.com/holepunchto/unslab
@@ -1096,7 +1153,7 @@ JavaScript Dependencies
1096
1153
  https://github.com/chm-diederichs/noise-curve-ed
1097
1154
  quickbit-universal@2.2.1
1098
1155
  https://github.com/holepunchto/quickbit-universal
1099
- semver@7.8.5
1156
+ semver@7.8.6
1100
1157
  https://github.com/npm/node-semver
1101
1158
  simdle-universal@1.1.3
1102
1159
  https://github.com/holepunchto/simdle-universal
@@ -1107,7 +1164,7 @@ JavaScript Dependencies
1107
1164
 
1108
1165
  --- mit (MIT License) ---
1109
1166
 
1110
- @jridgewell/resolve-uri@3.1.2
1167
+ @jridgewell/resolve-uri@3.1.3
1111
1168
  https://github.com/jridgewell/resolve-uri
1112
1169
  @jridgewell/sourcemap-codec@1.6.0
1113
1170
  https://github.com/jridgewell/sourcemaps
@@ -1145,11 +1202,11 @@ JavaScript Dependencies
1145
1202
  https://github.com/mafintosh/generate-string
1146
1203
  hyperbee@2.27.3
1147
1204
  https://github.com/holepunchto/hyperbee
1148
- hypercore@11.39.5
1205
+ hypercore@11.40.4
1149
1206
  https://github.com/holepunchto/hypercore
1150
1207
  hypercore-crypto@3.7.0
1151
1208
  https://github.com/mafintosh/hypercore-crypto
1152
- hyperdht@6.35.0
1209
+ hyperdht@6.36.0
1153
1210
  https://github.com/holepunchto/hyperdht
1154
1211
  hyperswarm@4.17.2
1155
1212
  https://github.com/holepunchto/hyperswarm
@@ -1171,7 +1228,7 @@ JavaScript Dependencies
1171
1228
  https://github.com/mafintosh/promaphore
1172
1229
  protocol-buffers-encodings@1.2.0
1173
1230
  https://github.com/mafintosh/protocol-buffers-encodings
1174
- protomux@3.13.0
1231
+ protomux@3.13.1
1175
1232
  https://github.com/holepunchto/protomux
1176
1233
  queue-tick@1.0.1
1177
1234
  https://github.com/mafintosh/queue-tick
@@ -1195,7 +1252,7 @@ JavaScript Dependencies
1195
1252
  https://github.com/mafintosh/signal-promise
1196
1253
  signed-varint@2.0.1
1197
1254
  https://github.com/dominictarr/signed-varint
1198
- sodium-native@5.2.0
1255
+ sodium-native@5.2.1
1199
1256
  https://github.com/holepunchto/sodium-native
1200
1257
  sodium-secretstream@1.2.0
1201
1258
  https://github.com/mafintosh/sodium-secretstream
package/README.md CHANGED
@@ -22,14 +22,13 @@ For AI/LLM tools, use [https://docs.qvac.tether.io/llms-full.txt](https://docs.q
22
22
 
23
23
  See https://docs.qvac.tether.io/sdk/getting-started/installation
24
24
 
25
- On Node.js, the SDK installs and launches its own Bare worker through `bare-runtime`.
26
- Its dependency range must satisfy `@qvac/inference`'s `engines.bare` requirement.
25
+ On Node.js, the SDK starts its own Bare worker with the Bare that `bare-sidecar` installs.
27
26
  When upgrading the SDK, reinstall dependencies with the existing lockfile so the
28
- package manager can replace an older, incompatible runtime. Remove any override
29
- or resolution that forces the worker below that requirement; installing a newer
30
- global `bare` executable does not change the SDK's worker dependency.
27
+ package manager can replace an older, incompatible `bare-sidecar`. Remove any override
28
+ or resolution that forces it below the SDK's range; installing a newer global `bare`
29
+ executable does not change the SDK's worker.
31
30
 
32
- For mobile apps that use only raw PCM streaming transcription, list the required audio plugins and set `"includeAudioDecoder": false` in `qvac.config.*` before bundling or running Expo prebuild. You can also use `qvac bundle sdk --defer bare-ffmpeg`. Both options leave `bare-ffmpeg` out of the native addon manifest. Bundle FFmpeg when the app decodes compressed audio files or asks `audiogen-ggml` for a compressed output format; PCM and WAV output need no FFmpeg.
31
+ For mobile apps that use only raw PCM streaming transcription, list the required audio plugins and set `"includeAudioDecoder": false` in `qvac.config.*` before bundling or running Expo prebuild. You can also use `qvac bundle sdk --defer bare-ffmpeg`. Both options leave `bare-ffmpeg` out of the worker bundle. Bundle FFmpeg when the app decodes compressed audio files or asks `audiogen-ggml` for a compressed output format; PCM and WAV output need no FFmpeg.
33
32
 
34
33
  ## Quickstart
35
34
 
@@ -84,12 +83,6 @@ try {
84
83
  node quickstart.js
85
84
  ```
86
85
 
87
- A first `loadModel()` call also starts the SDK's worker. If that startup ever
88
- exceeds its budget (cold disk cache, antivirus scanning the native addon), the
89
- call fails with `RPC_INIT_TIMEOUT`. Re-running usually succeeds; to give every
90
- start more room, raise `rpcInitTimeoutMs` in `qvac.config.*` or set the
91
- `QVAC_RPC_INIT_TIMEOUT_MS` environment variable.
92
-
93
86
  ## Documentation
94
87
 
95
88
  The [QVAC SDK documentation](https://docs.qvac.tether.io/sdk/) covers each
@@ -98,7 +91,7 @@ capability with its configuration and examples. See the
98
91
  and the [release notes](https://docs.qvac.tether.io/sdk/reference/release-notes/)
99
92
  for what changed in each release.
100
93
 
101
- TranscribePsy (`PARAKEET_TRANSCRIBEPSY_250M_Q8_0`, eight European
94
+ TranscribePsy EU-sub (`PARAKEET_TRANSCRIBEPSY_250M_Q8_0`, eight European
102
95
  languages) has a separate Core ML distribution instead of a sidecar:
103
96
  `PARAKEET_TRANSCRIBEPSY_250M_COREML_Q8_0` is an encoder-less GGUF whose
104
97
  encoder and decoder bundles the SDK stages beside it, so both stages run on
@@ -108,6 +101,10 @@ refused up front with the ggml constant to use instead. See
108
101
  which also shows the `longFormWindowFrames` / `longFormContextFrames` knobs
109
102
  that bound the offline encoder window on long recordings.
110
103
 
104
+ See the [transcription documentation](https://docs.qvac.tether.io/sdk/ai-capabilities/transcription)
105
+ for the full TranscribePsy-250M-EU model (`PARAKEET_TRANSCRIBEPSY_250M_EU_Q8_0`)
106
+ and its `language` routes.
107
+
111
108
  ## Examples
112
109
 
113
110
  The [`examples`](./examples) directory has scripts covering every SDK capability.
@@ -2,27 +2,28 @@
2
2
  * Parakeet Sortformer diarization + TDT transcription pipeline.
3
3
  *
4
4
  * Usage:
5
- * npx tsx examples/asr/parakeet-sortformer.ts [sortformer-gguf] [wav-file]
5
+ * npx tsx examples/asr/parakeet-sortformer.ts <wav-file> [sortformer-gguf]
6
6
  *
7
7
  * Two-step flow: Sortformer v2.1 diarizes the audio, then TDT transcribes each
8
- * speaker segment. Defaults to registry GGUFs and
9
- * `examples/audio/diarization-sample-16k.wav`. For live streaming + AOSC, see
8
+ * speaker segment. Defaults to registry GGUFs. For live streaming + AOSC, see
10
9
  * `parakeet-sortformer-streaming.ts`.
11
10
  *
12
- * Sample audio is in the QVAC source repo but not the published npm package.
13
- * Download the default file into `examples/audio/`:
11
+ * Audio should be 16 kHz mono 16-bit PCM in a WAV container. A multi-speaker
12
+ * sample is in the QVAC source repo but not the published npm package:
14
13
  * https://github.com/tetherto/qvac/blob/main/packages/sdk/examples/audio/diarization-sample-16k.wav
15
14
  */
16
15
  import { loadModel, unloadModel, transcribe, PARAKEET_TDT_0_6B_V3_Q8_0, PARAKEET_SORTFORMER_4SPK_V2_1_Q8_0 } from '@qvac/sdk';
17
- import { dirname, join } from 'path';
18
- import { fileURLToPath } from 'url';
16
+ import { join } from 'path';
19
17
  import { readFileSync, writeFileSync, mkdirSync } from 'fs';
20
18
  import { tmpdir } from 'os';
21
- const __dirname = dirname(fileURLToPath(import.meta.url));
22
19
  const args = process.argv.slice(2);
23
- const sortformerSrc = args[0] ?? PARAKEET_SORTFORMER_4SPK_V2_1_Q8_0;
24
- const defaultAudioPath = join(__dirname, '..', 'audio', 'diarization-sample-16k.wav');
25
- const audioFilePath = args[1] ?? defaultAudioPath;
20
+ if (!args[0]) {
21
+ console.error('Usage: npx tsx examples/asr/parakeet-sortformer.ts <wav-file> [sortformer-gguf]');
22
+ console.error('\nIf the model path is omitted, defaults to the registry model.');
23
+ process.exit(1);
24
+ }
25
+ const audioFilePath = args[0];
26
+ const sortformerSrc = args[1] ?? PARAKEET_SORTFORMER_4SPK_V2_1_Q8_0;
26
27
  try {
27
28
  // ── Step 1: Diarize with Sortformer ──
28
29
  const sfModelId = await loadModel({
@@ -71,15 +72,24 @@ catch (error) {
71
72
  process.exit(1);
72
73
  }
73
74
  // ── Helpers ──
75
+ // Sortformer reports each segment as `Speaker N: HH:MM:SS.mmm - HH:MM:SS.mmm`
74
76
  function parseDiarization(text) {
75
77
  const segs = [];
76
78
  for (const line of text.split('\n')) {
77
- const m = line.match(/Speaker (\d+): ([\d.]+)s - ([\d.]+)s/);
78
- if (m)
79
- segs.push({ speaker: +m[1], start: +m[2], end: +m[3] });
79
+ const m = line.match(/Speaker (\d+): (\d+):(\d+):([\d.]+) - (\d+):(\d+):([\d.]+)/);
80
+ if (m) {
81
+ segs.push({
82
+ speaker: +m[1],
83
+ start: seconds(m[2], m[3], m[4]),
84
+ end: seconds(m[5], m[6], m[7])
85
+ });
86
+ }
80
87
  }
81
88
  return segs.sort((a, b) => a.start - b.start);
82
89
  }
90
+ function seconds(h, m, s) {
91
+ return +h * 3600 + +m * 60 + +s;
92
+ }
83
93
  function readPcm(wavPath) {
84
94
  const buf = readFileSync(wavPath);
85
95
  const dataOffset = buf.indexOf('data') + 4;
@@ -2,7 +2,7 @@
2
2
  * TranscribePsy transcription from an audio file.
3
3
  *
4
4
  * Usage:
5
- * npx tsx examples/asr/parakeet-transcribepsy-filesystem.ts <audio-file> [--coreml] [--window-sec <seconds>]
5
+ * npx tsx examples/asr/parakeet-transcribepsy-filesystem.ts <audio-file> [--eu [--language en|other|auto]] [--coreml] [--window-sec <seconds>]
6
6
  *
7
7
  * TranscribePsy-250M-EU-sub is a 254M Parakeet-TDT distilled for Dutch,
8
8
  * English, French, German, Italian, Polish, Portuguese and Spanish; the engine
@@ -13,23 +13,43 @@
13
13
  * encoder and decoder bundles with the GGUF, and both stages run on the Neural
14
14
  * Engine. Anywhere else that constant is refused at load time.
15
15
  *
16
+ * `--eu` loads the full 25-language TranscribePsy-250M-EU instead
17
+ * (`PARAKEET_TRANSCRIBEPSY_250M_EU_Q8_0`): one GGUF with its CAFE language
18
+ * adapters and gate embedded, ggml on every platform, no Core ML distribution.
19
+ * `--language` picks its route: `en` for the English trunk, `other` for the
20
+ * non-English adapters, or `auto` (the default) to let the gate decide from
21
+ * the first seconds of the recording.
22
+ *
16
23
  * Long recordings are encoded in overlapping windows, so memory stays flat
17
24
  * however long the file is. Without `--window-sec` the engine uses the 60 s
18
25
  * windows with 25 % overlap the model recommends; an explicit window is sent
19
26
  * as encoder frames (12.5 per second) with a quarter of it as context, which
20
27
  * is how a phone with little memory can trade speed for a smaller footprint.
21
28
  */
22
- import { loadModel, unloadModel, transcribe, PARAKEET_TRANSCRIBEPSY_250M_Q8_0, PARAKEET_TRANSCRIBEPSY_250M_COREML_Q8_0 } from '@qvac/sdk';
29
+ import { loadModel, unloadModel, transcribe, PARAKEET_TRANSCRIBEPSY_250M_Q8_0, PARAKEET_TRANSCRIBEPSY_250M_COREML_Q8_0, PARAKEET_TRANSCRIBEPSY_250M_EU_Q8_0 } from '@qvac/sdk';
23
30
  const ENCODER_FRAMES_PER_SECOND = 12.5;
24
31
  const RECOMMENDED_OVERLAP = 0.25;
32
+ const EU_LANGUAGES = ['en', 'other', 'auto'];
33
+ const USAGE = 'Usage: npx tsx examples/asr/parakeet-transcribepsy-filesystem.ts <audio-file> ' +
34
+ '[--eu [--language en|other|auto]] [--coreml] [--window-sec <seconds>]';
25
35
  const args = process.argv.slice(2);
26
- const audioFilePath = args.find((arg) => !arg.startsWith('--'));
36
+ const valueFlags = new Set(['--window-sec', '--language']);
37
+ const audioFilePath = args.find((arg, index) => !arg.startsWith('--') && !valueFlags.has(args[index - 1] ?? ''));
27
38
  const useCoreml = args.includes('--coreml');
39
+ const useEu = args.includes('--eu');
28
40
  const windowIndex = args.indexOf('--window-sec');
29
41
  const windowSeconds = windowIndex === -1 ? undefined : Number(args[windowIndex + 1]);
30
- if (!audioFilePath || (windowSeconds !== undefined && !(windowSeconds > 0))) {
31
- console.error('Usage: npx tsx examples/asr/parakeet-transcribepsy-filesystem.ts <audio-file> ' +
32
- '[--coreml] [--window-sec <seconds>]');
42
+ const languageIndex = args.indexOf('--language');
43
+ const language = languageIndex === -1 ? undefined : args[languageIndex + 1];
44
+ function isEuLanguage(value) {
45
+ return EU_LANGUAGES.includes(value ?? '');
46
+ }
47
+ if (!audioFilePath ||
48
+ (windowSeconds !== undefined && !(windowSeconds > 0)) ||
49
+ (useEu && useCoreml) ||
50
+ // `--language` needs a value, and only the full EU model has a route to pick.
51
+ (languageIndex !== -1 && (!useEu || !isEuLanguage(language)))) {
52
+ console.error(USAGE);
33
53
  process.exit(1);
34
54
  }
35
55
  // An explicit window becomes the engine's frame counts; the overlap is shared
@@ -40,15 +60,24 @@ const longForm = windowSeconds === undefined
40
60
  longFormWindowFrames: Math.round(windowSeconds * ENCODER_FRAMES_PER_SECOND),
41
61
  longFormContextFrames: Math.round((windowSeconds * ENCODER_FRAMES_PER_SECOND * RECOMMENDED_OVERLAP) / 2)
42
62
  };
43
- const modelSrc = useCoreml
44
- ? PARAKEET_TRANSCRIBEPSY_250M_COREML_Q8_0
45
- : PARAKEET_TRANSCRIBEPSY_250M_Q8_0;
63
+ // The EU route only means something to the full model; EU-sub has no gate.
64
+ const route = useEu && language !== undefined ? { language } : {};
65
+ const modelSrc = useEu
66
+ ? PARAKEET_TRANSCRIBEPSY_250M_EU_Q8_0
67
+ : useCoreml
68
+ ? PARAKEET_TRANSCRIBEPSY_250M_COREML_Q8_0
69
+ : PARAKEET_TRANSCRIBEPSY_250M_Q8_0;
70
+ const variant = useEu
71
+ ? `EU, 25 languages, route ${language ?? 'auto'}`
72
+ : useCoreml
73
+ ? 'EU-sub, Core ML distribution'
74
+ : 'EU-sub, ggml';
46
75
  try {
47
- console.log(`▸ Loading TranscribePsy (${useCoreml ? 'Core ML distribution' : 'ggml'})...`);
76
+ console.log(`▸ Loading TranscribePsy (${variant})...`);
48
77
  const modelId = await loadModel({
49
78
  modelSrc,
50
79
  modelType: 'parakeet-transcription',
51
- modelConfig: longForm,
80
+ modelConfig: { ...longForm, ...route },
52
81
  onProgress: (p) => {
53
82
  const mb = (n) => (n / 1e6).toFixed(1);
54
83
  const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;