@qvac/sdk 0.8.2 → 0.9.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 +267 -63
- package/README.md +2 -0
- 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/cache-logger.d.ts +1 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +3 -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 +57 -11
- 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 +81 -25
- package/dist/server/rpc/delegate-utils.d.ts +0 -2
- package/dist/server/rpc/delegate-utils.js +0 -5
|
@@ -52,6 +52,7 @@ export declare const parakeetPlugin: {
|
|
|
52
52
|
"onnx-tts": "onnx-tts";
|
|
53
53
|
"parakeet-transcription": "parakeet-transcription";
|
|
54
54
|
"onnx-ocr": "onnx-ocr";
|
|
55
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
55
56
|
llm: "llm";
|
|
56
57
|
whisper: "whisper";
|
|
57
58
|
embeddings: "embeddings";
|
|
@@ -59,34 +60,7 @@ export declare const parakeetPlugin: {
|
|
|
59
60
|
parakeet: "parakeet";
|
|
60
61
|
tts: "tts";
|
|
61
62
|
ocr: "ocr";
|
|
62
|
-
|
|
63
|
-
}, import("zod/v4/core").$strip>]>>;
|
|
64
|
-
parakeetEncoderDataSrc: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
65
|
-
src: import("zod").ZodString;
|
|
66
|
-
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
67
|
-
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
68
|
-
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
69
|
-
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
70
|
-
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
71
|
-
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
72
|
-
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
73
|
-
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
74
|
-
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
75
|
-
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
76
|
-
"llamacpp-completion": "llamacpp-completion";
|
|
77
|
-
"whispercpp-transcription": "whispercpp-transcription";
|
|
78
|
-
"llamacpp-embedding": "llamacpp-embedding";
|
|
79
|
-
"nmtcpp-translation": "nmtcpp-translation";
|
|
80
|
-
"onnx-tts": "onnx-tts";
|
|
81
|
-
"parakeet-transcription": "parakeet-transcription";
|
|
82
|
-
"onnx-ocr": "onnx-ocr";
|
|
83
|
-
llm: "llm";
|
|
84
|
-
whisper: "whisper";
|
|
85
|
-
embeddings: "embeddings";
|
|
86
|
-
nmt: "nmt";
|
|
87
|
-
parakeet: "parakeet";
|
|
88
|
-
tts: "tts";
|
|
89
|
-
ocr: "ocr";
|
|
63
|
+
diffusion: "diffusion";
|
|
90
64
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
91
65
|
}, import("zod/v4/core").$strip>]>>;
|
|
92
66
|
parakeetDecoderSrc: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
@@ -108,6 +82,7 @@ export declare const parakeetPlugin: {
|
|
|
108
82
|
"onnx-tts": "onnx-tts";
|
|
109
83
|
"parakeet-transcription": "parakeet-transcription";
|
|
110
84
|
"onnx-ocr": "onnx-ocr";
|
|
85
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
111
86
|
llm: "llm";
|
|
112
87
|
whisper: "whisper";
|
|
113
88
|
embeddings: "embeddings";
|
|
@@ -115,6 +90,7 @@ export declare const parakeetPlugin: {
|
|
|
115
90
|
parakeet: "parakeet";
|
|
116
91
|
tts: "tts";
|
|
117
92
|
ocr: "ocr";
|
|
93
|
+
diffusion: "diffusion";
|
|
118
94
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
119
95
|
}, import("zod/v4/core").$strip>]>>;
|
|
120
96
|
parakeetVocabSrc: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
@@ -136,6 +112,7 @@ export declare const parakeetPlugin: {
|
|
|
136
112
|
"onnx-tts": "onnx-tts";
|
|
137
113
|
"parakeet-transcription": "parakeet-transcription";
|
|
138
114
|
"onnx-ocr": "onnx-ocr";
|
|
115
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
139
116
|
llm: "llm";
|
|
140
117
|
whisper: "whisper";
|
|
141
118
|
embeddings: "embeddings";
|
|
@@ -143,6 +120,7 @@ export declare const parakeetPlugin: {
|
|
|
143
120
|
parakeet: "parakeet";
|
|
144
121
|
tts: "tts";
|
|
145
122
|
ocr: "ocr";
|
|
123
|
+
diffusion: "diffusion";
|
|
146
124
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
147
125
|
}, import("zod/v4/core").$strip>]>>;
|
|
148
126
|
parakeetPreprocessorSrc: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
@@ -164,6 +142,7 @@ export declare const parakeetPlugin: {
|
|
|
164
142
|
"onnx-tts": "onnx-tts";
|
|
165
143
|
"parakeet-transcription": "parakeet-transcription";
|
|
166
144
|
"onnx-ocr": "onnx-ocr";
|
|
145
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
167
146
|
llm: "llm";
|
|
168
147
|
whisper: "whisper";
|
|
169
148
|
embeddings: "embeddings";
|
|
@@ -171,6 +150,7 @@ export declare const parakeetPlugin: {
|
|
|
171
150
|
parakeet: "parakeet";
|
|
172
151
|
tts: "tts";
|
|
173
152
|
ocr: "ocr";
|
|
153
|
+
diffusion: "diffusion";
|
|
174
154
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
175
155
|
}, import("zod/v4/core").$strip>]>>;
|
|
176
156
|
parakeetCtcModelSrc: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
@@ -192,6 +172,7 @@ export declare const parakeetPlugin: {
|
|
|
192
172
|
"onnx-tts": "onnx-tts";
|
|
193
173
|
"parakeet-transcription": "parakeet-transcription";
|
|
194
174
|
"onnx-ocr": "onnx-ocr";
|
|
175
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
195
176
|
llm: "llm";
|
|
196
177
|
whisper: "whisper";
|
|
197
178
|
embeddings: "embeddings";
|
|
@@ -199,34 +180,7 @@ export declare const parakeetPlugin: {
|
|
|
199
180
|
parakeet: "parakeet";
|
|
200
181
|
tts: "tts";
|
|
201
182
|
ocr: "ocr";
|
|
202
|
-
|
|
203
|
-
}, import("zod/v4/core").$strip>]>>;
|
|
204
|
-
parakeetCtcModelDataSrc: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
205
|
-
src: import("zod").ZodString;
|
|
206
|
-
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
207
|
-
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
208
|
-
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
209
|
-
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
210
|
-
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
211
|
-
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
212
|
-
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
213
|
-
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
214
|
-
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
215
|
-
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
216
|
-
"llamacpp-completion": "llamacpp-completion";
|
|
217
|
-
"whispercpp-transcription": "whispercpp-transcription";
|
|
218
|
-
"llamacpp-embedding": "llamacpp-embedding";
|
|
219
|
-
"nmtcpp-translation": "nmtcpp-translation";
|
|
220
|
-
"onnx-tts": "onnx-tts";
|
|
221
|
-
"parakeet-transcription": "parakeet-transcription";
|
|
222
|
-
"onnx-ocr": "onnx-ocr";
|
|
223
|
-
llm: "llm";
|
|
224
|
-
whisper: "whisper";
|
|
225
|
-
embeddings: "embeddings";
|
|
226
|
-
nmt: "nmt";
|
|
227
|
-
parakeet: "parakeet";
|
|
228
|
-
tts: "tts";
|
|
229
|
-
ocr: "ocr";
|
|
183
|
+
diffusion: "diffusion";
|
|
230
184
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
231
185
|
}, import("zod/v4/core").$strip>]>>;
|
|
232
186
|
parakeetTokenizerSrc: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
@@ -248,6 +202,7 @@ export declare const parakeetPlugin: {
|
|
|
248
202
|
"onnx-tts": "onnx-tts";
|
|
249
203
|
"parakeet-transcription": "parakeet-transcription";
|
|
250
204
|
"onnx-ocr": "onnx-ocr";
|
|
205
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
251
206
|
llm: "llm";
|
|
252
207
|
whisper: "whisper";
|
|
253
208
|
embeddings: "embeddings";
|
|
@@ -255,6 +210,7 @@ export declare const parakeetPlugin: {
|
|
|
255
210
|
parakeet: "parakeet";
|
|
256
211
|
tts: "tts";
|
|
257
212
|
ocr: "ocr";
|
|
213
|
+
diffusion: "diffusion";
|
|
258
214
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
259
215
|
}, import("zod/v4/core").$strip>]>>;
|
|
260
216
|
parakeetSortformerSrc: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
@@ -276,6 +232,7 @@ export declare const parakeetPlugin: {
|
|
|
276
232
|
"onnx-tts": "onnx-tts";
|
|
277
233
|
"parakeet-transcription": "parakeet-transcription";
|
|
278
234
|
"onnx-ocr": "onnx-ocr";
|
|
235
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
279
236
|
llm: "llm";
|
|
280
237
|
whisper: "whisper";
|
|
281
238
|
embeddings: "embeddings";
|
|
@@ -283,6 +240,7 @@ export declare const parakeetPlugin: {
|
|
|
283
240
|
parakeet: "parakeet";
|
|
284
241
|
tts: "tts";
|
|
285
242
|
ocr: "ocr";
|
|
243
|
+
diffusion: "diffusion";
|
|
286
244
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
287
245
|
}, import("zod/v4/core").$strip>]>>;
|
|
288
246
|
}, import("zod/v4/core").$strip>;
|
|
@@ -290,8 +248,9 @@ export declare const parakeetPlugin: {
|
|
|
290
248
|
resolveConfig(cfg: ParakeetModelConfig, ctx: ResolveContext): Promise<ResolveResult<ParakeetModelConfig>>;
|
|
291
249
|
createModel(params: CreateModelParams): PluginModelResult;
|
|
292
250
|
handlers: {
|
|
293
|
-
|
|
251
|
+
transcribe: import("../../../../schemas/index").PluginHandlerDefinition<import("zod").ZodObject<{
|
|
294
252
|
modelId: import("zod").ZodString;
|
|
253
|
+
prompt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
295
254
|
audioChunk: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
296
255
|
type: import("zod").ZodLiteral<"base64">;
|
|
297
256
|
value: import("zod").ZodString;
|
|
@@ -299,13 +258,24 @@ export declare const parakeetPlugin: {
|
|
|
299
258
|
type: import("zod").ZodLiteral<"filePath">;
|
|
300
259
|
value: import("zod").ZodString;
|
|
301
260
|
}, import("zod/v4/core").$strip>], "type">;
|
|
302
|
-
|
|
303
|
-
type: import("zod").ZodLiteral<"transcribeStream">;
|
|
261
|
+
type: import("zod").ZodLiteral<"transcribe">;
|
|
304
262
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
305
|
-
type: import("zod").ZodLiteral<"transcribeStream">;
|
|
306
263
|
text: import("zod").ZodOptional<import("zod").ZodString>;
|
|
307
264
|
done: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
265
|
+
stats: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
266
|
+
audioDuration: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
267
|
+
realTimeFactor: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
268
|
+
tokensPerSecond: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
269
|
+
totalTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
270
|
+
totalSegments: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
271
|
+
whisperEncodeTime: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
272
|
+
whisperDecodeTime: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
273
|
+
encoderTime: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
274
|
+
decoderTime: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
275
|
+
melSpecTime: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
276
|
+
}, import("zod/v4/core").$strip>>;
|
|
308
277
|
error: import("zod").ZodOptional<import("zod").ZodString>;
|
|
278
|
+
type: import("zod").ZodLiteral<"transcribe">;
|
|
309
279
|
}, import("zod/v4/core").$strip>>;
|
|
310
280
|
};
|
|
311
281
|
logging: {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import parakeetAddonLogging from "@qvac/transcription-parakeet/addonLogging.js";
|
|
2
2
|
import TranscriptionParakeet, {} from "@qvac/transcription-parakeet";
|
|
3
|
-
import { definePlugin, defineHandler,
|
|
3
|
+
import { definePlugin, defineHandler, transcribeRequestSchema, transcribeResponseSchema, ModelType, parakeetConfigSchema, ADDON_PARAKEET, } from "../../../../schemas/index.js";
|
|
4
4
|
import { createStreamLogger, registerAddonLogger } from "../../../../logging/index.js";
|
|
5
5
|
import { parseModelPath } from "../../../utils/index.js";
|
|
6
6
|
import { ModelLoadFailedError, ParakeetArtifactsRequiredError, } from "../../../../utils/errors-server.js";
|
|
7
7
|
import FilesystemDL from "@qvac/dl-filesystem";
|
|
8
8
|
import { transcribe } from "../../ops/transcribe.js";
|
|
9
|
+
import { attachModelExecutionMs } from "../../../../profiling/model-execution.js";
|
|
9
10
|
async function resolveTdtConfig(cfg, ctx) {
|
|
10
11
|
const { parakeetEncoderSrc, parakeetEncoderDataSrc, parakeetDecoderSrc, parakeetVocabSrc, parakeetPreprocessorSrc, } = cfg;
|
|
11
12
|
if (!parakeetEncoderSrc ||
|
|
@@ -25,11 +26,11 @@ async function resolveTdtConfig(cfg, ctx) {
|
|
|
25
26
|
return {
|
|
26
27
|
config: cfg,
|
|
27
28
|
artifacts: {
|
|
28
|
-
encoderPath,
|
|
29
|
-
...(encoderDataPath !== undefined && { encoderDataPath }),
|
|
30
|
-
...(decoderPath !== undefined && { decoderPath }),
|
|
31
|
-
...(vocabPath !== undefined && { vocabPath }),
|
|
32
|
-
...(preprocessorPath !== undefined && { preprocessorPath }),
|
|
29
|
+
encoder: encoderPath,
|
|
30
|
+
...(encoderDataPath !== undefined && { encoderData: encoderDataPath }),
|
|
31
|
+
...(decoderPath !== undefined && { decoder: decoderPath }),
|
|
32
|
+
...(vocabPath !== undefined && { vocab: vocabPath }),
|
|
33
|
+
...(preprocessorPath !== undefined && { preprocessor: preprocessorPath }),
|
|
33
34
|
},
|
|
34
35
|
};
|
|
35
36
|
}
|
|
@@ -47,9 +48,9 @@ async function resolveCtcConfig(cfg, ctx) {
|
|
|
47
48
|
return {
|
|
48
49
|
config: cfg,
|
|
49
50
|
artifacts: {
|
|
50
|
-
ctcModelPath,
|
|
51
|
-
...(ctcModelDataPath !== undefined && { ctcModelDataPath }),
|
|
52
|
-
...(tokenizerPath !== undefined && { tokenizerPath }),
|
|
51
|
+
model: ctcModelPath,
|
|
52
|
+
...(ctcModelDataPath !== undefined && { modelData: ctcModelDataPath }),
|
|
53
|
+
...(tokenizerPath !== undefined && { tokenizer: tokenizerPath }),
|
|
53
54
|
},
|
|
54
55
|
};
|
|
55
56
|
}
|
|
@@ -63,15 +64,15 @@ async function resolveSortformerConfig(cfg, ctx) {
|
|
|
63
64
|
return {
|
|
64
65
|
config: cfg,
|
|
65
66
|
artifacts: {
|
|
66
|
-
...(sortformerPath !== undefined && { sortformerPath }),
|
|
67
|
+
...(sortformerPath !== undefined && { sortformer: sortformerPath }),
|
|
67
68
|
},
|
|
68
69
|
};
|
|
69
70
|
}
|
|
70
|
-
function createParakeetModel(params,
|
|
71
|
+
function createParakeetModel(params, primaryFileKey) {
|
|
71
72
|
const config = (params.modelConfig ?? {});
|
|
72
|
-
const artifacts = params.artifacts ?? {};
|
|
73
|
+
const artifacts = { ...(params.artifacts ?? {}) };
|
|
73
74
|
const modelType = config.modelType ?? "tdt";
|
|
74
|
-
const primaryPath = artifacts[
|
|
75
|
+
const primaryPath = artifacts[primaryFileKey] ?? params.modelPath;
|
|
75
76
|
if (!primaryPath) {
|
|
76
77
|
throw new ModelLoadFailedError(`Parakeet ${modelType} requires a model source`);
|
|
77
78
|
}
|
|
@@ -79,10 +80,12 @@ function createParakeetModel(params, addonPathKey) {
|
|
|
79
80
|
const loader = new FilesystemDL({ dirPath });
|
|
80
81
|
const logger = createStreamLogger(params.modelId, ModelType.parakeetTranscription);
|
|
81
82
|
registerAddonLogger(params.modelId, ModelType.parakeetTranscription, logger);
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
[addonPathKey]: primaryPath,
|
|
83
|
+
const files = {
|
|
84
|
+
[primaryFileKey]: primaryPath,
|
|
85
85
|
...artifacts,
|
|
86
|
+
};
|
|
87
|
+
const addonConfig = {
|
|
88
|
+
enableStats: true,
|
|
86
89
|
parakeetConfig: {
|
|
87
90
|
modelType,
|
|
88
91
|
maxThreads: config.maxThreads,
|
|
@@ -94,11 +97,10 @@ function createParakeetModel(params, addonPathKey) {
|
|
|
94
97
|
},
|
|
95
98
|
};
|
|
96
99
|
const model = new TranscriptionParakeet({
|
|
97
|
-
|
|
100
|
+
files,
|
|
101
|
+
config: addonConfig,
|
|
98
102
|
logger,
|
|
99
|
-
|
|
100
|
-
diskPath: dirPath,
|
|
101
|
-
}, addonConfig);
|
|
103
|
+
});
|
|
102
104
|
return { model, loader };
|
|
103
105
|
}
|
|
104
106
|
export const parakeetPlugin = definePlugin({
|
|
@@ -118,32 +120,42 @@ export const parakeetPlugin = definePlugin({
|
|
|
118
120
|
createModel(params) {
|
|
119
121
|
const modelType = (params.modelConfig ?? {}).modelType ?? "tdt";
|
|
120
122
|
if (modelType === "ctc")
|
|
121
|
-
return createParakeetModel(params, "
|
|
123
|
+
return createParakeetModel(params, "model");
|
|
122
124
|
if (modelType === "sortformer")
|
|
123
|
-
return createParakeetModel(params, "
|
|
124
|
-
return createParakeetModel(params, "
|
|
125
|
+
return createParakeetModel(params, "sortformer");
|
|
126
|
+
return createParakeetModel(params, "encoder");
|
|
125
127
|
},
|
|
126
128
|
handlers: {
|
|
127
|
-
|
|
128
|
-
requestSchema:
|
|
129
|
-
responseSchema:
|
|
129
|
+
transcribe: defineHandler({
|
|
130
|
+
requestSchema: transcribeRequestSchema,
|
|
131
|
+
responseSchema: transcribeResponseSchema,
|
|
130
132
|
streaming: true,
|
|
131
133
|
handler: async function* (request) {
|
|
132
|
-
|
|
134
|
+
const stream = transcribe({
|
|
133
135
|
modelId: request.modelId,
|
|
134
136
|
audioChunk: request.audioChunk,
|
|
135
137
|
prompt: request.prompt,
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
});
|
|
139
|
+
try {
|
|
140
|
+
let result = await stream.next();
|
|
141
|
+
while (!result.done) {
|
|
142
|
+
yield {
|
|
143
|
+
type: "transcribe",
|
|
144
|
+
text: result.value,
|
|
145
|
+
};
|
|
146
|
+
result = await stream.next();
|
|
147
|
+
}
|
|
148
|
+
const { modelExecutionMs, stats } = result.value;
|
|
149
|
+
yield attachModelExecutionMs({
|
|
150
|
+
type: "transcribe",
|
|
151
|
+
text: "",
|
|
152
|
+
done: true,
|
|
153
|
+
...(stats && { stats }),
|
|
154
|
+
}, modelExecutionMs);
|
|
155
|
+
}
|
|
156
|
+
finally {
|
|
157
|
+
await stream.return?.(undefined);
|
|
141
158
|
}
|
|
142
|
-
yield {
|
|
143
|
-
type: "transcribeStream",
|
|
144
|
-
text: "",
|
|
145
|
-
done: true,
|
|
146
|
-
};
|
|
147
159
|
},
|
|
148
160
|
}),
|
|
149
161
|
},
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { getModel } from "../../../registry/model-registry.js";
|
|
2
|
+
export async function* diffusion(request) {
|
|
3
|
+
const model = getModel(request.modelId);
|
|
4
|
+
const response = await model.run({
|
|
5
|
+
prompt: request.prompt,
|
|
6
|
+
negative_prompt: request.negative_prompt,
|
|
7
|
+
width: request.width,
|
|
8
|
+
height: request.height,
|
|
9
|
+
steps: request.steps,
|
|
10
|
+
cfg_scale: request.cfg_scale,
|
|
11
|
+
guidance: request.guidance,
|
|
12
|
+
sampling_method: request.sampling_method,
|
|
13
|
+
scheduler: request.scheduler,
|
|
14
|
+
seed: request.seed,
|
|
15
|
+
batch_count: request.batch_count,
|
|
16
|
+
vae_tiling: request.vae_tiling,
|
|
17
|
+
cache_preset: request.cache_preset,
|
|
18
|
+
});
|
|
19
|
+
let outputIndex = 0;
|
|
20
|
+
for await (const chunk of response.iterate()) {
|
|
21
|
+
if (chunk instanceof Uint8Array) {
|
|
22
|
+
yield {
|
|
23
|
+
type: "diffusionStream",
|
|
24
|
+
data: Buffer.from(chunk).toString("base64"),
|
|
25
|
+
outputIndex: outputIndex++,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
else if (typeof chunk === "string") {
|
|
29
|
+
try {
|
|
30
|
+
const tick = JSON.parse(chunk);
|
|
31
|
+
if ("step" in tick) {
|
|
32
|
+
yield {
|
|
33
|
+
type: "diffusionStream",
|
|
34
|
+
step: tick["step"],
|
|
35
|
+
totalSteps: tick["total"],
|
|
36
|
+
elapsedMs: tick["elapsed_ms"],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Non-JSON string output — skip
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const responseWithStats = response;
|
|
46
|
+
yield {
|
|
47
|
+
type: "diffusionStream",
|
|
48
|
+
done: true,
|
|
49
|
+
stats: responseWithStats.stats ?? undefined,
|
|
50
|
+
};
|
|
51
|
+
}
|