@qvac/inference 0.17.0 → 0.18.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 (111) hide show
  1. package/NOTICE +22 -80
  2. package/dist/api/completion-stream.d.ts +1 -1
  3. package/dist/api/completion-stream.js +1 -1
  4. package/dist/api/index.d.ts +1 -1
  5. package/dist/api/index.js +1 -1
  6. package/dist/api/text-to-speech.js +22 -2
  7. package/dist/api/transcribe.d.ts +19 -2
  8. package/dist/api/transcribe.js +66 -27
  9. package/dist/api/translate.js +6 -17
  10. package/dist/api/vla.d.ts +42 -1
  11. package/dist/api/vla.js +50 -1
  12. package/dist/constants/audio.d.ts +2 -1
  13. package/dist/constants/audio.js +17 -1
  14. package/dist/errors/index.d.ts +3 -0
  15. package/dist/errors/index.js +5 -0
  16. package/dist/handlers/load-model/handler.js +2 -2
  17. package/dist/handlers/load-model/resolve-session.d.ts +1 -1
  18. package/dist/handlers/load-model/resolve-session.js +3 -3
  19. package/dist/handlers/load-model/resolve.d.ts +12 -2
  20. package/dist/handlers/load-model/resolve.js +90 -12
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/models/registry/models.d.ts +782 -6
  24. package/dist/models/registry/models.js +2664 -1859
  25. package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-input.d.ts +19 -0
  26. package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-input.js +153 -0
  27. package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +54 -4
  28. package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +28 -0
  29. package/dist/plugins/builtin/ggml-ocr/plugin.js +3 -1
  30. package/dist/plugins/builtin/ggml-vla/ops/vla-set-embodiment.d.ts +2 -0
  31. package/dist/plugins/builtin/ggml-vla/ops/vla-set-embodiment.js +9 -0
  32. package/dist/plugins/builtin/ggml-vla/plugin.d.ts +37 -0
  33. package/dist/plugins/builtin/ggml-vla/plugin.js +21 -4
  34. package/dist/plugins/builtin/index.d.ts +1 -0
  35. package/dist/plugins/builtin/index.js +1 -0
  36. package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +16 -15
  37. package/dist/plugins/builtin/llamacpp-completion/ops/cache-logger.d.ts +1 -1
  38. package/dist/plugins/builtin/llamacpp-completion/ops/cache-logger.js +2 -2
  39. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +6 -0
  40. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.js +10 -0
  41. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.d.ts +1 -0
  42. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +131 -123
  43. package/dist/plugins/builtin/llamacpp-completion/ops/finetune.js +110 -20
  44. package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.d.ts +50 -23
  45. package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.js +308 -143
  46. package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-state.d.ts +1 -0
  47. package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-state.js +2 -2
  48. package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +6 -6
  49. package/dist/plugins/builtin/llamacpp-completion/plugin.js +56 -36
  50. package/dist/plugins/builtin/llamacpp-completion/transform.js +0 -7
  51. package/dist/plugins/builtin/llamacpp-embedding/plugin.js +2 -3
  52. package/dist/plugins/builtin/nmtcpp-translation/plugin.js +6 -5
  53. package/dist/plugins/builtin/parakeet-transcription/plugin.js +27 -16
  54. package/dist/plugins/builtin/tts-ggml/ops/parler-options.js +23 -3
  55. package/dist/plugins/builtin/tts-ggml/plugin.d.ts +302 -4
  56. package/dist/plugins/builtin/tts-ggml/plugin.js +131 -0
  57. package/dist/plugins/builtin/whispercpp-transcription/plugin.js +48 -39
  58. package/dist/plugins/ops/cancel.d.ts +1 -1
  59. package/dist/plugins/ops/cancel.js +1 -1
  60. package/dist/plugins/ops/kv-cache-retention.js +11 -0
  61. package/dist/plugins/ops/kv-cache-utils.d.ts +1 -1
  62. package/dist/plugins/ops/kv-cache-utils.js +40 -12
  63. package/dist/plugins/ops/transcribe.d.ts +2 -2
  64. package/dist/plugins/ops/transcribe.js +54 -48
  65. package/dist/plugins/ops/translate-stats.d.ts +4 -0
  66. package/dist/plugins/ops/translate-stats.js +11 -0
  67. package/dist/plugins/ops/translate.js +66 -38
  68. package/dist/plugins/ops/unload-model.js +30 -24
  69. package/dist/runtime/model-registry.d.ts +1 -0
  70. package/dist/runtime/request-context.js +29 -14
  71. package/dist/runtime/request-registry.d.ts +27 -0
  72. package/dist/runtime/request-registry.js +246 -76
  73. package/dist/schemas/audio-gen.d.ts +103 -0
  74. package/dist/schemas/audio-gen.js +135 -4
  75. package/dist/schemas/common.d.ts +550 -11
  76. package/dist/schemas/config.d.ts +60 -24
  77. package/dist/schemas/errors.d.ts +1 -0
  78. package/dist/schemas/errors.js +5 -0
  79. package/dist/schemas/index.d.ts +1 -1
  80. package/dist/schemas/index.js +1 -1
  81. package/dist/schemas/llamacpp-config.d.ts +10 -10
  82. package/dist/schemas/llamacpp-config.js +12 -5
  83. package/dist/schemas/load-model.d.ts +3691 -336
  84. package/dist/schemas/load-model.js +37 -19
  85. package/dist/schemas/text-to-speech.d.ts +1086 -110
  86. package/dist/schemas/text-to-speech.js +197 -7
  87. package/dist/schemas/tools.d.ts +0 -16
  88. package/dist/schemas/tools.js +0 -15
  89. package/dist/schemas/transcription-config.d.ts +2 -0
  90. package/dist/schemas/transcription-config.js +6 -0
  91. package/dist/schemas/transcription.d.ts +3 -0
  92. package/dist/schemas/vla.d.ts +83 -0
  93. package/dist/schemas/vla.js +105 -2
  94. package/dist/surface.d.ts +1 -1
  95. package/dist/surface.js +1 -1
  96. package/dist/utils/addon-responses.d.ts +4 -12
  97. package/dist/utils/audio/decoder.d.ts +37 -1
  98. package/dist/utils/audio/decoder.js +82 -52
  99. package/dist/utils/config-transform.d.ts +3 -0
  100. package/dist/utils/config-transform.js +6 -0
  101. package/dist/utils/index.d.ts +0 -1
  102. package/dist/utils/index.js +0 -1
  103. package/dist/utils/shard-utils.d.ts +1 -0
  104. package/dist/utils/shard-utils.js +14 -0
  105. package/dist/utils/tool-integration.d.ts +3 -10
  106. package/dist/utils/tool-integration.js +3 -12
  107. package/package.json +26 -22
  108. package/dist/plugins/builtin/llamacpp-completion/ops/batch-cancelled.d.ts +0 -22
  109. package/dist/plugins/builtin/llamacpp-completion/ops/batch-cancelled.js +0 -30
  110. package/dist/utils/expand-gguf-shards.d.ts +0 -2
  111. package/dist/utils/expand-gguf-shards.js +0 -22
