@qvac/sdk 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +27 -11
- package/README.md +34 -35
- package/dist/client/api/batch-completion.d.ts +15 -0
- package/dist/client/api/batch-completion.js +332 -0
- package/dist/client/api/bci-transcribe.d.ts +1 -1
- package/dist/client/api/bci-transcribe.js +31 -31
- package/dist/client/api/cancel.d.ts +1 -1
- package/dist/client/api/cancel.js +18 -18
- package/dist/client/api/classify.d.ts +1 -1
- package/dist/client/api/classify.js +9 -6
- package/dist/client/api/client-request-id.js +1 -1
- package/dist/client/api/completion-stream.d.ts +3 -3
- package/dist/client/api/completion-stream.js +18 -18
- package/dist/client/api/delete-cache.js +9 -9
- package/dist/client/api/diffusion.d.ts +1 -1
- package/dist/client/api/diffusion.js +17 -11
- package/dist/client/api/download-asset.d.ts +1 -1
- package/dist/client/api/download-asset.js +11 -11
- package/dist/client/api/embed.d.ts +1 -1
- package/dist/client/api/embed.js +10 -10
- package/dist/client/api/finetune.d.ts +1 -1
- package/dist/client/api/finetune.js +25 -27
- package/dist/client/api/get-loaded-model-info.d.ts +2 -2
- package/dist/client/api/get-loaded-model-info.js +8 -8
- package/dist/client/api/get-model-info.d.ts +1 -1
- package/dist/client/api/get-model-info.js +7 -7
- package/dist/client/api/heartbeat.d.ts +2 -2
- package/dist/client/api/heartbeat.js +7 -7
- package/dist/client/api/index.d.ts +33 -32
- package/dist/client/api/index.js +33 -32
- package/dist/client/api/invoke-plugin.d.ts +1 -1
- package/dist/client/api/invoke-plugin.js +10 -10
- package/dist/client/api/load-model.d.ts +1 -1
- package/dist/client/api/load-model.js +32 -32
- package/dist/client/api/logging-stream.d.ts +1 -1
- package/dist/client/api/logging-stream.js +6 -6
- package/dist/client/api/ocr.d.ts +1 -1
- package/dist/client/api/ocr.js +11 -11
- package/dist/client/api/provide.d.ts +1 -1
- package/dist/client/api/provide.js +7 -7
- package/dist/client/api/rag.d.ts +1 -1
- package/dist/client/api/rag.js +65 -66
- package/dist/client/api/registry.d.ts +1 -1
- package/dist/client/api/registry.js +8 -8
- package/dist/client/api/resume.js +5 -5
- package/dist/client/api/state.d.ts +1 -1
- package/dist/client/api/state.js +5 -5
- package/dist/client/api/stop-provider.js +6 -6
- package/dist/client/api/subscribe-logs.d.ts +1 -1
- package/dist/client/api/subscribe-logs.js +3 -3
- package/dist/client/api/suspend.js +5 -5
- package/dist/client/api/text-to-speech.d.ts +1 -1
- package/dist/client/api/text-to-speech.js +37 -39
- package/dist/client/api/transcribe.d.ts +2 -2
- package/dist/client/api/transcribe.js +44 -45
- package/dist/client/api/translate.d.ts +1 -1
- package/dist/client/api/translate.js +14 -14
- package/dist/client/api/unload-model.d.ts +1 -1
- package/dist/client/api/unload-model.js +11 -11
- package/dist/client/api/upscale.d.ts +1 -1
- package/dist/client/api/upscale.js +9 -9
- package/dist/client/api/video.d.ts +1 -1
- package/dist/client/api/video.js +16 -14
- package/dist/client/api/vla-helpers.d.ts +2 -2
- package/dist/client/api/vla-helpers.js +6 -11
- package/dist/client/api/vla.d.ts +1 -1
- package/dist/client/api/vla.js +13 -13
- package/dist/client/config-loader/config-utils.d.ts +1 -1
- package/dist/client/config-loader/config-utils.js +3 -3
- package/dist/client/config-loader/resolve-config.bare.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.bare.js +11 -11
- package/dist/client/config-loader/resolve-config.expo.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.expo.js +6 -6
- package/dist/client/config-loader/resolve-config.node.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.node.js +27 -27
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/init-hooks.d.ts +1 -1
- package/dist/client/init-hooks.js +12 -12
- package/dist/client/logging-stream-registry.d.ts +1 -1
- package/dist/client/logging-stream-registry.js +6 -6
- package/dist/client/parse-input.d.ts +1 -1
- package/dist/client/parse-input.js +3 -3
- package/dist/client/plugins-factory.d.ts +2 -2
- package/dist/client/plugins-factory.js +2 -2
- package/dist/client/rpc/bare-client.d.ts +2 -1
- package/dist/client/rpc/bare-client.js +37 -39
- package/dist/client/rpc/ensure-worker-ready.js +4 -4
- package/dist/client/rpc/expo-device-info.d.ts +1 -1
- package/dist/client/rpc/expo-device-info.js +11 -11
- package/dist/client/rpc/expo-rpc-client.d.ts +2 -1
- package/dist/client/rpc/expo-rpc-client.js +38 -47
- package/dist/client/rpc/node-rpc-client.d.ts +2 -1
- package/dist/client/rpc/node-rpc-client.js +103 -75
- package/dist/client/rpc/profiling/index.d.ts +1 -1
- package/dist/client/rpc/profiling/index.js +1 -1
- package/dist/client/rpc/profiling/profiler.d.ts +2 -2
- package/dist/client/rpc/profiling/profiler.js +31 -34
- package/dist/client/rpc/rpc-client.d.ts +2 -2
- package/dist/client/rpc/rpc-client.js +113 -72
- package/dist/client/rpc/rpc-error.d.ts +1 -1
- package/dist/client/rpc/rpc-error.js +14 -14
- package/dist/commands/bundle/bare-pack.d.ts +1 -1
- package/dist/commands/bundle/bare-pack.js +20 -20
- package/dist/commands/bundle/constants.js +21 -21
- package/dist/commands/bundle/entry-gen.d.ts +1 -1
- package/dist/commands/bundle/entry-gen.js +10 -10
- package/dist/commands/bundle/index.js +47 -47
- package/dist/commands/bundle/manifest.d.ts +1 -1
- package/dist/commands/bundle/manifest.js +44 -46
- package/dist/commands/bundle/plugins.d.ts +2 -2
- package/dist/commands/bundle/plugins.js +7 -7
- package/dist/commands/bundle/resolve-sdk-import.d.ts +6 -0
- package/dist/commands/bundle/resolve-sdk-import.js +53 -0
- package/dist/commands/index.d.ts +4 -4
- package/dist/commands/index.js +2 -2
- package/dist/commands/verify/abi.d.ts +9 -9
- package/dist/commands/verify/abi.js +31 -31
- package/dist/commands/verify/addon-source.d.ts +1 -1
- package/dist/commands/verify/addon-source.js +13 -14
- package/dist/commands/verify/bundle-source.d.ts +1 -1
- package/dist/commands/verify/bundle-source.js +7 -7
- package/dist/commands/verify/index.d.ts +3 -3
- package/dist/commands/verify/index.js +18 -17
- package/dist/commands/verify/node-modules-source.d.ts +1 -1
- package/dist/commands/verify/node-modules-source.js +11 -11
- package/dist/commands/verify/prebuilds.d.ts +3 -3
- package/dist/commands/verify/prebuilds.js +8 -8
- package/dist/constants/audio.d.ts +1 -1
- package/dist/constants/audio.js +1 -1
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/index.js +2 -2
- package/dist/constants/registry.js +1 -1
- package/dist/examples/audio/mic-input.d.ts +1 -1
- package/dist/examples/audio/mic-input.js +31 -31
- package/dist/examples/batch-completion.d.ts +38 -0
- package/dist/examples/batch-completion.js +100 -0
- package/dist/examples/bci/bci-filesystem-streaming.js +20 -20
- package/dist/examples/bci/bci-filesystem.js +17 -17
- package/dist/examples/cache-management.js +32 -32
- package/dist/examples/cancel-by-request-id.js +11 -11
- package/dist/examples/classification/classify-image.js +5 -5
- package/dist/examples/completion-events.js +16 -18
- package/dist/examples/completion-stop-reason.js +13 -13
- package/dist/examples/concurrent-completion-collision.js +20 -20
- package/dist/examples/config/blind-relay/blind-relay.config.js +4 -4
- package/dist/examples/config/default/default.config.js +2 -2
- package/dist/examples/config/plugins/plugins.config.js +2 -2
- package/dist/examples/config-reload.js +14 -14
- package/dist/examples/default-config-usage.js +10 -13
- package/dist/examples/delegated-inference/composite.js +23 -23
- package/dist/examples/delegated-inference/consumer-profiled.js +19 -19
- package/dist/examples/delegated-inference/consumer.js +11 -11
- package/dist/examples/delegated-inference/provider.js +24 -24
- package/dist/examples/diffusion-esrgan-upscale.js +19 -19
- package/dist/examples/diffusion-flux2-klein-img2img.js +17 -17
- package/dist/examples/diffusion-flux2-klein.js +14 -14
- package/dist/examples/diffusion-img2img.js +13 -13
- package/dist/examples/diffusion-img2vid.js +22 -23
- package/dist/examples/diffusion-simple.js +7 -7
- package/dist/examples/diffusion-txt2img.js +13 -14
- package/dist/examples/diffusion-txt2vid.js +18 -18
- package/dist/examples/download-with-blind-relays.js +7 -8
- package/dist/examples/download-with-cancel.js +9 -9
- package/dist/examples/embed-multi-gpu.js +9 -9
- package/dist/examples/embed-p2p.js +24 -24
- package/dist/examples/finetune/llamacpp-finetune.js +21 -21
- package/dist/examples/kv-cache-cleanup.js +34 -34
- package/dist/examples/kv-cache-custom-key.js +30 -30
- package/dist/examples/kv-cache-example.js +18 -20
- package/dist/examples/llamacpp-cache.js +33 -33
- package/dist/examples/llamacpp-dynamic-tools.js +38 -38
- package/dist/examples/llamacpp-filesystem.js +13 -15
- package/dist/examples/llamacpp-http.js +12 -14
- package/dist/examples/llamacpp-multi-gpu.js +12 -12
- package/dist/examples/llamacpp-multimodal.js +16 -16
- package/dist/examples/llamacpp-p2p.js +11 -11
- package/dist/examples/llamacpp-sharded.js +12 -12
- package/dist/examples/llamacpp-structured-output.js +37 -37
- package/dist/examples/logging-file-transport.js +19 -21
- package/dist/examples/logging-global.js +8 -8
- package/dist/examples/logging-streaming.js +16 -18
- package/dist/examples/mcp-websearch.js +44 -44
- package/dist/examples/multi-model-demo.js +33 -33
- package/dist/examples/ocr-fasttext.js +17 -17
- package/dist/examples/parallel-download.js +11 -13
- package/dist/examples/plugins.js +43 -43
- package/dist/examples/profiling/basic.js +34 -36
- package/dist/examples/profiling/per-call.js +16 -16
- package/dist/examples/quickstart.bare.js +4 -6
- package/dist/examples/quickstart.js +7 -7
- package/dist/examples/rag/rag-chromadb.js +26 -26
- package/dist/examples/rag/rag-hyperdb/cancellation.js +19 -20
- package/dist/examples/rag/rag-hyperdb/ingest.js +19 -19
- package/dist/examples/rag/rag-hyperdb/pipeline.js +26 -26
- package/dist/examples/rag/rag-hyperdb/workspaces.js +46 -46
- package/dist/examples/rag/rag-lancedb.js +29 -32
- package/dist/examples/rag/rag-sqlite.js +25 -25
- package/dist/examples/registry-query.js +15 -15
- package/dist/examples/seed-p2p.js +8 -8
- package/dist/examples/suspend-resume.js +20 -20
- package/dist/examples/tools/llamacpp-native-tools.js +25 -25
- package/dist/examples/tools/llamacpp-tools-gemma4.js +14 -14
- package/dist/examples/tools/llamacpp-tools-harmony-multiturn.js +15 -15
- package/dist/examples/tools/llamacpp-tools-pythonic.js +15 -15
- package/dist/examples/tools/llamacpp-tools-qwen35.js +14 -14
- package/dist/examples/tools/shared.d.ts +2 -2
- package/dist/examples/tools/shared.js +17 -17
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +12 -12
- package/dist/examples/transcription/parakeet-microphone-record.js +19 -19
- package/dist/examples/transcription/parakeet-microphone-stream.js +23 -23
- package/dist/examples/transcription/parakeet-sortformer-streaming.js +18 -28
- package/dist/examples/transcription/parakeet-sortformer.js +21 -21
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +13 -13
- package/dist/examples/transcription/whispercpp-filesystem-streaming.js +34 -34
- package/dist/examples/transcription/whispercpp-filesystem.js +19 -19
- package/dist/examples/transcription/whispercpp-microphone-conversation.js +27 -27
- package/dist/examples/transcription/whispercpp-microphone-record.js +21 -21
- package/dist/examples/transcription/whispercpp-prompt.js +18 -18
- package/dist/examples/translation/translation-bergamot-batch.js +17 -17
- package/dist/examples/translation/translation-bergamot-pivot.js +16 -16
- package/dist/examples/translation/translation-bergamot.js +11 -11
- package/dist/examples/translation/translation-indic.js +10 -10
- package/dist/examples/translation/translation-llm-afriquegemma.js +10 -10
- package/dist/examples/translation/translation-llm-context.js +10 -10
- package/dist/examples/translation/translation-llm.js +13 -13
- package/dist/examples/translation/translation-stream.js +11 -11
- package/dist/examples/tts/chatterbox-enhanced.d.ts +2 -0
- package/dist/examples/tts/chatterbox-enhanced.js +55 -0
- package/dist/examples/tts/chatterbox-multilingual.d.ts +2 -0
- package/dist/examples/tts/chatterbox-multilingual.js +54 -0
- package/dist/examples/tts/chatterbox.js +18 -18
- package/dist/examples/tts/llm-to-tts-streaming.js +30 -30
- package/dist/examples/tts/supertonic-enhanced.d.ts +2 -0
- package/dist/examples/tts/supertonic-enhanced.js +57 -0
- package/dist/examples/tts/supertonic-multilingual.js +19 -19
- package/dist/examples/tts/supertonic.js +18 -18
- package/dist/examples/tts/utils.js +24 -32
- package/dist/examples/vla-pi05.js +14 -14
- package/dist/examples/vla-smolvla.js +14 -14
- package/dist/examples/voice-assistant/voice-assistant.js +46 -46
- package/dist/expo/plugins/find-in-ancestor-node-modules.js +3 -3
- package/dist/expo/plugins/get-project-root.d.ts +2 -2
- package/dist/expo/plugins/get-project-root.js +1 -1
- package/dist/expo/plugins/index.d.ts +11 -11
- package/dist/expo/plugins/index.js +10 -10
- package/dist/expo/plugins/resolve-sdk-package-dir.js +7 -11
- package/dist/expo/plugins/withAndroidArchitecture.d.ts +1 -1
- package/dist/expo/plugins/withAndroidArchitecture.js +12 -12
- package/dist/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
- package/dist/expo/plugins/withAndroidNdkVersion.js +9 -9
- package/dist/expo/plugins/withDeviceInfo.d.ts +1 -1
- package/dist/expo/plugins/withDeviceInfo.js +13 -13
- package/dist/expo/plugins/withMobileBundle.d.ts +1 -1
- package/dist/expo/plugins/withMobileBundle.js +34 -42
- package/dist/expo/plugins/withOpenCL.d.ts +1 -1
- package/dist/expo/plugins/withOpenCL.js +14 -16
- package/dist/expo/plugins/withQvacSDK.d.ts +1 -1
- package/dist/expo/plugins/withQvacSDK.js +12 -12
- package/dist/index.d.ts +16 -16
- package/dist/index.js +16 -17
- package/dist/logging/addon.d.ts +1 -1
- package/dist/logging/addon.js +13 -13
- package/dist/logging/base-logger.d.ts +2 -2
- package/dist/logging/base-logger.js +6 -6
- package/dist/logging/client-logger.d.ts +1 -1
- package/dist/logging/client-logger.js +3 -3
- package/dist/logging/index.d.ts +9 -9
- package/dist/logging/index.js +8 -8
- package/dist/logging/logger.d.ts +1 -1
- package/dist/logging/logger.js +4 -4
- package/dist/logging/namespaces.d.ts +1 -1
- package/dist/logging/namespaces.js +5 -5
- package/dist/logging/registry.d.ts +2 -2
- package/dist/logging/registry.js +3 -3
- package/dist/logging/server-logger.d.ts +1 -1
- package/dist/logging/server-logger.js +2 -2
- package/dist/logging/stream-logger.d.ts +1 -1
- package/dist/logging/stream-logger.js +4 -4
- package/dist/logging/transport.d.ts +1 -1
- package/dist/logging/types.d.ts +1 -1
- package/dist/logging/utils.d.ts +2 -2
- package/dist/logging/utils.js +40 -41
- package/dist/models/registry/index.d.ts +1 -1
- package/dist/models/registry/index.js +5 -5
- package/dist/models/registry/models.d.ts +429 -122
- package/dist/models/registry/models.js +13693 -13369
- package/dist/models/update-models/codegen.d.ts +1 -1
- package/dist/models/update-models/codegen.js +8 -8
- package/dist/models/update-models/companions.d.ts +6 -1
- package/dist/models/update-models/companions.js +104 -39
- package/dist/models/update-models/history.d.ts +1 -1
- package/dist/models/update-models/history.js +11 -11
- package/dist/models/update-models/index.js +32 -34
- package/dist/models/update-models/naming.d.ts +2 -2
- package/dist/models/update-models/naming.js +177 -186
- package/dist/models/update-models/processing.d.ts +2 -2
- package/dist/models/update-models/processing.js +17 -19
- package/dist/models/update-models/registry.d.ts +2 -2
- package/dist/models/update-models/registry.js +9 -9
- package/dist/models/update-models/shards.d.ts +1 -1
- package/dist/models/update-models/shards.js +3 -3
- package/dist/models/update-models/types.d.ts +1 -1
- package/dist/models/update-models/utils.js +5 -5
- package/dist/pear/pre.js +84 -84
- package/dist/profiling/aggregator.d.ts +1 -1
- package/dist/profiling/aggregator.js +6 -6
- package/dist/profiling/clock.d.ts +1 -1
- package/dist/profiling/clock.js +10 -10
- package/dist/profiling/controller.d.ts +2 -2
- package/dist/profiling/controller.js +11 -12
- package/dist/profiling/envelope.d.ts +1 -1
- package/dist/profiling/envelope.js +4 -6
- package/dist/profiling/events.d.ts +2 -2
- package/dist/profiling/events.js +8 -10
- package/dist/profiling/exporters.d.ts +1 -1
- package/dist/profiling/exporters.js +81 -79
- package/dist/profiling/index.d.ts +8 -8
- package/dist/profiling/index.js +7 -7
- package/dist/profiling/model-execution.js +2 -1
- package/dist/profiling/ring-buffer.js +2 -2
- package/dist/profiling/types.d.ts +3 -3
- package/dist/schemas/archive.d.ts +1 -1
- package/dist/schemas/archive.js +8 -14
- package/dist/schemas/batch-completion-stream.d.ts +463 -0
- package/dist/schemas/batch-completion-stream.js +124 -0
- package/dist/schemas/bci-config.d.ts +1 -1
- package/dist/schemas/bci-config.js +7 -7
- package/dist/schemas/bci.d.ts +3 -3
- package/dist/schemas/bci.js +25 -31
- package/dist/schemas/cancel.d.ts +6 -1
- package/dist/schemas/cancel.js +33 -34
- package/dist/schemas/classification.d.ts +1 -1
- package/dist/schemas/classification.js +7 -7
- package/dist/schemas/common.d.ts +194 -25
- package/dist/schemas/common.js +40 -37
- package/dist/schemas/completion-event.d.ts +11 -8
- package/dist/schemas/completion-event.js +27 -26
- package/dist/schemas/completion-stream.d.ts +4 -3
- package/dist/schemas/completion-stream.js +51 -67
- package/dist/schemas/delegate.d.ts +1 -1
- package/dist/schemas/delegate.js +7 -7
- package/dist/schemas/delete-cache.d.ts +1 -1
- package/dist/schemas/delete-cache.js +8 -8
- package/dist/schemas/download-asset.d.ts +2 -2
- package/dist/schemas/download-asset.js +21 -21
- package/dist/schemas/embed.d.ts +3 -3
- package/dist/schemas/embed.js +16 -27
- package/dist/schemas/engine-addon-map.d.ts +2 -2
- package/dist/schemas/engine-addon-map.js +24 -24
- package/dist/schemas/error.d.ts +1 -1
- package/dist/schemas/error.js +12 -13
- package/dist/schemas/finetune.d.ts +1 -1
- package/dist/schemas/finetune.js +35 -41
- package/dist/schemas/get-loaded-model-info.d.ts +1 -1
- package/dist/schemas/get-loaded-model-info.js +10 -10
- package/dist/schemas/get-model-info.d.ts +1 -1
- package/dist/schemas/get-model-info.js +48 -91
- package/dist/schemas/heartbeat.d.ts +1 -1
- package/dist/schemas/heartbeat.js +6 -6
- package/dist/schemas/index.d.ts +52 -51
- package/dist/schemas/index.js +52 -51
- package/dist/schemas/json-schema.d.ts +1 -1
- package/dist/schemas/llamacpp-config.d.ts +33 -25
- package/dist/schemas/llamacpp-config.js +43 -30
- package/dist/schemas/load-model.d.ts +160 -128
- package/dist/schemas/load-model.js +120 -126
- package/dist/schemas/logging-stream.d.ts +1 -1
- package/dist/schemas/logging-stream.js +6 -12
- package/dist/schemas/mcp-adapter.d.ts +1 -1
- package/dist/schemas/model-src-utils.d.ts +1 -1
- package/dist/schemas/model-src-utils.js +13 -13
- package/dist/schemas/model-types.d.ts +1 -1
- package/dist/schemas/model-types.js +27 -27
- package/dist/schemas/ocr.d.ts +1 -1
- package/dist/schemas/ocr.js +18 -18
- package/dist/schemas/path-validation.d.ts +1 -1
- package/dist/schemas/path-validation.js +4 -4
- package/dist/schemas/plugin.d.ts +9 -10
- package/dist/schemas/plugin.js +47 -47
- package/dist/schemas/profiling.d.ts +1 -1
- package/dist/schemas/profiling.js +16 -16
- package/dist/schemas/provide.d.ts +1 -1
- package/dist/schemas/provide.js +8 -8
- package/dist/schemas/rag.d.ts +3 -3
- package/dist/schemas/rag.js +65 -70
- package/dist/schemas/registry.d.ts +1 -1
- package/dist/schemas/registry.js +44 -66
- package/dist/schemas/reload-config.d.ts +1 -1
- package/dist/schemas/reload-config.js +14 -18
- package/dist/schemas/resume.d.ts +1 -1
- package/dist/schemas/resume.js +3 -3
- package/dist/schemas/runtime-context.d.ts +1 -1
- package/dist/schemas/runtime-context.js +4 -4
- package/dist/schemas/sdcpp-config.d.ts +9 -9
- package/dist/schemas/sdcpp-config.js +298 -300
- package/dist/schemas/sdk-config.d.ts +55 -43
- package/dist/schemas/sdk-config.js +25 -29
- package/dist/schemas/sdk-errors-client.d.ts +1 -1
- package/dist/schemas/sdk-errors-client.js +80 -80
- package/dist/schemas/sdk-errors-registry.js +1 -1
- package/dist/schemas/sdk-errors-server.d.ts +1 -1
- package/dist/schemas/sdk-errors-server.js +200 -199
- package/dist/schemas/shard.d.ts +1 -1
- package/dist/schemas/shard.js +4 -4
- package/dist/schemas/state.d.ts +1 -1
- package/dist/schemas/state.js +5 -10
- package/dist/schemas/stop-provide.d.ts +1 -1
- package/dist/schemas/stop-provide.js +4 -4
- package/dist/schemas/suspend.d.ts +1 -1
- package/dist/schemas/suspend.js +3 -3
- package/dist/schemas/text-to-speech.d.ts +455 -3
- package/dist/schemas/text-to-speech.js +146 -110
- package/dist/schemas/tools.d.ts +1 -1
- package/dist/schemas/tools.js +17 -24
- package/dist/schemas/transcription-config.d.ts +1 -1
- package/dist/schemas/transcription-config.js +18 -18
- package/dist/schemas/transcription.d.ts +5 -5
- package/dist/schemas/transcription.js +31 -33
- package/dist/schemas/translate.d.ts +3 -3
- package/dist/schemas/translate.js +38 -67
- package/dist/schemas/translation-config.d.ts +1 -1
- package/dist/schemas/translation-config.js +116 -123
- package/dist/schemas/unload-model.d.ts +1 -1
- package/dist/schemas/unload-model.js +6 -6
- package/dist/schemas/vla.d.ts +1 -1
- package/dist/schemas/vla.js +30 -30
- package/dist/scripts/run-security-tests.js +9 -10
- package/dist/scripts/run-unit-tests.js +11 -12
- package/dist/server/bare/delegate-connect-diagnostics.js +13 -19
- package/dist/server/bare/delegate-rpc-client.d.ts +2 -2
- package/dist/server/bare/delegate-rpc-client.js +32 -34
- package/dist/server/bare/hyperswarm.d.ts +3 -3
- package/dist/server/bare/hyperswarm.js +14 -14
- package/dist/server/bare/ops/bci-transcribe.d.ts +1 -1
- package/dist/server/bare/ops/bci-transcribe.js +44 -44
- package/dist/server/bare/ops/cancel.d.ts +2 -2
- package/dist/server/bare/ops/cancel.js +6 -6
- package/dist/server/bare/ops/embed.d.ts +1 -1
- package/dist/server/bare/ops/embed.js +26 -16
- package/dist/server/bare/ops/kv-cache-utils.d.ts +1 -1
- package/dist/server/bare/ops/kv-cache-utils.js +17 -19
- package/dist/server/bare/ops/load-model.d.ts +2 -2
- package/dist/server/bare/ops/load-model.js +14 -18
- package/dist/server/bare/ops/transcribe.d.ts +3 -3
- package/dist/server/bare/ops/transcribe.js +62 -62
- package/dist/server/bare/ops/translate.d.ts +1 -1
- package/dist/server/bare/ops/translate.js +39 -30
- package/dist/server/bare/ops/unload-model.d.ts +1 -1
- package/dist/server/bare/ops/unload-model.js +12 -12
- package/dist/server/bare/plugins/bci-whispercpp-transcription/args.d.ts +2 -2
- package/dist/server/bare/plugins/bci-whispercpp-transcription/args.js +3 -3
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +2 -2
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +33 -33
- package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.d.ts +1 -1
- package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.js +1 -1
- package/dist/server/bare/plugins/ggml-classification/ops/classify.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-classification/ops/classify.js +8 -8
- package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-classification/plugin.js +14 -14
- package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.js +27 -26
- package/dist/server/bare/plugins/ggml-ocr/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-ocr/plugin.js +38 -38
- package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.js +3 -3
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +23 -23
- package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-vla/plugin.js +15 -15
- package/dist/server/bare/plugins/index.d.ts +11 -11
- package/dist/server/bare/plugins/index.js +11 -11
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.d.ts +23 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.js +30 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.d.ts +32 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.js +99 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.d.ts +1 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +8 -8
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +3 -2
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +4 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +22 -4
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +55 -59
- package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.js +5 -5
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.d.ts +2 -2
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +34 -34
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +7 -7
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +19 -23
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +4 -6
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +186 -17
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +235 -70
- package/dist/server/bare/plugins/llamacpp-completion/transform.d.ts +1 -1
- package/dist/server/bare/plugins/llamacpp-completion/transform.js +15 -15
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +3 -3
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +27 -29
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +38 -39
- package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.d.ts +1 -1
- package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.js +19 -22
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +36 -36
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.d.ts +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +15 -17
- package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.d.ts +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.js +11 -11
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +42 -44
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +4 -4
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +69 -63
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.d.ts +2 -2
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.js +19 -21
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.d.ts +2 -2
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.js +22 -24
- package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +3 -2
- package/dist/server/bare/plugins/tts-ggml/plugin.js +95 -49
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +52 -52
- package/dist/server/bare/rag-hyperdb/handlers/chunk.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/chunk.js +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.js +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.js +4 -4
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.js +3 -3
- package/dist/server/bare/rag-hyperdb/handlers/ingest.d.ts +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/ingest.js +4 -4
- package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.js +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/reindex.d.ts +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/reindex.js +5 -5
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.d.ts +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.js +3 -3
- package/dist/server/bare/rag-hyperdb/handlers/search.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/search.js +3 -3
- package/dist/server/bare/rag-hyperdb/index.d.ts +11 -11
- package/dist/server/bare/rag-hyperdb/index.js +11 -11
- package/dist/server/bare/rag-hyperdb/rag-operation-manager.js +3 -3
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +20 -20
- package/dist/server/bare/registry/config-registry.d.ts +1 -1
- package/dist/server/bare/registry/config-registry.js +13 -16
- package/dist/server/bare/registry/logging-stream-registry.d.ts +1 -1
- package/dist/server/bare/registry/logging-stream-registry.js +2 -2
- package/dist/server/bare/registry/model-config-registry.d.ts +2 -2
- package/dist/server/bare/registry/model-config-registry.js +6 -6
- package/dist/server/bare/registry/model-config-utils.d.ts +2 -2
- package/dist/server/bare/registry/model-config-utils.js +35 -35
- package/dist/server/bare/registry/model-registry.d.ts +3 -3
- package/dist/server/bare/registry/model-registry.js +11 -11
- package/dist/server/bare/registry/registry-client.d.ts +1 -1
- package/dist/server/bare/registry/registry-client.js +18 -18
- package/dist/server/bare/registry/runtime-context-registry.d.ts +1 -1
- package/dist/server/bare/registry/runtime-context-registry.js +3 -3
- package/dist/server/bare/runtime/disposable-scope.js +3 -3
- package/dist/server/bare/runtime/index.d.ts +7 -7
- package/dist/server/bare/runtime/index.js +3 -3
- package/dist/server/bare/runtime/request-context.d.ts +4 -4
- package/dist/server/bare/runtime/request-id.js +1 -1
- package/dist/server/bare/runtime/request-registry-singleton.d.ts +1 -1
- package/dist/server/bare/runtime/request-registry-singleton.js +23 -4
- package/dist/server/bare/runtime/request-registry.d.ts +27 -12
- package/dist/server/bare/runtime/request-registry.js +39 -34
- package/dist/server/bare/runtime/with-request-context.d.ts +1 -1
- package/dist/server/bare/runtime/with-request-context.js +11 -11
- package/dist/server/bare/runtime-lifecycle.d.ts +1 -1
- package/dist/server/bare/runtime-lifecycle.js +27 -31
- package/dist/server/bare/types/addon-responses.d.ts +5 -4
- package/dist/server/bare/utils/audio-input.d.ts +2 -2
- package/dist/server/bare/utils/audio-input.js +7 -7
- package/dist/server/bare/utils/transcribe-metadata.d.ts +1 -1
- package/dist/server/bare/utils/transcribe-metadata.js +4 -4
- package/dist/server/bare/utils/tts-stats.d.ts +1 -1
- package/dist/server/bare/utils/tts-stats.js +3 -3
- package/dist/server/env.js +8 -8
- package/dist/server/error-handlers.d.ts +3 -3
- package/dist/server/error-handlers.js +11 -11
- package/dist/server/plugins/index.d.ts +1 -1
- package/dist/server/plugins/index.js +1 -1
- package/dist/server/plugins/registry.d.ts +1 -1
- package/dist/server/plugins/registry.js +12 -14
- package/dist/server/rpc/create-server.d.ts +1 -1
- package/dist/server/rpc/create-server.js +11 -12
- package/dist/server/rpc/delegate-transport.d.ts +3 -3
- package/dist/server/rpc/delegate-transport.js +43 -44
- package/dist/server/rpc/handle-request.d.ts +1 -1
- package/dist/server/rpc/handle-request.js +28 -30
- package/dist/server/rpc/handler-registry.d.ts +1 -1
- package/dist/server/rpc/handler-registry.js +97 -92
- package/dist/server/rpc/handler-selection.d.ts +3 -3
- package/dist/server/rpc/handler-selection.js +3 -3
- package/dist/server/rpc/handler-utils.d.ts +7 -7
- package/dist/server/rpc/handler-utils.js +32 -35
- package/dist/server/rpc/handlers/batch-completion-stream.d.ts +78 -0
- package/dist/server/rpc/handlers/batch-completion-stream.js +4 -0
- package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/bci-transcribe-stream.js +2 -2
- package/dist/server/rpc/handlers/bci-transcribe.d.ts +1 -1
- package/dist/server/rpc/handlers/bci-transcribe.js +2 -2
- package/dist/server/rpc/handlers/cancel-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/cancel-delegated.js +13 -13
- package/dist/server/rpc/handlers/cancelHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/cancelHandler.js +11 -11
- package/dist/server/rpc/handlers/classify.d.ts +1 -1
- package/dist/server/rpc/handlers/classify.js +2 -2
- package/dist/server/rpc/handlers/completion-stream-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/completion-stream-delegated.js +14 -14
- package/dist/server/rpc/handlers/completion-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/completion-stream.js +2 -2
- package/dist/server/rpc/handlers/delete-cache.d.ts +1 -1
- package/dist/server/rpc/handlers/delete-cache.js +10 -10
- package/dist/server/rpc/handlers/diffusion-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/diffusion-stream.js +2 -2
- package/dist/server/rpc/handlers/download-asset.d.ts +1 -1
- package/dist/server/rpc/handlers/download-asset.js +20 -20
- package/dist/server/rpc/handlers/embed.d.ts +1 -1
- package/dist/server/rpc/handlers/embed.js +2 -2
- package/dist/server/rpc/handlers/finetune.d.ts +1 -1
- package/dist/server/rpc/handlers/finetune.js +8 -6
- package/dist/server/rpc/handlers/get-loaded-model-info.d.ts +1 -1
- package/dist/server/rpc/handlers/get-loaded-model-info.js +9 -9
- package/dist/server/rpc/handlers/get-model-info.d.ts +1 -1
- package/dist/server/rpc/handlers/get-model-info.js +20 -20
- package/dist/server/rpc/handlers/heartbeat-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/heartbeat-delegated.js +7 -7
- package/dist/server/rpc/handlers/heartbeat.d.ts +1 -1
- package/dist/server/rpc/handlers/heartbeat.js +1 -1
- package/dist/server/rpc/handlers/index.d.ts +33 -31
- package/dist/server/rpc/handlers/index.js +34 -32
- package/dist/server/rpc/handlers/load-model/download-manager.d.ts +4 -4
- package/dist/server/rpc/handlers/load-model/download-manager.js +19 -17
- package/dist/server/rpc/handlers/load-model/download-stats.d.ts +4 -3
- package/dist/server/rpc/handlers/load-model/download-stats.js +9 -11
- package/dist/server/rpc/handlers/load-model/handler.d.ts +1 -1
- package/dist/server/rpc/handlers/load-model/handler.js +42 -43
- package/dist/server/rpc/handlers/load-model/http.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/http.js +100 -107
- package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +72 -74
- package/dist/server/rpc/handlers/load-model/index.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/index.js +2 -2
- package/dist/server/rpc/handlers/load-model/registry-client-options.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/registry-client-options.js +2 -3
- package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +5 -5
- package/dist/server/rpc/handlers/load-model/registry-companion-set.js +19 -21
- package/dist/server/rpc/handlers/load-model/registry-download-utils.d.ts +6 -6
- package/dist/server/rpc/handlers/load-model/registry-download-utils.js +16 -18
- package/dist/server/rpc/handlers/load-model/registry-metadata.d.ts +11 -0
- package/dist/server/rpc/handlers/load-model/registry-metadata.js +23 -0
- package/dist/server/rpc/handlers/load-model/registry.d.ts +4 -3
- package/dist/server/rpc/handlers/load-model/registry.js +50 -56
- package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/resolve-session.js +7 -7
- package/dist/server/rpc/handlers/load-model/resolve.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/resolve.js +36 -35
- package/dist/server/rpc/handlers/load-model/types.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/types.js +7 -7
- package/dist/server/rpc/handlers/load-model-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model-delegated.js +31 -30
- package/dist/server/rpc/handlers/logging-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/logging-stream.js +3 -3
- package/dist/server/rpc/handlers/ocr-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/ocr-stream.js +2 -2
- package/dist/server/rpc/handlers/plugin-dispatch.js +9 -9
- package/dist/server/rpc/handlers/plugin-invoke.d.ts +1 -1
- package/dist/server/rpc/handlers/plugin-invoke.js +16 -16
- package/dist/server/rpc/handlers/provideHandler/connection.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler/connection.js +16 -16
- package/dist/server/rpc/handlers/provideHandler/handler.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler/handler.js +18 -18
- package/dist/server/rpc/handlers/provideHandler/proxy.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler/proxy.js +11 -11
- package/dist/server/rpc/handlers/provideHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler.js +1 -1
- package/dist/server/rpc/handlers/rag.d.ts +1 -1
- package/dist/server/rpc/handlers/rag.js +50 -50
- package/dist/server/rpc/handlers/registry.d.ts +1 -1
- package/dist/server/rpc/handlers/registry.js +34 -36
- package/dist/server/rpc/handlers/resume.d.ts +1 -1
- package/dist/server/rpc/handlers/resume.js +3 -3
- package/dist/server/rpc/handlers/state.d.ts +1 -1
- package/dist/server/rpc/handlers/state.js +3 -3
- package/dist/server/rpc/handlers/stopProvideHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/stopProvideHandler.js +7 -7
- package/dist/server/rpc/handlers/suspend.d.ts +1 -1
- package/dist/server/rpc/handlers/suspend.js +3 -3
- package/dist/server/rpc/handlers/text-to-speech-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/text-to-speech-stream.js +2 -2
- package/dist/server/rpc/handlers/text-to-speech.d.ts +1 -1
- package/dist/server/rpc/handlers/text-to-speech.js +2 -2
- package/dist/server/rpc/handlers/transcribe-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/transcribe-stream.js +2 -2
- package/dist/server/rpc/handlers/transcribe.d.ts +1 -1
- package/dist/server/rpc/handlers/transcribe.js +2 -2
- package/dist/server/rpc/handlers/translate.d.ts +1 -1
- package/dist/server/rpc/handlers/translate.js +2 -2
- package/dist/server/rpc/handlers/unload-model-delegated.d.ts +1 -1
- package/dist/server/rpc/handlers/unload-model-delegated.js +10 -10
- package/dist/server/rpc/handlers/unload-model.d.ts +1 -1
- package/dist/server/rpc/handlers/unload-model.js +10 -10
- package/dist/server/rpc/handlers/upscale-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/upscale-stream.js +2 -2
- package/dist/server/rpc/handlers/video-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/video-stream.js +2 -2
- package/dist/server/rpc/index.d.ts +2 -2
- package/dist/server/rpc/index.js +2 -2
- package/dist/server/rpc/profiling/context.d.ts +1 -1
- package/dist/server/rpc/profiling/context.js +9 -10
- package/dist/server/rpc/profiling/delegation-profiler.d.ts +2 -2
- package/dist/server/rpc/profiling/delegation-profiler.js +23 -24
- package/dist/server/rpc/profiling/index.d.ts +4 -4
- package/dist/server/rpc/profiling/index.js +4 -4
- package/dist/server/rpc/profiling/operation-metrics.d.ts +2 -2
- package/dist/server/rpc/profiling/operation-metrics.js +102 -102
- package/dist/server/rpc/profiling/operation-wrappers.d.ts +1 -1
- package/dist/server/rpc/profiling/operation-wrappers.js +16 -14
- package/dist/server/rpc/profiling/profiler.d.ts +2 -2
- package/dist/server/rpc/profiling/profiler.js +9 -13
- package/dist/server/rpc/rpc-utils.js +1 -4
- package/dist/server/rpc/transport-selector.d.ts +1 -1
- package/dist/server/rpc/transport-selector.js +4 -4
- package/dist/server/utils/archive.js +27 -29
- package/dist/server/utils/audio/decoder.d.ts +2 -2
- package/dist/server/utils/audio/decoder.js +11 -11
- package/dist/server/utils/cache/auto-history.d.ts +1 -1
- package/dist/server/utils/cache/auto-history.js +5 -5
- package/dist/server/utils/cache/paths.d.ts +2 -2
- package/dist/server/utils/cache/paths.js +14 -14
- package/dist/server/utils/checksum.d.ts +1 -1
- package/dist/server/utils/checksum.js +10 -12
- package/dist/server/utils/clear-storage.d.ts +1 -1
- package/dist/server/utils/clear-storage.js +8 -11
- package/dist/server/utils/completion-normalizer.d.ts +1 -1
- package/dist/server/utils/completion-normalizer.js +106 -113
- package/dist/server/utils/config-transform.d.ts +1 -1
- package/dist/server/utils/config-transform.js +2 -2
- package/dist/server/utils/expand-gguf-shards.js +4 -4
- package/dist/server/utils/formatting.js +6 -12
- package/dist/server/utils/gguf-tensor-extractor.js +17 -21
- package/dist/server/utils/index.d.ts +11 -11
- package/dist/server/utils/index.js +11 -11
- package/dist/server/utils/multi-gpu-mobile.js +1 -1
- package/dist/server/utils/path-security.d.ts +1 -1
- package/dist/server/utils/path-security.js +6 -6
- package/dist/server/utils/qvac-paths.js +3 -3
- package/dist/server/utils/response-format.d.ts +1 -1
- package/dist/server/utils/response-format.js +4 -4
- package/dist/server/utils/shard-utils.d.ts +1 -1
- package/dist/server/utils/shard-utils.js +14 -16
- package/dist/server/utils/tool-integration.d.ts +1 -1
- package/dist/server/utils/tool-integration.js +5 -9
- package/dist/server/utils/tools/dialect.d.ts +1 -1
- package/dist/server/utils/tools/dialect.js +7 -7
- package/dist/server/utils/tools/index.d.ts +2 -2
- package/dist/server/utils/tools/index.js +2 -2
- package/dist/server/utils/tools/parser.d.ts +1 -1
- package/dist/server/utils/tools/parser.js +14 -14
- package/dist/server/utils/tools/parsers/gemma4native.d.ts +2 -2
- package/dist/server/utils/tools/parsers/gemma4native.js +13 -8
- package/dist/server/utils/tools/parsers/harmony.d.ts +2 -2
- package/dist/server/utils/tools/parsers/harmony.js +9 -11
- package/dist/server/utils/tools/parsers/hermes.d.ts +2 -2
- package/dist/server/utils/tools/parsers/hermes.js +16 -16
- package/dist/server/utils/tools/parsers/json.d.ts +2 -2
- package/dist/server/utils/tools/parsers/json.js +14 -14
- package/dist/server/utils/tools/parsers/pythonic.d.ts +2 -2
- package/dist/server/utils/tools/parsers/pythonic.js +43 -43
- package/dist/server/utils/tools/parsers/qwen35.d.ts +2 -2
- package/dist/server/utils/tools/parsers/qwen35.js +20 -20
- package/dist/server/utils/tools/shared.d.ts +1 -1
- package/dist/server/utils/tools/shared.js +10 -12
- package/dist/server/utils/worker-lock.js +10 -10
- package/dist/server/worker-core.d.ts +1 -1
- package/dist/server/worker-core.js +44 -43
- package/dist/server/worker.js +9 -9
- package/dist/utils/aggregate-events.d.ts +2 -2
- package/dist/utils/aggregate-events.js +17 -19
- package/dist/utils/cache-normalize.js +1 -4
- package/dist/utils/encoding.js +1 -1
- package/dist/utils/errors-base.d.ts +1 -1
- package/dist/utils/errors-base.js +1 -1
- package/dist/utils/errors-client.d.ts +1 -1
- package/dist/utils/errors-client.js +5 -5
- package/dist/utils/errors-server.d.ts +3 -3
- package/dist/utils/errors-server.js +19 -18
- package/dist/utils/load-model-validation.js +3 -3
- package/dist/utils/mcp-adapter.d.ts +4 -4
- package/dist/utils/mcp-adapter.js +31 -38
- package/dist/utils/path-sanitize.js +14 -17
- package/dist/utils/tool-helpers.d.ts +2 -2
- package/dist/utils/tool-helpers.js +25 -26
- package/dist/utils/withTimeout.d.ts +7 -0
- package/dist/utils/withTimeout.js +11 -1
- package/dist/utils/zod-error.d.ts +1 -1
- package/dist/utils/zod-error.js +1 -1
- package/electron-forge/index.cjs +274 -317
- package/expo/plugins/patches/android-link.mjs +25 -30
- package/expo/plugins/patches/ios-link.mjs +25 -30
- package/package.json +17 -16
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
*
|
|
11
11
|
* For offline batch diarization (Sortformer + TDT), see `parakeet-sortformer.ts`.
|
|
12
12
|
*/
|
|
13
|
-
import { loadModel, unloadModel, transcribeStream, PARAKEET_SORTFORMER_4SPK_V2_1_Q8_0
|
|
14
|
-
import { spawn } from
|
|
13
|
+
import { loadModel, unloadModel, transcribeStream, PARAKEET_SORTFORMER_4SPK_V2_1_Q8_0 } from '@qvac/sdk';
|
|
14
|
+
import { spawn } from 'child_process';
|
|
15
15
|
const SAMPLE_RATE = 16000;
|
|
16
16
|
const BYTES_PER_S16_SAMPLE = 2;
|
|
17
17
|
const STREAM_CHUNK_MS = 2000;
|
|
@@ -24,12 +24,12 @@ const SORTFORMER_V21_AOSC_LOAD_CONFIG = {
|
|
|
24
24
|
streamingSpkCacheLen: 188,
|
|
25
25
|
streamingFifoLen: 188,
|
|
26
26
|
streamingChunkLeftContextMs: 80,
|
|
27
|
-
streamingSpkCacheUpdatePeriod: 144
|
|
27
|
+
streamingSpkCacheUpdatePeriod: 144
|
|
28
28
|
};
|
|
29
29
|
const args = process.argv.slice(2);
|
|
30
30
|
if (!args[0]) {
|
|
31
|
-
console.error(
|
|
32
|
-
console.error(
|
|
31
|
+
console.error('Usage: bun run examples/transcription/parakeet-sortformer-streaming.ts <wav-file-path> [sortformer-gguf]');
|
|
32
|
+
console.error('\nDefaults to the v2.1 q8_0 registry model (PARAKEET_SORTFORMER_4SPK_V2_1_Q8_0).');
|
|
33
33
|
process.exit(1);
|
|
34
34
|
}
|
|
35
35
|
const audioFilePath = args[0];
|
|
@@ -44,20 +44,10 @@ async function cleanup() {
|
|
|
44
44
|
function readS16leFromWav(wavPath) {
|
|
45
45
|
return new Promise((resolve, reject) => {
|
|
46
46
|
const chunks = [];
|
|
47
|
-
const proc = spawn(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
String(SAMPLE_RATE),
|
|
52
|
-
"-ac",
|
|
53
|
-
"1",
|
|
54
|
-
"-f",
|
|
55
|
-
"s16le",
|
|
56
|
-
"pipe:1",
|
|
57
|
-
], { stdio: ["ignore", "pipe", "ignore"] });
|
|
58
|
-
proc.stdout.on("data", (buf) => chunks.push(buf));
|
|
59
|
-
proc.on("error", reject);
|
|
60
|
-
proc.on("close", (code) => {
|
|
47
|
+
const proc = spawn('ffmpeg', ['-i', wavPath, '-ar', String(SAMPLE_RATE), '-ac', '1', '-f', 's16le', 'pipe:1'], { stdio: ['ignore', 'pipe', 'ignore'] });
|
|
48
|
+
proc.stdout.on('data', (buf) => chunks.push(buf));
|
|
49
|
+
proc.on('error', reject);
|
|
50
|
+
proc.on('close', (code) => {
|
|
61
51
|
if (code !== 0) {
|
|
62
52
|
reject(new Error(`ffmpeg exited with code ${code}`));
|
|
63
53
|
return;
|
|
@@ -68,26 +58,26 @@ function readS16leFromWav(wavPath) {
|
|
|
68
58
|
});
|
|
69
59
|
}
|
|
70
60
|
const loadOptions = {
|
|
71
|
-
modelType:
|
|
61
|
+
modelType: 'parakeet-transcription',
|
|
72
62
|
modelConfig: { ...SORTFORMER_V21_AOSC_LOAD_CONFIG },
|
|
73
63
|
onProgress: (p) => {
|
|
74
64
|
const mb = (n) => (n / 1e6).toFixed(1);
|
|
75
65
|
const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
|
|
76
66
|
process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
|
|
77
67
|
if (p.percentage >= 100)
|
|
78
|
-
process.stderr.write(
|
|
68
|
+
process.stderr.write('\n');
|
|
79
69
|
},
|
|
80
70
|
...(sortformerOverride
|
|
81
71
|
? { modelSrc: sortformerOverride }
|
|
82
|
-
: { modelSrc: PARAKEET_SORTFORMER_4SPK_V2_1_Q8_0 })
|
|
72
|
+
: { modelSrc: PARAKEET_SORTFORMER_4SPK_V2_1_Q8_0 })
|
|
83
73
|
};
|
|
84
74
|
try {
|
|
85
|
-
console.log(
|
|
75
|
+
console.log('▸ Loading Sortformer v2.1 with streaming + AOSC (load-time config)...');
|
|
86
76
|
modelId = await loadModel(loadOptions);
|
|
87
77
|
console.log(`▸ Model loaded: ${modelId}`);
|
|
88
78
|
const session = await transcribeStream({
|
|
89
79
|
modelId,
|
|
90
|
-
parakeetStreamingConfig: { chunkMs: STREAM_CHUNK_MS }
|
|
80
|
+
parakeetStreamingConfig: { chunkMs: STREAM_CHUNK_MS }
|
|
91
81
|
});
|
|
92
82
|
console.log(`▸ Streaming ${audioFilePath} in ${STREAM_CHUNK_MS}ms chunks (wall-clock paced)...`);
|
|
93
83
|
const pcm = await readS16leFromWav(audioFilePath);
|
|
@@ -110,18 +100,18 @@ try {
|
|
|
110
100
|
session.end();
|
|
111
101
|
const lines = [];
|
|
112
102
|
for await (const event of session) {
|
|
113
|
-
if (event.type ===
|
|
103
|
+
if (event.type === 'text' && event.text.trim()) {
|
|
114
104
|
lines.push(event.text.trim());
|
|
115
105
|
console.log(event.text.trim());
|
|
116
106
|
}
|
|
117
107
|
}
|
|
118
|
-
console.log(
|
|
119
|
-
console.log(lines.join(
|
|
108
|
+
console.log('\n▸ Streaming diarization transcript');
|
|
109
|
+
console.log(lines.join('\n') || '(no speaker lines emitted)');
|
|
120
110
|
await cleanup();
|
|
121
111
|
process.exit(0);
|
|
122
112
|
}
|
|
123
113
|
catch (error) {
|
|
124
|
-
console.error(
|
|
114
|
+
console.error('✖', error);
|
|
125
115
|
await cleanup();
|
|
126
116
|
process.exit(1);
|
|
127
117
|
}
|
|
@@ -13,31 +13,31 @@
|
|
|
13
13
|
* Download the default file into `examples/audio/`:
|
|
14
14
|
* https://github.com/tetherto/qvac/blob/main/packages/sdk/examples/audio/diarization-sample-16k.wav
|
|
15
15
|
*/
|
|
16
|
-
import { loadModel, unloadModel, transcribe, PARAKEET_TDT_0_6B_V3_Q8_0, PARAKEET_SORTFORMER_4SPK_V2_1_Q8_0
|
|
17
|
-
import { dirname, join } from
|
|
18
|
-
import { fileURLToPath } from
|
|
19
|
-
import { readFileSync, writeFileSync, mkdirSync } from
|
|
20
|
-
import { tmpdir } from
|
|
16
|
+
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';
|
|
19
|
+
import { readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
20
|
+
import { tmpdir } from 'os';
|
|
21
21
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
22
22
|
const args = process.argv.slice(2);
|
|
23
23
|
const sortformerSrc = args[0] ?? PARAKEET_SORTFORMER_4SPK_V2_1_Q8_0;
|
|
24
|
-
const defaultAudioPath = join(__dirname,
|
|
24
|
+
const defaultAudioPath = join(__dirname, '..', 'audio', 'diarization-sample-16k.wav');
|
|
25
25
|
const audioFilePath = args[1] ?? defaultAudioPath;
|
|
26
26
|
try {
|
|
27
27
|
// ── Step 1: Diarize with Sortformer ──
|
|
28
28
|
const sfModelId = await loadModel({
|
|
29
29
|
modelSrc: sortformerSrc,
|
|
30
|
-
modelType:
|
|
30
|
+
modelType: 'parakeet-transcription'
|
|
31
31
|
});
|
|
32
32
|
const diarization = await transcribe({
|
|
33
33
|
modelId: sfModelId,
|
|
34
|
-
audioChunk: audioFilePath
|
|
34
|
+
audioChunk: audioFilePath
|
|
35
35
|
});
|
|
36
36
|
await unloadModel({ modelId: sfModelId });
|
|
37
37
|
const segments = parseDiarization(diarization);
|
|
38
38
|
// ── Step 2: Transcribe each segment with TDT ──
|
|
39
39
|
const tdtModelId = await loadModel({
|
|
40
|
-
modelSrc: PARAKEET_TDT_0_6B_V3_Q8_0
|
|
40
|
+
modelSrc: PARAKEET_TDT_0_6B_V3_Q8_0
|
|
41
41
|
});
|
|
42
42
|
const pcm = readPcm(audioFilePath);
|
|
43
43
|
const sliceDir = join(tmpdir(), `qvac-diarize-${Date.now()}`);
|
|
@@ -47,33 +47,33 @@ try {
|
|
|
47
47
|
const seg = segments[i];
|
|
48
48
|
const slicePath = join(sliceDir, `seg-${i}.wav`);
|
|
49
49
|
if (!writeWavSlice(pcm, seg.start, seg.end, slicePath)) {
|
|
50
|
-
results.push({ ...seg, text:
|
|
50
|
+
results.push({ ...seg, text: '[No speech detected]' });
|
|
51
51
|
continue;
|
|
52
52
|
}
|
|
53
53
|
const text = await transcribe({
|
|
54
54
|
modelId: tdtModelId,
|
|
55
|
-
audioChunk: slicePath
|
|
55
|
+
audioChunk: slicePath
|
|
56
56
|
});
|
|
57
|
-
results.push({ ...seg, text: text.trim() ||
|
|
57
|
+
results.push({ ...seg, text: text.trim() || '[No speech detected]' });
|
|
58
58
|
}
|
|
59
59
|
await unloadModel({ modelId: tdtModelId });
|
|
60
60
|
// ── Step 3: Merge consecutive same-speaker segments and print ──
|
|
61
61
|
const merged = mergeSpeakers(results);
|
|
62
|
-
console.log(
|
|
62
|
+
console.log('\n▸ Diarized transcription');
|
|
63
63
|
for (const entry of merged) {
|
|
64
64
|
console.log(`Speaker ${entry.speaker} (${entry.start.toFixed(2)}s - ${entry.end.toFixed(2)}s):`);
|
|
65
65
|
console.log(` ${entry.text}\n`);
|
|
66
66
|
}
|
|
67
|
-
console.log(
|
|
67
|
+
console.log('▸ Done');
|
|
68
68
|
}
|
|
69
69
|
catch (error) {
|
|
70
|
-
console.error(
|
|
70
|
+
console.error('✖', error);
|
|
71
71
|
process.exit(1);
|
|
72
72
|
}
|
|
73
73
|
// ── Helpers ──
|
|
74
74
|
function parseDiarization(text) {
|
|
75
75
|
const segs = [];
|
|
76
|
-
for (const line of text.split(
|
|
76
|
+
for (const line of text.split('\n')) {
|
|
77
77
|
const m = line.match(/Speaker (\d+): ([\d.]+)s - ([\d.]+)s/);
|
|
78
78
|
if (m)
|
|
79
79
|
segs.push({ speaker: +m[1], start: +m[2], end: +m[3] });
|
|
@@ -82,7 +82,7 @@ function parseDiarization(text) {
|
|
|
82
82
|
}
|
|
83
83
|
function readPcm(wavPath) {
|
|
84
84
|
const buf = readFileSync(wavPath);
|
|
85
|
-
const dataOffset = buf.indexOf(
|
|
85
|
+
const dataOffset = buf.indexOf('data') + 4;
|
|
86
86
|
return buf.subarray(dataOffset + 4, dataOffset + 4 + buf.readUInt32LE(dataOffset));
|
|
87
87
|
}
|
|
88
88
|
function writeWavSlice(pcm, startSec, endSec, outPath) {
|
|
@@ -94,9 +94,9 @@ function writeWavSlice(pcm, startSec, endSec, outPath) {
|
|
|
94
94
|
return false;
|
|
95
95
|
const slice = pcm.subarray(startByte, endByte);
|
|
96
96
|
const hdr = Buffer.alloc(44);
|
|
97
|
-
hdr.write(
|
|
97
|
+
hdr.write('RIFF', 0);
|
|
98
98
|
hdr.writeUInt32LE(36 + slice.length, 4);
|
|
99
|
-
hdr.write(
|
|
99
|
+
hdr.write('WAVEfmt ', 8);
|
|
100
100
|
hdr.writeUInt32LE(16, 16);
|
|
101
101
|
hdr.writeUInt16LE(1, 20);
|
|
102
102
|
hdr.writeUInt16LE(1, 22);
|
|
@@ -104,7 +104,7 @@ function writeWavSlice(pcm, startSec, endSec, outPath) {
|
|
|
104
104
|
hdr.writeUInt32LE(SR * BPS, 28);
|
|
105
105
|
hdr.writeUInt16LE(BPS, 32);
|
|
106
106
|
hdr.writeUInt16LE(16, 34);
|
|
107
|
-
hdr.write(
|
|
107
|
+
hdr.write('data', 36);
|
|
108
108
|
hdr.writeUInt32LE(slice.length, 40);
|
|
109
109
|
writeFileSync(outPath, Buffer.concat([hdr, slice]));
|
|
110
110
|
return true;
|
|
@@ -114,7 +114,7 @@ function mergeSpeakers(entries) {
|
|
|
114
114
|
for (const e of entries) {
|
|
115
115
|
const last = out[out.length - 1];
|
|
116
116
|
if (last && last.speaker === e.speaker) {
|
|
117
|
-
last.text +=
|
|
117
|
+
last.text += ' ' + e.text;
|
|
118
118
|
last.end = e.end;
|
|
119
119
|
}
|
|
120
120
|
else {
|
|
@@ -10,39 +10,39 @@
|
|
|
10
10
|
*
|
|
11
11
|
* Audio should be 16 kHz mono PCM in a WAV container.
|
|
12
12
|
*/
|
|
13
|
-
import { loadModel, unloadModel, transcribe, PARAKEET_TDT_0_6B_V3_Q8_0
|
|
13
|
+
import { loadModel, unloadModel, transcribe, PARAKEET_TDT_0_6B_V3_Q8_0 } from '@qvac/sdk';
|
|
14
14
|
const args = process.argv.slice(2);
|
|
15
15
|
if (!args[0]) {
|
|
16
|
-
console.error(
|
|
17
|
-
|
|
18
|
-
console.error(
|
|
16
|
+
console.error('Usage: bun run examples/transcription/parakeet-tdt-filesystem.ts <wav-file-path> ' +
|
|
17
|
+
'[parakeet-tdt-gguf]');
|
|
18
|
+
console.error('\nIf the model path is omitted, defaults to the registry model.');
|
|
19
19
|
process.exit(1);
|
|
20
20
|
}
|
|
21
21
|
const audioFilePath = args[0];
|
|
22
22
|
const parakeetModelSrc = args[1] ?? PARAKEET_TDT_0_6B_V3_Q8_0;
|
|
23
23
|
try {
|
|
24
|
-
console.log(
|
|
25
|
-
console.log(
|
|
24
|
+
console.log('▸ Starting Parakeet transcription example...');
|
|
25
|
+
console.log('▸ Loading Parakeet model...');
|
|
26
26
|
const modelId = await loadModel({
|
|
27
27
|
modelSrc: parakeetModelSrc,
|
|
28
|
-
modelType:
|
|
28
|
+
modelType: 'parakeet-transcription',
|
|
29
29
|
onProgress: (p) => {
|
|
30
30
|
const mb = (n) => (n / 1e6).toFixed(1);
|
|
31
31
|
const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
|
|
32
32
|
process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
|
|
33
33
|
if (p.percentage >= 100)
|
|
34
|
-
process.stderr.write(
|
|
35
|
-
}
|
|
34
|
+
process.stderr.write('\n');
|
|
35
|
+
}
|
|
36
36
|
});
|
|
37
37
|
console.log(`▸ Parakeet model loaded with ID: ${modelId}`);
|
|
38
|
-
console.log(
|
|
38
|
+
console.log('▸ Transcribing audio...');
|
|
39
39
|
const text = await transcribe({ modelId, audioChunk: audioFilePath });
|
|
40
40
|
console.log(text);
|
|
41
|
-
console.log(
|
|
41
|
+
console.log('▸ Unloading Parakeet model...');
|
|
42
42
|
await unloadModel({ modelId });
|
|
43
|
-
console.log(
|
|
43
|
+
console.log('▸ Parakeet model unloaded successfully');
|
|
44
44
|
}
|
|
45
45
|
catch (error) {
|
|
46
|
-
console.error(
|
|
46
|
+
console.error('✖', error);
|
|
47
47
|
process.exit(1);
|
|
48
48
|
}
|
|
@@ -12,29 +12,29 @@
|
|
|
12
12
|
* Set SAMPLE_FILE to a custom WAV, or download the default audio into examples/audio/:
|
|
13
13
|
* https://github.com/tetherto/qvac/blob/main/packages/sdk/examples/audio/diarization-sample-16k.wav
|
|
14
14
|
*/
|
|
15
|
-
import { loadModel, unloadModel, transcribeStream, WHISPER_TINY, VAD_SILERO_5_1_2
|
|
16
|
-
import { spawn } from
|
|
17
|
-
import path from
|
|
18
|
-
import { fileURLToPath } from
|
|
15
|
+
import { loadModel, unloadModel, transcribeStream, WHISPER_TINY, VAD_SILERO_5_1_2 } from '@qvac/sdk';
|
|
16
|
+
import { spawn } from 'child_process';
|
|
17
|
+
import path from 'path';
|
|
18
|
+
import { fileURLToPath } from 'url';
|
|
19
19
|
const __filename = fileURLToPath(import.meta.url);
|
|
20
20
|
const __dirname = path.dirname(__filename);
|
|
21
|
-
const SAMPLE_FILE = path.resolve(__dirname,
|
|
21
|
+
const SAMPLE_FILE = path.resolve(__dirname, '../audio/diarization-sample-16k.wav');
|
|
22
22
|
const SAMPLE_RATE = 16000;
|
|
23
23
|
const BYTES_PER_SAMPLE = 4; // f32le
|
|
24
24
|
const CHUNK_SIZE = Math.floor(0.1 * SAMPLE_RATE) * BYTES_PER_SAMPLE; // 100ms chunks
|
|
25
25
|
try {
|
|
26
|
-
console.log(
|
|
26
|
+
console.log('▸ transcribeStream file test');
|
|
27
27
|
console.log(`▸ File: ${SAMPLE_FILE}`);
|
|
28
28
|
console.log(`▸ Chunk size: ${CHUNK_SIZE} bytes (100ms)`);
|
|
29
|
-
console.log(
|
|
29
|
+
console.log('▸ Loading model...');
|
|
30
30
|
const modelId = await loadModel({
|
|
31
31
|
modelSrc: WHISPER_TINY,
|
|
32
32
|
modelConfig: {
|
|
33
33
|
vadModelSrc: VAD_SILERO_5_1_2,
|
|
34
|
-
audio_format:
|
|
35
|
-
strategy:
|
|
34
|
+
audio_format: 'f32le',
|
|
35
|
+
strategy: 'greedy',
|
|
36
36
|
n_threads: 4,
|
|
37
|
-
language:
|
|
37
|
+
language: 'en',
|
|
38
38
|
no_timestamps: true,
|
|
39
39
|
suppress_blank: true,
|
|
40
40
|
suppress_nst: true,
|
|
@@ -44,39 +44,39 @@ try {
|
|
|
44
44
|
min_speech_duration_ms: 250,
|
|
45
45
|
min_silence_duration_ms: 500,
|
|
46
46
|
max_speech_duration_s: 15.0,
|
|
47
|
-
speech_pad_ms: 200
|
|
48
|
-
}
|
|
49
|
-
}
|
|
47
|
+
speech_pad_ms: 200
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
50
|
});
|
|
51
51
|
console.log(`▸ Model loaded: ${modelId}`);
|
|
52
|
-
console.log(
|
|
52
|
+
console.log('▸ Opening live session...');
|
|
53
53
|
const session = await transcribeStream({ modelId, metadata: true });
|
|
54
|
-
console.log(
|
|
55
|
-
const ffmpeg = spawn(
|
|
56
|
-
|
|
54
|
+
console.log('▸ Session open. Streaming audio...');
|
|
55
|
+
const ffmpeg = spawn('ffmpeg', [
|
|
56
|
+
'-i',
|
|
57
57
|
SAMPLE_FILE,
|
|
58
|
-
|
|
58
|
+
'-ar',
|
|
59
59
|
String(SAMPLE_RATE),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
], { stdio: [
|
|
60
|
+
'-ac',
|
|
61
|
+
'1',
|
|
62
|
+
'-sample_fmt',
|
|
63
|
+
'flt',
|
|
64
|
+
'-f',
|
|
65
|
+
'f32le',
|
|
66
|
+
'pipe:1'
|
|
67
|
+
], { stdio: ['ignore', 'pipe', 'ignore'] });
|
|
68
68
|
let totalBytes = 0;
|
|
69
|
-
ffmpeg.stdout.on(
|
|
69
|
+
ffmpeg.stdout.on('data', (raw) => {
|
|
70
70
|
for (let offset = 0; offset < raw.length; offset += CHUNK_SIZE) {
|
|
71
71
|
const chunk = raw.subarray(offset, offset + CHUNK_SIZE);
|
|
72
72
|
session.write(chunk);
|
|
73
73
|
totalBytes += chunk.length;
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
|
-
ffmpeg.on(
|
|
76
|
+
ffmpeg.on('close', () => {
|
|
77
77
|
const durationSec = totalBytes / (SAMPLE_RATE * BYTES_PER_SAMPLE);
|
|
78
78
|
console.log(`▸ Audio streamed: ${totalBytes} bytes (~${durationSec.toFixed(1)}s)`);
|
|
79
|
-
console.log(
|
|
79
|
+
console.log('▸ Waiting for transcription...');
|
|
80
80
|
session.end();
|
|
81
81
|
});
|
|
82
82
|
const segments = [];
|
|
@@ -88,17 +88,17 @@ try {
|
|
|
88
88
|
}
|
|
89
89
|
console.log(`\n▸ Segments: ${segments.length}`);
|
|
90
90
|
if (segments.length > 0) {
|
|
91
|
-
console.log(segments.map((s) => s.text.trim()).join(
|
|
91
|
+
console.log(segments.map((s) => s.text.trim()).join(' '));
|
|
92
92
|
}
|
|
93
93
|
else {
|
|
94
|
-
console.log(
|
|
94
|
+
console.log('▸ No transcription segments received!');
|
|
95
95
|
}
|
|
96
|
-
console.log(
|
|
96
|
+
console.log('▸ Unloading model...');
|
|
97
97
|
await unloadModel({ modelId });
|
|
98
|
-
console.log(
|
|
98
|
+
console.log('▸ Done.');
|
|
99
99
|
process.exit(0);
|
|
100
100
|
}
|
|
101
101
|
catch (error) {
|
|
102
|
-
console.error(
|
|
102
|
+
console.error('✖', error);
|
|
103
103
|
process.exit(1);
|
|
104
104
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { loadModel, unloadModel, transcribe, WHISPER_TINY } from
|
|
1
|
+
import { loadModel, unloadModel, transcribe, WHISPER_TINY } from '@qvac/sdk';
|
|
2
2
|
// Parse command line arguments
|
|
3
3
|
const args = process.argv.slice(2);
|
|
4
4
|
if (!args[0]) {
|
|
5
|
-
console.error(
|
|
5
|
+
console.error('Usage: bun run examples/whispercpp-filesystem.ts <wav-file-path>');
|
|
6
6
|
process.exit(1);
|
|
7
7
|
}
|
|
8
8
|
const audioFilePath = args[0];
|
|
9
9
|
try {
|
|
10
|
-
console.log(
|
|
10
|
+
console.log('▸ Starting Whisper transcription example...');
|
|
11
11
|
// Load the Whisper model
|
|
12
|
-
console.log(
|
|
12
|
+
console.log('▸ Loading Whisper model...');
|
|
13
13
|
const modelId = await loadModel({
|
|
14
14
|
modelSrc: WHISPER_TINY,
|
|
15
15
|
modelConfig: {
|
|
16
|
-
audio_format:
|
|
16
|
+
audio_format: 'f32le',
|
|
17
17
|
// Sampling strategy
|
|
18
|
-
strategy:
|
|
18
|
+
strategy: 'greedy',
|
|
19
19
|
n_threads: 4,
|
|
20
20
|
// Transcription options
|
|
21
|
-
language:
|
|
21
|
+
language: 'en',
|
|
22
22
|
translate: false,
|
|
23
23
|
no_timestamps: false,
|
|
24
24
|
single_segment: false,
|
|
@@ -38,32 +38,32 @@ try {
|
|
|
38
38
|
min_silence_duration_ms: 150,
|
|
39
39
|
max_speech_duration_s: 30.0,
|
|
40
40
|
speech_pad_ms: 600,
|
|
41
|
-
samples_overlap: 0.3
|
|
41
|
+
samples_overlap: 0.3
|
|
42
42
|
},
|
|
43
43
|
// Context parameters for GPU
|
|
44
44
|
contextParams: {
|
|
45
45
|
use_gpu: true,
|
|
46
46
|
flash_attn: true,
|
|
47
|
-
gpu_device: 0
|
|
48
|
-
}
|
|
47
|
+
gpu_device: 0
|
|
48
|
+
}
|
|
49
49
|
},
|
|
50
50
|
onProgress: (p) => {
|
|
51
51
|
const mb = (n) => (n / 1e6).toFixed(1);
|
|
52
52
|
const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
|
|
53
53
|
process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
|
|
54
54
|
if (p.percentage >= 100)
|
|
55
|
-
process.stderr.write(
|
|
56
|
-
}
|
|
55
|
+
process.stderr.write('\n');
|
|
56
|
+
}
|
|
57
57
|
});
|
|
58
58
|
console.log(`▸ Whisper model loaded with ID: ${modelId}`);
|
|
59
59
|
// Perform transcription with per-segment metadata
|
|
60
|
-
console.log(
|
|
60
|
+
console.log('▸ Transcribing audio...');
|
|
61
61
|
const segments = await transcribe({
|
|
62
62
|
modelId,
|
|
63
63
|
audioChunk: audioFilePath,
|
|
64
|
-
metadata: true
|
|
64
|
+
metadata: true
|
|
65
65
|
});
|
|
66
|
-
console.log(
|
|
66
|
+
console.log('▸ Transcription result:');
|
|
67
67
|
for (const segment of segments) {
|
|
68
68
|
const start = (segment.startMs / 1000).toFixed(2);
|
|
69
69
|
const end = (segment.endMs / 1000).toFixed(2);
|
|
@@ -71,14 +71,14 @@ try {
|
|
|
71
71
|
}
|
|
72
72
|
console.log(`\nFull transcript: ${segments
|
|
73
73
|
.map((s) => s.text)
|
|
74
|
-
.join(
|
|
74
|
+
.join('')
|
|
75
75
|
.trim()}`);
|
|
76
76
|
// Unload the model when done
|
|
77
|
-
console.log(
|
|
77
|
+
console.log('▸ Unloading Whisper model...');
|
|
78
78
|
await unloadModel({ modelId });
|
|
79
|
-
console.log(
|
|
79
|
+
console.log('▸ Whisper model unloaded successfully');
|
|
80
80
|
}
|
|
81
81
|
catch (error) {
|
|
82
|
-
console.error(
|
|
82
|
+
console.error('✖', error);
|
|
83
83
|
process.exit(1);
|
|
84
84
|
}
|
|
@@ -16,44 +16,44 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Requirements: FFmpeg installed, microphone access.
|
|
18
18
|
*/
|
|
19
|
-
import { loadModel, unloadModel, transcribeStream, WHISPER_TINY, VAD_SILERO_5_1_2
|
|
20
|
-
import { spawnSync } from
|
|
21
|
-
import { startMicrophone } from
|
|
19
|
+
import { loadModel, unloadModel, transcribeStream, WHISPER_TINY, VAD_SILERO_5_1_2 } from '@qvac/sdk';
|
|
20
|
+
import { spawnSync } from 'child_process';
|
|
21
|
+
import { startMicrophone } from '../audio/mic-input';
|
|
22
22
|
const SAMPLE_RATE = 16000;
|
|
23
23
|
try {
|
|
24
|
-
const r = spawnSync(
|
|
24
|
+
const r = spawnSync('ffmpeg', ['-version'], { stdio: 'ignore' });
|
|
25
25
|
if (r.error || r.status !== 0)
|
|
26
|
-
throw new Error(
|
|
26
|
+
throw new Error('FFmpeg not found');
|
|
27
27
|
}
|
|
28
28
|
catch {
|
|
29
|
-
console.error(
|
|
29
|
+
console.error('✖ FFmpeg is required. Install it and try again.');
|
|
30
30
|
process.exit(1);
|
|
31
31
|
}
|
|
32
32
|
let modelId = null;
|
|
33
33
|
let ffmpeg = null;
|
|
34
34
|
async function cleanup() {
|
|
35
|
-
console.log(
|
|
35
|
+
console.log('\n\n▸ Stopping...');
|
|
36
36
|
ffmpeg?.kill();
|
|
37
37
|
if (modelId)
|
|
38
38
|
await unloadModel({ modelId });
|
|
39
|
-
console.log(
|
|
39
|
+
console.log('▸ Done.');
|
|
40
40
|
}
|
|
41
|
-
process.on(
|
|
41
|
+
process.on('SIGINT', () => {
|
|
42
42
|
void cleanup().finally(() => process.exit(0));
|
|
43
43
|
});
|
|
44
|
-
process.on(
|
|
44
|
+
process.on('SIGTERM', () => {
|
|
45
45
|
void cleanup().finally(() => process.exit(0));
|
|
46
46
|
});
|
|
47
47
|
try {
|
|
48
|
-
console.log(
|
|
48
|
+
console.log('▸ Loading model (whisper-tiny + Silero VAD)...');
|
|
49
49
|
modelId = await loadModel({
|
|
50
50
|
modelSrc: WHISPER_TINY,
|
|
51
51
|
modelConfig: {
|
|
52
52
|
vadModelSrc: VAD_SILERO_5_1_2,
|
|
53
|
-
audio_format:
|
|
54
|
-
strategy:
|
|
53
|
+
audio_format: 'f32le',
|
|
54
|
+
strategy: 'greedy',
|
|
55
55
|
n_threads: 4,
|
|
56
|
-
language:
|
|
56
|
+
language: 'en',
|
|
57
57
|
no_timestamps: true,
|
|
58
58
|
suppress_blank: true,
|
|
59
59
|
suppress_nst: true,
|
|
@@ -63,33 +63,33 @@ try {
|
|
|
63
63
|
min_speech_duration_ms: 250,
|
|
64
64
|
min_silence_duration_ms: 300,
|
|
65
65
|
max_speech_duration_s: 15.0,
|
|
66
|
-
speech_pad_ms: 100
|
|
67
|
-
}
|
|
68
|
-
}
|
|
66
|
+
speech_pad_ms: 100
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
69
|
});
|
|
70
|
-
console.log(
|
|
71
|
-
ffmpeg = startMicrophone({ sampleRate: SAMPLE_RATE, format:
|
|
70
|
+
console.log('▸ Model loaded.\n');
|
|
71
|
+
ffmpeg = startMicrophone({ sampleRate: SAMPLE_RATE, format: 'f32le' });
|
|
72
72
|
const session = await transcribeStream({
|
|
73
73
|
modelId,
|
|
74
74
|
emitVadEvents: true,
|
|
75
|
-
endOfTurnSilenceMs: 800
|
|
75
|
+
endOfTurnSilenceMs: 800
|
|
76
76
|
});
|
|
77
|
-
ffmpeg.stdout.on(
|
|
78
|
-
console.log(
|
|
77
|
+
ffmpeg.stdout.on('data', (chunk) => session.write(chunk));
|
|
78
|
+
console.log('▸ Listening... speak and pause to see transcripts, VAD events, and end-of-turn signals.\n');
|
|
79
79
|
let lastSpeaking = false;
|
|
80
80
|
for await (const event of session) {
|
|
81
81
|
switch (event.type) {
|
|
82
|
-
case
|
|
82
|
+
case 'text':
|
|
83
83
|
console.log(`> ${event.text.trim()}`);
|
|
84
84
|
break;
|
|
85
|
-
case
|
|
85
|
+
case 'vad':
|
|
86
86
|
if (event.speaking !== lastSpeaking) {
|
|
87
87
|
console.log(`▸ [vad] speaking=${event.speaking} probability=${event.probability.toFixed(2)}`);
|
|
88
88
|
lastSpeaking = event.speaking;
|
|
89
89
|
}
|
|
90
90
|
break;
|
|
91
|
-
case
|
|
92
|
-
if (event.source ===
|
|
91
|
+
case 'endOfTurn':
|
|
92
|
+
if (event.source === 'whisper') {
|
|
93
93
|
console.log(`▸ [endOfTurn] silence ${event.silenceDurationMs}ms — turn complete\n`);
|
|
94
94
|
}
|
|
95
95
|
else {
|
|
@@ -100,7 +100,7 @@ try {
|
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
catch (error) {
|
|
103
|
-
console.error(
|
|
103
|
+
console.error('✖', error);
|
|
104
104
|
await cleanup();
|
|
105
105
|
process.exit(1);
|
|
106
106
|
}
|