@qvac/sdk 0.7.1 → 0.8.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 +73 -10
- package/README.md +4 -4
- package/bare-imports.json +9 -0
- package/dist/client/api/cancel.d.ts +9 -0
- package/dist/client/api/cancel.js +9 -0
- package/dist/client/api/completion-stream.d.ts +2 -1
- package/dist/client/api/completion-stream.js +2 -1
- package/dist/client/api/download-asset.d.ts +3 -2
- package/dist/client/api/download-asset.js +4 -3
- package/dist/client/api/embed.d.ts +5 -2
- package/dist/client/api/embed.js +2 -2
- package/dist/client/api/get-model-info.d.ts +1 -1
- package/dist/client/api/heartbeat.d.ts +30 -0
- package/dist/client/api/heartbeat.js +38 -0
- package/dist/client/api/index.d.ts +1 -1
- package/dist/client/api/index.js +1 -1
- package/dist/client/api/invoke-plugin.d.ts +3 -2
- package/dist/client/api/invoke-plugin.js +4 -4
- package/dist/client/api/load-model.d.ts +12 -10
- package/dist/client/api/load-model.js +3 -3
- package/dist/client/api/rag.d.ts +10 -10
- package/dist/client/api/rag.js +21 -21
- package/dist/client/api/text-to-speech.d.ts +2 -2
- package/dist/client/api/text-to-speech.js +3 -3
- package/dist/client/api/transcribe.d.ts +5 -3
- package/dist/client/api/transcribe.js +6 -4
- package/dist/client/api/translate.d.ts +2 -2
- package/dist/client/api/translate.js +3 -3
- package/dist/client/rpc/node-rpc-client.d.ts +2 -7
- package/dist/client/rpc/node-rpc-client.js +2 -39
- package/dist/client/rpc/profiling/index.d.ts +2 -0
- package/dist/client/rpc/profiling/index.js +1 -0
- package/dist/client/rpc/profiling/profiler.d.ts +27 -0
- package/dist/client/rpc/profiling/profiler.js +139 -0
- package/dist/client/rpc/rpc-client.d.ts +2 -2
- package/dist/client/rpc/rpc-client.js +174 -12
- package/dist/examples/delegated-inference/consumer-profiled.d.ts +2 -0
- package/dist/examples/delegated-inference/consumer-profiled.js +67 -0
- package/dist/examples/embed-p2p.d.ts +2 -0
- package/dist/examples/llamacpp-multimodal.js +1 -1
- package/dist/examples/llamacpp-p2p.d.ts +2 -0
- package/dist/examples/parallel-download.js +45 -13
- package/dist/examples/profiling/basic.d.ts +2 -0
- package/dist/examples/profiling/basic.js +71 -0
- package/dist/examples/profiling/per-call.d.ts +2 -0
- package/dist/examples/profiling/per-call.js +30 -0
- package/dist/examples/seed-p2p.d.ts +2 -0
- package/dist/examples/transcription/parakeet-ctc-filesystem.d.ts +2 -0
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +40 -0
- package/dist/examples/transcription/parakeet-microphone-record.d.ts +2 -0
- package/dist/examples/transcription/parakeet-microphone-record.js +95 -0
- package/dist/examples/transcription/parakeet-sortformer.d.ts +2 -0
- package/dist/examples/transcription/parakeet-sortformer.js +115 -0
- package/dist/examples/transcription/parakeet-tdt-filesystem.d.ts +2 -0
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +44 -0
- package/dist/examples/translation/translation-bergamot-pivot.d.ts +2 -0
- package/dist/examples/translation/translation-bergamot-pivot.js +73 -0
- package/dist/examples/translation/translation-llm-afriquegemma.d.ts +2 -0
- package/dist/examples/translation/translation-llm-afriquegemma.js +39 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -1
- package/dist/logging/index.d.ts +1 -1
- package/dist/logging/index.js +1 -1
- package/dist/logging/namespaces.d.ts +3 -9
- package/dist/logging/namespaces.js +2 -8
- package/dist/logging/registry.js +15 -1
- package/dist/models/registry/models.d.ts +1671 -310
- package/dist/models/registry/models.js +2116 -710
- package/dist/models/update-models/codegen.js +2 -2
- package/dist/models/update-models/history.d.ts +11 -0
- package/dist/models/update-models/history.js +24 -5
- package/dist/models/update-models/index.js +17 -16
- package/dist/models/update-models/naming.js +56 -0
- package/dist/profiling/aggregator.d.ts +15 -0
- package/dist/profiling/aggregator.js +100 -0
- package/dist/profiling/clock.d.ts +12 -0
- package/dist/profiling/clock.js +51 -0
- package/dist/profiling/controller.d.ts +33 -0
- package/dist/profiling/controller.js +123 -0
- package/dist/profiling/envelope.d.ts +10 -0
- package/dist/profiling/envelope.js +36 -0
- package/dist/profiling/events.d.ts +20 -0
- package/dist/profiling/events.js +37 -0
- package/dist/profiling/exporters.d.ts +10 -0
- package/dist/profiling/exporters.js +236 -0
- package/dist/profiling/index.d.ts +36 -0
- package/dist/profiling/index.js +31 -0
- package/dist/profiling/ring-buffer.d.ts +19 -0
- package/dist/profiling/ring-buffer.js +83 -0
- package/dist/profiling/types.d.ts +47 -0
- package/dist/profiling/types.js +1 -0
- package/dist/schemas/cancel.d.ts +12 -0
- package/dist/schemas/cancel.js +2 -0
- package/dist/schemas/common.d.ts +1927 -135
- package/dist/schemas/common.js +6 -3
- package/dist/schemas/completion-stream.d.ts +31 -0
- package/dist/schemas/completion-stream.js +13 -0
- package/dist/schemas/delegate.d.ts +8 -0
- package/dist/schemas/delegate.js +5 -2
- package/dist/schemas/download-asset.d.ts +14 -3
- package/dist/schemas/download-asset.js +3 -1
- package/dist/schemas/engine-addon-map.js +9 -6
- package/dist/schemas/get-model-info.d.ts +2 -0
- package/dist/schemas/get-model-info.js +1 -0
- package/dist/schemas/heartbeat.d.ts +17 -0
- package/dist/schemas/heartbeat.js +10 -0
- package/dist/schemas/index.d.ts +3 -2
- package/dist/schemas/index.js +3 -2
- package/dist/schemas/llamacpp-config.d.ts +140 -14
- package/dist/schemas/llamacpp-config.js +11 -7
- package/dist/schemas/load-model.d.ts +9762 -2515
- package/dist/schemas/load-model.js +142 -182
- 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 +37 -0
- package/dist/schemas/ocr.js +5 -0
- package/dist/schemas/plugin.d.ts +51 -5
- package/dist/schemas/plugin.js +26 -0
- package/dist/schemas/profiling.d.ts +105 -0
- package/dist/schemas/profiling.js +66 -0
- package/dist/schemas/registry.d.ts +18 -0
- package/dist/schemas/registry.js +2 -0
- package/dist/schemas/reload-config.d.ts +126 -6
- package/dist/schemas/reload-config.js +1 -1
- package/dist/schemas/sdk-config.d.ts +2280 -24
- package/dist/schemas/sdk-config.js +6 -1
- package/dist/schemas/sdk-errors-client.d.ts +1 -0
- package/dist/schemas/sdk-errors-client.js +7 -0
- package/dist/schemas/sdk-errors-server.d.ts +3 -0
- package/dist/schemas/sdk-errors-server.js +15 -0
- package/dist/schemas/text-to-speech.d.ts +90 -68
- package/dist/schemas/text-to-speech.js +16 -33
- package/dist/schemas/transcription-config.d.ts +383 -0
- package/dist/schemas/{whispercpp-config.js → transcription-config.js} +29 -1
- package/dist/schemas/translation-config.d.ts +463 -8
- package/dist/schemas/translation-config.js +35 -2
- package/dist/server/bare/delegate-rpc-client.js +52 -11
- package/dist/server/bare/ops/load-model.d.ts +7 -1
- package/dist/server/bare/ops/load-model.js +41 -42
- package/dist/server/bare/ops/transcribe.d.ts +3 -0
- package/dist/server/bare/ops/transcribe.js +75 -0
- package/dist/server/bare/ops/translate.d.ts +2 -0
- package/dist/server/bare/ops/translate.js +12 -4
- 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 +2 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +8 -6
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +108 -3
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +19 -6
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +32 -2
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +31 -17
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +325 -3
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +117 -13
- package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +50 -2
- package/dist/server/bare/plugins/onnx-ocr/plugin.js +46 -5
- package/dist/server/bare/plugins/onnx-tts/plugin.d.ts +351 -4
- package/dist/server/bare/plugins/onnx-tts/plugin.js +81 -61
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +317 -0
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +154 -0
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +209 -3
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +21 -9
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +2 -2
- package/dist/server/bare/registry/model-config-utils.js +3 -1
- package/dist/server/bare/registry/model-registry.d.ts +2 -0
- package/dist/server/bare/registry/model-registry.js +2 -1
- package/dist/server/bare/utils/audio-input.d.ts +10 -0
- package/dist/server/bare/utils/audio-input.js +33 -0
- package/dist/server/error-handlers.d.ts +3 -2
- package/dist/server/error-handlers.js +11 -8
- package/dist/server/plugins/registry.js +5 -1
- package/dist/server/rpc/delegate-transport.d.ts +11 -3
- package/dist/server/rpc/delegate-transport.js +214 -38
- package/dist/server/rpc/delegate-utils.d.ts +2 -0
- package/dist/server/rpc/delegate-utils.js +5 -0
- package/dist/server/rpc/handle-request.js +43 -4
- package/dist/server/rpc/handler-registry.js +33 -4
- package/dist/server/rpc/handler-utils.d.ts +5 -4
- package/dist/server/rpc/handler-utils.js +114 -31
- package/dist/server/rpc/handlers/cancel-delegated.d.ts +4 -0
- package/dist/server/rpc/handlers/cancel-delegated.js +71 -0
- package/dist/server/rpc/handlers/completion-stream-delegated.d.ts +3 -1
- package/dist/server/rpc/handlers/completion-stream-delegated.js +13 -4
- package/dist/server/rpc/handlers/download-asset.js +55 -3
- package/dist/server/rpc/handlers/heartbeat-delegated.d.ts +4 -0
- package/dist/server/rpc/handlers/heartbeat-delegated.js +32 -0
- package/dist/server/rpc/handlers/heartbeat.d.ts +3 -0
- package/dist/server/rpc/handlers/heartbeat.js +3 -0
- package/dist/server/rpc/handlers/index.d.ts +2 -2
- package/dist/server/rpc/handlers/index.js +2 -2
- package/dist/server/rpc/handlers/load-model/download-stats.d.ts +6 -0
- package/dist/server/rpc/handlers/load-model/download-stats.js +87 -0
- package/dist/server/rpc/handlers/load-model/handler.js +108 -123
- package/dist/server/rpc/handlers/load-model/http.d.ts +2 -1
- package/dist/server/rpc/handlers/load-model/http.js +21 -5
- package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +2 -1
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +19 -14
- package/dist/server/rpc/handlers/load-model/registry.d.ts +2 -1
- package/dist/server/rpc/handlers/load-model/registry.js +113 -136
- package/dist/server/rpc/handlers/load-model/resolve.d.ts +2 -0
- package/dist/server/rpc/handlers/load-model/resolve.js +55 -22
- package/dist/server/rpc/handlers/load-model/types.d.ts +29 -0
- package/dist/server/rpc/handlers/load-model/types.js +1 -0
- package/dist/server/rpc/handlers/load-model-delegated.d.ts +5 -1
- package/dist/server/rpc/handlers/load-model-delegated.js +41 -11
- package/dist/server/rpc/handlers/plugin-dispatch.js +15 -10
- package/dist/server/rpc/handlers/plugin-invoke.js +56 -51
- package/dist/server/rpc/handlers/rag.js +24 -0
- package/dist/server/rpc/handlers/unload-model-delegated.d.ts +3 -0
- package/dist/server/rpc/handlers/unload-model-delegated.js +32 -0
- package/dist/server/rpc/profiling/context.d.ts +18 -0
- package/dist/server/rpc/profiling/context.js +38 -0
- package/dist/server/rpc/profiling/delegation-profiler.d.ts +32 -0
- package/dist/server/rpc/profiling/delegation-profiler.js +154 -0
- package/dist/server/rpc/profiling/index.d.ts +5 -0
- package/dist/server/rpc/profiling/index.js +4 -0
- package/dist/server/rpc/profiling/operation-metrics.d.ts +25 -0
- package/dist/server/rpc/profiling/operation-metrics.js +199 -0
- package/dist/server/rpc/profiling/operation-wrappers.d.ts +18 -0
- package/dist/server/rpc/profiling/operation-wrappers.js +124 -0
- package/dist/server/rpc/profiling/profiler.d.ts +13 -0
- package/dist/server/rpc/profiling/profiler.js +97 -0
- package/dist/server/utils/cache.d.ts +2 -1
- package/dist/server/utils/cache.js +5 -1
- package/dist/server/utils/checksum.d.ts +2 -0
- package/dist/server/utils/checksum.js +7 -0
- package/dist/server/utils/formatting.d.ts +6 -0
- package/dist/server/utils/formatting.js +35 -0
- package/dist/server/worker.js +2 -1
- package/dist/utils/errors-client.d.ts +3 -0
- package/dist/utils/errors-client.js +6 -0
- package/dist/utils/errors-server.d.ts +9 -0
- package/dist/utils/errors-server.js +15 -0
- package/dist/utils/global-singleton.d.ts +2 -0
- package/dist/utils/global-singleton.js +10 -0
- package/package.json +22 -18
- package/dist/client/api/ping.d.ts +0 -11
- package/dist/client/api/ping.js +0 -19
- package/dist/examples/embed-hyperdrive.d.ts +0 -2
- package/dist/examples/llamacpp-hyperdrive.d.ts +0 -2
- package/dist/examples/seed-hyperdrive.d.ts +0 -2
- package/dist/schemas/ping.d.ts +0 -11
- package/dist/schemas/ping.js +0 -8
- package/dist/schemas/whispercpp-config.d.ts +0 -70
- package/dist/server/bare/plugins/whispercpp-transcription/ops/transcribe-stream.d.ts +0 -3
- package/dist/server/bare/plugins/whispercpp-transcription/ops/transcribe-stream.js +0 -81
- package/dist/server/rpc/handlers/ping.d.ts +0 -3
- package/dist/server/rpc/handlers/ping.js +0 -3
- /package/dist/examples/{embed-hyperdrive.js → embed-p2p.js} +0 -0
- /package/dist/examples/{llamacpp-hyperdrive.js → llamacpp-p2p.js} +0 -0
- /package/dist/examples/{seed-hyperdrive.js → seed-p2p.js} +0 -0
- /package/dist/examples/{whispercpp-filesystem.d.ts → transcription/whispercpp-filesystem.d.ts} +0 -0
- /package/dist/examples/{whispercpp-filesystem.js → transcription/whispercpp-filesystem.js} +0 -0
- /package/dist/examples/{whispercpp-microphone-record.d.ts → transcription/whispercpp-microphone-record.d.ts} +0 -0
- /package/dist/examples/{whispercpp-microphone-record.js → transcription/whispercpp-microphone-record.js} +0 -0
- /package/dist/examples/{whispercpp-prompt.d.ts → transcription/whispercpp-prompt.d.ts} +0 -0
- /package/dist/examples/{whispercpp-prompt.js → transcription/whispercpp-prompt.js} +0 -0
package/dist/schemas/common.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { perCallProfilingSchema } from "./profiling.js";
|
|
3
|
+
import { heartbeatRequestSchema, heartbeatResponseSchema } from "./heartbeat.js";
|
|
3
4
|
import { completionStreamRequestSchema, completionStreamResponseSchema, } from "./completion-stream.js";
|
|
4
5
|
import { loadModelRequestSchema, loadModelResponseSchema, modelProgressUpdateSchema, } from "./load-model.js";
|
|
5
6
|
import { downloadAssetRequestSchema, downloadAssetResponseSchema, } from "./download-asset.js";
|
|
@@ -20,7 +21,7 @@ import { ocrStreamRequestSchema, ocrStreamResponseSchema } from "./ocr.js";
|
|
|
20
21
|
import { pluginInvokeRequestSchema, pluginInvokeResponseSchema, pluginInvokeStreamRequestSchema, pluginInvokeStreamResponseSchema, } from "./plugin.js";
|
|
21
22
|
import { modelRegistryListRequestSchema, modelRegistryListResponseSchema, modelRegistrySearchRequestSchema, modelRegistrySearchResponseSchema, modelRegistryGetModelRequestSchema, modelRegistryGetModelResponseSchema, } from "./registry.js";
|
|
22
23
|
export const requestSchema = z.union([
|
|
23
|
-
|
|
24
|
+
heartbeatRequestSchema,
|
|
24
25
|
loadModelRequestSchema,
|
|
25
26
|
downloadAssetRequestSchema,
|
|
26
27
|
completionStreamRequestSchema,
|
|
@@ -44,7 +45,7 @@ export const requestSchema = z.union([
|
|
|
44
45
|
modelRegistryGetModelRequestSchema,
|
|
45
46
|
]);
|
|
46
47
|
export const responseSchema = z.discriminatedUnion("type", [
|
|
47
|
-
|
|
48
|
+
heartbeatResponseSchema,
|
|
48
49
|
loadModelResponseSchema,
|
|
49
50
|
downloadAssetResponseSchema,
|
|
50
51
|
completionStreamResponseSchema,
|
|
@@ -72,5 +73,7 @@ export const responseSchema = z.discriminatedUnion("type", [
|
|
|
72
73
|
]);
|
|
73
74
|
export const rpcOptionsSchema = z.object({
|
|
74
75
|
timeout: z.number().min(100).optional(),
|
|
76
|
+
healthCheckTimeout: z.number().min(100).optional(),
|
|
75
77
|
forceNewConnection: z.boolean().optional(),
|
|
78
|
+
profiling: perCallProfilingSchema.optional(),
|
|
76
79
|
});
|
|
@@ -2,6 +2,16 @@ import { z } from "zod";
|
|
|
2
2
|
export declare const attachmentSchema: z.ZodObject<{
|
|
3
3
|
path: z.ZodString;
|
|
4
4
|
}, z.core.$strip>;
|
|
5
|
+
export declare const generationParamsSchema: z.ZodObject<{
|
|
6
|
+
temp: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
top_k: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
predict: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
repeat_penalty: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
}, z.core.$strict>;
|
|
5
15
|
export declare const completionParamsSchema: z.ZodObject<{
|
|
6
16
|
history: z.ZodArray<z.ZodObject<{
|
|
7
17
|
role: z.ZodString;
|
|
@@ -45,6 +55,16 @@ export declare const completionClientParamsSchema: z.ZodObject<{
|
|
|
45
55
|
}, z.core.$strip>>>;
|
|
46
56
|
stream: z.ZodBoolean;
|
|
47
57
|
kvCache: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
58
|
+
generationParams: z.ZodOptional<z.ZodObject<{
|
|
59
|
+
temp: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
top_k: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
predict: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
repeat_penalty: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
}, z.core.$strict>>;
|
|
48
68
|
}, z.core.$strip>;
|
|
49
69
|
export declare const completionStreamRequestSchema: z.ZodObject<{
|
|
50
70
|
history: z.ZodArray<z.ZodObject<{
|
|
@@ -78,6 +98,16 @@ export declare const completionStreamRequestSchema: z.ZodObject<{
|
|
|
78
98
|
}, z.core.$strip>>>;
|
|
79
99
|
stream: z.ZodBoolean;
|
|
80
100
|
kvCache: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>;
|
|
101
|
+
generationParams: z.ZodOptional<z.ZodObject<{
|
|
102
|
+
temp: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
top_p: z.ZodOptional<z.ZodNumber>;
|
|
104
|
+
top_k: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
predict: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
107
|
+
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
repeat_penalty: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
}, z.core.$strict>>;
|
|
81
111
|
type: z.ZodLiteral<"completionStream">;
|
|
82
112
|
}, z.core.$strip>;
|
|
83
113
|
export declare const completionStatsSchema: z.ZodObject<{
|
|
@@ -122,6 +152,7 @@ export declare const completionStreamResponseSchema: z.ZodObject<{
|
|
|
122
152
|
}, z.core.$strip>>>;
|
|
123
153
|
error: z.ZodOptional<z.ZodString>;
|
|
124
154
|
}, z.core.$strip>;
|
|
155
|
+
export type GenerationParams = z.infer<typeof generationParamsSchema>;
|
|
125
156
|
export type CompletionParams = z.infer<typeof completionParamsSchema>;
|
|
126
157
|
export type CompletionClientParams = z.input<typeof completionClientParamsSchema>;
|
|
127
158
|
export type CompletionStreamRequest = z.infer<typeof completionStreamRequestSchema>;
|
|
@@ -7,6 +7,18 @@ const kvCacheSchema = z.union([
|
|
|
7
7
|
z.boolean(),
|
|
8
8
|
z.string().min(1, "KV cache key cannot be empty string"),
|
|
9
9
|
]);
|
|
10
|
+
export const generationParamsSchema = z
|
|
11
|
+
.object({
|
|
12
|
+
temp: z.number().optional(),
|
|
13
|
+
top_p: z.number().optional(),
|
|
14
|
+
top_k: z.number().optional(),
|
|
15
|
+
predict: z.number().optional(),
|
|
16
|
+
seed: z.number().optional(),
|
|
17
|
+
frequency_penalty: z.number().optional(),
|
|
18
|
+
presence_penalty: z.number().optional(),
|
|
19
|
+
repeat_penalty: z.number().optional(),
|
|
20
|
+
})
|
|
21
|
+
.strict();
|
|
10
22
|
export const completionParamsSchema = z.object({
|
|
11
23
|
history: z.array(z.object({
|
|
12
24
|
role: z.string(),
|
|
@@ -20,6 +32,7 @@ export const completionClientParamsSchema = completionParamsSchema.extend({
|
|
|
20
32
|
tools: z.array(toolSchema).optional(),
|
|
21
33
|
stream: z.boolean(),
|
|
22
34
|
kvCache: kvCacheSchema.optional(),
|
|
35
|
+
generationParams: generationParamsSchema.optional(),
|
|
23
36
|
});
|
|
24
37
|
export const completionStreamRequestSchema = completionClientParamsSchema.extend({
|
|
25
38
|
type: z.literal("completionStream"),
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export declare const delegateBaseSchema: z.ZodObject<{
|
|
3
|
+
topic: z.ZodString;
|
|
4
|
+
providerPublicKey: z.ZodString;
|
|
5
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
healthCheckTimeout: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
}, z.core.$strip>;
|
|
2
8
|
export declare const delegateSchema: z.ZodOptional<z.ZodObject<{
|
|
3
9
|
topic: z.ZodString;
|
|
4
10
|
providerPublicKey: z.ZodString;
|
|
5
11
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
healthCheckTimeout: z.ZodOptional<z.ZodNumber>;
|
|
6
13
|
fallbackToLocal: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
7
14
|
forceNewConnection: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
8
15
|
}, z.core.$strip>>;
|
|
16
|
+
export type DelegateBase = z.infer<typeof delegateBaseSchema>;
|
|
9
17
|
export type Delegate = z.infer<typeof delegateSchema>;
|
|
10
18
|
//# sourceMappingURL=delegate.d.ts.map
|
package/dist/schemas/delegate.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export const
|
|
3
|
-
.object({
|
|
2
|
+
export const delegateBaseSchema = z.object({
|
|
4
3
|
topic: z.string(),
|
|
5
4
|
providerPublicKey: z.string(),
|
|
6
5
|
timeout: z.number().min(100).optional(),
|
|
6
|
+
healthCheckTimeout: z.number().min(100).optional(),
|
|
7
|
+
});
|
|
8
|
+
export const delegateSchema = delegateBaseSchema
|
|
9
|
+
.extend({
|
|
7
10
|
fallbackToLocal: z.boolean().optional().default(false),
|
|
8
11
|
forceNewConnection: z.boolean().optional().default(false),
|
|
9
12
|
})
|
|
@@ -18,11 +18,13 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
18
18
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
19
19
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
20
20
|
"onnx-tts": "onnx-tts";
|
|
21
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
21
22
|
"onnx-ocr": "onnx-ocr";
|
|
22
23
|
llm: "llm";
|
|
23
24
|
whisper: "whisper";
|
|
24
25
|
embeddings: "embeddings";
|
|
25
26
|
nmt: "nmt";
|
|
27
|
+
parakeet: "parakeet";
|
|
26
28
|
tts: "tts";
|
|
27
29
|
ocr: "ocr";
|
|
28
30
|
}>, z.ZodLiteral<"vad">]>>;
|
|
@@ -41,7 +43,7 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
41
43
|
engine?: string | undefined;
|
|
42
44
|
expectedSize?: number | undefined;
|
|
43
45
|
sha256Checksum?: string | undefined;
|
|
44
|
-
addon?: "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "onnx-ocr" | "llm" | "whisper" | "embeddings" | "nmt" | "tts" | "ocr" | "vad" | 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;
|
|
45
47
|
};
|
|
46
48
|
}, {
|
|
47
49
|
assetSrc: string | {
|
|
@@ -55,7 +57,7 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
55
57
|
engine?: string | undefined;
|
|
56
58
|
expectedSize?: number | undefined;
|
|
57
59
|
sha256Checksum?: string | undefined;
|
|
58
|
-
addon?: "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "onnx-ocr" | "llm" | "whisper" | "embeddings" | "nmt" | "tts" | "ocr" | "vad" | 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;
|
|
59
61
|
};
|
|
60
62
|
seed?: boolean | undefined;
|
|
61
63
|
}>>;
|
|
@@ -77,11 +79,13 @@ export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<
|
|
|
77
79
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
78
80
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
79
81
|
"onnx-tts": "onnx-tts";
|
|
82
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
80
83
|
"onnx-ocr": "onnx-ocr";
|
|
81
84
|
llm: "llm";
|
|
82
85
|
whisper: "whisper";
|
|
83
86
|
embeddings: "embeddings";
|
|
84
87
|
nmt: "nmt";
|
|
88
|
+
parakeet: "parakeet";
|
|
85
89
|
tts: "tts";
|
|
86
90
|
ocr: "ocr";
|
|
87
91
|
}>, z.ZodLiteral<"vad">]>>;
|
|
@@ -106,7 +110,7 @@ export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<
|
|
|
106
110
|
engine?: string | undefined;
|
|
107
111
|
expectedSize?: number | undefined;
|
|
108
112
|
sha256Checksum?: string | undefined;
|
|
109
|
-
addon?: "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "onnx-ocr" | "llm" | "whisper" | "embeddings" | "nmt" | "tts" | "ocr" | "vad" | 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;
|
|
110
114
|
};
|
|
111
115
|
seed?: boolean | undefined;
|
|
112
116
|
onProgress?: unknown;
|
|
@@ -139,6 +143,12 @@ export declare const downloadTypeSchema: z.ZodEnum<{
|
|
|
139
143
|
http: "http";
|
|
140
144
|
registry: "registry";
|
|
141
145
|
}>;
|
|
146
|
+
export declare const sourceTypeSchema: z.ZodEnum<{
|
|
147
|
+
hyperdrive: "hyperdrive";
|
|
148
|
+
http: "http";
|
|
149
|
+
registry: "registry";
|
|
150
|
+
filesystem: "filesystem";
|
|
151
|
+
}>;
|
|
142
152
|
export declare const downloadMetadataSchema: z.ZodObject<{
|
|
143
153
|
key: z.ZodString;
|
|
144
154
|
startTime: z.ZodNumber;
|
|
@@ -174,6 +184,7 @@ export type DownloadAssetOptions = z.input<typeof downloadAssetOptionsSchema> &
|
|
|
174
184
|
export type DownloadAssetRequest = z.infer<typeof downloadAssetRequestSchema>;
|
|
175
185
|
export type DownloadAssetResponse = z.infer<typeof downloadAssetResponseSchema>;
|
|
176
186
|
export type DownloadType = z.infer<typeof downloadTypeSchema>;
|
|
187
|
+
export type SourceType = z.infer<typeof sourceTypeSchema>;
|
|
177
188
|
export type BaseDownloadEntry = z.infer<typeof downloadMetadataSchema> & {
|
|
178
189
|
promise: Promise<string>;
|
|
179
190
|
abortController: AbortController;
|
|
@@ -36,7 +36,9 @@ export const downloadAssetResponseSchema = z.object({
|
|
|
36
36
|
assetId: z.string().optional(),
|
|
37
37
|
error: z.string().optional(),
|
|
38
38
|
});
|
|
39
|
-
|
|
39
|
+
const downloadTypes = ["hyperdrive", "http", "registry"];
|
|
40
|
+
export const downloadTypeSchema = z.enum(downloadTypes);
|
|
41
|
+
export const sourceTypeSchema = z.enum([...downloadTypes, "filesystem"]);
|
|
40
42
|
export const downloadMetadataSchema = z.object({
|
|
41
43
|
key: z.string(),
|
|
42
44
|
startTime: z.number(),
|
|
@@ -1,4 +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
3
|
import { modelRegistryEngineSchema, } from "./registry.js";
|
|
3
4
|
// Canonical engine → addon mapping (exhaustive).
|
|
4
5
|
// TypeScript enforces that every ModelRegistryEngine has an entry.
|
|
@@ -9,20 +10,22 @@ export const ENGINE_TO_ADDON = {
|
|
|
9
10
|
[ModelType.nmtcppTranslation]: "nmt",
|
|
10
11
|
[ModelType.onnxTts]: "tts",
|
|
11
12
|
[ModelType.onnxOcr]: "ocr",
|
|
13
|
+
[ModelType.parakeetTranscription]: "parakeet",
|
|
12
14
|
"onnx-vad": "vad",
|
|
13
15
|
};
|
|
14
16
|
// Legacy engine names → canonical engine.
|
|
15
17
|
// Used for backward compatibility with old registry data that uses @qvac/* package names.
|
|
16
18
|
const LEGACY_ENGINE_TO_CANONICAL = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
[ADDON_LLM]: ModelType.llamacppCompletion,
|
|
20
|
+
[ADDON_WHISPER]: ModelType.whispercppTranscription,
|
|
21
|
+
[ADDON_EMBEDDING]: ModelType.llamacppEmbedding,
|
|
22
|
+
[ADDON_NMT]: ModelType.nmtcppTranslation,
|
|
23
|
+
[ADDON_TTS]: ModelType.onnxTts,
|
|
24
|
+
[ADDON_OCR]: ModelType.onnxOcr,
|
|
25
|
+
[ADDON_PARAKEET]: ModelType.parakeetTranscription,
|
|
21
26
|
"@qvac/translation-llamacpp": ModelType.nmtcppTranslation,
|
|
22
27
|
"@qvac/vad-silero": "onnx-vad",
|
|
23
|
-
"@qvac/tts-onnx": ModelType.onnxTts,
|
|
24
28
|
"@qvac/tts": ModelType.onnxTts,
|
|
25
|
-
"@qvac/ocr-onnx": ModelType.onnxOcr,
|
|
26
29
|
// Tag-style names (used by some older registry entries)
|
|
27
30
|
generation: ModelType.llamacppCompletion,
|
|
28
31
|
transcription: ModelType.whispercppTranscription,
|
|
@@ -39,6 +39,7 @@ export declare const modelInfoSchema: z.ZodObject<{
|
|
|
39
39
|
whisper: "whisper";
|
|
40
40
|
embeddings: "embeddings";
|
|
41
41
|
nmt: "nmt";
|
|
42
|
+
parakeet: "parakeet";
|
|
42
43
|
tts: "tts";
|
|
43
44
|
ocr: "ocr";
|
|
44
45
|
vad: "vad";
|
|
@@ -84,6 +85,7 @@ export declare const getModelInfoResponseSchema: z.ZodObject<{
|
|
|
84
85
|
whisper: "whisper";
|
|
85
86
|
embeddings: "embeddings";
|
|
86
87
|
nmt: "nmt";
|
|
88
|
+
parakeet: "parakeet";
|
|
87
89
|
tts: "tts";
|
|
88
90
|
ocr: "ocr";
|
|
89
91
|
vad: "vad";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const heartbeatRequestSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"heartbeat">;
|
|
4
|
+
delegate: z.ZodOptional<z.ZodObject<{
|
|
5
|
+
topic: z.ZodString;
|
|
6
|
+
providerPublicKey: z.ZodString;
|
|
7
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
healthCheckTimeout: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export declare const heartbeatResponseSchema: z.ZodObject<{
|
|
12
|
+
type: z.ZodLiteral<"heartbeat">;
|
|
13
|
+
number: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type HeartbeatRequest = z.infer<typeof heartbeatRequestSchema>;
|
|
16
|
+
export type HeartbeatResponse = z.infer<typeof heartbeatResponseSchema>;
|
|
17
|
+
//# sourceMappingURL=heartbeat.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { delegateBaseSchema } from "./delegate.js";
|
|
3
|
+
export const heartbeatRequestSchema = z.object({
|
|
4
|
+
type: z.literal("heartbeat"),
|
|
5
|
+
delegate: delegateBaseSchema.optional(),
|
|
6
|
+
});
|
|
7
|
+
export const heartbeatResponseSchema = z.object({
|
|
8
|
+
type: z.literal("heartbeat"),
|
|
9
|
+
number: z.number(),
|
|
10
|
+
});
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -12,13 +12,13 @@ export * from "./logging-stream";
|
|
|
12
12
|
export * from "./provide";
|
|
13
13
|
export * from "./stop-provide";
|
|
14
14
|
export * from "./unload-model";
|
|
15
|
-
export * from "./
|
|
15
|
+
export * from "./heartbeat";
|
|
16
16
|
export * from "./common";
|
|
17
17
|
export * from "./transcription";
|
|
18
18
|
export * from "./translate";
|
|
19
19
|
export * from "./translation-config";
|
|
20
20
|
export * from "./llamacpp-config";
|
|
21
|
-
export * from "./
|
|
21
|
+
export * from "./transcription-config";
|
|
22
22
|
export * from "./text-to-speech";
|
|
23
23
|
export * from "./error";
|
|
24
24
|
export * from "./rag";
|
|
@@ -28,6 +28,7 @@ export { SDK_CLIENT_ERROR_CODES } from "./sdk-errors-client";
|
|
|
28
28
|
export { SDK_SERVER_ERROR_CODES } from "./sdk-errors-server";
|
|
29
29
|
export { REGISTRY_ERROR_CODES } from "./sdk-errors-registry";
|
|
30
30
|
export { qvacConfigSchema, deviceMatchSchema, deviceConfigDefaultsSchema, devicePatternSchema, type QvacConfig, type DeviceMatch, type DeviceConfigDefaults, type DevicePattern, } from "./sdk-config";
|
|
31
|
+
export { PROFILING_KEY, PROFILING_TRAILER_KEY, DELEGATION_BREAKDOWN_KEY, OPERATION_EVENT_KEY, profilerModeSchema, serverBreakdownSchema, delegationBreakdownSchema, operationEventSchema, profilingRequestMetaSchema, profilingResponseMetaSchema, perCallProfilingSchema, type ProfilerMode, type ServerBreakdown, type DelegationBreakdown, type OperationEvent, type ProfilingRequestMeta, type ProfilingResponseMeta, type PerCallProfiling, } from "./profiling";
|
|
31
32
|
export { runtimeContextSchema, type RuntimeContext } from "./runtime-context";
|
|
32
33
|
export * from "./get-model-info";
|
|
33
34
|
export * from "./model-src-utils";
|
package/dist/schemas/index.js
CHANGED
|
@@ -13,13 +13,13 @@ export * from "./logging-stream.js";
|
|
|
13
13
|
export * from "./provide.js";
|
|
14
14
|
export * from "./stop-provide.js";
|
|
15
15
|
export * from "./unload-model.js";
|
|
16
|
-
export * from "./
|
|
16
|
+
export * from "./heartbeat.js";
|
|
17
17
|
export * from "./common.js";
|
|
18
18
|
export * from "./transcription.js";
|
|
19
19
|
export * from "./translate.js";
|
|
20
20
|
export * from "./translation-config.js";
|
|
21
21
|
export * from "./llamacpp-config.js";
|
|
22
|
-
export * from "./
|
|
22
|
+
export * from "./transcription-config.js";
|
|
23
23
|
export * from "./text-to-speech.js";
|
|
24
24
|
export * from "./error.js";
|
|
25
25
|
export * from "./rag.js";
|
|
@@ -29,6 +29,7 @@ export { SDK_CLIENT_ERROR_CODES } from "./sdk-errors-client.js";
|
|
|
29
29
|
export { SDK_SERVER_ERROR_CODES } from "./sdk-errors-server.js";
|
|
30
30
|
export { REGISTRY_ERROR_CODES } from "./sdk-errors-registry.js";
|
|
31
31
|
export { qvacConfigSchema, deviceMatchSchema, deviceConfigDefaultsSchema, devicePatternSchema, } from "./sdk-config.js";
|
|
32
|
+
export { PROFILING_KEY, PROFILING_TRAILER_KEY, DELEGATION_BREAKDOWN_KEY, OPERATION_EVENT_KEY, profilerModeSchema, serverBreakdownSchema, delegationBreakdownSchema, operationEventSchema, profilingRequestMetaSchema, profilingResponseMetaSchema, perCallProfilingSchema, } from "./profiling.js";
|
|
32
33
|
export { runtimeContextSchema } from "./runtime-context.js";
|
|
33
34
|
export * from "./get-model-info.js";
|
|
34
35
|
export * from "./model-src-utils.js";
|
|
@@ -24,6 +24,34 @@ export declare const llmConfigBaseSchema: z.ZodObject<{
|
|
|
24
24
|
stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
25
|
n_discarded: z.ZodOptional<z.ZodNumber>;
|
|
26
26
|
tools: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
projectionModelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
28
|
+
src: z.ZodString;
|
|
29
|
+
name: z.ZodOptional<z.ZodString>;
|
|
30
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
31
|
+
registryPath: z.ZodOptional<z.ZodString>;
|
|
32
|
+
registrySource: z.ZodOptional<z.ZodString>;
|
|
33
|
+
blobCoreKey: z.ZodOptional<z.ZodString>;
|
|
34
|
+
blobIndex: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
engine: z.ZodOptional<z.ZodString>;
|
|
36
|
+
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
38
|
+
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
39
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
40
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
41
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
42
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
43
|
+
"onnx-tts": "onnx-tts";
|
|
44
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
45
|
+
"onnx-ocr": "onnx-ocr";
|
|
46
|
+
llm: "llm";
|
|
47
|
+
whisper: "whisper";
|
|
48
|
+
embeddings: "embeddings";
|
|
49
|
+
nmt: "nmt";
|
|
50
|
+
parakeet: "parakeet";
|
|
51
|
+
tts: "tts";
|
|
52
|
+
ocr: "ocr";
|
|
53
|
+
}>, z.ZodLiteral<"vad">]>>;
|
|
54
|
+
}, z.core.$strip>]>>;
|
|
27
55
|
}, z.core.$strip>;
|
|
28
56
|
export type LlmConfigInput = z.infer<typeof llmConfigBaseSchema>;
|
|
29
57
|
export declare const LLM_CONFIG_DEFAULTS: {
|
|
@@ -51,6 +79,34 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
51
79
|
stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
52
80
|
n_discarded: z.ZodOptional<z.ZodNumber>;
|
|
53
81
|
tools: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
+
projectionModelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
83
|
+
src: z.ZodString;
|
|
84
|
+
name: z.ZodOptional<z.ZodString>;
|
|
85
|
+
modelId: z.ZodOptional<z.ZodString>;
|
|
86
|
+
registryPath: z.ZodOptional<z.ZodString>;
|
|
87
|
+
registrySource: z.ZodOptional<z.ZodString>;
|
|
88
|
+
blobCoreKey: z.ZodOptional<z.ZodString>;
|
|
89
|
+
blobIndex: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
engine: z.ZodOptional<z.ZodString>;
|
|
91
|
+
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
93
|
+
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
94
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
95
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
96
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
97
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
98
|
+
"onnx-tts": "onnx-tts";
|
|
99
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
100
|
+
"onnx-ocr": "onnx-ocr";
|
|
101
|
+
llm: "llm";
|
|
102
|
+
whisper: "whisper";
|
|
103
|
+
embeddings: "embeddings";
|
|
104
|
+
nmt: "nmt";
|
|
105
|
+
parakeet: "parakeet";
|
|
106
|
+
tts: "tts";
|
|
107
|
+
ocr: "ocr";
|
|
108
|
+
}>, z.ZodLiteral<"vad">]>>;
|
|
109
|
+
}, z.core.$strip>]>>;
|
|
54
110
|
}, z.core.$strip>, z.ZodTransform<{
|
|
55
111
|
ctx_size: number | undefined;
|
|
56
112
|
temp?: number | undefined;
|
|
@@ -70,6 +126,19 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
70
126
|
stop_sequences?: string[] | undefined;
|
|
71
127
|
n_discarded?: number | undefined;
|
|
72
128
|
tools?: boolean | undefined;
|
|
129
|
+
projectionModelSrc?: string | {
|
|
130
|
+
src: string;
|
|
131
|
+
name?: string | undefined;
|
|
132
|
+
modelId?: string | undefined;
|
|
133
|
+
registryPath?: string | undefined;
|
|
134
|
+
registrySource?: string | undefined;
|
|
135
|
+
blobCoreKey?: string | undefined;
|
|
136
|
+
blobIndex?: number | undefined;
|
|
137
|
+
engine?: string | undefined;
|
|
138
|
+
expectedSize?: number | undefined;
|
|
139
|
+
sha256Checksum?: string | undefined;
|
|
140
|
+
addon?: "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "llm" | "whisper" | "embeddings" | "nmt" | "parakeet" | "tts" | "ocr" | "vad" | undefined;
|
|
141
|
+
} | undefined;
|
|
73
142
|
}, {
|
|
74
143
|
ctx_size?: number | undefined;
|
|
75
144
|
temp?: number | undefined;
|
|
@@ -89,18 +158,50 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
89
158
|
stop_sequences?: string[] | undefined;
|
|
90
159
|
n_discarded?: number | undefined;
|
|
91
160
|
tools?: boolean | undefined;
|
|
161
|
+
projectionModelSrc?: string | {
|
|
162
|
+
src: string;
|
|
163
|
+
name?: string | undefined;
|
|
164
|
+
modelId?: string | undefined;
|
|
165
|
+
registryPath?: string | undefined;
|
|
166
|
+
registrySource?: string | undefined;
|
|
167
|
+
blobCoreKey?: string | undefined;
|
|
168
|
+
blobIndex?: number | undefined;
|
|
169
|
+
engine?: string | undefined;
|
|
170
|
+
expectedSize?: number | undefined;
|
|
171
|
+
sha256Checksum?: string | undefined;
|
|
172
|
+
addon?: "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "llm" | "whisper" | "embeddings" | "nmt" | "parakeet" | "tts" | "ocr" | "vad" | undefined;
|
|
173
|
+
} | undefined;
|
|
92
174
|
}>>;
|
|
93
175
|
export type LlmConfig = z.infer<typeof llmConfigSchema>;
|
|
94
176
|
export declare const embedConfigBaseSchema: z.ZodObject<{
|
|
95
177
|
gpuLayers: z.ZodOptional<z.ZodNumber>;
|
|
96
|
-
device: z.ZodOptional<z.
|
|
178
|
+
device: z.ZodOptional<z.ZodEnum<{
|
|
179
|
+
gpu: "gpu";
|
|
180
|
+
cpu: "cpu";
|
|
181
|
+
}>>;
|
|
97
182
|
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
98
|
-
|
|
183
|
+
pooling: z.ZodOptional<z.ZodEnum<{
|
|
184
|
+
none: "none";
|
|
185
|
+
mean: "mean";
|
|
186
|
+
cls: "cls";
|
|
187
|
+
last: "last";
|
|
188
|
+
rank: "rank";
|
|
189
|
+
}>>;
|
|
190
|
+
attention: z.ZodOptional<z.ZodEnum<{
|
|
191
|
+
causal: "causal";
|
|
192
|
+
"non-causal": "non-causal";
|
|
193
|
+
}>>;
|
|
194
|
+
embdNormalize: z.ZodOptional<z.ZodNumber>;
|
|
99
195
|
flashAttention: z.ZodOptional<z.ZodEnum<{
|
|
100
196
|
on: "on";
|
|
101
197
|
off: "off";
|
|
198
|
+
auto: "auto";
|
|
102
199
|
}>>;
|
|
103
|
-
|
|
200
|
+
mainGpu: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
201
|
+
integrated: "integrated";
|
|
202
|
+
dedicated: "dedicated";
|
|
203
|
+
}>]>>;
|
|
204
|
+
verbosity: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
104
205
|
}, z.core.$strip>;
|
|
105
206
|
export type EmbedConfigInput = z.infer<typeof embedConfigBaseSchema>;
|
|
106
207
|
export declare const EMBED_CONFIG_DEFAULTS: {
|
|
@@ -110,28 +211,53 @@ export declare const EMBED_CONFIG_DEFAULTS: {
|
|
|
110
211
|
};
|
|
111
212
|
export declare const embedConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
112
213
|
gpuLayers: z.ZodOptional<z.ZodNumber>;
|
|
113
|
-
device: z.ZodOptional<z.
|
|
214
|
+
device: z.ZodOptional<z.ZodEnum<{
|
|
215
|
+
gpu: "gpu";
|
|
216
|
+
cpu: "cpu";
|
|
217
|
+
}>>;
|
|
114
218
|
batchSize: z.ZodOptional<z.ZodNumber>;
|
|
115
|
-
|
|
219
|
+
pooling: z.ZodOptional<z.ZodEnum<{
|
|
220
|
+
none: "none";
|
|
221
|
+
mean: "mean";
|
|
222
|
+
cls: "cls";
|
|
223
|
+
last: "last";
|
|
224
|
+
rank: "rank";
|
|
225
|
+
}>>;
|
|
226
|
+
attention: z.ZodOptional<z.ZodEnum<{
|
|
227
|
+
causal: "causal";
|
|
228
|
+
"non-causal": "non-causal";
|
|
229
|
+
}>>;
|
|
230
|
+
embdNormalize: z.ZodOptional<z.ZodNumber>;
|
|
116
231
|
flashAttention: z.ZodOptional<z.ZodEnum<{
|
|
117
232
|
on: "on";
|
|
118
233
|
off: "off";
|
|
234
|
+
auto: "auto";
|
|
119
235
|
}>>;
|
|
120
|
-
|
|
236
|
+
mainGpu: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
237
|
+
integrated: "integrated";
|
|
238
|
+
dedicated: "dedicated";
|
|
239
|
+
}>]>>;
|
|
240
|
+
verbosity: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
121
241
|
}, z.core.$strip>, z.ZodTransform<{
|
|
122
242
|
gpuLayers: number | undefined;
|
|
123
|
-
device:
|
|
243
|
+
device: "gpu" | "cpu" | undefined;
|
|
124
244
|
batchSize: number | undefined;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
245
|
+
pooling?: "none" | "mean" | "cls" | "last" | "rank" | undefined;
|
|
246
|
+
attention?: "causal" | "non-causal" | undefined;
|
|
247
|
+
embdNormalize?: number | undefined;
|
|
248
|
+
flashAttention?: "on" | "off" | "auto" | undefined;
|
|
249
|
+
mainGpu?: number | "integrated" | "dedicated" | undefined;
|
|
250
|
+
verbosity?: 0 | 3 | 2 | 1 | undefined;
|
|
128
251
|
}, {
|
|
129
252
|
gpuLayers?: number | undefined;
|
|
130
|
-
device?:
|
|
253
|
+
device?: "gpu" | "cpu" | undefined;
|
|
131
254
|
batchSize?: number | undefined;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
255
|
+
pooling?: "none" | "mean" | "cls" | "last" | "rank" | undefined;
|
|
256
|
+
attention?: "causal" | "non-causal" | undefined;
|
|
257
|
+
embdNormalize?: number | undefined;
|
|
258
|
+
flashAttention?: "on" | "off" | "auto" | undefined;
|
|
259
|
+
mainGpu?: number | "integrated" | "dedicated" | undefined;
|
|
260
|
+
verbosity?: 0 | 3 | 2 | 1 | undefined;
|
|
135
261
|
}>>;
|
|
136
262
|
export type EmbedConfig = z.infer<typeof embedConfigSchema>;
|
|
137
263
|
//# sourceMappingURL=llamacpp-config.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { modelSrcInputSchema } from "./model-src-utils.js";
|
|
2
3
|
export const VERBOSITY = {
|
|
3
4
|
ERROR: 0,
|
|
4
5
|
WARN: 1,
|
|
@@ -37,6 +38,7 @@ export const llmConfigBaseSchema = z.object({
|
|
|
37
38
|
stop_sequences: z.array(z.string()).optional(),
|
|
38
39
|
n_discarded: z.number().optional(),
|
|
39
40
|
tools: z.boolean().optional(),
|
|
41
|
+
projectionModelSrc: modelSrcInputSchema.optional(),
|
|
40
42
|
});
|
|
41
43
|
// Default values - typed as partial of the config
|
|
42
44
|
export const LLM_CONFIG_DEFAULTS = {
|
|
@@ -53,14 +55,16 @@ export const llmConfigSchema = llmConfigBaseSchema.transform((data) => ({
|
|
|
53
55
|
// Base schema - validates types, all fields optional (for client-side validation)
|
|
54
56
|
export const embedConfigBaseSchema = z.object({
|
|
55
57
|
gpuLayers: z.number().int().optional(),
|
|
56
|
-
device: z.
|
|
58
|
+
device: z.enum(["gpu", "cpu"]).optional(),
|
|
57
59
|
batchSize: z.number().int().min(1).optional(),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
pooling: z.enum(["none", "mean", "cls", "last", "rank"]).optional(),
|
|
61
|
+
attention: z.enum(["causal", "non-causal"]).optional(),
|
|
62
|
+
embdNormalize: z.number().int().optional(),
|
|
63
|
+
flashAttention: z.enum(["on", "off", "auto"]).optional(),
|
|
64
|
+
mainGpu: z
|
|
65
|
+
.union([z.number().int().min(0), z.enum(["integrated", "dedicated"])])
|
|
66
|
+
.optional(),
|
|
67
|
+
verbosity: verbositySchema.optional(),
|
|
64
68
|
});
|
|
65
69
|
// Default values - typed as partial of the config
|
|
66
70
|
export const EMBED_CONFIG_DEFAULTS = {
|