package/NOTICE CHANGED
@@ -61,6 +61,8 @@ Third-Party Model Licenses
61
61
 
62
62
  --- apache-2.0 (Apache License 2.0) ---
63
63
 
64
+ abot-world-0-5b-lf-dit-q8_0
65
+ https://huggingface.co/acvlab/ABot-World-0-5B-LF
64
66
  bci-embedder
65
67
  https://github.com/tetherto/qvac/releases/download/bci-test-assets-v0.1.0/bci-embedder.bin
66
68
  cosyvoice3-flow-f32
@@ -193,6 +195,8 @@ Third-Party Model Licenses
193
195
  https://huggingface.co/HuggingFaceVLA/smolvla_libero
194
196
  SmolVLM2-500M-Video-Instruct-GGUF
195
197
  https://huggingface.co/ggml-org/SmolVLM2-500M-Video-Instruct-GGUF
198
+ umt5-xxl-enc-q8_0
199
+ https://huggingface.co/Comfy-Org/Wan_2.1_ComfyUI_repackaged
196
200
  unlimited-ocr-gguf
197
201
  https://huggingface.co/vimalnakrani/unlimited-ocr-gguf
198
202
  voice-en
@@ -211,6 +215,8 @@ Third-Party Model Licenses
211
215
  https://huggingface.co/city96/Wan2.1-I2V-14B-720P-gguf
212
216
  Wan2.1-T2V-14B-gguf
213
217
  https://huggingface.co/city96/Wan2.1-T2V-14B-gguf
218
+ wan2.2_vae_f16
219
+ https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged
214
220
  Wan2.2-TI2V-5B-Turbo-GGUF
215
221
  https://huggingface.co/hum-ma/Wan2.2-TI2V-5B-Turbo-GGUF
216
222
 
@@ -348,6 +354,8 @@ Third-Party Model Licenses
348
354
  https://huggingface.co/spaces/YatharthS
349
355
  pt-tiny-ggml-model-f16
350
356
  https://huggingface.co/DavyCosta701/whisper-tiny-pt-bpra
357
+ taew2_2_f16
358
+ https://github.com/madebyollin/taehv
351
359
  tiny_acft_q8_0
352
360
  https://voiceinput.futo.org/VoiceInput/tiny_en_acft_q8_0.bin
353
361
  tiny_en_acft_q8_0
@@ -624,49 +632,15 @@ JavaScript Dependencies
624
632
 
625
633
  @hyperswarm/secret-stream@6.9.1
626
634
  https://github.com/holepunchto/hyperswarm-secret-stream
627
- @qvac/asr-ggml@0.1.1
628
- https://github.com/tetherto/qvac
629
- @qvac/audiogen-ggml@0.1.0
630
- https://github.com/tetherto/qvac
631
- @qvac/bci-whispercpp@0.5.1
632
- https://github.com/tetherto/qvac
633
- @qvac/classification-ggml@0.15.1
634
- https://github.com/tetherto/qvac
635
- @qvac/decoder-audio@0.5.0
636
- https://github.com/tetherto/qvac
637
- @qvac/diagnostics@0.1.2
638
- https://github.com/tetherto/qvac
639
- @qvac/diffusion-cpp@0.17.0
640
- https://github.com/tetherto/qvac
641
- @qvac/embed-llamacpp@0.30.1
642
- https://github.com/tetherto/qvac
643
635
  @qvac/error@0.1.1
644
- @qvac/fabric@0.3.1
645
- https://github.com/tetherto/qvac
646
- @qvac/infer-base@0.4.2
647
- https://github.com/tetherto/qvac
648
- @qvac/infer-base@0.6.2
649
- https://github.com/tetherto/qvac
650
- @qvac/langdetect-text@0.1.2
651
- https://github.com/tetherto/qvac
652
- @qvac/llm-llamacpp@0.39.2
653
- https://github.com/tetherto/qvac
654
636
  @qvac/logging@0.1.1
