@qvac/inference 0.20.1 → 0.21.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.
- package/NOTICE +90 -24
- package/README.md +8 -5
- package/dist/api/bci-transcribe.d.ts +4 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/rpc-server.d.ts +19 -0
- package/dist/api/rpc-server.js +44 -0
- package/dist/api/text-to-speech.d.ts +9 -0
- package/dist/api/text-to-speech.js +9 -0
- package/dist/api/transcribe.d.ts +11 -7
- package/dist/api/transcribe.js +47 -15
- package/dist/api/video-request.d.ts +5 -5
- package/dist/dispatch.js +39 -7
- package/dist/errors/index.d.ts +7 -0
- package/dist/errors/index.js +15 -0
- package/dist/handlers/assess-model-fit.d.ts +8 -20
- package/dist/handlers/assess-model-fit.js +195 -77
- package/dist/handlers/completion-orchestrate.js +17 -0
- package/dist/handlers/get-loaded-model-info.js +4 -1
- package/dist/handlers/get-model-info.js +29 -1
- package/dist/handlers/load-model/coreml-sidecars.d.ts +25 -0
- package/dist/handlers/load-model/coreml-sidecars.js +274 -0
- package/dist/handlers/load-model/hyperdrive.js +2 -2
- package/dist/handlers/load-model/registry.js +59 -0
- package/dist/handlers/rpc-server.d.ts +23 -0
- package/dist/handlers/rpc-server.js +141 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/models/registry/models.d.ts +7731 -5672
- package/dist/models/registry/models.js +4652 -2526
- package/dist/models/registry/resource-profiles.js +481 -94
- package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +8 -6
- package/dist/plugins/builtin/audiogen-ggml/plugin.js +2 -1
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +73 -1
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +37 -19
- package/dist/plugins/builtin/ggml-vla/plugin.d.ts +1 -1
- package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +9 -5
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +1 -1
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +16 -7
- package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +22 -11
- package/dist/plugins/builtin/llamacpp-completion/plugin.js +9 -3
- package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +5 -3
- package/dist/plugins/builtin/llamacpp-embedding/plugin.js +2 -1
- package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +121 -0
- package/dist/plugins/builtin/parakeet-transcription/plugin.js +56 -27
- package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +8 -2
- package/dist/plugins/builtin/sdcpp-generation/plugin.js +7 -2
- package/dist/plugins/builtin/tts-ggml/ops/parler-options.d.ts +2 -0
- package/dist/plugins/builtin/tts-ggml/ops/parler-options.js +5 -1
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +27 -10
- package/dist/plugins/builtin/tts-ggml/plugin.d.ts +181 -0
- package/dist/plugins/builtin/tts-ggml/plugin.js +84 -2
- package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +136 -0
- package/dist/plugins/builtin/whispercpp-transcription/plugin.js +18 -7
- package/dist/plugins/ops/bci-transcribe.d.ts +6 -2
- package/dist/plugins/ops/bci-transcribe.js +18 -13
- package/dist/plugins/ops/load-model.js +2 -2
- package/dist/plugins/ops/transcribe.d.ts +4 -2
- package/dist/plugins/ops/transcribe.js +39 -2
- package/dist/plugins/ops/translate-stats.d.ts +2 -1
- package/dist/plugins/ops/translate-stats.js +64 -7
- package/dist/plugins/ops/translate.js +20 -4
- package/dist/profiling/operation-metrics.js +56 -0
- package/dist/registry.js +4 -0
- package/dist/resources/model-fit/assess.d.ts +37 -2
- package/dist/resources/model-fit/assess.js +24 -3
- package/dist/resources/model-fit/estimators/llm.js +2 -2
- package/dist/resources/model-fit/estimators/whisper.js +3 -4
- package/dist/resources/model-fit/fit-stub/fetch-fit-stub.d.ts +20 -1
- package/dist/resources/model-fit/fit-stub/fetch-fit-stub.js +126 -47
- package/dist/resources/model-fit/fit-stub/project-fit-from-load.d.ts +27 -0
- package/dist/resources/model-fit/fit-stub/project-fit-from-load.js +31 -0
- package/dist/resources/model-fit/fit-stub/resolve-load-from-stubs.d.ts +38 -0
- package/dist/resources/model-fit/fit-stub/resolve-load-from-stubs.js +138 -0
- package/dist/resources/model-fit/floor.js +2 -2
- package/dist/resources/model-fit/native-probe/advisory-fit.d.ts +9 -6
- package/dist/resources/model-fit/native-probe/advisory-fit.js +129 -80
- package/dist/resources/model-fit/native-probe/child-engine-fit.d.ts +2 -0
- package/dist/resources/model-fit/native-probe/child-engine-fit.js +41 -0
- package/dist/resources/model-fit/native-probe/classify-fit.d.ts +6 -0
- package/dist/resources/model-fit/native-probe/classify-fit.js +135 -0
- package/dist/resources/model-fit/native-probe/create-fit-request.d.ts +28 -0
- package/dist/resources/model-fit/native-probe/create-fit-request.js +51 -0
- package/dist/resources/model-fit/native-probe/engine-fit.d.ts +59 -0
- package/dist/resources/model-fit/native-probe/engine-fit.js +13 -0
- package/dist/resources/model-fit/native-probe/engines/asr.d.ts +10 -0
- package/dist/resources/model-fit/native-probe/engines/asr.js +103 -0
- package/dist/resources/model-fit/native-probe/engines/audiogen.d.ts +8 -0
- package/dist/resources/model-fit/native-probe/engines/audiogen.js +35 -0
- package/dist/resources/model-fit/native-probe/engines/diffusion.d.ts +7 -0
- package/dist/resources/model-fit/native-probe/engines/diffusion.js +55 -0
- package/dist/resources/model-fit/native-probe/engines/gpu.d.ts +10 -0
- package/dist/resources/model-fit/native-probe/engines/gpu.js +21 -0
- package/dist/resources/model-fit/native-probe/engines/llama.d.ts +13 -0
- package/dist/resources/model-fit/native-probe/engines/llama.js +145 -0
- package/dist/resources/model-fit/native-probe/engines/tts.d.ts +8 -0
- package/dist/resources/model-fit/native-probe/engines/tts.js +106 -0
- package/dist/resources/model-fit/native-probe/fit-outcome.d.ts +16 -0
- package/dist/resources/model-fit/native-probe/fit-outcome.js +1 -0
- package/dist/resources/model-fit/native-probe/fit-process.d.ts +27 -0
- package/dist/resources/model-fit/native-probe/fit-process.js +55 -0
- package/dist/resources/model-fit/native-probe/fit-runner.d.ts +1 -0
- package/dist/resources/model-fit/native-probe/fit-runner.js +58 -0
- package/dist/resources/model-fit/native-probe/run-fit.d.ts +24 -0
- package/dist/resources/model-fit/native-probe/run-fit.js +20 -0
- package/dist/resources/model-fit/native-probe/run-in-process-fit.d.ts +14 -34
- package/dist/resources/model-fit/native-probe/run-in-process-fit.js +55 -139
- package/dist/resources/model-fit/native-probe/run-isolated-fit.d.ts +5 -12
- package/dist/resources/model-fit/native-probe/run-isolated-fit.js +13 -8
- package/dist/resources/model-fit/platform.d.ts +9 -0
- package/dist/resources/model-fit/platform.js +28 -0
- package/dist/rpc/device-map.d.ts +13 -0
- package/dist/rpc/device-map.js +22 -0
- package/dist/rpc/discovery.d.ts +12 -0
- package/dist/rpc/discovery.js +225 -0
- package/dist/rpc/ggml-provider.d.ts +4 -0
- package/dist/rpc/ggml-provider.js +25 -0
- package/dist/rpc/index.d.ts +2 -0
- package/dist/rpc/index.js +1 -0
- package/dist/rpc/instance.d.ts +6 -0
- package/dist/rpc/instance.js +21 -0
- package/dist/rpc/inventory.d.ts +5 -0
- package/dist/rpc/inventory.js +144 -0
- package/dist/rpc/manager.d.ts +14 -0
- package/dist/rpc/manager.js +174 -0
- package/dist/rpc/network.d.ts +11 -0
- package/dist/rpc/network.js +85 -0
- package/dist/rpc/provider.d.ts +6 -0
- package/dist/rpc/provider.js +24 -0
- package/dist/runtime/lifecycle.js +31 -13
- package/dist/runtime/request-context.d.ts +1 -1
- package/dist/runtime/state.js +5 -0
- package/dist/schemas/assess-model-fit.d.ts +269 -85
- package/dist/schemas/assess-model-fit.js +78 -54
- package/dist/schemas/audio-gen.d.ts +6 -6
- package/dist/schemas/audio-gen.js +2 -2
- package/dist/schemas/batch-completion-stream.d.ts +13 -5
- package/dist/schemas/batch-completion-stream.js +5 -3
- package/dist/schemas/bci-config.js +1 -1
- package/dist/schemas/bci.d.ts +86 -1
- package/dist/schemas/bci.js +21 -2
- package/dist/schemas/cancel.d.ts +10 -0
- package/dist/schemas/cancel.js +2 -0
- package/dist/schemas/common.d.ts +708 -66
- package/dist/schemas/common.js +7 -0
- package/dist/schemas/completion-event.d.ts +6 -6
- package/dist/schemas/completion-stream.d.ts +27 -8
- package/dist/schemas/completion-stream.js +41 -4
- package/dist/schemas/config.d.ts +104 -36
- package/dist/schemas/config.js +10 -0
- package/dist/schemas/embed.d.ts +2 -2
- package/dist/schemas/error.js +13 -0
- package/dist/schemas/errors.d.ts +1 -0
- package/dist/schemas/errors.js +5 -0
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/llamacpp-config.d.ts +25 -18
- package/dist/schemas/llamacpp-config.js +26 -16
- package/dist/schemas/load-model.d.ts +2608 -469
- package/dist/schemas/load-model.js +2 -2
- package/dist/schemas/mcp-adapter.d.ts +4 -0
- package/dist/schemas/model-config-schemas.d.ts +183 -6
- package/dist/schemas/model-info.d.ts +56 -0
- package/dist/schemas/model-info.js +5 -1
- package/dist/schemas/plugin.d.ts +8 -2
- package/dist/schemas/profiling.d.ts +4 -4
- package/dist/schemas/reload-config.d.ts +30 -0
- package/dist/schemas/rpc-server.d.ts +101 -0
- package/dist/schemas/rpc-server.js +87 -0
- package/dist/schemas/sdcpp-config.d.ts +7 -3
- package/dist/schemas/sdcpp-config.js +37 -2
- package/dist/schemas/system-resources.d.ts +4 -4
- package/dist/schemas/text-to-speech.d.ts +529 -1
- package/dist/schemas/text-to-speech.js +122 -12
- package/dist/schemas/tools.d.ts +2 -0
- package/dist/schemas/tools.js +8 -0
- package/dist/schemas/transcription-config.d.ts +5 -0
- package/dist/schemas/transcription-config.js +20 -2
- package/dist/schemas/transcription.d.ts +164 -0
- package/dist/schemas/transcription.js +71 -4
- package/dist/schemas/vla.d.ts +1 -1
- package/dist/surface.d.ts +4 -1
- package/dist/surface.js +3 -1
- package/dist/utils/addon-responses.d.ts +5 -1
- package/dist/utils/archive.js +5 -1
- package/dist/utils/asr-diagnostics.d.ts +12 -0
- package/dist/utils/asr-diagnostics.js +42 -0
- package/dist/utils/asr-events.d.ts +1 -0
- package/dist/utils/asr-events.js +3 -2
- package/dist/utils/cache/paths.js +3 -2
- package/dist/utils/mcp-adapter.js +7 -1
- package/dist/utils/multi-gpu-mobile.d.ts +1 -1
- package/dist/utils/multi-gpu-mobile.js +8 -6
- package/dist/utils/path-security.d.ts +5 -0
- package/dist/utils/path-security.js +14 -0
- package/dist/utils/tool-helpers.d.ts +4 -0
- package/dist/utils/tool-helpers.js +2 -0
- package/dist/utils/tools/defer.d.ts +93 -0
- package/dist/utils/tools/defer.js +290 -0
- package/dist/utils/tools/index.d.ts +1 -0
- package/dist/utils/tools/index.js +1 -0
- package/dist/utils/transcribe-metadata.d.ts +21 -7
- package/dist/utils/transcribe-metadata.js +24 -8
- package/dist/utils/tts-stats.d.ts +6 -0
- package/dist/utils/tts-stats.js +14 -1
- package/package.json +43 -29
- package/dist/resources/model-fit/fit-stub/index.d.ts +0 -2
- package/dist/resources/model-fit/fit-stub/index.js +0 -2
- package/dist/resources/model-fit/fit-stub/project-fit-from-stub.d.ts +0 -31
- package/dist/resources/model-fit/fit-stub/project-fit-from-stub.js +0 -36
- package/dist/resources/model-fit/native-probe/create-llama-fit-request.d.ts +0 -26
- package/dist/resources/model-fit/native-probe/create-llama-fit-request.js +0 -191
package/NOTICE
CHANGED
|
@@ -71,6 +71,8 @@ Third-Party Model Licenses
|
|
|
71
71
|
https://huggingface.co/Audio8/Audio8-TTS-Preview-0.6b
|
|
72
72
|
bci-embedder
|
|
73
73
|
https://github.com/tetherto/qvac/releases/download/bci-test-assets-v0.1.0/bci-embedder.bin
|
|
74
|
+
coremldata
|
|
75
|
+
https://huggingface.co/Audio8/Audio8-TTS-Preview-0.6b
|
|
74
76
|
cosyvoice3-campplus-f32
|
|
75
77
|
https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
|
|
76
78
|
cosyvoice3-flow-bf16
|
|
@@ -136,7 +138,7 @@ Third-Party Model Licenses
|
|
|
136
138
|
LightOnOCR-2-1B-ocr-soup-GGUF
|
|
137
139
|
https://huggingface.co/noctrex/LightOnOCR-2-1B-ocr-soup-GGUF
|
|
138
140
|
Llama_3.2_1B_Intruct_Tool_Calling_V2-GGUF
|
|
139
|
-
https://huggingface.co/
|
|
141
|
+
https://huggingface.co/mradermacher/Llama_3.2_1B_Intruct_Tool_Calling_V2-GGUF
|
|
140
142
|
MedPsy-1.7B-GGUF
|
|
141
143
|
https://huggingface.co/qvac/MedPsy-1.7B-GGUF
|
|
142
144
|
MedPsy-4B-GGUF
|
|
@@ -145,6 +147,14 @@ Third-Party Model Licenses
|
|
|
145
147
|
https://huggingface.co/FunAudioLLM/Fun-CosyVoice3-0.5B-2512
|
|
146
148
|
mmproj-unlimited-ocr-Q8_0
|
|
147
149
|
https://huggingface.co/baidu/Unlimited-OCR
|
|
150
|
+
model
|
|
151
|
+
https://huggingface.co/Audio8/Audio8-TTS-Preview-0.6b
|
|
152
|
+
moss-codec-decoder-f16
|
|
153
|
+
https://huggingface.co/OpenMOSS-Team/MOSS-TTS
|
|
154
|
+
moss-codec-encoder-f16
|
|
155
|
+
https://huggingface.co/OpenMOSS-Team/MOSS-TTS
|
|
156
|
+
moss-tts-delay-f16
|
|
157
|
+
https://huggingface.co/OpenMOSS-Team/MOSS-TTS
|
|
148
158
|
nb-tiny-ggml-model
|
|
149
159
|
https://huggingface.co/NbAiLab/nb-whisper-tiny
|
|
150
160
|
parler-indic-f16
|
|
@@ -211,6 +221,8 @@ Third-Party Model Licenses
|
|
|
211
221
|
https://huggingface.co/HuggingFaceVLA/smolvla_libero
|
|
212
222
|
SmolVLM2-500M-Video-Instruct-GGUF
|
|
213
223
|
https://huggingface.co/ggml-org/SmolVLM2-500M-Video-Instruct-GGUF
|
|
224
|
+
Ternary-Bonsai-2-27B-gguf
|
|
225
|
+
https://huggingface.co/prism-ml/Ternary-Bonsai-2-27B-gguf
|
|
214
226
|
TranslatePsy-AfriSLM-0.8B-Q4-GGUF
|
|
215
227
|
https://huggingface.co/qvac/TranslatePsy-AfriSLM-0.8B-Q4-GGUF
|
|
216
228
|
TranslatePsy-AfriSLM-0.8B-Q8-GGUF
|
|
@@ -251,6 +263,8 @@ Third-Party Model Licenses
|
|
|
251
263
|
https://huggingface.co/Comfy-Org/Wan_2.2_ComfyUI_Repackaged
|
|
252
264
|
Wan2.2-TI2V-5B-Turbo-GGUF
|
|
253
265
|
https://huggingface.co/hum-ma/Wan2.2-TI2V-5B-Turbo-GGUF
|
|
266
|
+
weight
|
|
267
|
+
https://huggingface.co/Audio8/Audio8-TTS-Preview-0.6b
|
|
254
268
|
|
|
255
269
|
--- bsd-3-clause (BSD 3-Clause License) ---
|
|
256
270
|
|
|
@@ -277,30 +291,58 @@ Third-Party Model Licenses
|
|
|
277
291
|
|
|
278
292
|
AfriqueGemma-4B-GGUF
|
|
279
293
|
https://huggingface.co/mradermacher/AfriqueGemma-4B-GGUF
|
|
294
|
+
coremldata
|
|
295
|
+
https://huggingface.co/nvidia/parakeet-ctc-0.6b
|
|
296
|
+
coremldata
|
|
297
|
+
https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3
|
|
298
|
+
coremldata
|
|
299
|
+
https://huggingface.co/nvidia/parakeet-tdt-1.1b
|
|
300
|
+
coremldata
|
|
301
|
+
https://huggingface.co/nvidia/parakeet_realtime_eou_120m-v1
|
|
302
|
+
model
|
|
303
|
+
https://huggingface.co/nvidia/parakeet-ctc-0.6b
|
|
304
|
+
model
|
|
305
|
+
https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3
|
|
306
|
+
model
|
|
307
|
+
https://huggingface.co/nvidia/parakeet-tdt-1.1b
|
|
308
|
+
model
|
|
309
|
+
https://huggingface.co/nvidia/parakeet_realtime_eou_120m-v1
|
|
310
|
+
parakeet_realtime_eou_120m-v1.f16
|
|
311
|
+
https://huggingface.co/nvidia/parakeet_realtime_eou_120m-v1
|
|
312
|
+
parakeet_realtime_eou_120m-v1.q4_0
|
|
313
|
+
https://huggingface.co/nvidia/parakeet_realtime_eou_120m-v1
|
|
314
|
+
parakeet_realtime_eou_120m-v1.q8_0
|
|
315
|
+
https://huggingface.co/nvidia/parakeet_realtime_eou_120m-v1
|
|
280
316
|
parakeet-ctc-0.6b.f16
|
|
281
317
|
https://huggingface.co/nvidia/parakeet-ctc-0.6b
|
|
282
318
|
parakeet-ctc-0.6b.q4_0
|
|
283
319
|
https://huggingface.co/nvidia/parakeet-ctc-0.6b
|
|
284
320
|
parakeet-ctc-0.6b.q8_0
|
|
285
321
|
https://huggingface.co/nvidia/parakeet-ctc-0.6b
|
|
286
|
-
parakeet-eou-120m-v1.f16
|
|
287
|
-
https://huggingface.co/nvidia/parakeet_realtime_eou_120m-v1
|
|
288
|
-
parakeet-eou-120m-v1.q4_0
|
|
289
|
-
https://huggingface.co/nvidia/parakeet_realtime_eou_120m-v1
|
|
290
|
-
parakeet-eou-120m-v1.q8_0
|
|
291
|
-
https://huggingface.co/nvidia/parakeet_realtime_eou_120m-v1
|
|
292
322
|
parakeet-tdt-0.6b-v3.f16
|
|
293
323
|
https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3
|
|
294
324
|
parakeet-tdt-0.6b-v3.q4_0
|
|
295
325
|
https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3
|
|
296
326
|
parakeet-tdt-0.6b-v3.q8_0
|
|
297
327
|
https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3
|
|
328
|
+
parakeet-tdt-1.1b.f16
|
|
329
|
+
https://huggingface.co/nvidia/parakeet-tdt-1.1b
|
|
330
|
+
parakeet-tdt-1.1b.q8_0
|
|
331
|
+
https://huggingface.co/nvidia/parakeet-tdt-1.1b
|
|
298
332
|
sortformer-4spk-v1.f16
|
|
299
333
|
https://huggingface.co/nvidia/diar_sortformer_4spk-v1
|
|
300
334
|
sortformer-4spk-v1.q4_0
|
|
301
335
|
https://huggingface.co/nvidia/diar_sortformer_4spk-v1
|
|
302
336
|
sortformer-4spk-v1.q8_0
|
|
303
337
|
https://huggingface.co/nvidia/diar_sortformer_4spk-v1
|
|
338
|
+
weight
|
|
339
|
+
https://huggingface.co/nvidia/parakeet-ctc-0.6b
|
|
340
|
+
weight
|
|
341
|
+
https://huggingface.co/nvidia/parakeet-tdt-0.6b-v3
|
|
342
|
+
weight
|
|
343
|
+
https://huggingface.co/nvidia/parakeet-tdt-1.1b
|
|
344
|
+
weight
|
|
345
|
+
https://huggingface.co/nvidia/parakeet_realtime_eou_120m-v1
|
|
304
346
|
|
|
305
347
|
--- gemma (Gemma Terms of Use) ---
|
|
306
348
|
|
|
@@ -362,6 +404,8 @@ Third-Party Model Licenses
|
|
|
362
404
|
https://huggingface.co/ResembleAI/chatterbox
|
|
363
405
|
chatterbox-t3-turbo
|
|
364
406
|
https://huggingface.co/ResembleAI/chatterbox-turbo
|
|
407
|
+
coremldata
|
|
408
|
+
https://huggingface.co/ai4bharat/indic-conformer-600m-multilingual
|
|
365
409
|
de-base-ggml-model-f16
|
|
366
410
|
https://huggingface.co/aware-ai/whisper-base-german
|
|
367
411
|
DeepSeek-V4-Flash-0731-GGUF
|
|
@@ -384,16 +428,18 @@ Third-Party Model Licenses
|
|
|
384
428
|
https://huggingface.co/ChristianAzinn/gte-large-gguf
|
|
385
429
|
gte-large-gguf
|
|
386
430
|
https://huggingface.co/ChristianAzinn/gte-large-gguf
|
|
387
|
-
indic-conformer-
|
|
431
|
+
indic-conformer-600m-multilingual.f16
|
|
388
432
|
https://huggingface.co/ai4bharat/indic-conformer-600m-multilingual
|
|
389
|
-
indic-conformer-
|
|
433
|
+
indic-conformer-600m-multilingual.q4_0
|
|
390
434
|
https://huggingface.co/ai4bharat/indic-conformer-600m-multilingual
|
|
391
|
-
indic-conformer-
|
|
435
|
+
indic-conformer-600m-multilingual.q8_0
|
|
392
436
|
https://huggingface.co/ai4bharat/indic-conformer-600m-multilingual
|
|
393
437
|
lavasr-denoiser-f16
|
|
394
438
|
https://huggingface.co/spaces/YatharthS
|
|
395
439
|
lavasr-enhancer-f16
|
|
396
440
|
https://huggingface.co/spaces/YatharthS
|
|
441
|
+
model
|
|
442
|
+
https://huggingface.co/ai4bharat/indic-conformer-600m-multilingual
|
|
397
443
|
pt-tiny-ggml-model-f16
|
|
398
444
|
https://huggingface.co/DavyCosta701/whisper-tiny-pt-bpra
|
|
399
445
|
taew2_2_f16
|
|
@@ -404,6 +450,8 @@ Third-Party Model Licenses
|
|
|
404
450
|
https://voiceinput.futo.org/VoiceInput/tiny_en_acft_q8_0.bin
|
|
405
451
|
vae-BF16
|
|
406
452
|
https://huggingface.co/ACE-Step/Ace-Step1.5
|
|
453
|
+
weight
|
|
454
|
+
https://huggingface.co/ai4bharat/indic-conformer-600m-multilingual
|
|
407
455
|
whisper-vad
|
|
408
456
|
https://huggingface.co/ggml-org/whisper-vad
|
|
409
457
|
whisper.cpp
|
|
@@ -618,6 +666,12 @@ Third-Party Model Licenses
|
|
|
618
666
|
|
|
619
667
|
--- nvidia-open-model-license ---
|
|
620
668
|
|
|
669
|
+
coremldata
|
|
670
|
+
https://huggingface.co/nvidia/diar_streaming_sortformer_4spk-v2.1
|
|
671
|
+
coremldata
|
|
672
|
+
https://huggingface.co/nvidia/nemotron-3.5-asr-streaming-0.6b
|
|
673
|
+
coremldata
|
|
674
|
+
https://huggingface.co/nvidia/parakeet-unified-en-0.6b
|
|
621
675
|
diar_streaming_sortformer_4spk-v2.1.f16
|
|
622
676
|
https://huggingface.co/nvidia/diar_streaming_sortformer_4spk-v2.1
|
|
623
677
|
diar_streaming_sortformer_4spk-v2.1.q4_0
|
|
@@ -628,6 +682,12 @@ Third-Party Model Licenses
|
|
|
628
682
|
https://huggingface.co/nvidia/GR00T-N1.7-LIBERO
|
|
629
683
|
groot-q8_vf16
|
|
630
684
|
https://huggingface.co/nvidia/GR00T-N1.7-3B
|
|
685
|
+
model
|
|
686
|
+
https://huggingface.co/nvidia/diar_streaming_sortformer_4spk-v2.1
|
|
687
|
+
model
|
|
688
|
+
https://huggingface.co/nvidia/nemotron-3.5-asr-streaming-0.6b
|
|
689
|
+
model
|
|
690
|
+
https://huggingface.co/nvidia/parakeet-unified-en-0.6b
|
|
631
691
|
nemotron-3.5-asr-streaming-0.6b.f16
|
|
632
692
|
https://huggingface.co/nvidia/nemotron-3.5-asr-streaming-0.6b
|
|
633
693
|
nemotron-3.5-asr-streaming-0.6b.q4_0
|
|
@@ -640,6 +700,12 @@ Third-Party Model Licenses
|
|
|
640
700
|
https://huggingface.co/nvidia/parakeet-unified-en-0.6b
|
|
641
701
|
parakeet-unified-en-0.6b.q8_0
|
|
642
702
|
https://huggingface.co/nvidia/parakeet-unified-en-0.6b
|
|
703
|
+
weight
|
|
704
|
+
https://huggingface.co/nvidia/diar_streaming_sortformer_4spk-v2.1
|
|
705
|
+
weight
|
|
706
|
+
https://huggingface.co/nvidia/nemotron-3.5-asr-streaming-0.6b
|
|
707
|
+
weight
|
|
708
|
+
https://huggingface.co/nvidia/parakeet-unified-en-0.6b
|
|
643
709
|
|
|
644
710
|
--- openrail ---
|
|
645
711
|
|
|
@@ -692,11 +758,11 @@ JavaScript Dependencies
|
|
|
692
758
|
@hyperswarm/secret-stream@6.9.2
|
|
693
759
|
https://github.com/holepunchto/hyperswarm-secret-stream
|
|
694
760
|
@qvac/error@0.1.1
|
|
695
|
-
@qvac/fabric@0.
|
|
761
|
+
@qvac/fabric@0.18.1
|
|
696
762
|
https://github.com/tetherto/qvac
|
|
697
|
-
@qvac/
|
|
763
|
+
@qvac/fabric-darwin-arm64@0.18.1
|
|
698
764
|
https://github.com/tetherto/qvac
|
|
699
|
-
@qvac/
|
|
765
|
+
@qvac/logging@0.1.1
|
|
700
766
|
https://github.com/tetherto/qvac
|
|
701
767
|
@qvac/rag@0.8.1
|
|
702
768
|
https://github.com/tetherto/qvac
|
|
@@ -722,7 +788,7 @@ JavaScript Dependencies
|
|
|
722
788
|
https://github.com/holepunchto/bare-buffer
|
|
723
789
|
bare-cpu-info@0.1.1
|
|
724
790
|
https://github.com/holepunchto/bare-cpu-info
|
|
725
|
-
bare-crypto@1.15.
|
|
791
|
+
bare-crypto@1.15.4
|
|
726
792
|
https://github.com/holepunchto/bare-crypto
|
|
727
793
|
bare-dns@2.2.1
|
|
728
794
|
https://github.com/holepunchto/bare-dns
|
|
@@ -734,7 +800,7 @@ JavaScript Dependencies
|
|
|
734
800
|
https://github.com/holepunchto/bare-fetch
|
|
735
801
|
bare-form-data@1.2.2
|
|
736
802
|
https://github.com/holepunchto/bare-form-data
|
|
737
|
-
bare-fs@4.8.
|
|
803
|
+
bare-fs@4.8.2
|
|
738
804
|
https://github.com/holepunchto/bare-fs
|
|
739
805
|
bare-gpu-info@0.1.1
|
|
740
806
|
https://github.com/holepunchto/bare-gpu-info
|
|
@@ -768,9 +834,9 @@ JavaScript Dependencies
|
|
|
768
834
|
https://github.com/holepunchto/bare-process
|
|
769
835
|
bare-rpc@1.3.8
|
|
770
836
|
https://github.com/holepunchto/bare-rpc
|
|
771
|
-
bare-runtime@1.
|
|
837
|
+
bare-runtime@1.34.1
|
|
772
838
|
https://github.com/holepunchto/bare-runtime
|
|
773
|
-
bare-runtime-darwin-arm64@1.
|
|
839
|
+
bare-runtime-darwin-arm64@1.34.1
|
|
774
840
|
https://github.com/holepunchto/bare-runtime
|
|
775
841
|
bare-semver@1.1.0
|
|
776
842
|
https://github.com/holepunchto/bare-semver
|
|
@@ -786,7 +852,7 @@ JavaScript Dependencies
|
|
|
786
852
|
https://github.com/holepunchto/bare-subprocess
|
|
787
853
|
bare-tcp@2.6.1
|
|
788
854
|
https://github.com/holepunchto/bare-tcp
|
|
789
|
-
bare-tls@3.1.
|
|
855
|
+
bare-tls@3.1.11
|
|
790
856
|
https://github.com/holepunchto/bare-tls
|
|
791
857
|
bare-tty@5.2.1
|
|
792
858
|
https://github.com/holepunchto/bare-tty
|
|
@@ -798,7 +864,7 @@ JavaScript Dependencies
|
|
|
798
864
|
https://github.com/holepunchto/bare-zlib
|
|
799
865
|
blind-relay@1.6.1
|
|
800
866
|
https://github.com/holepunchto/blind-relay
|
|
801
|
-
compact-encoding@3.5.
|
|
867
|
+
compact-encoding@3.5.2
|
|
802
868
|
https://github.com/holepunchto/compact-encoding
|
|
803
869
|
compact-encoding-bitfield@1.1.0
|
|
804
870
|
https://github.com/compact-encoding/compact-encoding-bitfield
|
|
@@ -822,7 +888,7 @@ JavaScript Dependencies
|
|
|
822
888
|
https://github.com/holepunchto/hypercore-stats
|
|
823
889
|
hypercore-storage@3.3.1
|
|
824
890
|
https://github.com/holepunchto/hypercore-storage
|
|
825
|
-
hyperdb@6.
|
|
891
|
+
hyperdb@6.10.0
|
|
826
892
|
https://github.com/holepunchto/hyperdb
|
|
827
893
|
hyperdht-address@1.1.1
|
|
828
894
|
https://github.com/holepunchto/hyperdht-address
|
|
@@ -846,7 +912,7 @@ JavaScript Dependencies
|
|
|
846
912
|
https://github.com/holepunchto/paparam
|
|
847
913
|
passive-core-watcher@1.0.1
|
|
848
914
|
https://github.com/holepunchto/passive-core-watcher
|
|
849
|
-
quickbit-native@2.4.
|
|
915
|
+
quickbit-native@2.4.9
|
|
850
916
|
https://github.com/holepunchto/quickbit-native
|
|
851
917
|
rabin-native@2.0.0
|
|
852
918
|
https://github.com/holepunchto/rabin-native
|
|
@@ -904,7 +970,7 @@ JavaScript Dependencies
|
|
|
904
970
|
https://github.com/mafintosh/bogon
|
|
905
971
|
codecs@3.1.0
|
|
906
972
|
https://github.com/mafintosh/codecs
|
|
907
|
-
corestore@7.
|
|
973
|
+
corestore@7.13.0
|
|
908
974
|
https://github.com/holepunchto/corestore
|
|
909
975
|
debounceify@1.1.0
|
|
910
976
|
https://github.com/mafintosh/debounceify
|
|
@@ -922,7 +988,7 @@ JavaScript Dependencies
|
|
|
922
988
|
https://github.com/mafintosh/generate-string
|
|
923
989
|
hyperbee@2.27.3
|
|
924
990
|
https://github.com/holepunchto/hyperbee
|
|
925
|
-
hypercore@11.
|
|
991
|
+
hypercore@11.37.1
|
|
926
992
|
https://github.com/holepunchto/hypercore
|
|
927
993
|
hypercore-crypto@3.7.0
|
|
928
994
|
https://github.com/mafintosh/hypercore-crypto
|
|
@@ -944,7 +1010,7 @@ JavaScript Dependencies
|
|
|
944
1010
|
https://github.com/mafintosh/nat-sampler
|
|
945
1011
|
protocol-buffers-encodings@1.2.0
|
|
946
1012
|
https://github.com/mafintosh/protocol-buffers-encodings
|
|
947
|
-
protomux@3.12.
|
|
1013
|
+
protomux@3.12.1
|
|
948
1014
|
https://github.com/holepunchto/protomux
|
|
949
1015
|
queue-tick@1.0.1
|
|
950
1016
|
https://github.com/mafintosh/queue-tick
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @qvac/inference
|
|
2
2
|
|
|
3
|
-
The Bare-only engine of the QVAC SDK. It runs inference directly on the [Bare runtime](https://bare.pears.com) in a single process
|
|
3
|
+
The Bare-only engine of the QVAC SDK. It runs inference directly on the [Bare runtime](https://bare.pears.com) in a single process without a worker or subprocess. Native GGML RPC is available as an opt-in distributed GPU path. You register the inference engines you need and call the same API surface as `@qvac/sdk`, in-process.
|
|
4
4
|
|
|
5
5
|
> _Part of the **QVAC** ecosystem_
|
|
6
6
|
>
|
|
@@ -13,7 +13,7 @@ The Bare-only engine of the QVAC SDK. It runs inference directly on the [Bare ru
|
|
|
13
13
|
|
|
14
14
|
`@qvac/inference` is the pure-Bare layer of the SDK, written in TypeScript: the client API, the request engine, and the plugin system, all running in one Bare process. `@qvac/sdk` builds on top of it to reach Node, Electron, Expo, and Pear by launching this engine as a worker; on Bare you use it directly. It replaces the deprecated `@qvac/bare-sdk` package (last release 0.18.2).
|
|
15
15
|
|
|
16
|
-
`@qvac/inference` ships no plugins by default and no addon dependencies. You install only the addon packages your app registers, so the resulting binary scales with the engines you actually assemble.
|
|
16
|
+
`@qvac/inference` ships no plugins by default and has no required model or RPC server addon dependencies. Model addons are optional peers; RPC serving uses an explicitly registered provider. You install only the addon packages your app registers, so the resulting binary scales with the engines and services you actually assemble.
|
|
17
17
|
|
|
18
18
|
## Requirements
|
|
19
19
|
|
|
@@ -57,7 +57,10 @@ const modelId = await loadModel({ modelSrc: LLAMA_3_2_1B_INST_Q4_0 })
|
|
|
57
57
|
const run = completion({ modelId, history: [{ role: 'user', content: 'Hi' }] })
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
Model operations require a registered model plugin. RPC discovery needs no model plugin or server provider; serving requires an explicitly registered server provider.
|
|
61
|
+
|
|
62
|
+
The [Bare serving example](examples/rpc-server.ts)
|
|
63
|
+
shows explicit registration and cleanup with `@qvac/ggml-rpc-server@0.1.0`.
|
|
61
64
|
|
|
62
65
|
## Capability to addon package
|
|
63
66
|
|
|
@@ -81,7 +84,7 @@ The engine resolves a `qvac.config.js` or `qvac.config.json` from the current wo
|
|
|
81
84
|
|
|
82
85
|
## System resource diagnostics
|
|
83
86
|
|
|
84
|
-
Use `getSystemResources` to inspect locally observed CPU, system-memory, GPU, and driver capabilities. Pass `sample: true` only when you also need a fresh usage sample.
|
|
87
|
+
Use `getSystemResources` to inspect locally observed CPU, system-memory, GPU, and driver capabilities. Pass `sample: true` only when you also need a fresh usage sample. Register a model plugin or RPC server provider before requesting diagnostics:
|
|
85
88
|
|
|
86
89
|
```js
|
|
87
90
|
import { registerPlugin, getSystemResources } from '@qvac/inference'
|
|
@@ -110,7 +113,7 @@ Every metric reports `supported`, `unavailable`, `unverified`, or `failed`. Supp
|
|
|
110
113
|
import { close, unloadModel } from '@qvac/inference'
|
|
111
114
|
|
|
112
115
|
await unloadModel({ modelId })
|
|
113
|
-
await close() // release the swarm, registry client, storage-root lock, and registered plugins
|
|
116
|
+
await close() // release the swarm, registry client, storage-root lock, and registered plugins. Stop owned RPC servers.
|
|
114
117
|
```
|
|
115
118
|
|
|
116
119
|
`close()` also clears the plugin registry, so if you keep using the API afterward you must `registerPlugin` / `plugins([...])` again first — otherwise the next call throws `PluginsNotRegisteredError`.
|
|
@@ -37,7 +37,10 @@ export declare function bciTranscribe(params: BciTranscribeClientParams, options
|
|
|
37
37
|
* @param params.modelId - The loaded BCI model to use.
|
|
38
38
|
* @param params.metadata - When true, the session yields transcript segment
|
|
39
39
|
* objects (`{ text, startMs, endMs, append, id }`)
|
|
40
|
-
* instead of plain text.
|
|
40
|
+
* instead of plain text. With `emit: 'delta'`, each
|
|
41
|
+
* segment also carries `windowStartTimestep`: its
|
|
42
|
+
* timestamps are window-local, and this maps them
|
|
43
|
+
* onto the stream timeline.
|
|
41
44
|
* @param params.windowTimesteps - Decode window size in timesteps.
|
|
42
45
|
* @param params.hopTimesteps - How far the window advances between decodes.
|
|
43
46
|
* @param params.emit - `'delta'` (default) yields only the newly-discovered
|
package/dist/api/index.d.ts
CHANGED
|
@@ -35,3 +35,4 @@ export { resume } from './resume.js';
|
|
|
35
35
|
export { state } from './state.js';
|
|
36
36
|
export { vla, vlaHparams, vlaSetEmbodiment } from './vla.js';
|
|
37
37
|
export { vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE } from './vla-helpers.js';
|
|
38
|
+
export { startRpcServer, stopRpcServer, discoverRpcServers } from './rpc-server.js';
|
package/dist/api/index.js
CHANGED
|
@@ -34,3 +34,4 @@ export { resume } from './resume.js';
|
|
|
34
34
|
export { state } from './state.js';
|
|
35
35
|
export { vla, vlaHparams, vlaSetEmbodiment } from './vla.js';
|
|
36
36
|
export { vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE } from './vla-helpers.js';
|
|
37
|
+
export { startRpcServer, stopRpcServer, discoverRpcServers } from './rpc-server.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type StartRpcServerOptions, type StopRpcServerOptions, type DiscoverRpcServersOptions, type RpcServerInfo, type RpcServerCandidate } from '../schemas/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Start a worker-owned native RPC server. Non-loopback binding and advertising require explicit opt-in.
|
|
4
|
+
* Cancel a pending start with its promise.requestId.
|
|
5
|
+
*/
|
|
6
|
+
export declare function startRpcServer(options?: StartRpcServerOptions): Promise<RpcServerInfo> & {
|
|
7
|
+
requestId: string;
|
|
8
|
+
};
|
|
9
|
+
/** Withdraw the announcement and await native stop. Bare stop has no deadline. */
|
|
10
|
+
export declare function stopRpcServer(options: StopRpcServerOptions): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Find private-network candidates with device inventories and server RDMA availability.
|
|
13
|
+
* RDMA availability is a server-side offer, not a guarantee of the negotiated transport.
|
|
14
|
+
* Use getRpcDeviceMap with the chosen endpoint registration order before loadModel.
|
|
15
|
+
* Cancel a pending search with its promise.requestId.
|
|
16
|
+
*/
|
|
17
|
+
export declare function discoverRpcServers(options: DiscoverRpcServersOptions): Promise<RpcServerCandidate[]> & {
|
|
18
|
+
requestId: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { send } from '../dispatch.js';
|
|
2
|
+
import { InvalidResponseError } from '../errors/index.js';
|
|
3
|
+
import { decoratePromise } from '../utils/decorate-promise.js';
|
|
4
|
+
import { generateRequestId } from '../runtime/request-id.js';
|
|
5
|
+
/**
|
|
6
|
+
* Start a worker-owned native RPC server. Non-loopback binding and advertising require explicit opt-in.
|
|
7
|
+
* Cancel a pending start with its promise.requestId.
|
|
8
|
+
*/
|
|
9
|
+
export function startRpcServer(options = {}) {
|
|
10
|
+
const requestId = generateRequestId();
|
|
11
|
+
return decoratePromise(runStartRpcServer(options, requestId), { requestId });
|
|
12
|
+
}
|
|
13
|
+
async function runStartRpcServer(options, requestId) {
|
|
14
|
+
const response = await send({ ...options, type: 'startRpcServer', requestId });
|
|
15
|
+
if (response.type !== 'startRpcServer')
|
|
16
|
+
throw new InvalidResponseError('startRpcServer');
|
|
17
|
+
return {
|
|
18
|
+
serverId: response.serverId,
|
|
19
|
+
url: response.url,
|
|
20
|
+
rdmaCapable: response.rdmaCapable
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/** Withdraw the announcement and await native stop. Bare stop has no deadline. */
|
|
24
|
+
export async function stopRpcServer(options) {
|
|
25
|
+
const response = await send({ ...options, type: 'stopRpcServer' });
|
|
26
|
+
if (response.type !== 'stopRpcServer')
|
|
27
|
+
throw new InvalidResponseError('stopRpcServer');
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Find private-network candidates with device inventories and server RDMA availability.
|
|
31
|
+
* RDMA availability is a server-side offer, not a guarantee of the negotiated transport.
|
|
32
|
+
* Use getRpcDeviceMap with the chosen endpoint registration order before loadModel.
|
|
33
|
+
* Cancel a pending search with its promise.requestId.
|
|
34
|
+
*/
|
|
35
|
+
export function discoverRpcServers(options) {
|
|
36
|
+
const requestId = generateRequestId();
|
|
37
|
+
return decoratePromise(runDiscoverRpcServers(options, requestId), { requestId });
|
|
38
|
+
}
|
|
39
|
+
async function runDiscoverRpcServers(options, requestId) {
|
|
40
|
+
const response = await send({ ...options, type: 'discoverRpcServers', requestId });
|
|
41
|
+
if (response.type !== 'discoverRpcServers')
|
|
42
|
+
throw new InvalidResponseError('discoverRpcServers');
|
|
43
|
+
return response.servers;
|
|
44
|
+
}
|
|
@@ -43,6 +43,15 @@ export declare class TtsMulticast {
|
|
|
43
43
|
* metadata with the audio. Multiple consumers can iterate the response
|
|
44
44
|
* independently via the underlying `TtsMulticast`.
|
|
45
45
|
*
|
|
46
|
+
* MOSS models stream natively rather than by sentence: under `stream: true`
|
|
47
|
+
* the whole text is one synthesis whose audio arrives every
|
|
48
|
+
* `streamChunkTokens` codec frames (in one piece when that is unset), so
|
|
49
|
+
* `durationTokens` and a MOSS-TTSD dialogue's reference transcripts apply to
|
|
50
|
+
* the text as a whole. `sentenceStream: true` still splits a single-speaker
|
|
51
|
+
* text; a dialogue rejects it. `sentenceStreamLocale` and
|
|
52
|
+
* `sentenceStreamMaxChunkScalars` configure that splitting, so a MOSS request
|
|
53
|
+
* rejects them unless it sets `sentenceStream: true`.
|
|
54
|
+
*
|
|
46
55
|
* `result.done` resolves to `true` when synthesis completes cleanly, `false`
|
|
47
56
|
* if the consumer breaks out before the terminal frame, or rejects on a
|
|
48
57
|
* pipeline error. Awaiting `done` is safe even when no stream is iterated.
|
|
@@ -202,6 +202,15 @@ function buildTextToSpeechStreamRequest(params, requestId) {
|
|
|
202
202
|
* metadata with the audio. Multiple consumers can iterate the response
|
|
203
203
|
* independently via the underlying `TtsMulticast`.
|
|
204
204
|
*
|
|
205
|
+
* MOSS models stream natively rather than by sentence: under `stream: true`
|
|
206
|
+
* the whole text is one synthesis whose audio arrives every
|
|
207
|
+
* `streamChunkTokens` codec frames (in one piece when that is unset), so
|
|
208
|
+
* `durationTokens` and a MOSS-TTSD dialogue's reference transcripts apply to
|
|
209
|
+
* the text as a whole. `sentenceStream: true` still splits a single-speaker
|
|
210
|
+
* text; a dialogue rejects it. `sentenceStreamLocale` and
|
|
211
|
+
* `sentenceStreamMaxChunkScalars` configure that splitting, so a MOSS request
|
|
212
|
+
* rejects them unless it sets `sentenceStream: true`.
|
|
213
|
+
*
|
|
205
214
|
* `result.done` resolves to `true` when synthesis completes cleanly, `false`
|
|
206
215
|
* if the consumer breaks out before the terminal frame, or rejects on a
|
|
207
216
|
* pipeline error. Awaiting `done` is safe even when no stream is iterated.
|
package/dist/api/transcribe.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TranscribeClientParams, type RPCOptions, type TranscribeSegment, type TranscribeStreamRequest, type TranscribeStreamClientParams, type TranscribeStreamSession, type TranscribeStreamMetadataSession, type TranscribeStreamConversationSession, type TranscribeStats } from '../schemas/index.js';
|
|
1
|
+
import { type TranscribeClientParams, type RPCOptions, type TranscribeSegment, type TranscribeStreamRequest, type TranscribeStreamClientParams, type TranscribeStreamSession, type TranscribeStreamMetadataSession, type TranscribeStreamConversationSession, type TranscribeStreamEvent, type TranscribeStats, type InferenceBackendDiagnostics } from '../schemas/index.js';
|
|
2
2
|
import { duplex } from '../dispatch.js';
|
|
3
3
|
type TranscribeDuplexFactory = (request: TranscribeStreamRequest, options?: RPCOptions) => ReturnType<typeof duplex>;
|
|
4
4
|
/**
|
|
@@ -10,8 +10,9 @@ type TranscribeDuplexFactory = (request: TranscribeStreamRequest, options?: RPCO
|
|
|
10
10
|
* @param params.audioChunk - Audio input as either a file path (string) or audio buffer
|
|
11
11
|
* @param params.prompt - Optional initial prompt to guide the transcription
|
|
12
12
|
* @param params.metadata - When true, resolves to an array of transcript
|
|
13
|
-
* segments (`{ text, startMs, endMs, append, id }
|
|
14
|
-
*
|
|
13
|
+
* segments (`{ text, startMs, endMs, append, id }`,
|
|
14
|
+
* plus `isEndOfTurn` and `startsWord` on parakeet)
|
|
15
|
+
* instead of joined text.
|
|
15
16
|
* @param options - Optional RPC options including per-call profiling
|
|
16
17
|
* @returns A promise (decorated with `requestId`) resolving to the
|
|
17
18
|
* complete transcribed text, or — when `metadata` is true —
|
|
@@ -57,8 +58,9 @@ export declare function transcribeStream(params: TranscribeClientParams, options
|
|
|
57
58
|
* @param params.modelId - The loaded transcription model to use
|
|
58
59
|
* @param params.prompt - Optional initial prompt to guide transcription
|
|
59
60
|
* @param params.metadata - When true, the session yields transcript segment
|
|
60
|
-
* objects (`{ text, startMs, endMs, append, id }
|
|
61
|
-
*
|
|
61
|
+
* objects (`{ text, startMs, endMs, append, id }`,
|
|
62
|
+
* plus `isEndOfTurn` and `startsWord` on parakeet)
|
|
63
|
+
* instead of plain text.
|
|
62
64
|
* @param options - Optional RPC options including per-call profiling.
|
|
63
65
|
* @returns A session object: call `write(audioChunk)` with a `Uint8Array`
|
|
64
66
|
* (Node `Buffer` is a `Uint8Array` subtype) to feed audio,
|
|
@@ -81,12 +83,14 @@ export declare function transcribeStream(params: TranscribeStreamClientParams, o
|
|
|
81
83
|
* to surface strings or segments; `sessionName` is only used to label the
|
|
82
84
|
* "already iterated" error so callers see the correct session type.
|
|
83
85
|
*/
|
|
84
|
-
export declare function createTranscribeStreamSession<T>(params: TranscribeStreamClientParams, options: RPCOptions | undefined, process: (line: string,
|
|
86
|
+
export declare function createTranscribeStreamSession<T>(params: TranscribeStreamClientParams, options: RPCOptions | undefined, process: (line: string, onTerminal: (stats: TranscribeStats | undefined, diagnostics: InferenceBackendDiagnostics | undefined) => void) => T | undefined | null, sessionName: string, duplexFactory?: TranscribeDuplexFactory): Promise<{
|
|
85
87
|
stats: Promise<TranscribeStats | undefined>;
|
|
88
|
+
diagnostics: Promise<InferenceBackendDiagnostics | undefined>;
|
|
86
89
|
write(audioChunk: Uint8Array): void;
|
|
87
90
|
end(): void;
|
|
88
91
|
destroy(): void;
|
|
89
92
|
[Symbol.asyncIterator](): AsyncIterator<T>;
|
|
90
93
|
}>;
|
|
91
|
-
export declare function processLine(line: string,
|
|
94
|
+
export declare function processLine(line: string, onTerminal: (stats: TranscribeStats | undefined, diagnostics: InferenceBackendDiagnostics | undefined) => void): string | undefined | null;
|
|
95
|
+
export declare function processLineConversation(line: string, wantsMetadata: boolean, onTerminal: (stats: TranscribeStats | undefined, diagnostics: InferenceBackendDiagnostics | undefined) => void): TranscribeStreamEvent | undefined | null;
|
|
92
96
|
export {};
|
package/dist/api/transcribe.js
CHANGED
|
@@ -144,16 +144,47 @@ export async function createTranscribeStreamSession(params, options, process, se
|
|
|
144
144
|
statsSettled = true;
|
|
145
145
|
rejectStatsPromise(error);
|
|
146
146
|
}
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
// Settled from the same terminal frame as `stats`, and on the same paths:
|
|
148
|
+
// resolved empty when the stream closes without one, rejected on error.
|
|
149
|
+
let diagnosticsSettled = false;
|
|
150
|
+
let resolveDiagnosticsPromise = () => { };
|
|
151
|
+
let rejectDiagnosticsPromise = () => { };
|
|
152
|
+
const diagnostics = new Promise((resolve, reject) => {
|
|
153
|
+
resolveDiagnosticsPromise = resolve;
|
|
154
|
+
rejectDiagnosticsPromise = reject;
|
|
155
|
+
});
|
|
156
|
+
diagnostics.catch(() => { });
|
|
157
|
+
function resolveDiagnostics(value) {
|
|
158
|
+
if (diagnosticsSettled)
|
|
159
|
+
return;
|
|
160
|
+
diagnosticsSettled = true;
|
|
161
|
+
resolveDiagnosticsPromise(value);
|
|
162
|
+
}
|
|
163
|
+
function rejectDiagnostics(error) {
|
|
164
|
+
if (diagnosticsSettled)
|
|
165
|
+
return;
|
|
166
|
+
diagnosticsSettled = true;
|
|
167
|
+
rejectDiagnosticsPromise(error);
|
|
168
|
+
}
|
|
169
|
+
function resolveTerminal(statsValue, diagnosticsValue) {
|
|
170
|
+
resolveStats(statsValue);
|
|
171
|
+
resolveDiagnostics(diagnosticsValue);
|
|
172
|
+
}
|
|
173
|
+
function resolveEmptyTerminal() {
|
|
174
|
+
resolveTerminal(undefined, undefined);
|
|
175
|
+
}
|
|
176
|
+
function rejectTerminal(error) {
|
|
177
|
+
rejectStats(error);
|
|
178
|
+
rejectDiagnostics(error);
|
|
149
179
|
}
|
|
150
180
|
function processResponse(line) {
|
|
151
|
-
return process(line,
|
|
181
|
+
return process(line, resolveTerminal);
|
|
152
182
|
}
|
|
153
|
-
const responses = parseLines(responseStream, processResponse,
|
|
183
|
+
const responses = parseLines(responseStream, processResponse, resolveEmptyTerminal, rejectTerminal);
|
|
154
184
|
let consumed = false;
|
|
155
185
|
return {
|
|
156
186
|
stats,
|
|
187
|
+
diagnostics,
|
|
157
188
|
write(audioChunk) {
|
|
158
189
|
requestStream.write(audioChunk);
|
|
159
190
|
},
|
|
@@ -161,7 +192,7 @@ export async function createTranscribeStreamSession(params, options, process, se
|
|
|
161
192
|
requestStream.end();
|
|
162
193
|
},
|
|
163
194
|
destroy() {
|
|
164
|
-
|
|
195
|
+
resolveEmptyTerminal();
|
|
165
196
|
requestStream.destroy();
|
|
166
197
|
responseStream.destroy();
|
|
167
198
|
},
|
|
@@ -182,7 +213,7 @@ function transcribeStreamDuplexMetadata(params, options) {
|
|
|
182
213
|
}
|
|
183
214
|
function transcribeStreamDuplexConversation(params, options) {
|
|
184
215
|
const wantsMetadata = params.metadata === true;
|
|
185
|
-
return createTranscribeStreamSession(params, options, (line,
|
|
216
|
+
return createTranscribeStreamSession(params, options, (line, onTerminal) => processLineConversation(line, wantsMetadata, onTerminal), 'TranscribeStreamConversationSession');
|
|
186
217
|
}
|
|
187
218
|
/**
|
|
188
219
|
* Line-delimited parser: reads newline-separated frames from a duplex
|
|
@@ -241,31 +272,32 @@ function parseResponseLine(line) {
|
|
|
241
272
|
* `undefined` for frames the caller should skip, or the value extracted from
|
|
242
273
|
* the frame.
|
|
243
274
|
*/
|
|
244
|
-
function processWith(line, extract,
|
|
275
|
+
function processWith(line, extract, onTerminal) {
|
|
245
276
|
const response = parseResponseLine(line);
|
|
246
277
|
if (response === null)
|
|
247
278
|
return undefined;
|
|
248
279
|
if (response.error)
|
|
249
280
|
throw new TranscriptionFailedError(response.error);
|
|
250
281
|
if (response.done) {
|
|
251
|
-
|
|
282
|
+
onTerminal(response.stats, response.diagnostics);
|
|
252
283
|
return null;
|
|
253
284
|
}
|
|
254
285
|
return extract(response);
|
|
255
286
|
}
|
|
256
|
-
export function processLine(line,
|
|
257
|
-
return processWith(line, (response) => (response.text?.trim() ? response.text : undefined),
|
|
287
|
+
export function processLine(line, onTerminal) {
|
|
288
|
+
return processWith(line, (response) => (response.text?.trim() ? response.text : undefined), onTerminal);
|
|
258
289
|
}
|
|
259
|
-
function processLineMetadata(line,
|
|
260
|
-
return processWith(line, (response) => response.segment,
|
|
290
|
+
function processLineMetadata(line, onTerminal) {
|
|
291
|
+
return processWith(line, (response) => response.segment, onTerminal);
|
|
261
292
|
}
|
|
262
|
-
function processLineConversation(line, wantsMetadata,
|
|
293
|
+
export function processLineConversation(line, wantsMetadata, onTerminal) {
|
|
263
294
|
return processWith(line, (response) => {
|
|
264
295
|
if (response.vad) {
|
|
265
296
|
return {
|
|
266
297
|
type: 'vad',
|
|
267
298
|
speaking: response.vad.speaking,
|
|
268
|
-
probability: response.vad.probability
|
|
299
|
+
probability: response.vad.probability,
|
|
300
|
+
...(response.vad.source && { source: response.vad.source })
|
|
269
301
|
};
|
|
270
302
|
}
|
|
271
303
|
if (response.endOfTurn) {
|
|
@@ -291,5 +323,5 @@ function processLineConversation(line, wantsMetadata, onStats) {
|
|
|
291
323
|
return { type: 'text', text: response.text };
|
|
292
324
|
}
|
|
293
325
|
return undefined;
|
|
294
|
-
},
|
|
326
|
+
}, onTerminal);
|
|
295
327
|
}
|