@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
package/dist/schemas/common.js
CHANGED
|
@@ -5,7 +5,7 @@ import { completionStreamRequestSchema, completionStreamResponseSchema, } from "
|
|
|
5
5
|
import { loadModelRequestSchema, loadModelResponseSchema, modelProgressUpdateSchema, } from "./load-model.js";
|
|
6
6
|
import { downloadAssetRequestSchema, downloadAssetResponseSchema, } from "./download-asset.js";
|
|
7
7
|
import { unloadModelRequestSchema, unloadModelResponseSchema, } from "./unload-model.js";
|
|
8
|
-
import { transcribeStreamRequestSchema, transcribeStreamResponseSchema, } from "./transcription.js";
|
|
8
|
+
import { transcribeRequestSchema, transcribeResponseSchema, transcribeStreamRequestSchema, transcribeStreamResponseSchema, } from "./transcription.js";
|
|
9
9
|
import { embedRequestSchema, embedResponseSchema } from "./embed.js";
|
|
10
10
|
import { cancelRequestSchema, cancelResponseSchema } from "./cancel.js";
|
|
11
11
|
import { provideRequestSchema, provideResponseSchema } from "./provide.js";
|
|
@@ -18,14 +18,19 @@ import { ragRequestSchema, ragResponseSchema, ragProgressUpdateSchema, } from ".
|
|
|
18
18
|
import { deleteCacheRequestSchema, deleteCacheResponseSchema, } from "./delete-cache.js";
|
|
19
19
|
import { getModelInfoRequestSchema, getModelInfoResponseSchema, } from "./get-model-info.js";
|
|
20
20
|
import { ocrStreamRequestSchema, ocrStreamResponseSchema } from "./ocr.js";
|
|
21
|
+
import { diffusionStreamRequestSchema, diffusionStreamResponseSchema, } from "./sdcpp-config.js";
|
|
22
|
+
import { finetuneRequestSchema, finetuneResponseSchema, finetuneProgressResponseSchema, } from "./finetune.js";
|
|
21
23
|
import { pluginInvokeRequestSchema, pluginInvokeResponseSchema, pluginInvokeStreamRequestSchema, pluginInvokeStreamResponseSchema, } from "./plugin.js";
|
|
22
24
|
import { modelRegistryListRequestSchema, modelRegistryListResponseSchema, modelRegistrySearchRequestSchema, modelRegistrySearchResponseSchema, modelRegistryGetModelRequestSchema, modelRegistryGetModelResponseSchema, } from "./registry.js";
|
|
25
|
+
import { suspendRequestSchema, suspendResponseSchema } from "./suspend.js";
|
|
26
|
+
import { resumeRequestSchema, resumeResponseSchema } from "./resume.js";
|
|
23
27
|
export const requestSchema = z.union([
|
|
24
28
|
heartbeatRequestSchema,
|
|
25
29
|
loadModelRequestSchema,
|
|
26
30
|
downloadAssetRequestSchema,
|
|
27
31
|
completionStreamRequestSchema,
|
|
28
32
|
unloadModelRequestSchema,
|
|
33
|
+
transcribeRequestSchema,
|
|
29
34
|
transcribeStreamRequestSchema,
|
|
30
35
|
loggingStreamRequestSchema,
|
|
31
36
|
embedRequestSchema,
|
|
@@ -38,11 +43,15 @@ export const requestSchema = z.union([
|
|
|
38
43
|
deleteCacheRequestSchema,
|
|
39
44
|
getModelInfoRequestSchema,
|
|
40
45
|
ocrStreamRequestSchema,
|
|
46
|
+
diffusionStreamRequestSchema,
|
|
47
|
+
finetuneRequestSchema,
|
|
41
48
|
pluginInvokeRequestSchema,
|
|
42
49
|
pluginInvokeStreamRequestSchema,
|
|
43
50
|
modelRegistryListRequestSchema,
|
|
44
51
|
modelRegistrySearchRequestSchema,
|
|
45
52
|
modelRegistryGetModelRequestSchema,
|
|
53
|
+
suspendRequestSchema,
|
|
54
|
+
resumeRequestSchema,
|
|
46
55
|
]);
|
|
47
56
|
export const responseSchema = z.discriminatedUnion("type", [
|
|
48
57
|
heartbeatResponseSchema,
|
|
@@ -51,6 +60,7 @@ export const responseSchema = z.discriminatedUnion("type", [
|
|
|
51
60
|
completionStreamResponseSchema,
|
|
52
61
|
unloadModelResponseSchema,
|
|
53
62
|
modelProgressUpdateSchema,
|
|
63
|
+
transcribeResponseSchema,
|
|
54
64
|
transcribeStreamResponseSchema,
|
|
55
65
|
loggingStreamResponseSchema,
|
|
56
66
|
embedResponseSchema,
|
|
@@ -65,11 +75,16 @@ export const responseSchema = z.discriminatedUnion("type", [
|
|
|
65
75
|
deleteCacheResponseSchema,
|
|
66
76
|
getModelInfoResponseSchema,
|
|
67
77
|
ocrStreamResponseSchema,
|
|
78
|
+
diffusionStreamResponseSchema,
|
|
79
|
+
finetuneResponseSchema,
|
|
80
|
+
finetuneProgressResponseSchema,
|
|
68
81
|
pluginInvokeResponseSchema,
|
|
69
82
|
pluginInvokeStreamResponseSchema,
|
|
70
83
|
modelRegistryListResponseSchema,
|
|
71
84
|
modelRegistrySearchResponseSchema,
|
|
72
85
|
modelRegistryGetModelResponseSchema,
|
|
86
|
+
suspendResponseSchema,
|
|
87
|
+
resumeResponseSchema,
|
|
73
88
|
]);
|
|
74
89
|
export const rpcOptionsSchema = z.object({
|
|
75
90
|
timeout: z.number().min(100).optional(),
|
|
@@ -111,18 +111,26 @@ export declare const completionStreamRequestSchema: z.ZodObject<{
|
|
|
111
111
|
type: z.ZodLiteral<"completionStream">;
|
|
112
112
|
}, z.core.$strip>;
|
|
113
113
|
export declare const completionStatsSchema: z.ZodObject<{
|
|
114
|
-
timeToFirstToken: z.ZodNumber
|
|
115
|
-
tokensPerSecond: z.ZodNumber
|
|
116
|
-
cacheTokens: z.ZodNumber
|
|
114
|
+
timeToFirstToken: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
tokensPerSecond: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
cacheTokens: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
backendDevice: z.ZodOptional<z.ZodEnum<{
|
|
118
|
+
cpu: "cpu";
|
|
119
|
+
gpu: "gpu";
|
|
120
|
+
}>>;
|
|
117
121
|
}, z.core.$strip>;
|
|
118
122
|
export declare const completionStreamResponseSchema: z.ZodObject<{
|
|
119
123
|
type: z.ZodLiteral<"completionStream">;
|
|
120
124
|
token: z.ZodString;
|
|
121
125
|
done: z.ZodOptional<z.ZodBoolean>;
|
|
122
126
|
stats: z.ZodOptional<z.ZodObject<{
|
|
123
|
-
timeToFirstToken: z.ZodNumber
|
|
124
|
-
tokensPerSecond: z.ZodNumber
|
|
125
|
-
cacheTokens: z.ZodNumber
|
|
127
|
+
timeToFirstToken: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
tokensPerSecond: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
cacheTokens: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
backendDevice: z.ZodOptional<z.ZodEnum<{
|
|
131
|
+
cpu: "cpu";
|
|
132
|
+
gpu: "gpu";
|
|
133
|
+
}>>;
|
|
126
134
|
}, z.core.$strip>>;
|
|
127
135
|
toolCallEvent: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
128
136
|
type: z.ZodLiteral<"toolCall">;
|
|
@@ -38,9 +38,10 @@ export const completionStreamRequestSchema = completionClientParamsSchema.extend
|
|
|
38
38
|
type: z.literal("completionStream"),
|
|
39
39
|
});
|
|
40
40
|
export const completionStatsSchema = z.object({
|
|
41
|
-
timeToFirstToken: z.number(),
|
|
42
|
-
tokensPerSecond: z.number(),
|
|
43
|
-
cacheTokens: z.number(),
|
|
41
|
+
timeToFirstToken: z.number().optional(),
|
|
42
|
+
tokensPerSecond: z.number().optional(),
|
|
43
|
+
cacheTokens: z.number().optional(),
|
|
44
|
+
backendDevice: z.enum(["cpu", "gpu"]).optional(),
|
|
44
45
|
});
|
|
45
46
|
export const completionStreamResponseSchema = z.object({
|
|
46
47
|
type: z.literal("completionStream"),
|
|
@@ -20,6 +20,7 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
20
20
|
"onnx-tts": "onnx-tts";
|
|
21
21
|
"parakeet-transcription": "parakeet-transcription";
|
|
22
22
|
"onnx-ocr": "onnx-ocr";
|
|
23
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
23
24
|
llm: "llm";
|
|
24
25
|
whisper: "whisper";
|
|
25
26
|
embeddings: "embeddings";
|
|
@@ -27,6 +28,7 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
27
28
|
parakeet: "parakeet";
|
|
28
29
|
tts: "tts";
|
|
29
30
|
ocr: "ocr";
|
|
31
|
+
diffusion: "diffusion";
|
|
30
32
|
}>, z.ZodLiteral<"vad">]>>;
|
|
31
33
|
}, z.core.$strip>]>;
|
|
32
34
|
seed: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -43,7 +45,7 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
43
45
|
engine?: string | undefined;
|
|
44
46
|
expectedSize?: number | undefined;
|
|
45
47
|
sha256Checksum?: string | undefined;
|
|
46
|
-
addon?: "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "llm" | "whisper" | "embeddings" | "nmt" | "parakeet" | "tts" | "ocr" | "vad" | undefined;
|
|
48
|
+
addon?: "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "sdcpp-generation" | "llm" | "whisper" | "embeddings" | "nmt" | "parakeet" | "tts" | "ocr" | "diffusion" | "vad" | undefined;
|
|
47
49
|
};
|
|
48
50
|
}, {
|
|
49
51
|
assetSrc: string | {
|
|
@@ -57,7 +59,7 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
57
59
|
engine?: string | undefined;
|
|
58
60
|
expectedSize?: number | undefined;
|
|
59
61
|
sha256Checksum?: string | undefined;
|
|
60
|
-
addon?: "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "llm" | "whisper" | "embeddings" | "nmt" | "parakeet" | "tts" | "ocr" | "vad" | undefined;
|
|
62
|
+
addon?: "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "sdcpp-generation" | "llm" | "whisper" | "embeddings" | "nmt" | "parakeet" | "tts" | "ocr" | "diffusion" | "vad" | undefined;
|
|
61
63
|
};
|
|
62
64
|
seed?: boolean | undefined;
|
|
63
65
|
}>>;
|
|
@@ -81,6 +83,7 @@ export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<
|
|
|
81
83
|
"onnx-tts": "onnx-tts";
|
|
82
84
|
"parakeet-transcription": "parakeet-transcription";
|
|
83
85
|
"onnx-ocr": "onnx-ocr";
|
|
86
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
84
87
|
llm: "llm";
|
|
85
88
|
whisper: "whisper";
|
|
86
89
|
embeddings: "embeddings";
|
|
@@ -88,6 +91,7 @@ export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<
|
|
|
88
91
|
parakeet: "parakeet";
|
|
89
92
|
tts: "tts";
|
|
90
93
|
ocr: "ocr";
|
|
94
|
+
diffusion: "diffusion";
|
|
91
95
|
}>, z.ZodLiteral<"vad">]>>;
|
|
92
96
|
}, z.core.$strip>]>;
|
|
93
97
|
seed: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -110,7 +114,7 @@ export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<
|
|
|
110
114
|
engine?: string | undefined;
|
|
111
115
|
expectedSize?: number | undefined;
|
|
112
116
|
sha256Checksum?: string | undefined;
|
|
113
|
-
addon?: "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "llm" | "whisper" | "embeddings" | "nmt" | "parakeet" | "tts" | "ocr" | "vad" | undefined;
|
|
117
|
+
addon?: "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "sdcpp-generation" | "llm" | "whisper" | "embeddings" | "nmt" | "parakeet" | "tts" | "ocr" | "diffusion" | "vad" | undefined;
|
|
114
118
|
};
|
|
115
119
|
seed?: boolean | undefined;
|
|
116
120
|
onProgress?: unknown;
|
package/dist/schemas/embed.d.ts
CHANGED
|
@@ -8,13 +8,32 @@ export declare const embedRequestSchema: z.ZodObject<{
|
|
|
8
8
|
text: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
9
9
|
type: z.ZodLiteral<"embed">;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
|
+
export declare const embedStatsSchema: z.ZodObject<{
|
|
12
|
+
totalTime: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
tokensPerSecond: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
totalTokens: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
backendDevice: z.ZodOptional<z.ZodEnum<{
|
|
16
|
+
cpu: "cpu";
|
|
17
|
+
gpu: "gpu";
|
|
18
|
+
}>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
11
20
|
export declare const embedResponseSchema: z.ZodObject<{
|
|
12
21
|
type: z.ZodLiteral<"embed">;
|
|
13
22
|
success: z.ZodBoolean;
|
|
14
23
|
embedding: z.ZodDefault<z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodArray<z.ZodNumber>>]>>;
|
|
24
|
+
stats: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
totalTime: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
tokensPerSecond: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
totalTokens: z.ZodOptional<z.ZodNumber>;
|
|
28
|
+
backendDevice: z.ZodOptional<z.ZodEnum<{
|
|
29
|
+
cpu: "cpu";
|
|
30
|
+
gpu: "gpu";
|
|
31
|
+
}>>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
15
33
|
error: z.ZodOptional<z.ZodString>;
|
|
16
34
|
}, z.core.$strip>;
|
|
17
35
|
export type EmbedParams = z.infer<typeof embedParamsSchema>;
|
|
18
36
|
export type EmbedRequest = z.infer<typeof embedRequestSchema>;
|
|
19
37
|
export type EmbedResponse = z.infer<typeof embedResponseSchema>;
|
|
38
|
+
export type EmbedStats = z.infer<typeof embedStatsSchema>;
|
|
20
39
|
//# sourceMappingURL=embed.d.ts.map
|
package/dist/schemas/embed.js
CHANGED
|
@@ -11,11 +11,18 @@ export const embedParamsSchema = z.object({
|
|
|
11
11
|
export const embedRequestSchema = embedParamsSchema.extend({
|
|
12
12
|
type: z.literal("embed"),
|
|
13
13
|
});
|
|
14
|
+
export const embedStatsSchema = z.object({
|
|
15
|
+
totalTime: z.number().optional(),
|
|
16
|
+
tokensPerSecond: z.number().optional(),
|
|
17
|
+
totalTokens: z.number().optional(),
|
|
18
|
+
backendDevice: z.enum(["cpu", "gpu"]).optional(),
|
|
19
|
+
});
|
|
14
20
|
export const embedResponseSchema = z.object({
|
|
15
21
|
type: z.literal("embed"),
|
|
16
22
|
success: z.boolean(),
|
|
17
23
|
embedding: z
|
|
18
24
|
.union([z.array(z.number()), z.array(z.array(z.number()))])
|
|
19
25
|
.default([]),
|
|
26
|
+
stats: embedStatsSchema.optional(),
|
|
20
27
|
error: z.string().optional(),
|
|
21
28
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ModelType } from "./model-types.js";
|
|
2
|
-
import { ADDON_EMBEDDING, ADDON_LLM, ADDON_NMT, ADDON_OCR, ADDON_PARAKEET, ADDON_TTS, ADDON_WHISPER, } from "./plugin.js";
|
|
2
|
+
import { ADDON_DIFFUSION, ADDON_EMBEDDING, ADDON_LLM, ADDON_NMT, ADDON_OCR, ADDON_PARAKEET, ADDON_TTS, ADDON_WHISPER, } from "./plugin.js";
|
|
3
3
|
import { modelRegistryEngineSchema, } from "./registry.js";
|
|
4
4
|
// Canonical engine → addon mapping (exhaustive).
|
|
5
5
|
// TypeScript enforces that every ModelRegistryEngine has an entry.
|
|
@@ -11,6 +11,7 @@ export const ENGINE_TO_ADDON = {
|
|
|
11
11
|
[ModelType.onnxTts]: "tts",
|
|
12
12
|
[ModelType.onnxOcr]: "ocr",
|
|
13
13
|
[ModelType.parakeetTranscription]: "parakeet",
|
|
14
|
+
[ModelType.sdcppGeneration]: "diffusion",
|
|
14
15
|
"onnx-vad": "vad",
|
|
15
16
|
};
|
|
16
17
|
// Legacy engine names → canonical engine.
|
|
@@ -34,6 +35,8 @@ const LEGACY_ENGINE_TO_CANONICAL = {
|
|
|
34
35
|
vad: "onnx-vad",
|
|
35
36
|
tts: ModelType.onnxTts,
|
|
36
37
|
ocr: ModelType.onnxOcr,
|
|
38
|
+
[ADDON_DIFFUSION]: ModelType.sdcppGeneration,
|
|
39
|
+
diffusion: ModelType.sdcppGeneration,
|
|
37
40
|
};
|
|
38
41
|
// Resolves any engine string (legacy or canonical) to a validated canonical engine.
|
|
39
42
|
// Returns null if the engine is not recognized.
|