655
637
  https://github.com/tetherto/qvac
656
- @qvac/ocr-ggml@0.13.1
657
- https://github.com/tetherto/qvac
658
638
  @qvac/rag@0.6.4
659
639
  https://github.com/tetherto/qvac
660
640
  @qvac/registry-client@0.6.1
661
641
  https://github.com/tetherto/qvac
662
642
  @qvac/registry-schema@0.3.0
663
643
  https://github.com/tetherto/qvac
664
- @qvac/translation-nmtcpp@8.2.1
665
- https://github.com/tetherto/qvac
666
- @qvac/tts-ggml@0.6.1
667
- https://github.com/tetherto/qvac
668
- @qvac/vla-ggml@0.16.2
669
- https://github.com/tetherto/qvac
670
644
  adaptive-timeout@1.0.1
671
645
  https://github.com/holepunchto/adaptive-timeout
672
646
  b4a@1.8.1
@@ -681,12 +655,8 @@ JavaScript Dependencies
681
655
  https://github.com/holepunchto/bare-ansi-escapes
682
656
  bare-assert@1.2.0
683
657
  https://github.com/holepunchto/bare-assert
684
- bare-buffer@3.6.2
658
+ bare-buffer@3.7.0
685
659
  https://github.com/holepunchto/bare-buffer
686
- bare-bundle@1.10.0
687
- https://github.com/holepunchto/bare-bundle
688
- bare-bundle-id@1.0.2
689
- https://github.com/holepunchto/bare-bundle-id
690
660
  bare-cpu-info@0.1.1
691
661
  https://github.com/holepunchto/bare-cpu-info
692
662
  bare-crypto@1.15.3
@@ -699,11 +669,9 @@ JavaScript Dependencies
699
669
  https://github.com/holepunchto/bare-events
700
670
  bare-fetch@3.2.0
701
671
  https://github.com/holepunchto/bare-fetch
702
- bare-ffmpeg@1.5.0
703
- https://github.com/holepunchto/bare-ffmpeg
704
672
  bare-form-data@1.2.2
705
673
  https://github.com/holepunchto/bare-form-data
706
- bare-fs@4.7.4
674
+ bare-fs@4.8.0
707
675
  https://github.com/holepunchto/bare-fs
708
676
  bare-gpu-info@0.1.1
709
677
  https://github.com/holepunchto/bare-gpu-info
@@ -711,30 +679,20 @@ JavaScript Dependencies
711
679
  https://github.com/holepunchto/bare-hrtime
712
680
  bare-http-parser@1.1.5
713
681
  https://github.com/holepunchto/bare-http-parser
714
- bare-http1@4.5.7
682
+ bare-http1@4.5.8
715
683
  https://github.com/holepunchto/bare-http1
716
684
  bare-https@3.0.0
717
685
  https://github.com/holepunchto/bare-https
718
- bare-inspect@3.1.4
686
+ bare-inspect@3.1.5
719
687
  https://github.com/holepunchto/bare-inspect
720
- bare-lief@0.2.6
721
- https://github.com/holepunchto/bare-lief
722
- bare-link@3.3.0
723
- https://github.com/holepunchto/bare-link
724
688
  bare-mime@1.0.0
725
689
  https://github.com/holepunchto/bare-mime
726
- bare-module-lexer@1.6.3
727
- https://github.com/holepunchto/bare-module-lexer
728
690
  bare-module-resolve@1.12.4
729
691
  https://github.com/holepunchto/bare-module-resolve
730
- bare-module-traverse@2.4.4
731
- https://github.com/holepunchto/bare-module-traverse
732
- bare-net@2.3.2
692
+ bare-net@2.3.3
733
693
  https://github.com/holepunchto/bare-net
734
694
  bare-os@3.9.3
735
695
  https://github.com/holepunchto/bare-os
736
- bare-pack@2.2.1
737
- https://github.com/holepunchto/bare-pack
738
696
  bare-path@3.1.1
739
697
  https://github.com/holepunchto/bare-path
740
698
  bare-performance@2.1.1
@@ -747,33 +705,23 @@ JavaScript Dependencies
747
705
  https://github.com/holepunchto/bare-process
748
706
  bare-rpc@1.3.8
749
707
  https://github.com/holepunchto/bare-rpc
750
- bare-runtime@1.30.3
751
- https://github.com/holepunchto/bare-runtime
752
- bare-runtime-darwin-arm64@1.30.3
753
- https://github.com/holepunchto/bare-runtime
754
708
  bare-semver@1.1.0
755
709
  https://github.com/holepunchto/bare-semver
756
- bare-signals@4.2.0
757
- https://github.com/holepunchto/bare-signals
758
710
  bare-signals@5.0.0
759
711
  https://github.com/holepunchto/bare-signals
760
712
  bare-stdio@1.0.3
761
713
  https://github.com/holepunchto/bare-stdio
762
714
  bare-stream@2.13.3
763
715
  https://github.com/holepunchto/bare-stream
764
- bare-structured-clone@1.6.0
765
- https://github.com/holepunchto/bare-structured-clone
766
- bare-subprocess@6.1.0
767
- https://github.com/holepunchto/bare-subprocess
768
- bare-tcp@2.5.3
716
+ bare-tcp@2.5.4
769
717
  https://github.com/holepunchto/bare-tcp
770
- bare-tls@3.1.7
718
+ bare-tls@3.1.8
771
719
  https://github.com/holepunchto/bare-tls
772
720
  bare-tty@5.1.2
