@qvac/sdk 0.10.2 → 0.12.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 +1455 -29
- package/README.md +2 -0
- package/dist/client/api/cancel.d.ts +24 -32
- package/dist/client/api/cancel.js +58 -31
- package/dist/client/api/classify.d.ts +23 -0
- package/dist/client/api/classify.js +43 -0
- package/dist/client/api/client-request-id.d.ts +17 -0
- package/dist/client/api/client-request-id.js +27 -0
- package/dist/client/api/completion-stream.d.ts +1 -1
- package/dist/client/api/completion-stream.js +34 -3
- package/dist/client/api/diffusion.d.ts +46 -0
- package/dist/client/api/diffusion.js +50 -1
- package/dist/client/api/download-asset.d.ts +12 -2
- package/dist/client/api/download-asset.js +21 -3
- package/dist/client/api/embed.d.ts +8 -4
- package/dist/client/api/embed.js +14 -1
- package/dist/client/api/get-model-info.d.ts +1 -1
- package/dist/client/api/index.d.ts +5 -0
- package/dist/client/api/index.js +5 -0
- package/dist/client/api/load-model.d.ts +12 -4
- package/dist/client/api/load-model.js +49 -2
- package/dist/client/api/rag.d.ts +9 -3
- package/dist/client/api/rag.js +23 -3
- package/dist/client/api/transcribe.d.ts +23 -8
- package/dist/client/api/transcribe.js +69 -4
- package/dist/client/api/unload-model.d.ts +5 -2
- package/dist/client/api/unload-model.js +9 -4
- package/dist/client/api/upscale.d.ts +45 -0
- package/dist/client/api/upscale.js +99 -0
- package/dist/client/api/video.d.ts +64 -0
- package/dist/client/api/video.js +147 -0
- package/dist/client/api/vla-helpers.d.ts +45 -0
- package/dist/client/api/vla-helpers.js +130 -0
- package/dist/client/api/vla.d.ts +65 -0
- package/dist/client/api/vla.js +109 -0
- package/dist/client/config-loader/resolve-config.node.d.ts +16 -0
- package/dist/client/config-loader/resolve-config.node.js +77 -23
- package/dist/client/plugins-factory.d.ts +8 -0
- package/dist/client/plugins-factory.js +10 -0
- package/dist/client/rpc/bare-client.js +62 -66
- package/dist/client/rpc/ensure-worker-ready.d.ts +9 -0
- package/dist/client/rpc/ensure-worker-ready.js +17 -0
- package/dist/client/rpc/expo-rpc-client.js +2 -1
- package/dist/client/rpc/node-rpc-client.js +22 -8
- package/dist/client/rpc/rpc-client.d.ts +2 -2
- package/dist/client/rpc/rpc-client.js +10 -4
- package/dist/client/rpc/rpc-error.d.ts +9 -0
- package/dist/client/rpc/rpc-error.js +105 -0
- package/dist/commands/bundle/bare-pack.d.ts +13 -0
- package/dist/commands/bundle/bare-pack.js +54 -0
- package/dist/commands/bundle/constants.d.ts +7 -0
- package/dist/commands/bundle/constants.js +23 -0
- package/dist/commands/bundle/entry-gen.d.ts +2 -0
- package/dist/commands/bundle/entry-gen.js +48 -0
- package/dist/commands/bundle/index.d.ts +20 -0
- package/dist/commands/bundle/index.js +141 -0
- package/dist/commands/bundle/manifest.d.ts +21 -0
- package/dist/commands/bundle/manifest.js +193 -0
- package/dist/commands/bundle/plugins.d.ts +9 -0
- package/dist/commands/bundle/plugins.js +51 -0
- package/dist/commands/index.d.ts +5 -0
- package/dist/commands/index.js +2 -0
- package/dist/commands/verify/abi.d.ts +52 -0
- package/dist/commands/verify/abi.js +125 -0
- package/dist/commands/verify/addon-source.d.ts +43 -0
- package/dist/commands/verify/addon-source.js +75 -0
- package/dist/commands/verify/bundle-source.d.ts +12 -0
- package/dist/commands/verify/bundle-source.js +53 -0
- package/dist/commands/verify/index.d.ts +59 -0
- package/dist/commands/verify/index.js +371 -0
- package/dist/commands/verify/node-modules-source.d.ts +11 -0
- package/dist/commands/verify/node-modules-source.js +76 -0
- package/dist/commands/verify/prebuilds.d.ts +15 -0
- package/dist/commands/verify/prebuilds.js +39 -0
- package/dist/examples/cancel-by-request-id.d.ts +38 -0
- package/dist/examples/cancel-by-request-id.js +103 -0
- package/dist/examples/classification/classify-image.d.ts +2 -0
- package/dist/examples/classification/classify-image.js +23 -0
- package/dist/examples/diffusion-esrgan-upscale.d.ts +2 -0
- package/dist/examples/diffusion-esrgan-upscale.js +78 -0
- package/dist/examples/diffusion-txt2vid.d.ts +2 -0
- package/dist/examples/diffusion-txt2vid.js +81 -0
- package/dist/examples/download-with-cancel.js +10 -10
- package/dist/examples/embed-multi-gpu.d.ts +2 -0
- package/dist/examples/embed-multi-gpu.js +46 -0
- package/dist/examples/llamacpp-multi-gpu.d.ts +2 -0
- package/dist/examples/llamacpp-multi-gpu.js +57 -0
- package/dist/examples/plugins.js +3 -7
- package/dist/examples/rag/rag-hyperdb/cancellation.js +20 -17
- package/dist/examples/tools/llamacpp-tools-gemma4.d.ts +2 -0
- package/dist/examples/tools/llamacpp-tools-gemma4.js +73 -0
- package/dist/examples/tools/llamacpp-tools-qwen35.d.ts +2 -0
- package/dist/examples/tools/llamacpp-tools-qwen35.js +69 -0
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +18 -12
- package/dist/examples/transcription/parakeet-microphone-record.js +7 -12
- package/dist/examples/transcription/parakeet-microphone-stream.d.ts +2 -0
- package/dist/examples/transcription/parakeet-microphone-stream.js +79 -0
- package/dist/examples/transcription/parakeet-sortformer-streaming.d.ts +2 -0
- package/dist/examples/transcription/parakeet-sortformer-streaming.js +121 -0
- package/dist/examples/transcription/parakeet-sortformer.js +58 -55
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +18 -15
- package/dist/examples/transcription/whispercpp-microphone-conversation.d.ts +2 -0
- package/dist/examples/transcription/whispercpp-microphone-conversation.js +107 -0
- package/dist/examples/tts/chatterbox.js +7 -16
- package/dist/examples/tts/llm-to-tts-streaming.js +3 -10
- package/dist/examples/tts/supertonic-multilingual.js +4 -12
- package/dist/examples/tts/supertonic.js +5 -12
- package/dist/examples/vla-smolvla.d.ts +2 -0
- package/dist/examples/vla-smolvla.js +75 -0
- package/dist/examples/voice-assistant/voice-assistant.js +3 -10
- package/dist/expo/plugins/find-in-ancestor-node-modules.d.ts +14 -0
- package/dist/expo/plugins/find-in-ancestor-node-modules.js +24 -0
- package/dist/expo/plugins/get-project-root.d.ts +22 -0
- package/dist/expo/plugins/get-project-root.js +23 -0
- package/dist/expo/plugins/index.d.ts +4 -0
- package/dist/expo/plugins/index.js +4 -0
- package/dist/expo/plugins/resolve-sdk-package-dir.d.ts +9 -2
- package/dist/expo/plugins/resolve-sdk-package-dir.js +38 -11
- package/dist/expo/plugins/withDeviceInfo.js +2 -1
- package/dist/expo/plugins/withMobileBundle.d.ts +5 -4
- package/dist/expo/plugins/withMobileBundle.js +42 -58
- package/dist/index.d.ts +6 -2
- package/dist/index.js +23 -2
- package/dist/models/registry/models.d.ts +3725 -514
- package/dist/models/registry/models.js +7269 -3910
- package/dist/models/update-models/naming.js +22 -8
- package/dist/pear/pre.d.ts +3 -0
- package/dist/pear/pre.js +9 -2
- package/dist/schemas/cancel.d.ts +172 -28
- package/dist/schemas/cancel.js +120 -19
- package/dist/schemas/classification.d.ts +53 -0
- package/dist/schemas/classification.js +33 -0
- package/dist/schemas/common.d.ts +860 -1379
- package/dist/schemas/common.js +8 -1
- package/dist/schemas/completion-event.d.ts +17 -0
- package/dist/schemas/completion-event.js +12 -1
- package/dist/schemas/completion-stream.d.ts +16 -1
- package/dist/schemas/completion-stream.js +25 -7
- package/dist/schemas/download-asset.d.ts +25 -9
- package/dist/schemas/download-asset.js +17 -6
- package/dist/schemas/embed.d.ts +1 -0
- package/dist/schemas/embed.js +5 -0
- package/dist/schemas/engine-addon-map.d.ts +3 -0
- package/dist/schemas/engine-addon-map.js +18 -5
- package/dist/schemas/error.d.ts +31 -0
- package/dist/schemas/error.js +29 -1
- package/dist/schemas/finetune.d.ts +2 -0
- package/dist/schemas/finetune.js +5 -0
- package/dist/schemas/get-model-info.d.ts +10 -6
- package/dist/schemas/get-model-info.js +2 -0
- package/dist/schemas/index.d.ts +3 -0
- package/dist/schemas/index.js +3 -0
- package/dist/schemas/llamacpp-config.d.ts +64 -8
- package/dist/schemas/llamacpp-config.js +12 -0
- package/dist/schemas/load-model.d.ts +4644 -8605
- package/dist/schemas/load-model.js +90 -7
- package/dist/schemas/model-src-utils.d.ts +34 -14
- package/dist/schemas/model-types.d.ts +54 -14
- package/dist/schemas/model-types.js +28 -5
- package/dist/schemas/ocr.d.ts +8 -3
- package/dist/schemas/plugin.d.ts +60 -6
- package/dist/schemas/plugin.js +31 -5
- package/dist/schemas/rag.d.ts +9 -0
- package/dist/schemas/rag.js +17 -9
- package/dist/schemas/registry.d.ts +74 -30
- package/dist/schemas/registry.js +5 -0
- package/dist/schemas/reload-config.d.ts +34 -14
- package/dist/schemas/sdcpp-config.d.ts +445 -16
- package/dist/schemas/sdcpp-config.js +387 -26
- package/dist/schemas/sdk-config.d.ts +2431 -2723
- package/dist/schemas/sdk-config.js +16 -1
- package/dist/schemas/sdk-errors-client.d.ts +6 -0
- package/dist/schemas/sdk-errors-client.js +31 -1
- package/dist/schemas/sdk-errors-server.d.ts +8 -1
- package/dist/schemas/sdk-errors-server.js +45 -5
- package/dist/schemas/text-to-speech.d.ts +81 -698
- package/dist/schemas/text-to-speech.js +46 -19
- package/dist/schemas/transcription-config.d.ts +40 -229
- package/dist/schemas/transcription-config.js +76 -15
- package/dist/schemas/transcription.d.ts +108 -2
- package/dist/schemas/transcription.js +81 -0
- package/dist/schemas/translate.d.ts +2 -0
- package/dist/schemas/translate.js +13 -2
- package/dist/schemas/translation-config.d.ts +90 -40
- package/dist/schemas/unload-model.d.ts +2 -1
- package/dist/schemas/unload-model.js +4 -1
- package/dist/schemas/vla.d.ts +87 -0
- package/dist/schemas/vla.js +108 -0
- package/dist/scripts/run-unit-tests.js +22 -3
- package/dist/server/bare/ops/cancel.d.ts +27 -1
- package/dist/server/bare/ops/cancel.js +36 -10
- package/dist/server/bare/ops/embed.d.ts +3 -3
- package/dist/server/bare/ops/embed.js +144 -28
- package/dist/server/bare/ops/kv-cache-utils.d.ts +0 -7
- package/dist/server/bare/ops/kv-cache-utils.js +8 -47
- package/dist/server/bare/ops/transcribe.d.ts +11 -5
- package/dist/server/bare/ops/transcribe.js +230 -50
- package/dist/server/bare/ops/translate.d.ts +1 -1
- package/dist/server/bare/ops/translate.js +197 -88
- package/dist/server/bare/plugins/ggml-classification/ops/classify.d.ts +6 -0
- package/dist/server/bare/plugins/ggml-classification/ops/classify.js +30 -0
- package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +32 -0
- package/dist/server/bare/plugins/ggml-classification/plugin.js +55 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.d.ts +3 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.js +12 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.d.ts +3 -0
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +75 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +54 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.js +57 -0
- package/dist/server/bare/plugins/index.d.ts +3 -1
- package/dist/server/bare/plugins/index.js +3 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +12 -3
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +173 -172
- package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.d.ts +29 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.js +65 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +125 -21
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +154 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +448 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.d.ts +21 -73
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +18 -101
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +36 -3
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +183 -85
- package/dist/server/bare/plugins/llamacpp-completion/transform.d.ts +10 -0
- package/dist/server/bare/plugins/llamacpp-completion/transform.js +34 -0
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +7 -0
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +10 -1
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +42 -15
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +5 -1
- package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +8 -3
- package/dist/server/bare/plugins/onnx-ocr/plugin.js +3 -0
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +73 -244
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +68 -96
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +8 -0
- package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.d.ts +3 -0
- package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.js +40 -0
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +3 -0
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +199 -0
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +288 -15
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +150 -7
- package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech-stream.js +2 -15
- package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech.js +2 -1
- package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +75 -0
- package/dist/server/bare/plugins/tts-ggml/plugin.js +189 -0
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +47 -3
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +61 -14
- package/dist/server/bare/rag-hyperdb/index.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/index.js +1 -1
- package/dist/server/bare/rag-hyperdb/rag-operation-manager.d.ts +26 -4
- package/dist/server/bare/rag-hyperdb/rag-operation-manager.js +65 -28
- package/dist/server/bare/registry/model-config-utils.js +7 -0
- package/dist/server/bare/runtime/disposable-scope.d.ts +36 -0
- package/dist/server/bare/runtime/disposable-scope.js +69 -0
- package/dist/server/bare/runtime/index.d.ts +8 -0
- package/dist/server/bare/runtime/index.js +3 -0
- package/dist/server/bare/runtime/request-context.d.ts +49 -0
- package/dist/server/bare/runtime/request-context.js +1 -0
- package/dist/server/bare/runtime/request-id.d.ts +12 -0
- package/dist/server/bare/runtime/request-id.js +14 -0
- package/dist/server/bare/runtime/request-registry-singleton.d.ts +4 -0
- package/dist/server/bare/runtime/request-registry-singleton.js +27 -0
- package/dist/server/bare/runtime/request-registry.d.ts +136 -0
- package/dist/server/bare/runtime/request-registry.js +297 -0
- package/dist/server/bare/runtime/with-request-context.d.ts +22 -0
- package/dist/server/bare/runtime/with-request-context.js +53 -0
- package/dist/server/bare/runtime-lifecycle.js +9 -9
- package/dist/server/bare/types/addon-responses.d.ts +12 -1
- package/dist/server/env.js +4 -1
- 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 -0
- package/dist/server/plugins/registry.js +5 -0
- package/dist/server/rpc/handler-registry.js +30 -7
- package/dist/server/rpc/handler-selection.d.ts +9 -0
- package/dist/server/rpc/handler-selection.js +14 -0
- package/dist/server/rpc/handler-utils.js +5 -13
- package/dist/server/rpc/handlers/cancel-delegated.js +28 -31
- package/dist/server/rpc/handlers/cancelHandler.d.ts +30 -1
- package/dist/server/rpc/handlers/cancelHandler.js +54 -22
- package/dist/server/rpc/handlers/classify.d.ts +3 -0
- package/dist/server/rpc/handlers/classify.js +4 -0
- package/dist/server/rpc/handlers/delete-cache.d.ts +9 -0
- package/dist/server/rpc/handlers/delete-cache.js +13 -15
- package/dist/server/rpc/handlers/download-asset.js +133 -40
- package/dist/server/rpc/handlers/index.d.ts +4 -0
- package/dist/server/rpc/handlers/index.js +4 -0
- package/dist/server/rpc/handlers/load-model/download-manager.d.ts +60 -2
- package/dist/server/rpc/handlers/load-model/download-manager.js +141 -8
- package/dist/server/rpc/handlers/load-model/handler.js +216 -98
- package/dist/server/rpc/handlers/load-model/http.js +3 -3
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +1 -1
- package/dist/server/rpc/handlers/load-model/registry.js +1 -1
- package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +20 -1
- package/dist/server/rpc/handlers/load-model/resolve-session.js +6 -5
- package/dist/server/rpc/handlers/load-model/resolve.d.ts +3 -2
- package/dist/server/rpc/handlers/load-model/resolve.js +18 -6
- package/dist/server/rpc/handlers/load-model/types.d.ts +24 -0
- package/dist/server/rpc/handlers/rag.js +133 -15
- package/dist/server/rpc/handlers/upscale-stream.d.ts +3 -0
- package/dist/server/rpc/handlers/upscale-stream.js +4 -0
- package/dist/server/rpc/handlers/video-stream.d.ts +3 -0
- package/dist/server/rpc/handlers/video-stream.js +4 -0
- package/dist/server/rpc/profiling/operation-metrics.js +23 -0
- package/dist/server/utils/completion-normalizer.js +8 -0
- package/dist/server/utils/config-transform.js +1 -1
- package/dist/server/utils/tools/dialect.js +4 -0
- package/dist/server/utils/tools/parser.js +16 -1
- package/dist/server/utils/tools/parsers/gemma4native.d.ts +4 -0
- package/dist/server/utils/tools/parsers/gemma4native.js +60 -0
- package/dist/server/utils/tools/parsers/qwen35.d.ts +4 -0
- package/dist/server/utils/tools/parsers/qwen35.js +120 -0
- package/dist/server/worker.js +14 -11
- package/dist/utils/aggregate-events.d.ts +9 -0
- package/dist/utils/aggregate-events.js +18 -3
- package/dist/utils/decorate-promise.d.ts +34 -0
- package/dist/utils/decorate-promise.js +35 -0
- package/dist/utils/errors-client.d.ts +18 -0
- package/dist/utils/errors-client.js +31 -0
- package/dist/utils/errors-server.d.ts +115 -2
- package/dist/utils/errors-server.js +148 -3
- package/package.json +68 -77
- package/dist/server/bare/plugins/onnx-tts/plugin.d.ts +0 -490
- package/dist/server/bare/plugins/onnx-tts/plugin.js +0 -266
- package/dist/server/bare/plugins/onnx-tts/wav-helper.d.ts +0 -14
- package/dist/server/bare/plugins/onnx-tts/wav-helper.js +0 -107
- /package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech-stream.d.ts +0 -0
- /package/dist/server/bare/plugins/{onnx-tts → tts-ggml}/ops/text-to-speech.d.ts +0 -0
|
@@ -11,38 +11,65 @@ const ttsLanguageSchema = z.enum(TTS_LANGUAGES);
|
|
|
11
11
|
export const ttsChatterboxRuntimeConfigSchema = z.object({
|
|
12
12
|
ttsEngine: z.literal("chatterbox"),
|
|
13
13
|
language: ttsLanguageSchema,
|
|
14
|
+
voice: z.string().optional(),
|
|
15
|
+
useGPU: z.boolean().optional(),
|
|
14
16
|
});
|
|
15
17
|
export const ttsSupertonicRuntimeConfigSchema = z.object({
|
|
16
18
|
ttsEngine: z.literal("supertonic"),
|
|
17
19
|
language: ttsLanguageSchema,
|
|
20
|
+
voice: z.string().optional(),
|
|
18
21
|
ttsSpeed: z.number().optional(),
|
|
19
22
|
ttsNumInferenceSteps: z.number().optional(),
|
|
20
|
-
|
|
23
|
+
useGPU: z.boolean().optional(),
|
|
21
24
|
});
|
|
22
25
|
export const ttsRuntimeConfigSchema = z.union([
|
|
23
26
|
ttsChatterboxRuntimeConfigSchema,
|
|
24
27
|
ttsSupertonicRuntimeConfigSchema,
|
|
25
28
|
]);
|
|
26
|
-
export const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
ttsLanguageModelSrc: modelSrcInputSchema,
|
|
32
|
-
referenceAudioSrc: modelSrcInputSchema,
|
|
33
|
-
});
|
|
34
|
-
export const ttsSupertonicConfigSchema = ttsSupertonicRuntimeConfigSchema.extend({
|
|
35
|
-
ttsTextEncoderSrc: modelSrcInputSchema,
|
|
36
|
-
ttsDurationPredictorSrc: modelSrcInputSchema,
|
|
37
|
-
ttsVectorEstimatorSrc: modelSrcInputSchema,
|
|
38
|
-
ttsVocoderSrc: modelSrcInputSchema,
|
|
39
|
-
ttsUnicodeIndexerSrc: modelSrcInputSchema,
|
|
40
|
-
ttsTtsConfigSrc: modelSrcInputSchema,
|
|
41
|
-
ttsVoiceStyleSrc: modelSrcInputSchema,
|
|
29
|
+
export const ttsChatterboxLoadConfigSchema = ttsChatterboxRuntimeConfigSchema.extend({
|
|
30
|
+
// Optional at schema time so legacy ONNX configs (no s3genModelSrc) reach
|
|
31
|
+
// the plugin's resolveConfig and raise LegacyTtsModelDeprecatedError.
|
|
32
|
+
s3genModelSrc: modelSrcInputSchema.optional(),
|
|
33
|
+
referenceAudioSrc: modelSrcInputSchema.optional(),
|
|
42
34
|
});
|
|
35
|
+
export const ttsSupertonicLoadConfigSchema = ttsSupertonicRuntimeConfigSchema;
|
|
36
|
+
export const ttsLoadConfigSchema = z.union([
|
|
37
|
+
ttsChatterboxLoadConfigSchema,
|
|
38
|
+
ttsSupertonicLoadConfigSchema,
|
|
39
|
+
]);
|
|
40
|
+
// === Legacy ONNX modelConfig fields (deprecated) ===
|
|
41
|
+
//
|
|
42
|
+
// Pre-@qvac/tts-ggml multi-file ONNX `modelConfig` fields are kept ONLY so
|
|
43
|
+
// callers migrating from earlier SDK versions hit a structured
|
|
44
|
+
// `LegacyTtsModelDeprecatedError` from the TTS plugin's `resolveConfig`,
|
|
45
|
+
// rather than a generic Zod `Unrecognized key` error.
|
|
46
|
+
export const LEGACY_TTS_ONNX_MODEL_CONFIG_FIELDS = [
|
|
47
|
+
// ONNX runtime flag; GGML uses modelSrc (GGUF) + `language` instead.
|
|
48
|
+
"ttsSupertonicMultilingual",
|
|
49
|
+
"ttsTokenizerSrc",
|
|
50
|
+
"ttsSpeechEncoderSrc",
|
|
51
|
+
"ttsEmbedTokensSrc",
|
|
52
|
+
"ttsConditionalDecoderSrc",
|
|
53
|
+
"ttsLanguageModelSrc",
|
|
54
|
+
"ttsTextEncoderSrc",
|
|
55
|
+
"ttsDurationPredictorSrc",
|
|
56
|
+
"ttsVectorEstimatorSrc",
|
|
57
|
+
"ttsVocoderSrc",
|
|
58
|
+
"ttsUnicodeIndexerSrc",
|
|
59
|
+
"ttsTtsConfigSrc",
|
|
60
|
+
"ttsVoiceStyleSrc",
|
|
61
|
+
];
|
|
62
|
+
const legacyTtsOnnxFieldsShape = LEGACY_TTS_ONNX_MODEL_CONFIG_FIELDS.reduce((acc, name) => {
|
|
63
|
+
acc[name] = z.unknown().optional();
|
|
64
|
+
return acc;
|
|
65
|
+
}, {});
|
|
66
|
+
// Strict load schema used by `loadModel` and the tts-ggml plugin's
|
|
67
|
+
// `loadConfigSchema`. Permits deprecated ONNX field names so
|
|
68
|
+
// `resolveConfig` can raise LegacyTtsModelDeprecatedError instead of a
|
|
69
|
+
// generic Zod error; other unknown keys are still rejected by `.strict()`.
|
|
43
70
|
export const ttsConfigSchema = z.union([
|
|
44
|
-
|
|
45
|
-
|
|
71
|
+
ttsChatterboxLoadConfigSchema.extend(legacyTtsOnnxFieldsShape).strict(),
|
|
72
|
+
ttsSupertonicLoadConfigSchema.extend(legacyTtsOnnxFieldsShape).strict(),
|
|
46
73
|
]);
|
|
47
74
|
export const ttsClientParamsSchema = z.object({
|
|
48
75
|
modelId: z.string(),
|
|
@@ -77,267 +77,78 @@ export declare const whisperConfigSchema: z.ZodObject<{
|
|
|
77
77
|
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
78
78
|
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
79
79
|
embeddings: "embeddings";
|
|
80
|
+
diffusion: "diffusion";
|
|
81
|
+
tts: "tts";
|
|
82
|
+
ocr: "ocr";
|
|
83
|
+
vla: "vla";
|
|
80
84
|
"llamacpp-completion": "llamacpp-completion";
|
|
81
85
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
82
86
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
83
87
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
84
88
|
"onnx-tts": "onnx-tts";
|
|
89
|
+
"tts-ggml": "tts-ggml";
|
|
85
90
|
"parakeet-transcription": "parakeet-transcription";
|
|
86
91
|
"onnx-ocr": "onnx-ocr";
|
|
87
92
|
"sdcpp-generation": "sdcpp-generation";
|
|
93
|
+
"ggml-vla": "ggml-vla";
|
|
94
|
+
"ggml-classification": "ggml-classification";
|
|
88
95
|
llm: "llm";
|
|
89
96
|
whisper: "whisper";
|
|
90
97
|
nmt: "nmt";
|
|
91
98
|
parakeet: "parakeet";
|
|
92
|
-
|
|
93
|
-
ocr: "ocr";
|
|
94
|
-
diffusion: "diffusion";
|
|
99
|
+
classification: "classification";
|
|
95
100
|
}>, z.ZodLiteral<"vad">]>>;
|
|
96
101
|
}, z.core.$strip>]>>;
|
|
97
102
|
}, z.core.$strip>;
|
|
98
103
|
export type WhisperConfig = z.infer<typeof whisperConfigSchema>;
|
|
99
|
-
export declare const parakeetModelTypeEnumSchema: z.ZodEnum<{
|
|
100
|
-
tdt: "tdt";
|
|
101
|
-
ctc: "ctc";
|
|
102
|
-
sortformer: "sortformer";
|
|
103
|
-
}>;
|
|
104
|
-
export type ParakeetModelVariant = z.infer<typeof parakeetModelTypeEnumSchema>;
|
|
105
104
|
export declare const parakeetRuntimeConfigSchema: z.ZodObject<{
|
|
106
|
-
modelType: z.ZodDefault<z.ZodEnum<{
|
|
107
|
-
tdt: "tdt";
|
|
108
|
-
ctc: "ctc";
|
|
109
|
-
sortformer: "sortformer";
|
|
110
|
-
}>>;
|
|
111
105
|
maxThreads: z.ZodOptional<z.ZodNumber>;
|
|
112
106
|
useGPU: z.ZodOptional<z.ZodBoolean>;
|
|
113
107
|
sampleRate: z.ZodOptional<z.ZodNumber>;
|
|
114
108
|
channels: z.ZodOptional<z.ZodNumber>;
|
|
115
109
|
captionEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
116
110
|
timestampsEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
streaming: z.ZodOptional<z.ZodBoolean>;
|
|
113
|
+
streamingChunkMs: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
streamingHistoryMs: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
streamingEmitPartials: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
+
streamingEnergyVad: z.ZodOptional<z.ZodBoolean>;
|
|
117
|
+
streamingLeftContextMs: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
streamingRightLookaheadMs: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
streamingSpkCacheEnable: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
streamingSpkCacheLen: z.ZodOptional<z.ZodNumber>;
|
|
121
|
+
streamingFifoLen: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
streamingChunkLeftContextMs: z.ZodOptional<z.ZodNumber>;
|
|
123
|
+
streamingChunkRightContextMs: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
streamingSpkCacheUpdatePeriod: z.ZodOptional<z.ZodNumber>;
|
|
117
125
|
}, z.core.$strip>;
|
|
118
126
|
export declare const parakeetConfigSchema: z.ZodObject<{
|
|
119
|
-
modelType: z.ZodDefault<z.ZodEnum<{
|
|
120
|
-
tdt: "tdt";
|
|
121
|
-
ctc: "ctc";
|
|
122
|
-
sortformer: "sortformer";
|
|
123
|
-
}>>;
|
|
124
127
|
maxThreads: z.ZodOptional<z.ZodNumber>;
|
|
125
128
|
useGPU: z.ZodOptional<z.ZodBoolean>;
|
|
126
129
|
sampleRate: z.ZodOptional<z.ZodNumber>;
|
|
127
130
|
channels: z.ZodOptional<z.ZodNumber>;
|
|
128
131
|
captionEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
129
132
|
timestampsEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
"whispercpp-transcription": "whispercpp-transcription";
|
|
145
|
-
"llamacpp-embedding": "llamacpp-embedding";
|
|
146
|
-
"nmtcpp-translation": "nmtcpp-translation";
|
|
147
|
-
"onnx-tts": "onnx-tts";
|
|
148
|
-
"parakeet-transcription": "parakeet-transcription";
|
|
149
|
-
"onnx-ocr": "onnx-ocr";
|
|
150
|
-
"sdcpp-generation": "sdcpp-generation";
|
|
151
|
-
llm: "llm";
|
|
152
|
-
whisper: "whisper";
|
|
153
|
-
nmt: "nmt";
|
|
154
|
-
parakeet: "parakeet";
|
|
155
|
-
tts: "tts";
|
|
156
|
-
ocr: "ocr";
|
|
157
|
-
diffusion: "diffusion";
|
|
158
|
-
}>, z.ZodLiteral<"vad">]>>;
|
|
159
|
-
}, z.core.$strip>]>>;
|
|
160
|
-
parakeetDecoderSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
161
|
-
src: z.ZodString;
|
|
162
|
-
name: z.ZodOptional<z.ZodString>;
|
|
163
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
164
|
-
registryPath: z.ZodOptional<z.ZodString>;
|
|
165
|
-
registrySource: z.ZodOptional<z.ZodString>;
|
|
166
|
-
blobCoreKey: z.ZodOptional<z.ZodString>;
|
|
167
|
-
blobIndex: z.ZodOptional<z.ZodNumber>;
|
|
168
|
-
engine: z.ZodOptional<z.ZodString>;
|
|
169
|
-
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
170
|
-
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
171
|
-
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
172
|
-
embeddings: "embeddings";
|
|
173
|
-
"llamacpp-completion": "llamacpp-completion";
|
|
174
|
-
"whispercpp-transcription": "whispercpp-transcription";
|
|
175
|
-
"llamacpp-embedding": "llamacpp-embedding";
|
|
176
|
-
"nmtcpp-translation": "nmtcpp-translation";
|
|
177
|
-
"onnx-tts": "onnx-tts";
|
|
178
|
-
"parakeet-transcription": "parakeet-transcription";
|
|
179
|
-
"onnx-ocr": "onnx-ocr";
|
|
180
|
-
"sdcpp-generation": "sdcpp-generation";
|
|
181
|
-
llm: "llm";
|
|
182
|
-
whisper: "whisper";
|
|
183
|
-
nmt: "nmt";
|
|
184
|
-
parakeet: "parakeet";
|
|
185
|
-
tts: "tts";
|
|
186
|
-
ocr: "ocr";
|
|
187
|
-
diffusion: "diffusion";
|
|
188
|
-
}>, z.ZodLiteral<"vad">]>>;
|
|
189
|
-
}, z.core.$strip>]>>;
|
|
190
|
-
parakeetVocabSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
191
|
-
src: z.ZodString;
|
|
192
|
-
name: z.ZodOptional<z.ZodString>;
|
|
193
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
194
|
-
registryPath: z.ZodOptional<z.ZodString>;
|
|
195
|
-
registrySource: z.ZodOptional<z.ZodString>;
|
|
196
|
-
blobCoreKey: z.ZodOptional<z.ZodString>;
|
|
197
|
-
blobIndex: z.ZodOptional<z.ZodNumber>;
|
|
198
|
-
engine: z.ZodOptional<z.ZodString>;
|
|
199
|
-
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
200
|
-
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
201
|
-
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
202
|
-
embeddings: "embeddings";
|
|
203
|
-
"llamacpp-completion": "llamacpp-completion";
|
|
204
|
-
"whispercpp-transcription": "whispercpp-transcription";
|
|
205
|
-
"llamacpp-embedding": "llamacpp-embedding";
|
|
206
|
-
"nmtcpp-translation": "nmtcpp-translation";
|
|
207
|
-
"onnx-tts": "onnx-tts";
|
|
208
|
-
"parakeet-transcription": "parakeet-transcription";
|
|
209
|
-
"onnx-ocr": "onnx-ocr";
|
|
210
|
-
"sdcpp-generation": "sdcpp-generation";
|
|
211
|
-
llm: "llm";
|
|
212
|
-
whisper: "whisper";
|
|
213
|
-
nmt: "nmt";
|
|
214
|
-
parakeet: "parakeet";
|
|
215
|
-
tts: "tts";
|
|
216
|
-
ocr: "ocr";
|
|
217
|
-
diffusion: "diffusion";
|
|
218
|
-
}>, z.ZodLiteral<"vad">]>>;
|
|
219
|
-
}, z.core.$strip>]>>;
|
|
220
|
-
parakeetPreprocessorSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
221
|
-
src: z.ZodString;
|
|
222
|
-
name: z.ZodOptional<z.ZodString>;
|
|
223
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
224
|
-
registryPath: z.ZodOptional<z.ZodString>;
|
|
225
|
-
registrySource: z.ZodOptional<z.ZodString>;
|
|
226
|
-
blobCoreKey: z.ZodOptional<z.ZodString>;
|
|
227
|
-
blobIndex: z.ZodOptional<z.ZodNumber>;
|
|
228
|
-
engine: z.ZodOptional<z.ZodString>;
|
|
229
|
-
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
230
|
-
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
231
|
-
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
232
|
-
embeddings: "embeddings";
|
|
233
|
-
"llamacpp-completion": "llamacpp-completion";
|
|
234
|
-
"whispercpp-transcription": "whispercpp-transcription";
|
|
235
|
-
"llamacpp-embedding": "llamacpp-embedding";
|
|
236
|
-
"nmtcpp-translation": "nmtcpp-translation";
|
|
237
|
-
"onnx-tts": "onnx-tts";
|
|
238
|
-
"parakeet-transcription": "parakeet-transcription";
|
|
239
|
-
"onnx-ocr": "onnx-ocr";
|
|
240
|
-
"sdcpp-generation": "sdcpp-generation";
|
|
241
|
-
llm: "llm";
|
|
242
|
-
whisper: "whisper";
|
|
243
|
-
nmt: "nmt";
|
|
244
|
-
parakeet: "parakeet";
|
|
245
|
-
tts: "tts";
|
|
246
|
-
ocr: "ocr";
|
|
247
|
-
diffusion: "diffusion";
|
|
248
|
-
}>, z.ZodLiteral<"vad">]>>;
|
|
249
|
-
}, z.core.$strip>]>>;
|
|
250
|
-
parakeetCtcModelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
251
|
-
src: z.ZodString;
|
|
252
|
-
name: z.ZodOptional<z.ZodString>;
|
|
253
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
254
|
-
registryPath: z.ZodOptional<z.ZodString>;
|
|
255
|
-
registrySource: z.ZodOptional<z.ZodString>;
|
|
256
|
-
blobCoreKey: z.ZodOptional<z.ZodString>;
|
|
257
|
-
blobIndex: z.ZodOptional<z.ZodNumber>;
|
|
258
|
-
engine: z.ZodOptional<z.ZodString>;
|
|
259
|
-
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
260
|
-
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
261
|
-
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
262
|
-
embeddings: "embeddings";
|
|
263
|
-
"llamacpp-completion": "llamacpp-completion";
|
|
264
|
-
"whispercpp-transcription": "whispercpp-transcription";
|
|
265
|
-
"llamacpp-embedding": "llamacpp-embedding";
|
|
266
|
-
"nmtcpp-translation": "nmtcpp-translation";
|
|
267
|
-
"onnx-tts": "onnx-tts";
|
|
268
|
-
"parakeet-transcription": "parakeet-transcription";
|
|
269
|
-
"onnx-ocr": "onnx-ocr";
|
|
270
|
-
"sdcpp-generation": "sdcpp-generation";
|
|
271
|
-
llm: "llm";
|
|
272
|
-
whisper: "whisper";
|
|
273
|
-
nmt: "nmt";
|
|
274
|
-
parakeet: "parakeet";
|
|
275
|
-
tts: "tts";
|
|
276
|
-
ocr: "ocr";
|
|
277
|
-
diffusion: "diffusion";
|
|
278
|
-
}>, z.ZodLiteral<"vad">]>>;
|
|
279
|
-
}, z.core.$strip>]>>;
|
|
280
|
-
parakeetTokenizerSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
281
|
-
src: z.ZodString;
|
|
282
|
-
name: z.ZodOptional<z.ZodString>;
|
|
283
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
284
|
-
registryPath: z.ZodOptional<z.ZodString>;
|
|
285
|
-
registrySource: z.ZodOptional<z.ZodString>;
|
|
286
|
-
blobCoreKey: z.ZodOptional<z.ZodString>;
|
|
287
|
-
blobIndex: z.ZodOptional<z.ZodNumber>;
|
|
288
|
-
engine: z.ZodOptional<z.ZodString>;
|
|
289
|
-
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
290
|
-
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
291
|
-
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
292
|
-
embeddings: "embeddings";
|
|
293
|
-
"llamacpp-completion": "llamacpp-completion";
|
|
294
|
-
"whispercpp-transcription": "whispercpp-transcription";
|
|
295
|
-
"llamacpp-embedding": "llamacpp-embedding";
|
|
296
|
-
"nmtcpp-translation": "nmtcpp-translation";
|
|
297
|
-
"onnx-tts": "onnx-tts";
|
|
298
|
-
"parakeet-transcription": "parakeet-transcription";
|
|
299
|
-
"onnx-ocr": "onnx-ocr";
|
|
300
|
-
"sdcpp-generation": "sdcpp-generation";
|
|
301
|
-
llm: "llm";
|
|
302
|
-
whisper: "whisper";
|
|
303
|
-
nmt: "nmt";
|
|
304
|
-
parakeet: "parakeet";
|
|
305
|
-
tts: "tts";
|
|
306
|
-
ocr: "ocr";
|
|
307
|
-
diffusion: "diffusion";
|
|
308
|
-
}>, z.ZodLiteral<"vad">]>>;
|
|
309
|
-
}, z.core.$strip>]>>;
|
|
310
|
-
parakeetSortformerSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
311
|
-
src: z.ZodString;
|
|
312
|
-
name: z.ZodOptional<z.ZodString>;
|
|
313
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
314
|
-
registryPath: z.ZodOptional<z.ZodString>;
|
|
315
|
-
registrySource: z.ZodOptional<z.ZodString>;
|
|
316
|
-
blobCoreKey: z.ZodOptional<z.ZodString>;
|
|
317
|
-
blobIndex: z.ZodOptional<z.ZodNumber>;
|
|
318
|
-
engine: z.ZodOptional<z.ZodString>;
|
|
319
|
-
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
320
|
-
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
321
|
-
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
322
|
-
embeddings: "embeddings";
|
|
323
|
-
"llamacpp-completion": "llamacpp-completion";
|
|
324
|
-
"whispercpp-transcription": "whispercpp-transcription";
|
|
325
|
-
"llamacpp-embedding": "llamacpp-embedding";
|
|
326
|
-
"nmtcpp-translation": "nmtcpp-translation";
|
|
327
|
-
"onnx-tts": "onnx-tts";
|
|
328
|
-
"parakeet-transcription": "parakeet-transcription";
|
|
329
|
-
"onnx-ocr": "onnx-ocr";
|
|
330
|
-
"sdcpp-generation": "sdcpp-generation";
|
|
331
|
-
llm: "llm";
|
|
332
|
-
whisper: "whisper";
|
|
333
|
-
nmt: "nmt";
|
|
334
|
-
parakeet: "parakeet";
|
|
335
|
-
tts: "tts";
|
|
336
|
-
ocr: "ocr";
|
|
337
|
-
diffusion: "diffusion";
|
|
338
|
-
}>, z.ZodLiteral<"vad">]>>;
|
|
339
|
-
}, z.core.$strip>]>>;
|
|
133
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
streaming: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
streamingChunkMs: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
streamingHistoryMs: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
streamingEmitPartials: z.ZodOptional<z.ZodBoolean>;
|
|
138
|
+
streamingEnergyVad: z.ZodOptional<z.ZodBoolean>;
|
|
139
|
+
streamingLeftContextMs: z.ZodOptional<z.ZodNumber>;
|
|
140
|
+
streamingRightLookaheadMs: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
streamingSpkCacheEnable: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
streamingSpkCacheLen: z.ZodOptional<z.ZodNumber>;
|
|
143
|
+
streamingFifoLen: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
streamingChunkLeftContextMs: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
streamingChunkRightContextMs: z.ZodOptional<z.ZodNumber>;
|
|
146
|
+
streamingSpkCacheUpdatePeriod: z.ZodOptional<z.ZodNumber>;
|
|
340
147
|
}, z.core.$strip>;
|
|
341
148
|
export type ParakeetRuntimeConfig = z.infer<typeof parakeetRuntimeConfigSchema>;
|
|
342
149
|
export type ParakeetConfig = z.infer<typeof parakeetConfigSchema>;
|
|
150
|
+
export declare const LEGACY_PARAKEET_ONNX_MODEL_CONFIG_FIELDS: readonly ["parakeetEncoderSrc", "parakeetDecoderSrc", "parakeetVocabSrc", "parakeetPreprocessorSrc", "parakeetCtcModelSrc", "parakeetTokenizerSrc", "parakeetSortformerSrc", "parakeetModelSrc", "modelType"];
|
|
151
|
+
export declare const parakeetLoadConfigSchema: z.ZodObject<{
|
|
152
|
+
[x: string]: z.ZodOptional<z.ZodUnknown>;
|
|
153
|
+
}, z.core.$strict>;
|
|
343
154
|
//# sourceMappingURL=transcription-config.d.ts.map
|
|
@@ -68,26 +68,87 @@ export const whisperConfigSchema = z.object({
|
|
|
68
68
|
miscConfig: miscConfigSchema,
|
|
69
69
|
vadModelSrc: modelSrcInputSchema.optional(),
|
|
70
70
|
});
|
|
71
|
-
// === Parakeet (NVIDIA NeMo
|
|
72
|
-
|
|
71
|
+
// === Parakeet (NVIDIA NeMo GGML) engine config ===
|
|
72
|
+
//
|
|
73
|
+
// Backed by the ggml-based qvac-parakeet.cpp engine. A single GGUF
|
|
74
|
+
// checkpoint covers every variant (TDT, CTC, EOU, Sortformer); the
|
|
75
|
+
// addon auto-detects the model type from `parakeet.model.type` GGUF
|
|
76
|
+
// metadata, so callers no longer pass a `modelType` discriminator and
|
|
77
|
+
// only ever supply a single `modelSrc` at `loadModel` time.
|
|
78
|
+
//
|
|
79
|
+
// The `streaming*` knobs below configure the addon at load time. To
|
|
80
|
+
// override any of them per `transcribeStream` call, see
|
|
81
|
+
// `parakeetStreamingRunConfigSchema` in `./transcription.ts` — the
|
|
82
|
+
// per-call schema intentionally drops the `streaming` prefix because
|
|
83
|
+
// every field on it is already namespaced under `parakeetStreamingConfig`.
|
|
73
84
|
export const parakeetRuntimeConfigSchema = z.object({
|
|
74
|
-
modelType: parakeetModelTypeEnumSchema.default("tdt"),
|
|
75
85
|
maxThreads: z.number().int().optional(),
|
|
76
86
|
useGPU: z.boolean().optional(),
|
|
77
87
|
sampleRate: z.number().int().optional(),
|
|
78
88
|
channels: z.number().int().optional(),
|
|
79
89
|
captionEnabled: z.boolean().optional(),
|
|
80
90
|
timestampsEnabled: z.boolean().optional(),
|
|
91
|
+
seed: z.number().int().optional(),
|
|
92
|
+
streaming: z.boolean().optional(),
|
|
93
|
+
streamingChunkMs: z.number().int().positive().optional(),
|
|
94
|
+
streamingHistoryMs: z.number().int().positive().optional(),
|
|
95
|
+
streamingEmitPartials: z.boolean().optional(),
|
|
96
|
+
/**
|
|
97
|
+
* CTC/TDT-only energy-based voice-activity hint. Forwarded to
|
|
98
|
+
* parakeet-cpp's `StreamingOptions::enable_energy_vad`. Influences
|
|
99
|
+
* how the engine segments speech (segment cadence, partial vs final
|
|
100
|
+
* emission) but does NOT add new event types to the transcribeStream
|
|
101
|
+
* output. Use the whisper engine if you need standalone VAD
|
|
102
|
+
* `speaking`/`probability` events.
|
|
103
|
+
*/
|
|
104
|
+
streamingEnergyVad: z.boolean().optional(),
|
|
105
|
+
streamingLeftContextMs: z.number().int().nonnegative().optional(),
|
|
106
|
+
streamingRightLookaheadMs: z.number().int().nonnegative().optional(),
|
|
107
|
+
// === AOSC (Audio-Online Speaker Cache; v2.1+ Sortformer only) =========
|
|
108
|
+
// Auto-enabled when the loaded GGUF carries
|
|
109
|
+
// `parakeet.model_variant == "sortformer-streaming-v2.1-aosc"`. Ignored
|
|
110
|
+
// by v1/v2 Sortformer and by non-Sortformer engines.
|
|
111
|
+
streamingSpkCacheEnable: z.boolean().optional(),
|
|
112
|
+
streamingSpkCacheLen: z.number().int().positive().optional(),
|
|
113
|
+
streamingFifoLen: z.number().int().positive().optional(),
|
|
114
|
+
streamingChunkLeftContextMs: z.number().int().nonnegative().optional(),
|
|
115
|
+
streamingChunkRightContextMs: z.number().int().nonnegative().optional(),
|
|
116
|
+
streamingSpkCacheUpdatePeriod: z.number().int().positive().optional(),
|
|
81
117
|
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
118
|
+
// Parakeet's load-time config currently has no fields beyond the
|
|
119
|
+
// runtime knobs (single GGUF model is supplied via the top-level
|
|
120
|
+
// `modelSrc` of `loadModel`). The alias is retained so consumers can
|
|
121
|
+
// keep importing `ParakeetConfig` / `parakeetConfigSchema`.
|
|
122
|
+
export const parakeetConfigSchema = parakeetRuntimeConfigSchema;
|
|
123
|
+
// === Parakeet legacy ONNX modelConfig fields (deprecated) ===
|
|
124
|
+
//
|
|
125
|
+
// As of @qvac/transcription-parakeet 0.6.0 the addon ships as a single
|
|
126
|
+
// GGUF that auto-detects TDT / CTC / EOU / Sortformer from GGUF
|
|
127
|
+
// metadata. The pre-0.4 multi-file ONNX `modelConfig` fields below are
|
|
128
|
+
// kept ONLY so callers migrating from earlier SDK versions hit a
|
|
129
|
+
// structured `LegacyParakeetModelDeprecatedError` (with a migration
|
|
130
|
+
// message) raised from the parakeet plugin's `resolveConfig`, rather
|
|
131
|
+
// than a generic Zod `Unrecognized key` error.
|
|
132
|
+
export const LEGACY_PARAKEET_ONNX_MODEL_CONFIG_FIELDS = [
|
|
133
|
+
"parakeetEncoderSrc",
|
|
134
|
+
"parakeetDecoderSrc",
|
|
135
|
+
"parakeetVocabSrc",
|
|
136
|
+
"parakeetPreprocessorSrc",
|
|
137
|
+
"parakeetCtcModelSrc",
|
|
138
|
+
"parakeetTokenizerSrc",
|
|
139
|
+
"parakeetSortformerSrc",
|
|
140
|
+
"parakeetModelSrc",
|
|
141
|
+
"modelType",
|
|
142
|
+
];
|
|
143
|
+
const legacyParakeetOnnxFieldsShape = LEGACY_PARAKEET_ONNX_MODEL_CONFIG_FIELDS.reduce((acc, name) => {
|
|
144
|
+
acc[name] = z.unknown().optional();
|
|
145
|
+
return acc;
|
|
146
|
+
}, {});
|
|
147
|
+
// Strict schema used by `loadModel` and the parakeet plugin's
|
|
148
|
+
// `loadConfigSchema`. Permits the deprecated ONNX field names so the
|
|
149
|
+
// plugin's `resolveConfig` can raise a structured
|
|
150
|
+
// `LegacyParakeetModelDeprecatedError` instead of a generic Zod error;
|
|
151
|
+
// other unknown keys are still rejected by `.strict()`.
|
|
152
|
+
export const parakeetLoadConfigSchema = parakeetRuntimeConfigSchema
|
|
153
|
+
.extend(legacyParakeetOnnxFieldsShape)
|
|
154
|
+
.strict();
|
|
@@ -37,6 +37,23 @@ export declare const transcribeSegmentSchema: z.ZodObject<{
|
|
|
37
37
|
append: z.ZodBoolean;
|
|
38
38
|
id: z.ZodNumber;
|
|
39
39
|
}, z.core.$strip>;
|
|
40
|
+
export declare const vadStateEventSchema: z.ZodObject<{
|
|
41
|
+
speaking: z.ZodBoolean;
|
|
42
|
+
probability: z.ZodNumber;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export declare const whisperEndOfTurnEventSchema: z.ZodObject<{
|
|
45
|
+
source: z.ZodLiteral<"whisper">;
|
|
46
|
+
silenceDurationMs: z.ZodNumber;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export declare const parakeetEndOfTurnEventSchema: z.ZodObject<{
|
|
49
|
+
source: z.ZodLiteral<"parakeet">;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export declare const endOfTurnEventSchema: z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
52
|
+
source: z.ZodLiteral<"whisper">;
|
|
53
|
+
silenceDurationMs: z.ZodNumber;
|
|
54
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
55
|
+
source: z.ZodLiteral<"parakeet">;
|
|
56
|
+
}, z.core.$strip>], "source">>;
|
|
40
57
|
export declare const transcribeRequestSchema: z.ZodObject<{
|
|
41
58
|
modelId: z.ZodString;
|
|
42
59
|
prompt: z.ZodOptional<z.ZodString>;
|
|
@@ -49,6 +66,7 @@ export declare const transcribeRequestSchema: z.ZodObject<{
|
|
|
49
66
|
value: z.ZodString;
|
|
50
67
|
}, z.core.$strip>], "type">;
|
|
51
68
|
type: z.ZodLiteral<"transcribe">;
|
|
69
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
52
70
|
}, z.core.$strip>;
|
|
53
71
|
export declare const transcribeResponseSchema: z.ZodObject<{
|
|
54
72
|
text: z.ZodOptional<z.ZodString>;
|
|
@@ -73,6 +91,16 @@ export declare const transcribeResponseSchema: z.ZodObject<{
|
|
|
73
91
|
append: z.ZodBoolean;
|
|
74
92
|
id: z.ZodNumber;
|
|
75
93
|
}, z.core.$strip>>;
|
|
94
|
+
vad: z.ZodOptional<z.ZodObject<{
|
|
95
|
+
speaking: z.ZodBoolean;
|
|
96
|
+
probability: z.ZodNumber;
|
|
97
|
+
}, z.core.$strip>>;
|
|
98
|
+
endOfTurn: z.ZodOptional<z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
99
|
+
source: z.ZodLiteral<"whisper">;
|
|
100
|
+
silenceDurationMs: z.ZodNumber;
|
|
101
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
102
|
+
source: z.ZodLiteral<"parakeet">;
|
|
103
|
+
}, z.core.$strip>], "source">>>;
|
|
76
104
|
type: z.ZodLiteral<"transcribe">;
|
|
77
105
|
}, z.core.$strip>;
|
|
78
106
|
export type AudioInput = z.infer<typeof audioInputSchema>;
|
|
@@ -86,11 +114,54 @@ export type TranscribeClientParams = {
|
|
|
86
114
|
};
|
|
87
115
|
export type TranscribeRequest = z.infer<typeof transcribeRequestSchema>;
|
|
88
116
|
export type TranscribeResponse = z.infer<typeof transcribeResponseSchema>;
|
|
117
|
+
/**
|
|
118
|
+
* Per-call overrides for parakeet's duplex streaming session.
|
|
119
|
+
*
|
|
120
|
+
* Each field maps to its `streaming*`-prefixed counterpart in
|
|
121
|
+
* `parakeetConfig` (see `parakeetRuntimeConfigSchema`). The `streaming`
|
|
122
|
+
* prefix is intentionally dropped here because every field on this
|
|
123
|
+
* object is already namespaced under the `parakeetStreamingConfig`
|
|
124
|
+
* field of `transcribeStream({ ... })`. Any field omitted falls back
|
|
125
|
+
* to the load-time value.
|
|
126
|
+
*/
|
|
127
|
+
export declare const parakeetStreamingRunConfigSchema: z.ZodObject<{
|
|
128
|
+
chunkMs: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
historyMs: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
leftContextMs: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
rightLookaheadMs: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
emitPartials: z.ZodOptional<z.ZodBoolean>;
|
|
133
|
+
emitEnergyVad: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
+
spkCacheEnable: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
spkCacheLen: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
fifoLen: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
chunkLeftContextMs: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
chunkRightContextMs: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
spkCacheUpdatePeriod: z.ZodOptional<z.ZodNumber>;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
export type ParakeetStreamingRunConfig = z.infer<typeof parakeetStreamingRunConfigSchema>;
|
|
89
142
|
export declare const transcribeStreamRequestSchema: z.ZodObject<{
|
|
90
143
|
modelId: z.ZodString;
|
|
91
144
|
prompt: z.ZodOptional<z.ZodString>;
|
|
92
145
|
metadata: z.ZodOptional<z.ZodBoolean>;
|
|
93
146
|
type: z.ZodLiteral<"transcribeStream">;
|
|
147
|
+
emitVadEvents: z.ZodOptional<z.ZodBoolean>;
|
|
148
|
+
endOfTurnSilenceMs: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
vadRunIntervalMs: z.ZodOptional<z.ZodNumber>;
|
|
150
|
+
parakeetStreamingConfig: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
chunkMs: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
historyMs: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
leftContextMs: z.ZodOptional<z.ZodNumber>;
|
|
154
|
+
rightLookaheadMs: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
emitPartials: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
+
emitEnergyVad: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
+
spkCacheEnable: z.ZodOptional<z.ZodBoolean>;
|
|
158
|
+
spkCacheLen: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
fifoLen: z.ZodOptional<z.ZodNumber>;
|
|
160
|
+
chunkLeftContextMs: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
chunkRightContextMs: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
spkCacheUpdatePeriod: z.ZodOptional<z.ZodNumber>;
|
|
163
|
+
}, z.core.$strip>>;
|
|
164
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
94
165
|
}, z.core.$strip>;
|
|
95
166
|
export declare const transcribeStreamResponseSchema: z.ZodObject<{
|
|
96
167
|
text: z.ZodOptional<z.ZodString>;
|
|
@@ -115,6 +186,16 @@ export declare const transcribeStreamResponseSchema: z.ZodObject<{
|
|
|
115
186
|
append: z.ZodBoolean;
|
|
116
187
|
id: z.ZodNumber;
|
|
117
188
|
}, z.core.$strip>>;
|
|
189
|
+
vad: z.ZodOptional<z.ZodObject<{
|
|
190
|
+
speaking: z.ZodBoolean;
|
|
191
|
+
probability: z.ZodNumber;
|
|
192
|
+
}, z.core.$strip>>;
|
|
193
|
+
endOfTurn: z.ZodOptional<z.ZodPreprocess<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
194
|
+
source: z.ZodLiteral<"whisper">;
|
|
195
|
+
silenceDurationMs: z.ZodNumber;
|
|
196
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
197
|
+
source: z.ZodLiteral<"parakeet">;
|
|
198
|
+
}, z.core.$strip>], "source">>>;
|
|
118
199
|
type: z.ZodLiteral<"transcribeStream">;
|
|
119
200
|
}, z.core.$strip>;
|
|
120
201
|
export type TranscribeStreamRequest = z.infer<typeof transcribeStreamRequestSchema>;
|
|
@@ -123,18 +204,43 @@ export type TranscribeStreamClientParams = {
|
|
|
123
204
|
modelId: string;
|
|
124
205
|
prompt?: string;
|
|
125
206
|
metadata?: boolean;
|
|
207
|
+
emitVadEvents?: boolean;
|
|
208
|
+
endOfTurnSilenceMs?: number;
|
|
209
|
+
vadRunIntervalMs?: number;
|
|
210
|
+
parakeetStreamingConfig?: ParakeetStreamingRunConfig;
|
|
126
211
|
};
|
|
127
212
|
export interface TranscribeStreamSession {
|
|
128
|
-
write(audioChunk:
|
|
213
|
+
write(audioChunk: Uint8Array): void;
|
|
129
214
|
end(): void;
|
|
130
215
|
destroy(): void;
|
|
131
216
|
[Symbol.asyncIterator](): AsyncIterator<string>;
|
|
132
217
|
}
|
|
133
218
|
export interface TranscribeStreamMetadataSession {
|
|
134
|
-
write(audioChunk:
|
|
219
|
+
write(audioChunk: Uint8Array): void;
|
|
135
220
|
end(): void;
|
|
136
221
|
destroy(): void;
|
|
137
222
|
[Symbol.asyncIterator](): AsyncIterator<TranscribeSegment>;
|
|
138
223
|
}
|
|
224
|
+
export type VadStateEvent = z.infer<typeof vadStateEventSchema>;
|
|
225
|
+
export type WhisperEndOfTurnEvent = z.infer<typeof whisperEndOfTurnEventSchema>;
|
|
226
|
+
export type ParakeetEndOfTurnEvent = z.infer<typeof parakeetEndOfTurnEventSchema>;
|
|
227
|
+
export type EndOfTurnEvent = z.infer<typeof endOfTurnEventSchema>;
|
|
228
|
+
export type TranscribeStreamEvent = {
|
|
229
|
+
type: "text";
|
|
230
|
+
text: string;
|
|
231
|
+
} | {
|
|
232
|
+
type: "segment";
|
|
233
|
+
segment: TranscribeSegment;
|
|
234
|
+
} | ({
|
|
235
|
+
type: "vad";
|
|
236
|
+
} & VadStateEvent) | ({
|
|
237
|
+
type: "endOfTurn";
|
|
238
|
+
} & EndOfTurnEvent);
|
|
239
|
+
export interface TranscribeStreamConversationSession {
|
|
240
|
+
write(audioChunk: Uint8Array): void;
|
|
241
|
+
end(): void;
|
|
242
|
+
destroy(): void;
|
|
243
|
+
[Symbol.asyncIterator](): AsyncIterator<TranscribeStreamEvent>;
|
|
244
|
+
}
|
|
139
245
|
export type TranscribeStats = z.infer<typeof transcribeStatsSchema>;
|
|
140
246
|
//# sourceMappingURL=transcription.d.ts.map
|