@qvac/sdk 0.8.3 → 0.9.1
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 +267 -63
- package/README.md +1 -1
- package/dist/client/api/diffusion.d.ts +32 -0
- package/dist/client/api/diffusion.js +103 -0
- package/dist/client/api/embed.d.ts +9 -3
- package/dist/client/api/embed.js +4 -1
- package/dist/client/api/finetune.d.ts +69 -0
- package/dist/client/api/finetune.js +139 -0
- package/dist/client/api/get-model-info.d.ts +1 -1
- package/dist/client/api/index.d.ts +4 -0
- package/dist/client/api/index.js +4 -0
- package/dist/client/api/rag.d.ts +1 -1
- package/dist/client/api/rag.js +1 -1
- package/dist/client/api/resume.d.ts +14 -0
- package/dist/client/api/resume.js +20 -0
- package/dist/client/api/suspend.d.ts +13 -0
- package/dist/client/api/suspend.js +19 -0
- package/dist/client/api/transcribe.d.ts +25 -17
- package/dist/client/api/transcribe.js +115 -35
- package/dist/client/rpc/bare-client.d.ts +5 -1
- package/dist/client/rpc/bare-client.js +70 -57
- package/dist/client/rpc/expo-rpc-client.d.ts +4 -0
- package/dist/client/rpc/expo-rpc-client.js +8 -0
- package/dist/client/rpc/node-rpc-client.d.ts +4 -0
- package/dist/client/rpc/node-rpc-client.js +8 -0
- package/dist/client/rpc/rpc-client.d.ts +13 -0
- package/dist/client/rpc/rpc-client.js +131 -1
- package/dist/examples/delegated-inference/composite.d.ts +2 -0
- package/dist/examples/delegated-inference/composite.js +99 -0
- package/dist/examples/diffusion-flux2-klein.d.ts +2 -0
- package/dist/examples/diffusion-flux2-klein.js +46 -0
- package/dist/examples/diffusion-simple.d.ts +2 -0
- package/dist/examples/diffusion-simple.js +17 -0
- package/dist/examples/diffusion-txt2img.d.ts +2 -0
- package/dist/examples/diffusion-txt2img.js +40 -0
- package/dist/examples/embed-p2p.js +2 -2
- package/dist/examples/finetune/llamacpp-finetune.d.ts +2 -0
- package/dist/examples/finetune/llamacpp-finetune.js +78 -0
- package/dist/examples/logging-streaming.js +1 -1
- package/dist/examples/mcp-websearch.js +2 -0
- package/dist/examples/ocr-fasttext.js +11 -0
- package/dist/examples/profiling/per-call.js +3 -3
- package/dist/examples/rag/rag-chromadb.js +2 -2
- package/dist/examples/rag/rag-hyperdb/pipeline.js +1 -1
- package/dist/examples/rag/rag-lancedb.js +2 -2
- package/dist/examples/rag/rag-sqlite.js +2 -2
- package/dist/examples/suspend-resume.d.ts +2 -0
- package/dist/examples/suspend-resume.js +52 -0
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +3 -5
- package/dist/examples/transcription/parakeet-microphone-record.js +42 -33
- package/dist/examples/transcription/parakeet-sortformer.js +13 -3
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +5 -7
- package/dist/examples/transcription/whispercpp-filesystem-streaming.d.ts +2 -0
- package/dist/examples/transcription/whispercpp-filesystem-streaming.js +99 -0
- package/dist/examples/transcription/whispercpp-microphone-record.js +78 -299
- package/dist/examples/transcription/whispercpp-prompt.js +11 -0
- package/dist/examples/translation/translation-llm.js +2 -2
- package/dist/examples/tts/supertonic-multilingual.d.ts +2 -0
- package/dist/examples/tts/supertonic-multilingual.js +56 -0
- package/dist/examples/tts/supertonic.js +12 -7
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/logging/utils.js +1 -1
- package/dist/models/registry/models.d.ts +15176 -4264
- package/dist/models/registry/models.js +18657 -7404
- package/dist/models/update-models/codegen.js +2 -2
- package/dist/models/update-models/naming.js +26 -0
- package/dist/pear/pre.js +2 -0
- package/dist/polyfills/bare-globals.d.ts +2 -0
- package/dist/polyfills/bare-globals.js +4 -0
- package/dist/polyfills/bare-globals.noop.d.ts +2 -0
- package/dist/polyfills/bare-globals.noop.js +1 -0
- package/dist/profiling/exporters.js +16 -11
- package/dist/profiling/model-execution.d.ts +16 -0
- package/dist/profiling/model-execution.js +33 -0
- package/dist/schemas/common.d.ts +967 -198
- package/dist/schemas/common.js +16 -1
- package/dist/schemas/completion-stream.d.ts +14 -6
- package/dist/schemas/completion-stream.js +4 -3
- package/dist/schemas/download-asset.d.ts +7 -3
- package/dist/schemas/embed.d.ts +19 -0
- package/dist/schemas/embed.js +7 -0
- package/dist/schemas/engine-addon-map.js +4 -1
- package/dist/schemas/finetune.d.ts +620 -0
- package/dist/schemas/finetune.js +161 -0
- package/dist/schemas/get-model-info.d.ts +2 -0
- package/dist/schemas/get-model-info.js +1 -0
- package/dist/schemas/index.d.ts +5 -1
- package/dist/schemas/index.js +5 -1
- package/dist/schemas/llamacpp-config.d.ts +26 -6
- package/dist/schemas/llamacpp-config.js +12 -0
- package/dist/schemas/load-model.d.ts +4005 -1400
- package/dist/schemas/load-model.js +34 -1
- package/dist/schemas/model-src-utils.d.ts +10 -2
- package/dist/schemas/model-types.d.ts +19 -1
- package/dist/schemas/model-types.js +11 -0
- package/dist/schemas/ocr.d.ts +2 -0
- package/dist/schemas/plugin.d.ts +24 -3
- package/dist/schemas/plugin.js +14 -0
- package/dist/schemas/profiling.d.ts +4 -0
- package/dist/schemas/profiling.js +4 -0
- package/dist/schemas/registry.d.ts +18 -0
- package/dist/schemas/registry.js +2 -0
- package/dist/schemas/reload-config.d.ts +9 -1
- package/dist/schemas/resume.d.ts +10 -0
- package/dist/schemas/resume.js +7 -0
- package/dist/schemas/sdcpp-config.d.ts +327 -0
- package/dist/schemas/sdcpp-config.js +102 -0
- package/dist/schemas/sdk-config.d.ts +1225 -235
- package/dist/schemas/sdk-config.js +4 -0
- package/dist/schemas/sdk-errors-server.d.ts +2 -0
- package/dist/schemas/sdk-errors-server.js +12 -0
- package/dist/schemas/suspend.d.ts +10 -0
- package/dist/schemas/suspend.js +7 -0
- package/dist/schemas/text-to-speech.d.ts +187 -10
- package/dist/schemas/text-to-speech.js +12 -4
- package/dist/schemas/transcription-config.d.ts +16 -56
- package/dist/schemas/transcription-config.js +0 -2
- package/dist/schemas/transcription.d.ts +66 -6
- package/dist/schemas/transcription.js +29 -7
- package/dist/schemas/translate.d.ts +14 -4
- package/dist/schemas/translate.js +10 -2
- package/dist/schemas/translation-config.d.ts +30 -10
- package/dist/server/bare/delegate-rpc-client.js +3 -3
- package/dist/server/bare/hyperswarm.js +15 -3
- package/dist/server/bare/ops/embed.d.ts +8 -4
- package/dist/server/bare/ops/embed.js +15 -4
- package/dist/server/bare/ops/transcribe.d.ts +6 -2
- package/dist/server/bare/ops/transcribe.js +53 -1
- package/dist/server/bare/ops/translate.d.ts +4 -1
- package/dist/server/bare/ops/translate.js +28 -65
- package/dist/server/bare/ops/unload-model.js +2 -0
- package/dist/server/bare/plugins/index.d.ts +1 -0
- package/dist/server/bare/plugins/index.js +1 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +3 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +45 -9
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.d.ts +11 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +112 -0
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +175 -5
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +45 -35
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +11 -1
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +9 -4
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +17 -2
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +16 -15
- package/dist/server/bare/plugins/onnx-ocr/ops/ocr-stream.d.ts +5 -7
- package/dist/server/bare/plugins/onnx-ocr/ops/ocr-stream.js +11 -3
- package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +2 -0
- package/dist/server/bare/plugins/onnx-ocr/plugin.js +24 -19
- package/dist/server/bare/plugins/onnx-tts/ops/text-to-speech.d.ts +7 -2
- package/dist/server/bare/plugins/onnx-tts/ops/text-to-speech.js +22 -97
- package/dist/server/bare/plugins/onnx-tts/plugin.d.ts +98 -9
- package/dist/server/bare/plugins/onnx-tts/plugin.js +85 -46
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +30 -60
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +49 -37
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.d.ts +3 -0
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +51 -0
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +278 -0
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +70 -0
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +38 -2
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +43 -22
- package/dist/server/bare/rag-hyperdb/handlers/ingest.js +2 -1
- package/dist/server/bare/rag-hyperdb/handlers/search.js +2 -1
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +7 -0
- package/dist/server/bare/registry/model-config-utils.js +3 -0
- package/dist/server/bare/registry/model-registry.d.ts +2 -2
- package/dist/server/bare/registry/model-registry.js +1 -1
- package/dist/server/bare/registry/registry-client.js +21 -0
- package/dist/server/bare/runtime-lifecycle.d.ts +28 -0
- package/dist/server/bare/runtime-lifecycle.js +132 -0
- package/dist/server/bare/types/addon-responses.d.ts +62 -0
- package/dist/server/bare/types/addon-responses.js +1 -0
- package/dist/server/env.js +3 -1
- package/dist/server/rpc/delegate-transport.js +1 -1
- package/dist/server/rpc/handle-request.js +50 -4
- package/dist/server/rpc/handler-registry.js +20 -1
- package/dist/server/rpc/handler-utils.d.ts +5 -3
- package/dist/server/rpc/handler-utils.js +52 -50
- package/dist/server/rpc/handlers/delete-cache.js +3 -0
- package/dist/server/rpc/handlers/diffusion-stream.d.ts +3 -0
- package/dist/server/rpc/handlers/diffusion-stream.js +4 -0
- package/dist/server/rpc/handlers/finetune.d.ts +3 -0
- package/dist/server/rpc/handlers/finetune.js +16 -0
- package/dist/server/rpc/handlers/index.d.ts +10 -0
- package/dist/server/rpc/handlers/index.js +10 -0
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +24 -9
- package/dist/server/rpc/handlers/load-model/registry.d.ts +11 -0
- package/dist/server/rpc/handlers/load-model/registry.js +31 -4
- package/dist/server/rpc/handlers/plugin-dispatch.d.ts +1 -13
- package/dist/server/rpc/handlers/plugin-dispatch.js +21 -21
- package/dist/server/rpc/handlers/resume.d.ts +3 -0
- package/dist/server/rpc/handlers/resume.js +11 -0
- package/dist/server/rpc/handlers/suspend.d.ts +3 -0
- package/dist/server/rpc/handlers/suspend.js +11 -0
- 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 +3 -0
- package/dist/server/rpc/handlers/transcribe.js +4 -0
- package/dist/server/rpc/profiling/operation-metrics.js +107 -16
- package/dist/server/rpc/profiling/operation-wrappers.d.ts +1 -1
- package/dist/server/rpc/profiling/operation-wrappers.js +51 -19
- package/dist/server/rpc/progress-throttle.d.ts +8 -0
- package/dist/server/rpc/progress-throttle.js +47 -0
- package/dist/server/rpc/rpc-utils.d.ts +5 -0
- package/dist/server/rpc/rpc-utils.js +11 -0
- package/dist/server/utils/path-security.js +1 -1
- package/dist/server/utils/tool-integration.js +10 -0
- package/dist/server/utils/tool-parser.js +9 -5
- package/dist/server/worker-core.d.ts +2 -0
- package/dist/server/worker-core.js +26 -23
- package/dist/server/worker.js +2 -1
- package/dist/utils/encoding.d.ts +9 -0
- package/dist/utils/encoding.js +14 -0
- package/dist/utils/errors-server.d.ts +6 -0
- package/dist/utils/errors-server.js +11 -0
- package/package.json +36 -25
- package/dist/server/rpc/delegate-utils.d.ts +0 -2
- package/dist/server/rpc/delegate-utils.js +0 -5
|
@@ -30,6 +30,7 @@ export declare const ttsPlugin: {
|
|
|
30
30
|
"onnx-tts": "onnx-tts";
|
|
31
31
|
"parakeet-transcription": "parakeet-transcription";
|
|
32
32
|
"onnx-ocr": "onnx-ocr";
|
|
33
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
33
34
|
llm: "llm";
|
|
34
35
|
whisper: "whisper";
|
|
35
36
|
embeddings: "embeddings";
|
|
@@ -37,6 +38,7 @@ export declare const ttsPlugin: {
|
|
|
37
38
|
parakeet: "parakeet";
|
|
38
39
|
tts: "tts";
|
|
39
40
|
ocr: "ocr";
|
|
41
|
+
diffusion: "diffusion";
|
|
40
42
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
41
43
|
}, import("zod/v4/core").$strip>]>;
|
|
42
44
|
ttsSpeechEncoderSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
@@ -58,6 +60,7 @@ export declare const ttsPlugin: {
|
|
|
58
60
|
"onnx-tts": "onnx-tts";
|
|
59
61
|
"parakeet-transcription": "parakeet-transcription";
|
|
60
62
|
"onnx-ocr": "onnx-ocr";
|
|
63
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
61
64
|
llm: "llm";
|
|
62
65
|
whisper: "whisper";
|
|
63
66
|
embeddings: "embeddings";
|
|
@@ -65,6 +68,7 @@ export declare const ttsPlugin: {
|
|
|
65
68
|
parakeet: "parakeet";
|
|
66
69
|
tts: "tts";
|
|
67
70
|
ocr: "ocr";
|
|
71
|
+
diffusion: "diffusion";
|
|
68
72
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
69
73
|
}, import("zod/v4/core").$strip>]>;
|
|
70
74
|
ttsEmbedTokensSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
@@ -86,6 +90,7 @@ export declare const ttsPlugin: {
|
|
|
86
90
|
"onnx-tts": "onnx-tts";
|
|
87
91
|
"parakeet-transcription": "parakeet-transcription";
|
|
88
92
|
"onnx-ocr": "onnx-ocr";
|
|
93
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
89
94
|
llm: "llm";
|
|
90
95
|
whisper: "whisper";
|
|
91
96
|
embeddings: "embeddings";
|
|
@@ -93,6 +98,7 @@ export declare const ttsPlugin: {
|
|
|
93
98
|
parakeet: "parakeet";
|
|
94
99
|
tts: "tts";
|
|
95
100
|
ocr: "ocr";
|
|
101
|
+
diffusion: "diffusion";
|
|
96
102
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
97
103
|
}, import("zod/v4/core").$strip>]>;
|
|
98
104
|
ttsConditionalDecoderSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
@@ -114,6 +120,7 @@ export declare const ttsPlugin: {
|
|
|
114
120
|
"onnx-tts": "onnx-tts";
|
|
115
121
|
"parakeet-transcription": "parakeet-transcription";
|
|
116
122
|
"onnx-ocr": "onnx-ocr";
|
|
123
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
117
124
|
llm: "llm";
|
|
118
125
|
whisper: "whisper";
|
|
119
126
|
embeddings: "embeddings";
|
|
@@ -121,6 +128,7 @@ export declare const ttsPlugin: {
|
|
|
121
128
|
parakeet: "parakeet";
|
|
122
129
|
tts: "tts";
|
|
123
130
|
ocr: "ocr";
|
|
131
|
+
diffusion: "diffusion";
|
|
124
132
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
125
133
|
}, import("zod/v4/core").$strip>]>;
|
|
126
134
|
ttsLanguageModelSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
@@ -142,6 +150,7 @@ export declare const ttsPlugin: {
|
|
|
142
150
|
"onnx-tts": "onnx-tts";
|
|
143
151
|
"parakeet-transcription": "parakeet-transcription";
|
|
144
152
|
"onnx-ocr": "onnx-ocr";
|
|
153
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
145
154
|
llm: "llm";
|
|
146
155
|
whisper: "whisper";
|
|
147
156
|
embeddings: "embeddings";
|
|
@@ -149,6 +158,7 @@ export declare const ttsPlugin: {
|
|
|
149
158
|
parakeet: "parakeet";
|
|
150
159
|
tts: "tts";
|
|
151
160
|
ocr: "ocr";
|
|
161
|
+
diffusion: "diffusion";
|
|
152
162
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
153
163
|
}, import("zod/v4/core").$strip>]>;
|
|
154
164
|
referenceAudioSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
@@ -170,6 +180,7 @@ export declare const ttsPlugin: {
|
|
|
170
180
|
"onnx-tts": "onnx-tts";
|
|
171
181
|
"parakeet-transcription": "parakeet-transcription";
|
|
172
182
|
"onnx-ocr": "onnx-ocr";
|
|
183
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
173
184
|
llm: "llm";
|
|
174
185
|
whisper: "whisper";
|
|
175
186
|
embeddings: "embeddings";
|
|
@@ -177,6 +188,7 @@ export declare const ttsPlugin: {
|
|
|
177
188
|
parakeet: "parakeet";
|
|
178
189
|
tts: "tts";
|
|
179
190
|
ocr: "ocr";
|
|
191
|
+
diffusion: "diffusion";
|
|
180
192
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
181
193
|
}, import("zod/v4/core").$strip>]>;
|
|
182
194
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
@@ -189,7 +201,8 @@ export declare const ttsPlugin: {
|
|
|
189
201
|
}>;
|
|
190
202
|
ttsSpeed: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
191
203
|
ttsNumInferenceSteps: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
192
|
-
|
|
204
|
+
ttsSupertonicMultilingual: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
205
|
+
ttsTextEncoderSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
193
206
|
src: import("zod").ZodString;
|
|
194
207
|
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
195
208
|
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -208,6 +221,7 @@ export declare const ttsPlugin: {
|
|
|
208
221
|
"onnx-tts": "onnx-tts";
|
|
209
222
|
"parakeet-transcription": "parakeet-transcription";
|
|
210
223
|
"onnx-ocr": "onnx-ocr";
|
|
224
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
211
225
|
llm: "llm";
|
|
212
226
|
whisper: "whisper";
|
|
213
227
|
embeddings: "embeddings";
|
|
@@ -215,9 +229,40 @@ export declare const ttsPlugin: {
|
|
|
215
229
|
parakeet: "parakeet";
|
|
216
230
|
tts: "tts";
|
|
217
231
|
ocr: "ocr";
|
|
232
|
+
diffusion: "diffusion";
|
|
218
233
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
219
234
|
}, import("zod/v4/core").$strip>]>;
|
|
220
|
-
|
|
235
|
+
ttsDurationPredictorSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
236
|
+
src: import("zod").ZodString;
|
|
237
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
238
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
239
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
240
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
241
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
242
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
243
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
244
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
245
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
246
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
247
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
248
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
249
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
250
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
251
|
+
"onnx-tts": "onnx-tts";
|
|
252
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
253
|
+
"onnx-ocr": "onnx-ocr";
|
|
254
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
255
|
+
llm: "llm";
|
|
256
|
+
whisper: "whisper";
|
|
257
|
+
embeddings: "embeddings";
|
|
258
|
+
nmt: "nmt";
|
|
259
|
+
parakeet: "parakeet";
|
|
260
|
+
tts: "tts";
|
|
261
|
+
ocr: "ocr";
|
|
262
|
+
diffusion: "diffusion";
|
|
263
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
264
|
+
}, import("zod/v4/core").$strip>]>;
|
|
265
|
+
ttsVectorEstimatorSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
221
266
|
src: import("zod").ZodString;
|
|
222
267
|
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
223
268
|
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -236,6 +281,7 @@ export declare const ttsPlugin: {
|
|
|
236
281
|
"onnx-tts": "onnx-tts";
|
|
237
282
|
"parakeet-transcription": "parakeet-transcription";
|
|
238
283
|
"onnx-ocr": "onnx-ocr";
|
|
284
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
239
285
|
llm: "llm";
|
|
240
286
|
whisper: "whisper";
|
|
241
287
|
embeddings: "embeddings";
|
|
@@ -243,9 +289,10 @@ export declare const ttsPlugin: {
|
|
|
243
289
|
parakeet: "parakeet";
|
|
244
290
|
tts: "tts";
|
|
245
291
|
ocr: "ocr";
|
|
292
|
+
diffusion: "diffusion";
|
|
246
293
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
247
294
|
}, import("zod/v4/core").$strip>]>;
|
|
248
|
-
|
|
295
|
+
ttsVocoderSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
249
296
|
src: import("zod").ZodString;
|
|
250
297
|
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
251
298
|
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -264,6 +311,7 @@ export declare const ttsPlugin: {
|
|
|
264
311
|
"onnx-tts": "onnx-tts";
|
|
265
312
|
"parakeet-transcription": "parakeet-transcription";
|
|
266
313
|
"onnx-ocr": "onnx-ocr";
|
|
314
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
267
315
|
llm: "llm";
|
|
268
316
|
whisper: "whisper";
|
|
269
317
|
embeddings: "embeddings";
|
|
@@ -271,9 +319,10 @@ export declare const ttsPlugin: {
|
|
|
271
319
|
parakeet: "parakeet";
|
|
272
320
|
tts: "tts";
|
|
273
321
|
ocr: "ocr";
|
|
322
|
+
diffusion: "diffusion";
|
|
274
323
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
275
324
|
}, import("zod/v4/core").$strip>]>;
|
|
276
|
-
|
|
325
|
+
ttsUnicodeIndexerSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
277
326
|
src: import("zod").ZodString;
|
|
278
327
|
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
279
328
|
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -292,6 +341,7 @@ export declare const ttsPlugin: {
|
|
|
292
341
|
"onnx-tts": "onnx-tts";
|
|
293
342
|
"parakeet-transcription": "parakeet-transcription";
|
|
294
343
|
"onnx-ocr": "onnx-ocr";
|
|
344
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
295
345
|
llm: "llm";
|
|
296
346
|
whisper: "whisper";
|
|
297
347
|
embeddings: "embeddings";
|
|
@@ -299,9 +349,10 @@ export declare const ttsPlugin: {
|
|
|
299
349
|
parakeet: "parakeet";
|
|
300
350
|
tts: "tts";
|
|
301
351
|
ocr: "ocr";
|
|
352
|
+
diffusion: "diffusion";
|
|
302
353
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
303
354
|
}, import("zod/v4/core").$strip>]>;
|
|
304
|
-
|
|
355
|
+
ttsTtsConfigSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
305
356
|
src: import("zod").ZodString;
|
|
306
357
|
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
307
358
|
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -320,6 +371,7 @@ export declare const ttsPlugin: {
|
|
|
320
371
|
"onnx-tts": "onnx-tts";
|
|
321
372
|
"parakeet-transcription": "parakeet-transcription";
|
|
322
373
|
"onnx-ocr": "onnx-ocr";
|
|
374
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
323
375
|
llm: "llm";
|
|
324
376
|
whisper: "whisper";
|
|
325
377
|
embeddings: "embeddings";
|
|
@@ -327,6 +379,37 @@ export declare const ttsPlugin: {
|
|
|
327
379
|
parakeet: "parakeet";
|
|
328
380
|
tts: "tts";
|
|
329
381
|
ocr: "ocr";
|
|
382
|
+
diffusion: "diffusion";
|
|
383
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
384
|
+
}, import("zod/v4/core").$strip>]>;
|
|
385
|
+
ttsVoiceStyleSrc: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
386
|
+
src: import("zod").ZodString;
|
|
387
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
388
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
389
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
390
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
391
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
392
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
393
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
394
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
395
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
396
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
397
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
398
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
399
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
400
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
401
|
+
"onnx-tts": "onnx-tts";
|
|
402
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
403
|
+
"onnx-ocr": "onnx-ocr";
|
|
404
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
405
|
+
llm: "llm";
|
|
406
|
+
whisper: "whisper";
|
|
407
|
+
embeddings: "embeddings";
|
|
408
|
+
nmt: "nmt";
|
|
409
|
+
parakeet: "parakeet";
|
|
410
|
+
tts: "tts";
|
|
411
|
+
ocr: "ocr";
|
|
412
|
+
diffusion: "diffusion";
|
|
330
413
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
331
414
|
}, import("zod/v4/core").$strip>]>;
|
|
332
415
|
}, import("zod/v4/core").$strip>]>;
|
|
@@ -344,11 +427,13 @@ export declare const ttsPlugin: {
|
|
|
344
427
|
} | {
|
|
345
428
|
config: TtsSupertonicRuntimeConfig;
|
|
346
429
|
artifacts: {
|
|
347
|
-
tokenizerPath: string;
|
|
348
430
|
textEncoderPath: string;
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
431
|
+
durationPredictorPath: string;
|
|
432
|
+
vectorEstimatorPath: string;
|
|
433
|
+
vocoderPath: string;
|
|
434
|
+
unicodeIndexerPath: string;
|
|
435
|
+
ttsConfigPath: string;
|
|
436
|
+
voiceStylePath: string;
|
|
352
437
|
};
|
|
353
438
|
}>;
|
|
354
439
|
createModel(params: CreateModelParams): PluginModelResult;
|
|
@@ -363,6 +448,10 @@ export declare const ttsPlugin: {
|
|
|
363
448
|
type: import("zod").ZodLiteral<"textToSpeech">;
|
|
364
449
|
buffer: import("zod").ZodArray<import("zod").ZodNumber>;
|
|
365
450
|
done: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
451
|
+
stats: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
452
|
+
audioDuration: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
453
|
+
totalSamples: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
454
|
+
}, import("zod/v4/core").$strip>>;
|
|
366
455
|
}, import("zod/v4/core").$strip>>;
|
|
367
456
|
};
|
|
368
457
|
logging: {
|
|
@@ -5,6 +5,7 @@ import { definePlugin, defineHandler, ttsRequestSchema, ttsResponseSchema, Model
|
|
|
5
5
|
import { createStreamLogger, registerAddonLogger } from "../../../../logging/index.js";
|
|
6
6
|
import { TtsArtifactsRequiredError, TtsReferenceAudioRequiredError, } from "../../../../utils/errors-server.js";
|
|
7
7
|
import { textToSpeech } from "./ops/text-to-speech.js";
|
|
8
|
+
import { attachModelExecutionMs } from "../../../../profiling/model-execution.js";
|
|
8
9
|
import { loadReferenceAudioAt24k } from "./wav-helper.js";
|
|
9
10
|
async function resolveChatterboxConfig(config, ctx) {
|
|
10
11
|
const { ttsTokenizerSrc, ttsSpeechEncoderSrc, ttsEmbedTokensSrc, ttsConditionalDecoderSrc, ttsLanguageModelSrc, referenceAudioSrc, language, } = config;
|
|
@@ -43,21 +44,25 @@ async function resolveChatterboxConfig(config, ctx) {
|
|
|
43
44
|
};
|
|
44
45
|
}
|
|
45
46
|
async function resolveSupertonicConfig(config, ctx) {
|
|
46
|
-
const {
|
|
47
|
-
if (!
|
|
48
|
-
!
|
|
49
|
-
!
|
|
50
|
-
!
|
|
51
|
-
!
|
|
47
|
+
const { ttsTextEncoderSrc, ttsDurationPredictorSrc, ttsVectorEstimatorSrc, ttsVocoderSrc, ttsUnicodeIndexerSrc, ttsTtsConfigSrc, ttsVoiceStyleSrc, ttsSpeed, ttsNumInferenceSteps, ttsSupertonicMultilingual, language, } = config;
|
|
48
|
+
if (!ttsTextEncoderSrc ||
|
|
49
|
+
!ttsDurationPredictorSrc ||
|
|
50
|
+
!ttsVectorEstimatorSrc ||
|
|
51
|
+
!ttsVocoderSrc ||
|
|
52
|
+
!ttsUnicodeIndexerSrc ||
|
|
53
|
+
!ttsTtsConfigSrc ||
|
|
54
|
+
!ttsVoiceStyleSrc) {
|
|
52
55
|
throw new TtsArtifactsRequiredError();
|
|
53
56
|
}
|
|
54
57
|
const resolve = ctx.resolveModelPath;
|
|
55
|
-
const [
|
|
56
|
-
resolve(ttsTokenizerSrc),
|
|
58
|
+
const [textEncoderPath, durationPredictorPath, vectorEstimatorPath, vocoderPath, unicodeIndexerPath, ttsConfigPath, voiceStylePath,] = await Promise.all([
|
|
57
59
|
resolve(ttsTextEncoderSrc),
|
|
58
|
-
resolve(
|
|
59
|
-
resolve(
|
|
60
|
-
resolve(
|
|
60
|
+
resolve(ttsDurationPredictorSrc),
|
|
61
|
+
resolve(ttsVectorEstimatorSrc),
|
|
62
|
+
resolve(ttsVocoderSrc),
|
|
63
|
+
resolve(ttsUnicodeIndexerSrc),
|
|
64
|
+
resolve(ttsTtsConfigSrc),
|
|
65
|
+
resolve(ttsVoiceStyleSrc),
|
|
61
66
|
]);
|
|
62
67
|
return {
|
|
63
68
|
config: {
|
|
@@ -65,13 +70,16 @@ async function resolveSupertonicConfig(config, ctx) {
|
|
|
65
70
|
language,
|
|
66
71
|
ttsSpeed,
|
|
67
72
|
ttsNumInferenceSteps,
|
|
73
|
+
ttsSupertonicMultilingual,
|
|
68
74
|
},
|
|
69
75
|
artifacts: {
|
|
70
|
-
tokenizerPath,
|
|
71
76
|
textEncoderPath,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
77
|
+
durationPredictorPath,
|
|
78
|
+
vectorEstimatorPath,
|
|
79
|
+
vocoderPath,
|
|
80
|
+
unicodeIndexerPath,
|
|
81
|
+
ttsConfigPath,
|
|
82
|
+
voiceStylePath,
|
|
75
83
|
},
|
|
76
84
|
};
|
|
77
85
|
}
|
|
@@ -95,51 +103,63 @@ function createChatterboxModel(modelId, config, artifacts) {
|
|
|
95
103
|
const logger = createStreamLogger(modelId, ModelType.onnxTts);
|
|
96
104
|
registerAddonLogger(modelId, ModelType.onnxTts, logger);
|
|
97
105
|
const referenceAudio = loadReferenceAudioAt24k(referenceAudioPath);
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
106
|
+
const model = new ONNXTTS({
|
|
107
|
+
files: {
|
|
108
|
+
tokenizerPath,
|
|
109
|
+
speechEncoderPath,
|
|
110
|
+
embedTokensPath,
|
|
111
|
+
conditionalDecoderPath,
|
|
112
|
+
languageModelPath,
|
|
113
|
+
},
|
|
114
|
+
engine: "chatterbox",
|
|
115
|
+
config: { language: config.language ?? "en", useGPU: false },
|
|
104
116
|
referenceAudio,
|
|
105
117
|
logger,
|
|
106
118
|
opts: { stats: true },
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const model = new ONNXTTS(args, modelConfig);
|
|
119
|
+
exclusiveRun: true,
|
|
120
|
+
});
|
|
110
121
|
return { model, loader: undefined };
|
|
111
122
|
}
|
|
112
123
|
function createSupertonicModel(modelId, config, artifacts) {
|
|
113
|
-
const tokenizerPath = artifacts["tokenizerPath"];
|
|
114
124
|
const textEncoderPath = artifacts["textEncoderPath"];
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
!
|
|
125
|
+
const durationPredictorPath = artifacts["durationPredictorPath"];
|
|
126
|
+
const vectorEstimatorPath = artifacts["vectorEstimatorPath"];
|
|
127
|
+
const vocoderPath = artifacts["vocoderPath"];
|
|
128
|
+
const unicodeIndexerPath = artifacts["unicodeIndexerPath"];
|
|
129
|
+
const ttsConfigPath = artifacts["ttsConfigPath"];
|
|
130
|
+
const voiceStylePath = artifacts["voiceStylePath"];
|
|
131
|
+
if (!textEncoderPath ||
|
|
132
|
+
!durationPredictorPath ||
|
|
133
|
+
!vectorEstimatorPath ||
|
|
134
|
+
!vocoderPath ||
|
|
135
|
+
!unicodeIndexerPath ||
|
|
136
|
+
!ttsConfigPath ||
|
|
137
|
+
!voiceStylePath) {
|
|
123
138
|
throw new TtsArtifactsRequiredError();
|
|
124
139
|
}
|
|
125
140
|
const logger = createStreamLogger(modelId, ModelType.onnxTts);
|
|
126
141
|
registerAddonLogger(modelId, ModelType.onnxTts, logger);
|
|
127
|
-
const
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
142
|
+
const voiceName = path.basename(voiceStylePath).replace(/\.json$/i, "") || "F1";
|
|
143
|
+
const model = new ONNXTTS({
|
|
144
|
+
files: {
|
|
145
|
+
textEncoderPath,
|
|
146
|
+
durationPredictorPath,
|
|
147
|
+
vectorEstimatorPath,
|
|
148
|
+
vocoderPath,
|
|
149
|
+
unicodeIndexerPath,
|
|
150
|
+
ttsConfigPath,
|
|
151
|
+
voiceStyleJsonPath: voiceStylePath,
|
|
152
|
+
},
|
|
153
|
+
engine: "supertonic",
|
|
135
154
|
voiceName,
|
|
136
155
|
speed: config.ttsSpeed ?? 1,
|
|
137
156
|
numInferenceSteps: config.ttsNumInferenceSteps ?? 5,
|
|
157
|
+
supertonicMultilingual: config.ttsSupertonicMultilingual !== false,
|
|
158
|
+
config: { language: config.language ?? "en" },
|
|
138
159
|
logger,
|
|
139
160
|
opts: { stats: true },
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
const model = new ONNXTTS(args, modelConfig);
|
|
161
|
+
exclusiveRun: true,
|
|
162
|
+
});
|
|
143
163
|
return { model, loader: undefined };
|
|
144
164
|
}
|
|
145
165
|
export const ttsPlugin = definePlugin({
|
|
@@ -169,8 +189,27 @@ export const ttsPlugin = definePlugin({
|
|
|
169
189
|
responseSchema: ttsResponseSchema,
|
|
170
190
|
streaming: true,
|
|
171
191
|
handler: async function* (request) {
|
|
172
|
-
|
|
173
|
-
|
|
192
|
+
const stream = textToSpeech(request);
|
|
193
|
+
try {
|
|
194
|
+
let result = await stream.next();
|
|
195
|
+
while (!result.done) {
|
|
196
|
+
yield {
|
|
197
|
+
type: "textToSpeech",
|
|
198
|
+
buffer: result.value.buffer,
|
|
199
|
+
done: false,
|
|
200
|
+
};
|
|
201
|
+
result = await stream.next();
|
|
202
|
+
}
|
|
203
|
+
const { modelExecutionMs, stats } = result.value;
|
|
204
|
+
yield attachModelExecutionMs({
|
|
205
|
+
type: "textToSpeech",
|
|
206
|
+
buffer: [],
|
|
207
|
+
done: true,
|
|
208
|
+
...(stats && { stats }),
|
|
209
|
+
}, modelExecutionMs);
|
|
210
|
+
}
|
|
211
|
+
finally {
|
|
212
|
+
await stream.return?.(undefined);
|
|
174
213
|
}
|
|
175
214
|
},
|
|
176
215
|
}),
|