773
721
  https://github.com/holepunchto/bare-tty
774
722
  bare-type@1.1.0
775
723
  https://github.com/holepunchto/bare-type
776
- bare-url@2.4.6
724
+ bare-url@2.5.2
777
725
  https://github.com/holepunchto/bare-url
778
726
  bare-zlib@1.4.1
779
727
  https://github.com/holepunchto/bare-zlib
@@ -799,9 +747,9 @@ JavaScript Dependencies
799
747
  https://github.com/holepunchto/hypercore-errors
800
748
  hypercore-id-encoding@1.3.0
801
749
  https://github.com/holepunchto/hypercore-id-encoding
802
- hypercore-stats@2.4.1
750
+ hypercore-stats@2.5.1
803
751
  https://github.com/holepunchto/hypercore-stats
804
- hypercore-storage@3.2.0
752
+ hypercore-storage@3.2.1
805
753
  https://github.com/holepunchto/hypercore-storage
806
754
  hyperdb@6.8.0
807
755
  https://github.com/holepunchto/hyperdb
@@ -823,7 +771,7 @@ JavaScript Dependencies
823
771
  https://github.com/holepunchto/mirror-drive
824
772
  noise-handshake@4.2.0
825
773
  https://github.com/holepunchto/noise-handshake
826
- paparam@1.10.2
774
+ paparam@1.12.0
827
775
  https://github.com/holepunchto/paparam
828
776
  passive-core-watcher@1.0.1
829
777
  https://github.com/holepunchto/passive-core-watcher
@@ -839,11 +787,9 @@ JavaScript Dependencies
839
787
  https://github.com/holepunchto/refcounter
840
788
  require-addon@1.2.0
841
789
  https://github.com/holepunchto/require-addon
842
- require-asset@1.2.2
843
- https://github.com/holepunchto/require-asset
844
790
  resource-on-exit@1.0.0
845
791
  https://github.com/holepunchto/bare-teardown
846
- rocksdb-native@3.17.2
792
+ rocksdb-native@3.17.4
847
793
  https://github.com/holepunchto/rocksdb-native
848
794
  scope-lock@1.2.4
849
795
  https://github.com/holepunchto/scope-lock
@@ -853,7 +799,7 @@ JavaScript Dependencies
853
799
  https://github.com/holepunchto/sub-encoder
854
800
  text-decoder@1.2.7
855
801
  https://github.com/holepunchto/text-decoder
856
- udx-native@1.20.7
802
+ udx-native@1.21.0
857
803
  https://github.com/holepunchto/udx-native
858
804
  unslab@1.3.0
859
805
  https://github.com/holepunchto/unslab
@@ -907,7 +853,7 @@ JavaScript Dependencies
907
853
  https://github.com/holepunchto/hypercore
908
854
  hypercore-crypto@3.7.0
909
855
  https://github.com/mafintosh/hypercore-crypto
910
- hyperdht@6.33.0
856
+ hyperdht@6.33.1
911
857
  https://github.com/holepunchto/hyperdht
912
858
  hyperswarm@4.17.0
913
859
  https://github.com/holepunchto/hyperswarm
@@ -923,8 +869,6 @@ JavaScript Dependencies
923
869
  https://github.com/mafintosh/mutexify
924
870
  nat-sampler@1.0.1
925
871
  https://github.com/mafintosh/nat-sampler
926
- promaphore@1.0.0
927
- https://github.com/mafintosh/promaphore
928
872
  protocol-buffers-encodings@1.2.0
929
873
  https://github.com/mafintosh/protocol-buffers-encodings
930
874
  protomux@3.11.0
@@ -969,8 +913,6 @@ JavaScript Dependencies
969
913
  https://github.com/mafintosh/timeout-refresh
970
914
  tiny-byte-size@1.1.0
971
915
  https://github.com/mafintosh/tiny-byte-size
972
- tinyld@1.3.4
973
- https://github.com/komodojp/tinyld
974
916
  unix-path-resolve@1.0.2
975
917
  https://github.com/mafintosh/unix-path-resolve
976
918
  unordered-set@2.0.1
