@qvac/sdk 0.13.4 → 0.14.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 +95 -1151
- package/README.md +1 -2
- package/bare-imports.json +0 -5
- package/dist/client/api/bci-transcribe.js +2 -1
- package/dist/client/api/download-asset.js +2 -1
- package/dist/client/api/finetune.js +6 -5
- package/dist/client/api/index.d.ts +1 -0
- package/dist/client/api/index.js +1 -0
- package/dist/client/api/load-model.d.ts +11 -8
- package/dist/client/api/load-model.js +6 -6
- package/dist/client/api/subscribe-logs.d.ts +28 -0
- package/dist/client/api/subscribe-logs.js +43 -0
- package/dist/client/api/text-to-speech.js +2 -1
- package/dist/client/config-loader/config-utils.js +2 -4
- package/dist/client/config-loader/resolve-config.bare.js +4 -3
- package/dist/client/parse-input.d.ts +3 -0
- package/dist/client/parse-input.js +14 -0
- package/dist/client/rpc/node-rpc-client.js +8 -2
- package/dist/client/rpc/rpc-client.js +39 -7
- package/dist/commands/bundle/constants.js +2 -1
- package/dist/examples/bci/bci-filesystem-streaming.js +14 -14
- package/dist/examples/bci/bci-filesystem.js +17 -13
- package/dist/examples/cache-management.js +38 -38
- package/dist/examples/cancel-by-request-id.js +9 -9
- package/dist/examples/completion-events.js +20 -14
- package/dist/examples/completion-stop-reason.js +13 -7
- package/dist/examples/concurrent-completion-collision.js +7 -7
- package/dist/examples/config-reload.js +7 -8
- package/dist/examples/default-config-usage.js +4 -4
- package/dist/examples/delegated-inference/composite.js +14 -10
- package/dist/examples/delegated-inference/consumer-profiled.js +13 -13
- package/dist/examples/delegated-inference/consumer.js +16 -12
- package/dist/examples/delegated-inference/provider.js +12 -12
- package/dist/examples/diffusion-esrgan-upscale.js +19 -15
- package/dist/examples/diffusion-flux2-klein-img2img.js +16 -11
- package/dist/examples/diffusion-flux2-klein.js +14 -9
- package/dist/examples/diffusion-img2img.js +9 -10
- package/dist/examples/diffusion-img2vid.js +17 -12
- package/dist/examples/diffusion-simple.js +1 -1
- package/dist/examples/diffusion-txt2img.js +14 -9
- package/dist/examples/diffusion-txt2vid.js +15 -10
- package/dist/examples/download-with-blind-relays.js +16 -21
- package/dist/examples/download-with-cancel.js +15 -16
- package/dist/examples/embed-multi-gpu.js +3 -4
- package/dist/examples/embed-p2p.js +11 -7
- package/dist/examples/finetune/llamacpp-finetune.js +7 -7
- package/dist/examples/kv-cache-cleanup.js +35 -35
- package/dist/examples/kv-cache-custom-key.js +24 -24
- package/dist/examples/kv-cache-example.js +9 -9
- package/dist/examples/llamacpp-cache.js +18 -14
- package/dist/examples/llamacpp-dynamic-tools.js +15 -9
- package/dist/examples/llamacpp-filesystem.js +15 -9
- package/dist/examples/llamacpp-http.js +12 -10
- package/dist/examples/llamacpp-multi-gpu.js +4 -4
- package/dist/examples/llamacpp-multimodal.js +13 -9
- package/dist/examples/llamacpp-p2p.js +8 -4
- package/dist/examples/llamacpp-sharded.js +5 -5
- package/dist/examples/llamacpp-structured-output.js +15 -9
- package/dist/examples/logging-file-transport.js +3 -3
- package/dist/examples/logging-global.d.ts +2 -0
- package/dist/examples/logging-global.js +34 -0
- package/dist/examples/logging-streaming.js +7 -10
- package/dist/examples/mcp-websearch.js +24 -18
- package/dist/examples/multi-model-demo.js +17 -11
- package/dist/examples/ocr-fasttext.js +14 -16
- package/dist/examples/parallel-download.js +7 -7
- package/dist/examples/plugins.js +40 -28
- package/dist/examples/profiling/basic.js +16 -10
- package/dist/examples/profiling/per-call.js +17 -11
- package/dist/examples/quickstart.bare.d.ts +2 -0
- package/dist/examples/quickstart.bare.js +18 -0
- package/dist/examples/quickstart.js +10 -3
- package/dist/examples/rag/rag-chromadb.js +18 -14
- package/dist/examples/rag/rag-hyperdb/cancellation.js +17 -14
- package/dist/examples/rag/rag-hyperdb/ingest.js +14 -12
- package/dist/examples/rag/rag-hyperdb/pipeline.js +19 -17
- package/dist/examples/rag/rag-hyperdb/workspaces.js +31 -27
- package/dist/examples/rag/rag-lancedb.js +12 -8
- package/dist/examples/rag/rag-sqlite.js +11 -7
- package/dist/examples/registry-query.js +17 -17
- package/dist/examples/seed-p2p.js +10 -6
- package/dist/examples/suspend-resume.js +20 -16
- package/dist/examples/tools/llamacpp-native-tools.js +24 -18
- package/dist/examples/tools/llamacpp-tools-gemma4.js +14 -8
- package/dist/examples/tools/llamacpp-tools-harmony-multiturn.js +20 -14
- package/dist/examples/tools/llamacpp-tools-pythonic.js +14 -8
- package/dist/examples/tools/llamacpp-tools-qwen35.js +14 -8
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +12 -9
- package/dist/examples/transcription/parakeet-microphone-record.js +15 -9
- package/dist/examples/transcription/parakeet-microphone-stream.js +15 -9
- package/dist/examples/transcription/parakeet-sortformer-streaming.js +12 -6
- package/dist/examples/transcription/parakeet-sortformer.js +3 -5
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +13 -10
- package/dist/examples/transcription/whispercpp-filesystem-streaming.js +16 -17
- package/dist/examples/transcription/whispercpp-filesystem.js +14 -10
- package/dist/examples/transcription/whispercpp-microphone-conversation.js +10 -10
- package/dist/examples/transcription/whispercpp-microphone-record.js +6 -6
- package/dist/examples/transcription/whispercpp-prompt.js +14 -10
- package/dist/examples/translation/translation-bergamot-batch.js +11 -7
- package/dist/examples/translation/translation-bergamot-pivot.js +13 -9
- package/dist/examples/translation/translation-bergamot.js +8 -4
- package/dist/examples/translation/translation-indic.js +8 -4
- package/dist/examples/translation/translation-llm-afriquegemma.js +7 -3
- package/dist/examples/translation/translation-llm-context.js +8 -4
- package/dist/examples/translation/translation-llm.js +7 -3
- package/dist/examples/translation/translation-stream.js +4 -4
- package/dist/examples/tts/chatterbox.js +19 -11
- package/dist/examples/tts/llm-to-tts-streaming.js +27 -14
- package/dist/examples/tts/supertonic-multilingual.js +18 -14
- package/dist/examples/tts/supertonic.js +19 -15
- package/dist/examples/tts/utils.js +1 -1
- package/dist/examples/vla-pi05.js +18 -14
- package/dist/examples/vla-smolvla.js +18 -14
- package/dist/examples/voice-assistant/voice-assistant.js +12 -12
- package/dist/index.d.ts +3 -4
- package/dist/index.js +3 -4
- package/dist/logging/client-logger.js +2 -1
- package/dist/logging/index.d.ts +1 -1
- package/dist/logging/index.js +1 -1
- package/dist/logging/namespaces.d.ts +1 -0
- package/dist/logging/namespaces.js +2 -0
- package/dist/logging/server-logger.js +1 -4
- package/dist/logging/utils.js +6 -1
- package/dist/models/registry/index.d.ts +17 -0
- package/dist/models/registry/index.js +20 -1
- package/dist/models/registry/models.d.ts +1062 -38
- package/dist/models/registry/models.js +3546 -2490
- package/dist/pear/pre.js +2 -2
- package/dist/schemas/bci-config.d.ts +37 -0
- package/dist/schemas/bci-config.js +2 -0
- package/dist/schemas/bci.d.ts +2 -0
- package/dist/schemas/common.d.ts +171 -94
- package/dist/schemas/completion-stream.d.ts +6 -3
- package/dist/schemas/completion-stream.js +10 -2
- package/dist/schemas/download-asset.d.ts +5 -5
- package/dist/schemas/engine-addon-map.d.ts +1 -1
- package/dist/schemas/engine-addon-map.js +6 -3
- package/dist/schemas/error.js +6 -1
- package/dist/schemas/llamacpp-config.d.ts +27 -8
- package/dist/schemas/llamacpp-config.js +19 -2
- package/dist/schemas/load-model.d.ts +4170 -570
- package/dist/schemas/load-model.js +85 -26
- package/dist/schemas/logging-stream.js +7 -1
- package/dist/schemas/model-src-utils.d.ts +6 -6
- package/dist/schemas/model-types.d.ts +14 -15
- package/dist/schemas/model-types.js +10 -11
- package/dist/schemas/ocr.d.ts +10 -8
- package/dist/schemas/ocr.js +8 -6
- package/dist/schemas/plugin.d.ts +6 -5
- package/dist/schemas/plugin.js +4 -4
- package/dist/schemas/rag.d.ts +4 -4
- package/dist/schemas/registry.d.ts +8 -8
- package/dist/schemas/registry.js +1 -1
- package/dist/schemas/reload-config.d.ts +6 -6
- package/dist/schemas/sdcpp-config.d.ts +12 -12
- package/dist/schemas/sdk-config.d.ts +171 -117
- package/dist/schemas/sdk-config.js +5 -5
- package/dist/schemas/sdk-errors-client.d.ts +1 -0
- package/dist/schemas/sdk-errors-client.js +7 -2
- package/dist/schemas/text-to-speech.d.ts +157 -13
- package/dist/schemas/text-to-speech.js +70 -7
- package/dist/schemas/transcription-config.d.ts +5 -1
- package/dist/schemas/transcription-config.js +2 -0
- package/dist/schemas/transcription.d.ts +3 -0
- package/dist/schemas/transcription.js +2 -1
- package/dist/schemas/translate.d.ts +6 -6
- package/dist/schemas/translate.js +2 -3
- package/dist/schemas/translation-config.d.ts +20 -20
- package/dist/server/bare/hyperswarm.js +3 -3
- package/dist/server/bare/ops/transcribe.js +46 -15
- package/dist/server/bare/plugins/bci-whispercpp-transcription/args.d.ts +3 -0
- package/dist/server/bare/plugins/bci-whispercpp-transcription/args.js +13 -0
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +41 -0
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +6 -11
- package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.d.ts +75 -0
- package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.js +11 -0
- package/dist/server/bare/plugins/{onnx-ocr → ggml-ocr}/plugin.d.ts +16 -10
- package/dist/server/bare/plugins/{onnx-ocr → ggml-ocr}/plugin.js +25 -18
- package/dist/server/bare/plugins/index.d.ts +1 -1
- package/dist/server/bare/plugins/index.js +1 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +10 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +29 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +4 -22
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +15 -7
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +7 -7
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +2 -0
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +10 -10
- package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +14 -8
- package/dist/server/bare/plugins/tts-ggml/plugin.js +12 -0
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +3 -1
- package/dist/server/bare/registry/logging-stream-registry.d.ts +4 -2
- package/dist/server/bare/registry/logging-stream-registry.js +12 -7
- package/dist/server/bare/registry/model-config-utils.js +2 -2
- package/dist/server/bare/registry/registry-client.js +1 -1
- package/dist/server/bare/runtime-lifecycle.d.ts +9 -0
- package/dist/server/bare/runtime-lifecycle.js +24 -0
- package/dist/server/bare/types/addon-responses.d.ts +1 -0
- package/dist/server/env.js +7 -10
- package/dist/server/plugins/registry.js +2 -4
- package/dist/server/rpc/handlers/load-model/handler.js +2 -4
- package/dist/server/rpc/handlers/load-model/http.js +253 -51
- package/dist/server/rpc/handlers/logging-stream.js +4 -2
- package/dist/server/rpc/handlers/plugin-invoke.js +5 -16
- package/dist/server/utils/completion-normalizer.js +13 -4
- package/dist/server/utils/worker-lock.js +5 -5
- package/dist/server/worker-core.d.ts +1 -1
- package/dist/server/worker-core.js +28 -18
- package/dist/utils/errors-client.d.ts +3 -0
- package/dist/utils/errors-client.js +5 -0
- package/dist/utils/errors-server.d.ts +2 -0
- package/dist/utils/errors-server.js +3 -0
- package/dist/utils/zod-error.d.ts +3 -0
- package/dist/utils/zod-error.js +4 -0
- package/package.json +21 -24
- package/dist/polyfills/bare-globals.d.ts +0 -2
- package/dist/polyfills/bare-globals.js +0 -4
- package/dist/polyfills/bare-globals.noop.d.ts +0 -2
- package/dist/polyfills/bare-globals.noop.js +0 -1
- /package/dist/server/bare/plugins/{onnx-ocr → ggml-ocr}/ops/ocr-stream.d.ts +0 -0
- /package/dist/server/bare/plugins/{onnx-ocr → ggml-ocr}/ops/ocr-stream.js +0 -0
|
@@ -51,7 +51,7 @@ export const deviceConfigDefaultsSchema = z
|
|
|
51
51
|
.optional(),
|
|
52
52
|
[ModelType.nmtcppTranslation]: z.record(z.string(), z.unknown()).optional(),
|
|
53
53
|
[ModelType.ttsGgml]: z.record(z.string(), z.unknown()).optional(),
|
|
54
|
-
[ModelType.
|
|
54
|
+
[ModelType.ggmlOcr]: ocrConfigSchema.partial().optional(),
|
|
55
55
|
[ModelType.sdcppGeneration]: sdcppConfigSchema.partial().optional(),
|
|
56
56
|
[ModelType.ggmlVla]: vlaConfigSchema.partial().optional(),
|
|
57
57
|
// Alias keys (user-friendly)
|
|
@@ -98,14 +98,14 @@ export const qvacConfigSchema = z.object({
|
|
|
98
98
|
swarmRelays: z.array(z.string()).optional(),
|
|
99
99
|
/**
|
|
100
100
|
* Global log level for all SDK loggers.
|
|
101
|
-
* Options: "error", "warn", "info", "debug"
|
|
101
|
+
* Options: "error", "warn", "info", "debug", "off".
|
|
102
102
|
* Defaults to "info".
|
|
103
103
|
*/
|
|
104
104
|
loggerLevel: logLevelSchema.optional(),
|
|
105
105
|
/**
|
|
106
|
-
*
|
|
107
|
-
* When false, logs
|
|
108
|
-
* Defaults to true.
|
|
106
|
+
* Print SDK logs to the console.
|
|
107
|
+
* When false, logs still reach streams and transports but are not printed.
|
|
108
|
+
* Defaults to false; set to true to see SDK logs on the console.
|
|
109
109
|
*/
|
|
110
110
|
loggerConsoleOutput: z.boolean().optional(),
|
|
111
111
|
/**
|
|
@@ -9,6 +9,7 @@ export declare const SDK_CLIENT_ERROR_CODES: {
|
|
|
9
9
|
readonly OCR_FAILED: 50007;
|
|
10
10
|
readonly MODEL_TYPE_REQUIRED: 50008;
|
|
11
11
|
readonly MODEL_SRC_TYPE_MISMATCH: 50009;
|
|
12
|
+
readonly REQUEST_VALIDATION_FAILED: 50010;
|
|
12
13
|
readonly RPC_NO_HANDLER: 50200;
|
|
13
14
|
readonly RPC_REQUEST_NOT_SENT: 50201;
|
|
14
15
|
readonly RPC_RESPONSE_STREAM_NOT_CREATED: 50202;
|
|
@@ -11,6 +11,7 @@ export const SDK_CLIENT_ERROR_CODES = {
|
|
|
11
11
|
OCR_FAILED: 50007,
|
|
12
12
|
MODEL_TYPE_REQUIRED: 50008,
|
|
13
13
|
MODEL_SRC_TYPE_MISMATCH: 50009,
|
|
14
|
+
REQUEST_VALIDATION_FAILED: 50010,
|
|
14
15
|
// RPC Communication Errors (50,200-50,399)
|
|
15
16
|
RPC_NO_HANDLER: 50200,
|
|
16
17
|
RPC_REQUEST_NOT_SENT: 50201,
|
|
@@ -76,12 +77,16 @@ const clientErrorDefinitions = {
|
|
|
76
77
|
},
|
|
77
78
|
[SDK_CLIENT_ERROR_CODES.MODEL_TYPE_REQUIRED]: {
|
|
78
79
|
name: "MODEL_TYPE_REQUIRED",
|
|
79
|
-
message: 'modelType is required: modelSrc is a plain string or lacks an engine/addon descriptor that can be inferred. Pass an explicit canonical modelType (e.g. "llamacpp-completion", "whispercpp-transcription", "nmtcpp-translation", "llamacpp-embedding", "tts-ggml", "
|
|
80
|
+
message: 'modelType is required: modelSrc is a plain string or lacks an engine/addon descriptor that can be inferred. Pass an explicit canonical modelType (e.g. "llamacpp-completion", "whispercpp-transcription", "nmtcpp-translation", "llamacpp-embedding", "tts-ggml", "ggml-ocr", "parakeet-transcription", "sdcpp-generation") or use a model constant that carries engine metadata.',
|
|
80
81
|
},
|
|
81
82
|
[SDK_CLIENT_ERROR_CODES.MODEL_SRC_TYPE_MISMATCH]: {
|
|
82
83
|
name: "MODEL_SRC_TYPE_MISMATCH",
|
|
83
84
|
message: (inferred, resolved) => `modelSrc describes "${inferred}", but modelType resolves to "${resolved}". Omit modelType to infer it automatically, or pass a matching modelType.`,
|
|
84
85
|
},
|
|
86
|
+
[SDK_CLIENT_ERROR_CODES.REQUEST_VALIDATION_FAILED]: {
|
|
87
|
+
name: "REQUEST_VALIDATION_FAILED",
|
|
88
|
+
message: (errors) => `Invalid request:\n${errors}`,
|
|
89
|
+
},
|
|
85
90
|
// RPC Communication Errors (50,200-50,399)
|
|
86
91
|
[SDK_CLIENT_ERROR_CODES.RPC_NO_HANDLER]: {
|
|
87
92
|
name: "RPC_NO_HANDLER",
|
|
@@ -167,7 +172,7 @@ const clientErrorDefinitions = {
|
|
|
167
172
|
},
|
|
168
173
|
[SDK_CLIENT_ERROR_CODES.WORKER_PLUGINS_NOT_REGISTERED]: {
|
|
169
174
|
name: "WORKER_PLUGINS_NOT_REGISTERED",
|
|
170
|
-
message: () => "No plugins registered in the worker.
|
|
175
|
+
message: () => "No plugins registered in the worker. On Bare, register the plugins you need with `plugins([...])` (or `registerPlugin(...)`) before the first SDK call — import each from its subpath, e.g. `@qvac/sdk/llamacpp-completion/plugin`. For direct Bare usage we recommend the dedicated `@qvac/bare-sdk` package. See https://docs.qvac.tether.io/configuration/plugins#runtime-registration-on-bare",
|
|
171
176
|
},
|
|
172
177
|
[SDK_CLIENT_ERROR_CODES.BUNDLE_VERIFICATION_FAILED]: {
|
|
173
178
|
name: "BUNDLE_VERIFICATION_FAILED",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const TTS_CHATTERBOX_LANGUAGES: readonly ["en", "es", "fr", "de", "it", "pt", "nl", "pl", "tr", "sv", "da", "fi", "no", "el", "ms", "sw", "ar", "ko"];
|
|
3
|
-
export declare const TTS_SUPERTONIC_LANGUAGES: readonly ["en", "es", "fr", "pt", "
|
|
4
|
-
export declare const TTS_LANGUAGES: readonly ["en", "es", "fr", "de", "it", "pt", "nl", "pl", "tr", "sv", "da", "fi", "no", "el", "ms", "sw", "ar", "ko"];
|
|
2
|
+
export declare const TTS_CHATTERBOX_LANGUAGES: readonly ["en", "es", "fr", "de", "it", "pt", "nl", "pl", "tr", "sv", "da", "fi", "no", "el", "ms", "sw", "ar", "ko", "he", "ru", "zh", "hi"];
|
|
3
|
+
export declare const TTS_SUPERTONIC_LANGUAGES: readonly ["en", "ko", "ja", "ar", "bg", "cs", "da", "de", "el", "es", "et", "fi", "fr", "hi", "hr", "hu", "id", "it", "lt", "lv", "nl", "pl", "pt", "ro", "ru", "sk", "sl", "sv", "tr", "uk", "vi"];
|
|
4
|
+
export declare const TTS_LANGUAGES: readonly ["en", "es", "fr", "de", "it", "pt", "nl", "pl", "tr", "sv", "da", "fi", "no", "el", "ms", "sw", "ar", "ko", "he", "ru", "zh", "hi", "ja", "bg", "cs", "et", "hr", "hu", "id", "lt", "lv", "ro", "sk", "sl", "uk", "vi"];
|
|
5
5
|
export declare const ttsChatterboxRuntimeConfigSchema: z.ZodObject<{
|
|
6
6
|
ttsEngine: z.ZodLiteral<"chatterbox">;
|
|
7
7
|
language: z.ZodEnum<{
|
|
@@ -16,8 +16,12 @@ export declare const ttsChatterboxRuntimeConfigSchema: z.ZodObject<{
|
|
|
16
16
|
nl: "nl";
|
|
17
17
|
pl: "pl";
|
|
18
18
|
pt: "pt";
|
|
19
|
+
ru: "ru";
|
|
20
|
+
zh: "zh";
|
|
19
21
|
da: "da";
|
|
20
22
|
el: "el";
|
|
23
|
+
he: "he";
|
|
24
|
+
hi: "hi";
|
|
21
25
|
ms: "ms";
|
|
22
26
|
no: "no";
|
|
23
27
|
sv: "sv";
|
|
@@ -26,22 +30,54 @@ export declare const ttsChatterboxRuntimeConfigSchema: z.ZodObject<{
|
|
|
26
30
|
}>;
|
|
27
31
|
voice: z.ZodOptional<z.ZodString>;
|
|
28
32
|
useGPU: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
streamChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
streamFirstChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
cfmSteps: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
threads: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
nGpuLayers: z.ZodOptional<z.ZodNumber>;
|
|
38
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
29
39
|
}, z.core.$strip>;
|
|
30
40
|
export declare const ttsSupertonicRuntimeConfigSchema: z.ZodObject<{
|
|
31
41
|
ttsEngine: z.ZodLiteral<"supertonic">;
|
|
32
42
|
language: z.ZodEnum<{
|
|
43
|
+
id: "id";
|
|
33
44
|
en: "en";
|
|
45
|
+
ar: "ar";
|
|
46
|
+
bg: "bg";
|
|
47
|
+
cs: "cs";
|
|
48
|
+
de: "de";
|
|
34
49
|
es: "es";
|
|
50
|
+
et: "et";
|
|
51
|
+
fi: "fi";
|
|
35
52
|
fr: "fr";
|
|
53
|
+
hu: "hu";
|
|
54
|
+
it: "it";
|
|
55
|
+
ja: "ja";
|
|
36
56
|
ko: "ko";
|
|
57
|
+
lt: "lt";
|
|
58
|
+
lv: "lv";
|
|
59
|
+
nl: "nl";
|
|
60
|
+
pl: "pl";
|
|
37
61
|
pt: "pt";
|
|
62
|
+
ru: "ru";
|
|
63
|
+
sk: "sk";
|
|
64
|
+
sl: "sl";
|
|
65
|
+
uk: "uk";
|
|
66
|
+
da: "da";
|
|
67
|
+
el: "el";
|
|
68
|
+
hi: "hi";
|
|
69
|
+
hr: "hr";
|
|
70
|
+
ro: "ro";
|
|
71
|
+
sv: "sv";
|
|
72
|
+
tr: "tr";
|
|
73
|
+
vi: "vi";
|
|
38
74
|
}>;
|
|
39
75
|
voice: z.ZodOptional<z.ZodString>;
|
|
40
76
|
ttsSpeed: z.ZodOptional<z.ZodNumber>;
|
|
41
77
|
ttsNumInferenceSteps: z.ZodOptional<z.ZodNumber>;
|
|
42
78
|
useGPU: z.ZodOptional<z.ZodBoolean>;
|
|
43
79
|
}, z.core.$strip>;
|
|
44
|
-
export declare const ttsRuntimeConfigSchema: z.
|
|
80
|
+
export declare const ttsRuntimeConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
45
81
|
ttsEngine: z.ZodLiteral<"chatterbox">;
|
|
46
82
|
language: z.ZodEnum<{
|
|
47
83
|
en: "en";
|
|
@@ -55,8 +91,12 @@ export declare const ttsRuntimeConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
55
91
|
nl: "nl";
|
|
56
92
|
pl: "pl";
|
|
57
93
|
pt: "pt";
|
|
94
|
+
ru: "ru";
|
|
95
|
+
zh: "zh";
|
|
58
96
|
da: "da";
|
|
59
97
|
el: "el";
|
|
98
|
+
he: "he";
|
|
99
|
+
hi: "hi";
|
|
60
100
|
ms: "ms";
|
|
61
101
|
no: "no";
|
|
62
102
|
sv: "sv";
|
|
@@ -65,20 +105,52 @@ export declare const ttsRuntimeConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
65
105
|
}>;
|
|
66
106
|
voice: z.ZodOptional<z.ZodString>;
|
|
67
107
|
useGPU: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
streamChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
streamFirstChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
cfmSteps: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
threads: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
nGpuLayers: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
68
114
|
}, z.core.$strip>, z.ZodObject<{
|
|
69
115
|
ttsEngine: z.ZodLiteral<"supertonic">;
|
|
70
116
|
language: z.ZodEnum<{
|
|
117
|
+
id: "id";
|
|
71
118
|
en: "en";
|
|
119
|
+
ar: "ar";
|
|
120
|
+
bg: "bg";
|
|
121
|
+
cs: "cs";
|
|
122
|
+
de: "de";
|
|
72
123
|
es: "es";
|
|
124
|
+
et: "et";
|
|
125
|
+
fi: "fi";
|
|
73
126
|
fr: "fr";
|
|
127
|
+
hu: "hu";
|
|
128
|
+
it: "it";
|
|
129
|
+
ja: "ja";
|
|
74
130
|
ko: "ko";
|
|
131
|
+
lt: "lt";
|
|
132
|
+
lv: "lv";
|
|
133
|
+
nl: "nl";
|
|
134
|
+
pl: "pl";
|
|
75
135
|
pt: "pt";
|
|
136
|
+
ru: "ru";
|
|
137
|
+
sk: "sk";
|
|
138
|
+
sl: "sl";
|
|
139
|
+
uk: "uk";
|
|
140
|
+
da: "da";
|
|
141
|
+
el: "el";
|
|
142
|
+
hi: "hi";
|
|
143
|
+
hr: "hr";
|
|
144
|
+
ro: "ro";
|
|
145
|
+
sv: "sv";
|
|
146
|
+
tr: "tr";
|
|
147
|
+
vi: "vi";
|
|
76
148
|
}>;
|
|
77
149
|
voice: z.ZodOptional<z.ZodString>;
|
|
78
150
|
ttsSpeed: z.ZodOptional<z.ZodNumber>;
|
|
79
151
|
ttsNumInferenceSteps: z.ZodOptional<z.ZodNumber>;
|
|
80
152
|
useGPU: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
-
}, z.core.$strip>]>;
|
|
153
|
+
}, z.core.$strip>], "ttsEngine">;
|
|
82
154
|
export declare const ttsChatterboxLoadConfigSchema: z.ZodObject<{
|
|
83
155
|
ttsEngine: z.ZodLiteral<"chatterbox">;
|
|
84
156
|
language: z.ZodEnum<{
|
|
@@ -93,8 +165,12 @@ export declare const ttsChatterboxLoadConfigSchema: z.ZodObject<{
|
|
|
93
165
|
nl: "nl";
|
|
94
166
|
pl: "pl";
|
|
95
167
|
pt: "pt";
|
|
168
|
+
ru: "ru";
|
|
169
|
+
zh: "zh";
|
|
96
170
|
da: "da";
|
|
97
171
|
el: "el";
|
|
172
|
+
he: "he";
|
|
173
|
+
hi: "hi";
|
|
98
174
|
ms: "ms";
|
|
99
175
|
no: "no";
|
|
100
176
|
sv: "sv";
|
|
@@ -103,6 +179,12 @@ export declare const ttsChatterboxLoadConfigSchema: z.ZodObject<{
|
|
|
103
179
|
}>;
|
|
104
180
|
voice: z.ZodOptional<z.ZodString>;
|
|
105
181
|
useGPU: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
+
streamChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
183
|
+
streamFirstChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
cfmSteps: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
threads: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
nGpuLayers: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
106
188
|
s3genModelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
107
189
|
src: z.ZodString;
|
|
108
190
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -128,7 +210,7 @@ export declare const ttsChatterboxLoadConfigSchema: z.ZodObject<{
|
|
|
128
210
|
"onnx-tts": "onnx-tts";
|
|
129
211
|
"tts-ggml": "tts-ggml";
|
|
130
212
|
"parakeet-transcription": "parakeet-transcription";
|
|
131
|
-
"
|
|
213
|
+
"ggml-ocr": "ggml-ocr";
|
|
132
214
|
"sdcpp-generation": "sdcpp-generation";
|
|
133
215
|
"ggml-vla": "ggml-vla";
|
|
134
216
|
"ggml-classification": "ggml-classification";
|
|
@@ -165,7 +247,7 @@ export declare const ttsChatterboxLoadConfigSchema: z.ZodObject<{
|
|
|
165
247
|
"onnx-tts": "onnx-tts";
|
|
166
248
|
"tts-ggml": "tts-ggml";
|
|
167
249
|
"parakeet-transcription": "parakeet-transcription";
|
|
168
|
-
"
|
|
250
|
+
"ggml-ocr": "ggml-ocr";
|
|
169
251
|
"sdcpp-generation": "sdcpp-generation";
|
|
170
252
|
"ggml-vla": "ggml-vla";
|
|
171
253
|
"ggml-classification": "ggml-classification";
|
|
@@ -181,18 +263,44 @@ export declare const ttsChatterboxLoadConfigSchema: z.ZodObject<{
|
|
|
181
263
|
export declare const ttsSupertonicLoadConfigSchema: z.ZodObject<{
|
|
182
264
|
ttsEngine: z.ZodLiteral<"supertonic">;
|
|
183
265
|
language: z.ZodEnum<{
|
|
266
|
+
id: "id";
|
|
184
267
|
en: "en";
|
|
268
|
+
ar: "ar";
|
|
269
|
+
bg: "bg";
|
|
270
|
+
cs: "cs";
|
|
271
|
+
de: "de";
|
|
185
272
|
es: "es";
|
|
273
|
+
et: "et";
|
|
274
|
+
fi: "fi";
|
|
186
275
|
fr: "fr";
|
|
276
|
+
hu: "hu";
|
|
277
|
+
it: "it";
|
|
278
|
+
ja: "ja";
|
|
187
279
|
ko: "ko";
|
|
280
|
+
lt: "lt";
|
|
281
|
+
lv: "lv";
|
|
282
|
+
nl: "nl";
|
|
283
|
+
pl: "pl";
|
|
188
284
|
pt: "pt";
|
|
285
|
+
ru: "ru";
|
|
286
|
+
sk: "sk";
|
|
287
|
+
sl: "sl";
|
|
288
|
+
uk: "uk";
|
|
289
|
+
da: "da";
|
|
290
|
+
el: "el";
|
|
291
|
+
hi: "hi";
|
|
292
|
+
hr: "hr";
|
|
293
|
+
ro: "ro";
|
|
294
|
+
sv: "sv";
|
|
295
|
+
tr: "tr";
|
|
296
|
+
vi: "vi";
|
|
189
297
|
}>;
|
|
190
298
|
voice: z.ZodOptional<z.ZodString>;
|
|
191
299
|
ttsSpeed: z.ZodOptional<z.ZodNumber>;
|
|
192
300
|
ttsNumInferenceSteps: z.ZodOptional<z.ZodNumber>;
|
|
193
301
|
useGPU: z.ZodOptional<z.ZodBoolean>;
|
|
194
302
|
}, z.core.$strip>;
|
|
195
|
-
export declare const ttsLoadConfigSchema: z.
|
|
303
|
+
export declare const ttsLoadConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
196
304
|
ttsEngine: z.ZodLiteral<"chatterbox">;
|
|
197
305
|
language: z.ZodEnum<{
|
|
198
306
|
en: "en";
|
|
@@ -206,8 +314,12 @@ export declare const ttsLoadConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
206
314
|
nl: "nl";
|
|
207
315
|
pl: "pl";
|
|
208
316
|
pt: "pt";
|
|
317
|
+
ru: "ru";
|
|
318
|
+
zh: "zh";
|
|
209
319
|
da: "da";
|
|
210
320
|
el: "el";
|
|
321
|
+
he: "he";
|
|
322
|
+
hi: "hi";
|
|
211
323
|
ms: "ms";
|
|
212
324
|
no: "no";
|
|
213
325
|
sv: "sv";
|
|
@@ -216,6 +328,12 @@ export declare const ttsLoadConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
216
328
|
}>;
|
|
217
329
|
voice: z.ZodOptional<z.ZodString>;
|
|
218
330
|
useGPU: z.ZodOptional<z.ZodBoolean>;
|
|
331
|
+
streamChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
332
|
+
streamFirstChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
333
|
+
cfmSteps: z.ZodOptional<z.ZodNumber>;
|
|
334
|
+
threads: z.ZodOptional<z.ZodNumber>;
|
|
335
|
+
nGpuLayers: z.ZodOptional<z.ZodNumber>;
|
|
336
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
219
337
|
s3genModelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
220
338
|
src: z.ZodString;
|
|
221
339
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -241,7 +359,7 @@ export declare const ttsLoadConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
241
359
|
"onnx-tts": "onnx-tts";
|
|
242
360
|
"tts-ggml": "tts-ggml";
|
|
243
361
|
"parakeet-transcription": "parakeet-transcription";
|
|
244
|
-
"
|
|
362
|
+
"ggml-ocr": "ggml-ocr";
|
|
245
363
|
"sdcpp-generation": "sdcpp-generation";
|
|
246
364
|
"ggml-vla": "ggml-vla";
|
|
247
365
|
"ggml-classification": "ggml-classification";
|
|
@@ -278,7 +396,7 @@ export declare const ttsLoadConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
278
396
|
"onnx-tts": "onnx-tts";
|
|
279
397
|
"tts-ggml": "tts-ggml";
|
|
280
398
|
"parakeet-transcription": "parakeet-transcription";
|
|
281
|
-
"
|
|
399
|
+
"ggml-ocr": "ggml-ocr";
|
|
282
400
|
"sdcpp-generation": "sdcpp-generation";
|
|
283
401
|
"ggml-vla": "ggml-vla";
|
|
284
402
|
"ggml-classification": "ggml-classification";
|
|
@@ -293,23 +411,49 @@ export declare const ttsLoadConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
293
411
|
}, z.core.$strip>, z.ZodObject<{
|
|
294
412
|
ttsEngine: z.ZodLiteral<"supertonic">;
|
|
295
413
|
language: z.ZodEnum<{
|
|
414
|
+
id: "id";
|
|
296
415
|
en: "en";
|
|
416
|
+
ar: "ar";
|
|
417
|
+
bg: "bg";
|
|
418
|
+
cs: "cs";
|
|
419
|
+
de: "de";
|
|
297
420
|
es: "es";
|
|
421
|
+
et: "et";
|
|
422
|
+
fi: "fi";
|
|
298
423
|
fr: "fr";
|
|
424
|
+
hu: "hu";
|
|
425
|
+
it: "it";
|
|
426
|
+
ja: "ja";
|
|
299
427
|
ko: "ko";
|
|
428
|
+
lt: "lt";
|
|
429
|
+
lv: "lv";
|
|
430
|
+
nl: "nl";
|
|
431
|
+
pl: "pl";
|
|
300
432
|
pt: "pt";
|
|
433
|
+
ru: "ru";
|
|
434
|
+
sk: "sk";
|
|
435
|
+
sl: "sl";
|
|
436
|
+
uk: "uk";
|
|
437
|
+
da: "da";
|
|
438
|
+
el: "el";
|
|
439
|
+
hi: "hi";
|
|
440
|
+
hr: "hr";
|
|
441
|
+
ro: "ro";
|
|
442
|
+
sv: "sv";
|
|
443
|
+
tr: "tr";
|
|
444
|
+
vi: "vi";
|
|
301
445
|
}>;
|
|
302
446
|
voice: z.ZodOptional<z.ZodString>;
|
|
303
447
|
ttsSpeed: z.ZodOptional<z.ZodNumber>;
|
|
304
448
|
ttsNumInferenceSteps: z.ZodOptional<z.ZodNumber>;
|
|
305
449
|
useGPU: z.ZodOptional<z.ZodBoolean>;
|
|
306
|
-
}, z.core.$strip>]>;
|
|
450
|
+
}, z.core.$strip>], "ttsEngine">;
|
|
307
451
|
export declare const LEGACY_TTS_ONNX_MODEL_CONFIG_FIELDS: readonly ["ttsSupertonicMultilingual", "ttsTokenizerSrc", "ttsSpeechEncoderSrc", "ttsEmbedTokensSrc", "ttsConditionalDecoderSrc", "ttsLanguageModelSrc", "ttsTextEncoderSrc", "ttsDurationPredictorSrc", "ttsVectorEstimatorSrc", "ttsVocoderSrc", "ttsUnicodeIndexerSrc", "ttsTtsConfigSrc", "ttsVoiceStyleSrc"];
|
|
308
|
-
export declare const ttsConfigSchema: z.
|
|
452
|
+
export declare const ttsConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
309
453
|
[x: string]: z.ZodOptional<z.ZodUnknown>;
|
|
310
454
|
}, z.core.$strict>, z.ZodObject<{
|
|
311
455
|
[x: string]: z.ZodOptional<z.ZodUnknown>;
|
|
312
|
-
}, z.core.$strict>]>;
|
|
456
|
+
}, z.core.$strict>], "ttsEngine">;
|
|
313
457
|
export declare const ttsClientParamsSchema: z.ZodObject<{
|
|
314
458
|
modelId: z.ZodString;
|
|
315
459
|
inputType: z.ZodDefault<z.ZodString>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { modelSrcInputSchema } from "./model-src-utils.js";
|
|
3
|
-
// Chatterbox multilingual supported languages (
|
|
3
|
+
// Chatterbox multilingual supported languages (22). The engines support
|
|
4
4
|
// different language sets, so the language enum is validated per engine.
|
|
5
5
|
export const TTS_CHATTERBOX_LANGUAGES = [
|
|
6
6
|
"en", // English
|
|
@@ -21,25 +21,88 @@ export const TTS_CHATTERBOX_LANGUAGES = [
|
|
|
21
21
|
"sw", // Swahili
|
|
22
22
|
"ar", // Arabic
|
|
23
23
|
"ko", // Korean
|
|
24
|
+
"he", // Hebrew
|
|
25
|
+
"ru", // Russian
|
|
26
|
+
"zh", // Chinese
|
|
27
|
+
"hi", // Hindi
|
|
24
28
|
];
|
|
25
|
-
// Supertonic supported languages (
|
|
29
|
+
// Supertonic supported languages (31, as of Supertonic 3). Earlier Supertonic
|
|
30
|
+
// releases (1/2) only cover a subset, but validation is per-engine, not
|
|
31
|
+
// per-model, so the enum reflects the engine's current full capability.
|
|
26
32
|
export const TTS_SUPERTONIC_LANGUAGES = [
|
|
27
33
|
"en", // English
|
|
34
|
+
"ko", // Korean
|
|
35
|
+
"ja", // Japanese
|
|
36
|
+
"ar", // Arabic
|
|
37
|
+
"bg", // Bulgarian
|
|
38
|
+
"cs", // Czech
|
|
39
|
+
"da", // Danish
|
|
40
|
+
"de", // German
|
|
41
|
+
"el", // Greek
|
|
28
42
|
"es", // Spanish
|
|
43
|
+
"et", // Estonian
|
|
44
|
+
"fi", // Finnish
|
|
29
45
|
"fr", // French
|
|
46
|
+
"hi", // Hindi
|
|
47
|
+
"hr", // Croatian
|
|
48
|
+
"hu", // Hungarian
|
|
49
|
+
"id", // Indonesian
|
|
50
|
+
"it", // Italian
|
|
51
|
+
"lt", // Lithuanian
|
|
52
|
+
"lv", // Latvian
|
|
53
|
+
"nl", // Dutch
|
|
54
|
+
"pl", // Polish
|
|
30
55
|
"pt", // Portuguese
|
|
31
|
-
"
|
|
56
|
+
"ro", // Romanian
|
|
57
|
+
"ru", // Russian
|
|
58
|
+
"sk", // Slovak
|
|
59
|
+
"sl", // Slovenian
|
|
60
|
+
"sv", // Swedish
|
|
61
|
+
"tr", // Turkish
|
|
62
|
+
"uk", // Ukrainian
|
|
63
|
+
"vi", // Vietnamese
|
|
64
|
+
];
|
|
65
|
+
// Supertonic languages not already present in the Chatterbox set, used to keep
|
|
66
|
+
// TTS_LANGUAGES a true union across engines without duplicates.
|
|
67
|
+
const TTS_SUPERTONIC_ONLY_LANGUAGES = [
|
|
68
|
+
"ja", // Japanese
|
|
69
|
+
"bg", // Bulgarian
|
|
70
|
+
"cs", // Czech
|
|
71
|
+
"et", // Estonian
|
|
72
|
+
"hr", // Croatian
|
|
73
|
+
"hu", // Hungarian
|
|
74
|
+
"id", // Indonesian
|
|
75
|
+
"lt", // Lithuanian
|
|
76
|
+
"lv", // Latvian
|
|
77
|
+
"ro", // Romanian
|
|
78
|
+
"sk", // Slovak
|
|
79
|
+
"sl", // Slovenian
|
|
80
|
+
"uk", // Ukrainian
|
|
81
|
+
"vi", // Vietnamese
|
|
32
82
|
];
|
|
33
83
|
// Union of all TTS-supported languages across engines. Kept for backwards
|
|
34
84
|
// compatibility; prefer the engine-specific lists when validating a config.
|
|
35
|
-
export const TTS_LANGUAGES = [
|
|
85
|
+
export const TTS_LANGUAGES = [
|
|
86
|
+
...TTS_CHATTERBOX_LANGUAGES,
|
|
87
|
+
...TTS_SUPERTONIC_ONLY_LANGUAGES,
|
|
88
|
+
];
|
|
36
89
|
const ttsChatterboxLanguageSchema = z.enum(TTS_CHATTERBOX_LANGUAGES);
|
|
37
90
|
const ttsSupertonicLanguageSchema = z.enum(TTS_SUPERTONIC_LANGUAGES);
|
|
91
|
+
const ttsIntegerSchema = z.number().int();
|
|
92
|
+
const ttsNonNegativeIntegerSchema = ttsIntegerSchema.nonnegative();
|
|
93
|
+
const ttsPositiveIntegerSchema = ttsIntegerSchema.positive();
|
|
38
94
|
export const ttsChatterboxRuntimeConfigSchema = z.object({
|
|
39
95
|
ttsEngine: z.literal("chatterbox"),
|
|
40
96
|
language: ttsChatterboxLanguageSchema,
|
|
41
97
|
voice: z.string().optional(),
|
|
42
98
|
useGPU: z.boolean().optional(),
|
|
99
|
+
// Chatterbox-only native streaming controls.
|
|
100
|
+
streamChunkTokens: ttsNonNegativeIntegerSchema.optional(),
|
|
101
|
+
streamFirstChunkTokens: ttsNonNegativeIntegerSchema.optional(),
|
|
102
|
+
cfmSteps: ttsNonNegativeIntegerSchema.optional(),
|
|
103
|
+
threads: ttsPositiveIntegerSchema.optional(),
|
|
104
|
+
nGpuLayers: ttsIntegerSchema.optional(),
|
|
105
|
+
seed: ttsIntegerSchema.optional(),
|
|
43
106
|
});
|
|
44
107
|
export const ttsSupertonicRuntimeConfigSchema = z.object({
|
|
45
108
|
ttsEngine: z.literal("supertonic"),
|
|
@@ -49,7 +112,7 @@ export const ttsSupertonicRuntimeConfigSchema = z.object({
|
|
|
49
112
|
ttsNumInferenceSteps: z.number().optional(),
|
|
50
113
|
useGPU: z.boolean().optional(),
|
|
51
114
|
});
|
|
52
|
-
export const ttsRuntimeConfigSchema = z.
|
|
115
|
+
export const ttsRuntimeConfigSchema = z.discriminatedUnion("ttsEngine", [
|
|
53
116
|
ttsChatterboxRuntimeConfigSchema,
|
|
54
117
|
ttsSupertonicRuntimeConfigSchema,
|
|
55
118
|
]);
|
|
@@ -60,7 +123,7 @@ export const ttsChatterboxLoadConfigSchema = ttsChatterboxRuntimeConfigSchema.ex
|
|
|
60
123
|
referenceAudioSrc: modelSrcInputSchema.optional(),
|
|
61
124
|
});
|
|
62
125
|
export const ttsSupertonicLoadConfigSchema = ttsSupertonicRuntimeConfigSchema;
|
|
63
|
-
export const ttsLoadConfigSchema = z.
|
|
126
|
+
export const ttsLoadConfigSchema = z.discriminatedUnion("ttsEngine", [
|
|
64
127
|
ttsChatterboxLoadConfigSchema,
|
|
65
128
|
ttsSupertonicLoadConfigSchema,
|
|
66
129
|
]);
|
|
@@ -94,7 +157,7 @@ const legacyTtsOnnxFieldsShape = LEGACY_TTS_ONNX_MODEL_CONFIG_FIELDS.reduce((acc
|
|
|
94
157
|
// `loadConfigSchema`. Permits deprecated ONNX field names so
|
|
95
158
|
// `resolveConfig` can raise LegacyTtsModelDeprecatedError instead of a
|
|
96
159
|
// generic Zod error; other unknown keys are still rejected by `.strict()`.
|
|
97
|
-
export const ttsConfigSchema = z.
|
|
160
|
+
export const ttsConfigSchema = z.discriminatedUnion("ttsEngine", [
|
|
98
161
|
ttsChatterboxLoadConfigSchema.extend(legacyTtsOnnxFieldsShape).strict(),
|
|
99
162
|
ttsSupertonicLoadConfigSchema.extend(legacyTtsOnnxFieldsShape).strict(),
|
|
100
163
|
]);
|
|
@@ -89,7 +89,7 @@ export declare const whisperConfigSchema: z.ZodObject<{
|
|
|
89
89
|
"onnx-tts": "onnx-tts";
|
|
90
90
|
"tts-ggml": "tts-ggml";
|
|
91
91
|
"parakeet-transcription": "parakeet-transcription";
|
|
92
|
-
"
|
|
92
|
+
"ggml-ocr": "ggml-ocr";
|
|
93
93
|
"sdcpp-generation": "sdcpp-generation";
|
|
94
94
|
"ggml-vla": "ggml-vla";
|
|
95
95
|
"ggml-classification": "ggml-classification";
|
|
@@ -124,6 +124,8 @@ export declare const parakeetRuntimeConfigSchema: z.ZodObject<{
|
|
|
124
124
|
streamingChunkLeftContextMs: z.ZodOptional<z.ZodNumber>;
|
|
125
125
|
streamingChunkRightContextMs: z.ZodOptional<z.ZodNumber>;
|
|
126
126
|
streamingSpkCacheUpdatePeriod: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
backendsDir: z.ZodOptional<z.ZodString>;
|
|
128
|
+
openclCacheDir: z.ZodOptional<z.ZodString>;
|
|
127
129
|
}, z.core.$strip>;
|
|
128
130
|
export declare const parakeetConfigSchema: z.ZodObject<{
|
|
129
131
|
maxThreads: z.ZodOptional<z.ZodNumber>;
|
|
@@ -146,6 +148,8 @@ export declare const parakeetConfigSchema: z.ZodObject<{
|
|
|
146
148
|
streamingChunkLeftContextMs: z.ZodOptional<z.ZodNumber>;
|
|
147
149
|
streamingChunkRightContextMs: z.ZodOptional<z.ZodNumber>;
|
|
148
150
|
streamingSpkCacheUpdatePeriod: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
backendsDir: z.ZodOptional<z.ZodString>;
|
|
152
|
+
openclCacheDir: z.ZodOptional<z.ZodString>;
|
|
149
153
|
}, z.core.$strip>;
|
|
150
154
|
export type ParakeetRuntimeConfig = z.infer<typeof parakeetRuntimeConfigSchema>;
|
|
151
155
|
export type ParakeetConfig = z.infer<typeof parakeetConfigSchema>;
|
|
@@ -114,6 +114,8 @@ export const parakeetRuntimeConfigSchema = z.object({
|
|
|
114
114
|
streamingChunkLeftContextMs: z.number().int().nonnegative().optional(),
|
|
115
115
|
streamingChunkRightContextMs: z.number().int().nonnegative().optional(),
|
|
116
116
|
streamingSpkCacheUpdatePeriod: z.number().int().positive().optional(),
|
|
117
|
+
backendsDir: z.string().optional(),
|
|
118
|
+
openclCacheDir: z.string().optional(),
|
|
117
119
|
});
|
|
118
120
|
// Parakeet's load-time config currently has no fields beyond the
|
|
119
121
|
// runtime knobs (single GGUF model is supplied via the top-level
|
|
@@ -31,6 +31,7 @@ export declare const transcribeStatsSchema: z.ZodObject<{
|
|
|
31
31
|
melSpecTime: z.ZodOptional<z.ZodNumber>;
|
|
32
32
|
backendDevice: z.ZodOptional<z.ZodNumber>;
|
|
33
33
|
backendId: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
gpuUnsupported: z.ZodOptional<z.ZodNumber>;
|
|
34
35
|
gpuMemTotalMb: z.ZodOptional<z.ZodNumber>;
|
|
35
36
|
gpuMemFreeMb: z.ZodOptional<z.ZodNumber>;
|
|
36
37
|
}, z.core.$strip>;
|
|
@@ -88,6 +89,7 @@ export declare const transcribeResponseSchema: z.ZodObject<{
|
|
|
88
89
|
melSpecTime: z.ZodOptional<z.ZodNumber>;
|
|
89
90
|
backendDevice: z.ZodOptional<z.ZodNumber>;
|
|
90
91
|
backendId: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
gpuUnsupported: z.ZodOptional<z.ZodNumber>;
|
|
91
93
|
gpuMemTotalMb: z.ZodOptional<z.ZodNumber>;
|
|
92
94
|
gpuMemFreeMb: z.ZodOptional<z.ZodNumber>;
|
|
93
95
|
}, z.core.$strip>>;
|
|
@@ -187,6 +189,7 @@ export declare const transcribeStreamResponseSchema: z.ZodObject<{
|
|
|
187
189
|
melSpecTime: z.ZodOptional<z.ZodNumber>;
|
|
188
190
|
backendDevice: z.ZodOptional<z.ZodNumber>;
|
|
189
191
|
backendId: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
gpuUnsupported: z.ZodOptional<z.ZodNumber>;
|
|
190
193
|
gpuMemTotalMb: z.ZodOptional<z.ZodNumber>;
|
|
191
194
|
gpuMemFreeMb: z.ZodOptional<z.ZodNumber>;
|
|
192
195
|
}, z.core.$strip>>;
|
|
@@ -33,12 +33,13 @@ export const transcribeStatsSchema = z.object({
|
|
|
33
33
|
encoderTime: z.number().optional(),
|
|
34
34
|
decoderTime: z.number().optional(),
|
|
35
35
|
melSpecTime: z.number().optional(),
|
|
36
|
-
// Backend selection captured once at model load
|
|
36
|
+
// Backend selection captured once at model load.
|
|
37
37
|
// `0` CPU / `1` GPU; `backendId` codes the GPU family (see the addon's
|
|
38
38
|
// BackendId enum). gpu memory fields are `-1` when the backend exposes
|
|
39
39
|
// no accounting, and absent entirely for the parakeet engine.
|
|
40
40
|
backendDevice: z.number().optional(),
|
|
41
41
|
backendId: z.number().optional(),
|
|
42
|
+
gpuUnsupported: z.number().optional(),
|
|
42
43
|
gpuMemTotalMb: z.number().optional(),
|
|
43
44
|
gpuMemFreeMb: z.number().optional(),
|
|
44
45
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { NmtLanguage } from "./translation-config";
|
|
3
3
|
import { type NmtModelTypeInput, type LlmModelTypeInput } from "./model-types";
|
|
4
|
-
declare const translateParamsSchema: z.
|
|
4
|
+
declare const translateParamsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5
5
|
modelId: z.ZodString;
|
|
6
6
|
text: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
7
7
|
stream: z.ZodBoolean;
|
|
@@ -20,7 +20,7 @@ declare const translateParamsSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
20
20
|
from: z.ZodOptional<z.ZodString>;
|
|
21
21
|
to: z.ZodString;
|
|
22
22
|
context: z.ZodOptional<z.ZodString>;
|
|
23
|
-
}, z.core.$strip>]>;
|
|
23
|
+
}, z.core.$strip>], "modelType">;
|
|
24
24
|
export declare const translationStatsSchema: z.ZodObject<{
|
|
25
25
|
totalTime: z.ZodOptional<z.ZodNumber>;
|
|
26
26
|
totalTokens: z.ZodOptional<z.ZodNumber>;
|
|
@@ -30,7 +30,7 @@ export declare const translationStatsSchema: z.ZodObject<{
|
|
|
30
30
|
encodeTime: z.ZodOptional<z.ZodNumber>;
|
|
31
31
|
cacheTokens: z.ZodOptional<z.ZodNumber>;
|
|
32
32
|
}, z.core.$strip>;
|
|
33
|
-
export declare const translateRequestSchema: z.
|
|
33
|
+
export declare const translateRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
34
34
|
modelId: z.ZodString;
|
|
35
35
|
text: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
36
36
|
stream: z.ZodBoolean;
|
|
@@ -53,8 +53,8 @@ export declare const translateRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
53
53
|
context: z.ZodOptional<z.ZodString>;
|
|
54
54
|
type: z.ZodLiteral<"translate">;
|
|
55
55
|
requestId: z.ZodOptional<z.ZodString>;
|
|
56
|
-
}, z.core.$strip>]>;
|
|
57
|
-
export declare const translateServerParamsSchema: z.ZodPipe<z.
|
|
56
|
+
}, z.core.$strip>], "modelType">;
|
|
57
|
+
export declare const translateServerParamsSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
58
58
|
modelId: z.ZodString;
|
|
59
59
|
text: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
60
60
|
stream: z.ZodBoolean;
|
|
@@ -73,7 +73,7 @@ export declare const translateServerParamsSchema: z.ZodPipe<z.ZodUnion<readonly
|
|
|
73
73
|
from: z.ZodOptional<z.ZodString>;
|
|
74
74
|
to: z.ZodString;
|
|
75
75
|
context: z.ZodOptional<z.ZodString>;
|
|
76
|
-
}, z.core.$strip>]>, z.ZodTransform<{
|
|
76
|
+
}, z.core.$strip>], "modelType">, z.ZodTransform<{
|
|
77
77
|
modelType: string;
|
|
78
78
|
modelId: string;
|
|
79
79
|
text: string | string[];
|