@@ -28,7 +28,7 @@ type CompletionParams = Omit<CompletionClientParams, 'tools'> & {
28
28
  * @param params.mcp - Optional array of MCP client inputs for tool integration
29
29
  * @param params.captureThinking - Best-effort parsing of `<think>` blocks into `thinkingDelta` events; `final.raw.fullText` always preserves the original output
30
30
  * @param params.emitRawDeltas - When true, every raw model token is also emitted as a `rawDelta` event
31
- * @param params.toolDialect - Override name-based dialect detection. Supported values: `"hermes"`, `"pythonic"`, `"json"`, `"harmony"`, `"qwen35"` (Qwen3.5/3.6), `"gemma4"`. Use when the auto-router doesn't recognise your model name. Drives both streaming frame detection and finalization parsing.
31
+ * @param params.toolDialect - Override name-based dialect detection. Supported values: `"hermes"`, `"pythonic"`, `"json"`, `"harmony"`, `"qwen35"` (Qwen3.5/3.6), `"gemma4"`, `"dsml"` (DeepSeek V3.2/V4). Use when the auto-router doesn't recognise your model name. Drives both streaming frame detection and finalization parsing.
32
32
  * Common override case: Llama 3.x tool-calling fine-tunes that emit the native pythonic header (`<|start_header_id|>tool_call<|end_header_id|>...<|eot_id|>`).
33
33
  * @param params.responseFormat - Optional structured-output constraint applied to the model's output:
34
34
  * - `{ type: "text" }` — no constraint (default behavior)
@@ -28,7 +28,7 @@ const logger = getAppLogger();
28
28
  * @param params.mcp - Optional array of MCP client inputs for tool integration
29
29
  * @param params.captureThinking - Best-effort parsing of `<think>` blocks into `thinkingDelta` events; `final.raw.fullText` always preserves the original output
30
30
  * @param params.emitRawDeltas - When true, every raw model token is also emitted as a `rawDelta` event
31
- * @param params.toolDialect - Override name-based dialect detection. Supported values: `"hermes"`, `"pythonic"`, `"json"`, `"harmony"`, `"qwen35"` (Qwen3.5/3.6), `"gemma4"`. Use when the auto-router doesn't recognise your model name. Drives both streaming frame detection and finalization parsing.
31
+ * @param params.toolDialect - Override name-based dialect detection. Supported values: `"hermes"`, `"pythonic"`, `"json"`, `"harmony"`, `"qwen35"` (Qwen3.5/3.6), `"gemma4"`, `"dsml"` (DeepSeek V3.2/V4). Use when the auto-router doesn't recognise your model name. Drives both streaming frame detection and finalization parsing.
32
32
  * Common override case: Llama 3.x tool-calling fine-tunes that emit the native pythonic header (`<|start_header_id|>tool_call<|end_header_id|>...<|eot_id|>`).
33
33
  * @param params.responseFormat - Optional structured-output constraint applied to the model's output:
34
34
  * - `{ type: "text" }` — no constraint (default behavior)
@@ -31,5 +31,5 @@ export { modelRegistryList, modelRegistrySearch, modelRegistryGetModel, type Mod
31
31
  export { suspend } from '../api/suspend.js';
32
32
  export { resume } from '../api/resume.js';
33
33
  export { state } from '../api/state.js';
34
- export { vla, vlaHparams } from '../api/vla.js';
34
+ export { vla, vlaHparams, vlaSetEmbodiment } from '../api/vla.js';
35
35
  export { vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE } from '../api/vla-helpers.js';
package/dist/api/index.js CHANGED
@@ -31,5 +31,5 @@ export { modelRegistryList, modelRegistrySearch, modelRegistryGetModel } from '.
31
31
  export { suspend } from '../api/suspend.js';
32
32
  export { resume } from '../api/resume.js';
33
33
  export { state } from '../api/state.js';
34
- export { vla, vlaHparams } from '../api/vla.js';
34
+ export { vla, vlaHparams, vlaSetEmbodiment } from '../api/vla.js';
35
35
  export { vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE } from '../api/vla-helpers.js';
@@ -142,7 +142,17 @@ function buildTtsRequest(params) {
142
142
  }),
143
143
  ...(params.sentenceStreamMaxChunkScalars !== undefined && {
144
144
  sentenceStreamMaxChunkScalars: params.sentenceStreamMaxChunkScalars
145
- })
145
+ }),
146
+ ...(params.description !== undefined && { description: params.description }),
147
+ ...(params.voiceDescription !== undefined && { voiceDescription: params.voiceDescription }),
148
+ ...(params.voice !== undefined && { voice: params.voice }),
149
+ ...(params.emotion !== undefined && { emotion: params.emotion }),
150
+ ...(params.pitch !== undefined && { pitch: params.pitch }),
151
+ ...(params.pace !== undefined && { pace: params.pace }),
152
+ ...(params.expressivity !== undefined && { expressivity: params.expressivity }),
153
+ ...(params.noise !== undefined && { noise: params.noise }),
154
+ ...(params.reverb !== undefined && { reverb: params.reverb }),
155
+ ...(params.quality !== undefined && { quality: params.quality })
146
156
  };
147
157
  }
148
158
  function buildTextToSpeechStreamRequest(params) {
@@ -161,7 +171,17 @@ function buildTextToSpeechStreamRequest(params) {
161
171
  }),
162
172
  ...(params.flushAfterMs !== undefined && {
163
173
  flushAfterMs: params.flushAfterMs
164
- })
174
+ }),
175
+ ...(params.description !== undefined && { description: params.description }),
176
+ ...(params.voiceDescription !== undefined && { voiceDescription: params.voiceDescription }),
177
+ ...(params.voice !== undefined && { voice: params.voice }),
178
+ ...(params.emotion !== undefined && { emotion: params.emotion }),
179
+ ...(params.pitch !== undefined && { pitch: params.pitch }),
180
+ ...(params.pace !== undefined && { pace: params.pace }),
181
+ ...(params.expressivity !== undefined && { expressivity: params.expressivity }),
182
+ ...(params.noise !== undefined && { noise: params.noise }),
183
+ ...(params.reverb !== undefined && { reverb: params.reverb }),
184
+ ...(params.quality !== undefined && { quality: params.quality })
165
185
  };
166
186
  }
167
187
  /**
@@ -1,4 +1,6 @@
1
- import { type TranscribeClientParams, type RPCOptions, type TranscribeSegment, type TranscribeStreamClientParams, type TranscribeStreamSession, type TranscribeStreamMetadataSession, type TranscribeStreamConversationSession } from '../schemas/index.js';
1
+ import { type TranscribeClientParams, type RPCOptions, type TranscribeSegment, type TranscribeStreamRequest, type TranscribeStreamClientParams, type TranscribeStreamSession, type TranscribeStreamMetadataSession, type TranscribeStreamConversationSession, type TranscribeStats } from '../schemas/index.js';
2
+ import { duplex } from '../dispatch.js';
3
+ type TranscribeDuplexFactory = (request: TranscribeStreamRequest, options?: RPCOptions) => ReturnType<typeof duplex>;
2
4
  /**
3
5
  * Transcribe audio and return the complete text. Accepts either a file
4
6
  * path or an audio buffer.
@@ -61,7 +63,8 @@ export declare function transcribeStream(params: TranscribeClientParams, options
61
63
  * @returns A session object: call `write(audioChunk)` with a `Uint8Array`
62
64
  * (Node `Buffer` is a `Uint8Array` subtype) to feed audio,
63
65
  * iterate with `for await (...)` to receive transcription, and
64
- * `end()` to signal end of audio.
66
+ * `end()` to signal end of audio. After consuming the iterator,
67
+ * await `session.stats` for terminal engine statistics.
65
68
  */
66
69
  export declare function transcribeStream(params: TranscribeStreamClientParams & {
67
70
  emitVadEvents: true;
@@ -73,3 +76,17 @@ export declare function transcribeStream(params: TranscribeStreamClientParams &
73
76
  metadata: true;
74
77
  }, options?: RPCOptions): Promise<TranscribeStreamMetadataSession>;
75
78
  export declare function transcribeStream(params: TranscribeStreamClientParams, options?: RPCOptions): Promise<TranscribeStreamSession>;
79
+ /**
80
+ * Shared duplex session factory. The per-call line processor decides whether
81
+ * to surface strings or segments; `sessionName` is only used to label the
82
+ * "already iterated" error so callers see the correct session type.
83
+ */
84
+ export declare function createTranscribeStreamSession<T>(params: TranscribeStreamClientParams, options: RPCOptions | undefined, process: (line: string, onStats: (stats: TranscribeStats | undefined) => void) => T | undefined | null, sessionName: string, duplexFactory?: TranscribeDuplexFactory): Promise<{
85
+ stats: Promise<TranscribeStats | undefined>;
86
+ write(audioChunk: Uint8Array): void;
87
+ end(): void;
88
+ destroy(): void;
89
+ [Symbol.asyncIterator](): AsyncIterator<T>;
90
+ }>;
91
+ export declare function processLine(line: string, onStats: (stats: TranscribeStats | undefined) => void): string | undefined | null;
92
+ export {};
@@ -121,12 +121,39 @@ function buildTranscribeStreamRequest(params) {
121
121
  * to surface strings or segments; `sessionName` is only used to label the
122
122
  * "already iterated" error so callers see the correct session type.
123
123
  */
124
- async function createTranscribeStreamSession(params, options, process, sessionName) {
124
+ export async function createTranscribeStreamSession(params, options, process, sessionName, duplexFactory = duplex) {
125
125
  const request = buildTranscribeStreamRequest(params);
126
- const { requestStream, responseStream } = await duplex(request, options);
127
- const responses = parseLines(responseStream, process);
126
+ const { requestStream, responseStream } = await duplexFactory(request, options);
127
+ let statsSettled = false;
128
+ let resolveStatsPromise = () => { };
129
+ let rejectStatsPromise = () => { };
130
+ const stats = new Promise((resolve, reject) => {
131
+ resolveStatsPromise = resolve;
132
+ rejectStatsPromise = reject;
133
+ });
134
+ stats.catch(() => { });
135
+ function resolveStats(value) {
136
+ if (statsSettled)
137
+ return;
138
+ statsSettled = true;
139
+ resolveStatsPromise(value);
140
+ }
141
+ function rejectStats(error) {
142
+ if (statsSettled)
143
+ return;
144
+ statsSettled = true;
145
+ rejectStatsPromise(error);
146
+ }
147
+ function resolveEmptyStats() {
148
+ resolveStats(undefined);
149
+ }
150
+ function processResponse(line) {
151
+ return process(line, resolveStats);
152
+ }
153
+ const responses = parseLines(responseStream, processResponse, resolveEmptyStats, rejectStats);
128
154
  let consumed = false;
129
155
  return {
156
+ stats,
130
157
  write(audioChunk) {
131
158
  requestStream.write(audioChunk);
132
159
  },
@@ -134,6 +161,7 @@ async function createTranscribeStreamSession(params, options, process, sessionNa
134
161
  requestStream.end();
135
162
  },
136
163
  destroy() {
164
+ resolveStats(undefined);
137
165
  requestStream.destroy();
138
166
  responseStream.destroy();
139
167
  },
@@ -154,32 +182,41 @@ function transcribeStreamDuplexMetadata(params, options) {
154
182
  }
155
183
  function transcribeStreamDuplexConversation(params, options) {
156
184
  const wantsMetadata = params.metadata === true;
157
- return createTranscribeStreamSession(params, options, (line) => processLineConversation(line, wantsMetadata), 'TranscribeStreamConversationSession');
185
+ return createTranscribeStreamSession(params, options, (line, onStats) => processLineConversation(line, wantsMetadata, onStats), 'TranscribeStreamConversationSession');
158
186
  }
159
187
  /**
160
188
  * Line-delimited parser: reads newline-separated frames from a duplex
161
189
  * response stream, passes each non-empty line through `process`, and yields
162
190
  * whatever values it returns. `null` from `process` terminates the stream.
163
191
  */
164
- async function* parseLines(responseStream, process) {
192
+ async function* parseLines(responseStream, process, onClose, onError) {
165
193
  let buf = '';
166
- for await (const chunk of responseStream) {
167
- buf += chunk.toString();
168
- const lines = buf.split('\n');
169
- buf = lines.pop() || '';
170
- for (const line of lines) {
171
- const result = process(line);
172
- if (result === null)
173
- return;
174
- if (result !== undefined)
194
+ try {
195
+ for await (const chunk of responseStream) {
196
+ buf += chunk.toString();
197
+ const lines = buf.split('\n');
198
+ buf = lines.pop() || '';
199
+ for (const line of lines) {
200
+ const result = process(line);
201
+ if (result === null)
202
+ return;
203
+ if (result !== undefined)
204
+ yield result;
205
+ }
206
+ }
207
+ // Process any residual data after stream ends
208
+ if (buf.trim()) {
209
+ const result = process(buf);
210
+ if (result !== null && result !== undefined)
175
211
  yield result;
176
212
  }
177
213
  }
178
- // Process any residual data after stream ends
179
- if (buf.trim()) {
180
- const result = process(buf);
181
- if (result !== null && result !== undefined)
182
- yield result;
214
+ catch (error) {
215
+ onError(error);
216
+ throw error;
217
+ }
218
+ finally {
219
+ onClose();
183
220
  }
184
221
  }
185
222
  function parseResponseLine(line) {
@@ -204,23 +241,25 @@ function parseResponseLine(line) {
204
241
  * `undefined` for frames the caller should skip, or the value extracted from
205
242
  * the frame.
206
243
  */
207
- function processWith(line, extract) {
244
+ function processWith(line, extract, onStats) {
208
245
  const response = parseResponseLine(line);
209
246
  if (response === null)
210
247
  return undefined;
211
248
  if (response.error)
212
249
  throw new TranscriptionFailedError(response.error);
213
- if (response.done)
250
+ if (response.done) {
251
+ onStats(response.stats);
214
252
  return null;
253
+ }
215
254
  return extract(response);
216
255
  }
217
- function processLine(line) {
218
- return processWith(line, (response) => (response.text?.trim() ? response.text : undefined));
256
+ export function processLine(line, onStats) {
257
+ return processWith(line, (response) => (response.text?.trim() ? response.text : undefined), onStats);
219
258
  }
220
- function processLineMetadata(line) {
221
- return processWith(line, (response) => response.segment);
259
+ function processLineMetadata(line, onStats) {
260
+ return processWith(line, (response) => response.segment, onStats);
222
261
  }
223
- function processLineConversation(line, wantsMetadata) {
262
+ function processLineConversation(line, wantsMetadata, onStats) {
224
263
  return processWith(line, (response) => {
225
264
  if (response.vad) {
226
265
  return {
@@ -252,5 +291,5 @@ function processLineConversation(line, wantsMetadata) {
252
291
  return { type: 'text', text: response.text };
253
292
  }
254
293
  return undefined;
255
- });
294
+ }, onStats);
256
295
  }
@@ -1,7 +1,5 @@
1
1
  import { stream as streamRpc } from '../dispatch.js';
2
- import { translateResponseSchema, normalizeModelType, ModelType } from '../schemas/index.js';
3
- import { detectOne } from '@qvac/langdetect-text';
4
- import { TranslationFailedError } from '../errors/index.js';
2
+ import { translateResponseSchema } from '../schemas/index.js';
5
3
  /**
6
4
  * Translates text from one language to another using a specified translation model.
7
5
  * Supports both NMT (Neural Machine Translation) and LLM models.
@@ -44,22 +42,13 @@ import { TranslationFailedError } from '../errors/index.js';
44
42
  * ```
45
43
  */
46
44
  export function translate(params, options) {
47
- const canonicalModelType = normalizeModelType(params.modelType);
48
- const isLlm = canonicalModelType === ModelType.llamacppCompletion;
49
- let sourceLanguage = isLlm ? params.from : undefined;
50
- if (!sourceLanguage && isLlm) {
51
- const detected = detectOne(params.text);
52
- if (detected.code === 'und' || detected.language === 'Undetermined') {
53
- throw new TranslationFailedError("Could not detect the source language. Please specify the 'from' parameter explicitly.");
54
- }
55
- sourceLanguage = detected.language;
56
- }
45
+ // Source-language auto-detection lives in the engine op
46
+ // (plugins/ops/translate.ts): `from` is passed through when present and
47
+ // resolved engine-side when absent, so every language binding shares one
48
+ // detector instead of each shipping its own.
57
49
  const request = {
58
50
  type: 'translate',
59
- ...params,
60
- ...(isLlm && {
61
- from: sourceLanguage
62
- })
51
+ ...params
63
52
  };
64
53
  let stats;
65
54
  let statsResolver = () => { };
package/dist/api/vla.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type VlaClientRunParams, type VlaClientRunResult, type VlaHparams } from '../schemas/index.js';
1
+ import { type VlaClientRunParams, type VlaClientRunResult, type VlaEmbodimentSelection, type VlaHparams } from '../schemas/index.js';
2
2
  /**
3
3
  * Run VLA inference on a loaded model (SmolVLA or π₀.₅) and return the
4
4
  * produced action chunk plus per-stage timings.
@@ -66,3 +66,44 @@ export declare function vlaHparams(params: {
66
66
  hparams: VlaHparams;
67
67
  backendName: string | null;
68
68
  }>;
69
+ /**
70
+ * Switch a loaded multi-embodiment GR00T model to another embodiment shipped
71
+ * in the same GGUF — no reload, only that embodiment's weight rows are re-read.
72
+ *
73
+ * The returned hparams follow the newly active embodiment: re-read
74
+ * `numCameras` (and re-size buffers if needed) before the next `vla()` call.
75
+ * `selectedEmbodimentTag` / `selectedEmbodimentCatId` report what was
76
+ * resolved. Selecting by `catId` reports that id's canonical tag, which may
77
+ * differ from the alias used to select — the id is the stable identity.
78
+ *
79
+ * Rejects (leaving the current embodiment active) for a non-GR00T or
80
+ * single-embodiment model, an unknown tag or `cat_id`, one not stored in the
81
+ * GGUF, an embodiment with no known camera count and no `numCameras`
82
+ * override, or while an inference response is still pending — await the
83
+ * in-flight `vla()` call first.
84
+ *
85
+ * @param params.modelId - Identifier of the loaded VLA model.
86
+ * @param params.embodiment - The embodiment to activate: a tag string, a
87
+ * numeric `cat_id` (0..31), or `{ tag | catId, numCameras }` where
88
+ * `numCameras` overrides the camera count stored in the GGUF.
89
+ * @returns The refreshed model hparams after the switch.
90
+ *
91
+ * @example
92
+ * ```typescript
93
+ * import { loadModel, vlaSetEmbodiment, vlaHparams } from "@qvac/inference";
94
+ *
95
+ * const modelId = await loadModel({
96
+ * modelSrc: "/path/to/groot-multi.gguf",
97
+ * modelType: "vla",
98
+ * modelConfig: { embodiment: "libero_sim" }, // initial selection at load
99
+ * });
100
+ * const { hparams } = await vlaSetEmbodiment({ modelId, embodiment: "real_droid" });
101
+ * console.log(hparams.selectedEmbodimentTag, hparams.numCameras);
102
+ * ```
103
+ */
104
+ export declare function vlaSetEmbodiment(params: {
105
+ modelId: string;
106
+ embodiment: VlaEmbodimentSelection;
107
+ }): Promise<{
108
+ hparams: VlaHparams;
109
+ }>;
package/dist/api/vla.js CHANGED
@@ -1,8 +1,9 @@
1
- import { vlaHparamsResponseSchema, vlaRunResponseSchema } from '../schemas/index.js';
1
+ import { vlaHparamsResponseSchema, vlaRunResponseSchema, vlaSetEmbodimentResponseSchema } from '../schemas/index.js';
2
2
  import { decodeBase64, encodeBase64 } from '../utils/encoding.js';
3
3
  import { invokePlugin } from '../api/invoke-plugin.js';
4
4
  const VLA_RUN_HANDLER = 'vlaRun';
5
5
  const VLA_HPARAMS_HANDLER = 'vlaHparams';
6
+ const VLA_SET_EMBODIMENT_HANDLER = 'vlaSetEmbodiment';
6
7
  function bytesOf(arr) {
7
8
  return new Uint8Array(arr.buffer, arr.byteOffset, arr.byteLength);
8
9
  }
@@ -111,3 +112,51 @@ export async function vlaHparams(params) {
111
112
  });
112
113
  return vlaHparamsResponseSchema.parse(result);
113
114
  }
115
+ /**
116
+ * Switch a loaded multi-embodiment GR00T model to another embodiment shipped
117
+ * in the same GGUF — no reload, only that embodiment's weight rows are re-read.
118
+ *
119
+ * The returned hparams follow the newly active embodiment: re-read
120
+ * `numCameras` (and re-size buffers if needed) before the next `vla()` call.
121
+ * `selectedEmbodimentTag` / `selectedEmbodimentCatId` report what was
122
+ * resolved. Selecting by `catId` reports that id's canonical tag, which may
123
+ * differ from the alias used to select — the id is the stable identity.
124
+ *
125
+ * Rejects (leaving the current embodiment active) for a non-GR00T or
126
+ * single-embodiment model, an unknown tag or `cat_id`, one not stored in the
127
+ * GGUF, an embodiment with no known camera count and no `numCameras`
128
+ * override, or while an inference response is still pending — await the
129
+ * in-flight `vla()` call first.
130
+ *
131
+ * @param params.modelId - Identifier of the loaded VLA model.
132
+ * @param params.embodiment - The embodiment to activate: a tag string, a
133
+ * numeric `cat_id` (0..31), or `{ tag | catId, numCameras }` where
134
+ * `numCameras` overrides the camera count stored in the GGUF.
135
+ * @returns The refreshed model hparams after the switch.
136
+ *
137
+ * @example
138
+ * ```typescript
139
+ * import { loadModel, vlaSetEmbodiment, vlaHparams } from "@qvac/inference";
140
+ *
141
+ * const modelId = await loadModel({
142
+ * modelSrc: "/path/to/groot-multi.gguf",
143
+ * modelType: "vla",
144
+ * modelConfig: { embodiment: "libero_sim" }, // initial selection at load
145
+ * });
146
+ * const { hparams } = await vlaSetEmbodiment({ modelId, embodiment: "real_droid" });
147
+ * console.log(hparams.selectedEmbodimentTag, hparams.numCameras);
148
+ * ```
149
+ */
150
+ export async function vlaSetEmbodiment(params) {
151
+ const wireRequest = {
152
+ type: 'vlaSetEmbodiment',
153
+ modelId: params.modelId,
154
+ embodiment: params.embodiment
155
+ };
156
+ const result = await invokePlugin({
157
+ modelId: params.modelId,
158
+ handler: VLA_SET_EMBODIMENT_HANDLER,
159
+ params: wireRequest
160
+ });
161
+ return vlaSetEmbodimentResponseSchema.parse(result);
162
+ }