@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
|
@@ -32,7 +32,8 @@ export declare const generationParamsSchema: z.ZodObject<{
|
|
|
32
32
|
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
33
33
|
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
34
34
|
repeat_penalty: z.ZodOptional<z.ZodNumber>;
|
|
35
|
-
reasoning_budget: z.ZodOptional<z.
|
|
35
|
+
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
remove_thinking_from_context: z.ZodOptional<z.ZodBoolean>;
|
|
36
37
|
}, z.core.$strict>;
|
|
37
38
|
export declare const responseFormatSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
38
39
|
type: z.ZodLiteral<"text">;
|
|
@@ -99,7 +100,8 @@ export declare const completionClientParamsSchema: z.ZodObject<{
|
|
|
99
100
|
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
100
101
|
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
101
102
|
repeat_penalty: z.ZodOptional<z.ZodNumber>;
|
|
102
|
-
reasoning_budget: z.ZodOptional<z.
|
|
103
|
+
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
104
|
+
remove_thinking_from_context: z.ZodOptional<z.ZodBoolean>;
|
|
103
105
|
}, z.core.$strict>>;
|
|
104
106
|
captureThinking: z.ZodOptional<z.ZodBoolean>;
|
|
105
107
|
emitRawDeltas: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -167,7 +169,8 @@ export declare const completionStreamRequestSchema: z.ZodObject<{
|
|
|
167
169
|
frequency_penalty: z.ZodOptional<z.ZodNumber>;
|
|
168
170
|
presence_penalty: z.ZodOptional<z.ZodNumber>;
|
|
169
171
|
repeat_penalty: z.ZodOptional<z.ZodNumber>;
|
|
170
|
-
reasoning_budget: z.ZodOptional<z.
|
|
172
|
+
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
remove_thinking_from_context: z.ZodOptional<z.ZodBoolean>;
|
|
171
174
|
}, z.core.$strict>>;
|
|
172
175
|
captureThinking: z.ZodOptional<z.ZodBoolean>;
|
|
173
176
|
emitRawDeltas: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { toolSchema } from "./tools.js";
|
|
3
3
|
import { completionEventSchema } from "./completion-event.js";
|
|
4
|
+
import { REASONING_BUDGET_MAX } from "./llamacpp-config.js";
|
|
4
5
|
export { completionStatsSchema, } from "./completion-event.js";
|
|
5
6
|
/**
|
|
6
7
|
* Tool-call output dialect. Auto-detected from the model name; pass via
|
|
@@ -63,9 +64,16 @@ export const generationParamsSchema = z
|
|
|
63
64
|
.optional()
|
|
64
65
|
.describe("Penalty applied to repeated tokens."),
|
|
65
66
|
reasoning_budget: z
|
|
66
|
-
.
|
|
67
|
+
.number()
|
|
68
|
+
.int()
|
|
69
|
+
.min(-1)
|
|
70
|
+
.max(REASONING_BUDGET_MAX)
|
|
71
|
+
.optional()
|
|
72
|
+
.describe("Per-request reasoning channel budget. `-1` keeps the model's reasoning channel on; `0` disables it for this request; any positive integer caps the reasoning channel at that many tokens. Equivalent to the load-time `reasoning_budget` config but scoped to a single `run()` call; the prior value is restored afterwards."),
|
|
73
|
+
remove_thinking_from_context: z
|
|
74
|
+
.boolean()
|
|
67
75
|
.optional()
|
|
68
|
-
.describe("
|
|
76
|
+
.describe("When the model emits a reasoning block during generation (e.g. `<think>...</think>` for the Qwen3 family, `<|channel>thought ... <channel|>` for Gemma 4), drop those tokens from the KV cache at end-of-generation so subsequent turns do not accumulate reasoning history. Defaults to `false`. No-op for models without a recognised reasoning channel. Throws on models with recurrent memory (SSM / hybrid SSM such as Qwen3.5), where the cache edit is unsupported."),
|
|
69
77
|
})
|
|
70
78
|
.strict();
|
|
71
79
|
const jsonSchemaObjectSchema = z.record(z.string(), z.unknown());
|
|
@@ -26,7 +26,7 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
26
26
|
"onnx-tts": "onnx-tts";
|
|
27
27
|
"tts-ggml": "tts-ggml";
|
|
28
28
|
"parakeet-transcription": "parakeet-transcription";
|
|
29
|
-
"
|
|
29
|
+
"ggml-ocr": "ggml-ocr";
|
|
30
30
|
"sdcpp-generation": "sdcpp-generation";
|
|
31
31
|
"ggml-vla": "ggml-vla";
|
|
32
32
|
"ggml-classification": "ggml-classification";
|
|
@@ -52,7 +52,7 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
52
52
|
engine?: string | undefined;
|
|
53
53
|
expectedSize?: number | undefined;
|
|
54
54
|
sha256Checksum?: string | undefined;
|
|
55
|
-
addon?: "embeddings" | "diffusion" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "
|
|
55
|
+
addon?: "embeddings" | "diffusion" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "ggml-ocr" | "sdcpp-generation" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
|
|
56
56
|
};
|
|
57
57
|
}, {
|
|
58
58
|
assetSrc: string | {
|
|
@@ -66,7 +66,7 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
66
66
|
engine?: string | undefined;
|
|
67
67
|
expectedSize?: number | undefined;
|
|
68
68
|
sha256Checksum?: string | undefined;
|
|
69
|
-
addon?: "embeddings" | "diffusion" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "
|
|
69
|
+
addon?: "embeddings" | "diffusion" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "ggml-ocr" | "sdcpp-generation" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
|
|
70
70
|
};
|
|
71
71
|
seed?: boolean | undefined;
|
|
72
72
|
}>>;
|
|
@@ -96,7 +96,7 @@ export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<
|
|
|
96
96
|
"onnx-tts": "onnx-tts";
|
|
97
97
|
"tts-ggml": "tts-ggml";
|
|
98
98
|
"parakeet-transcription": "parakeet-transcription";
|
|
99
|
-
"
|
|
99
|
+
"ggml-ocr": "ggml-ocr";
|
|
100
100
|
"sdcpp-generation": "sdcpp-generation";
|
|
101
101
|
"ggml-vla": "ggml-vla";
|
|
102
102
|
"ggml-classification": "ggml-classification";
|
|
@@ -130,7 +130,7 @@ export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<
|
|
|
130
130
|
engine?: string | undefined;
|
|
131
131
|
expectedSize?: number | undefined;
|
|
132
132
|
sha256Checksum?: string | undefined;
|
|
133
|
-
addon?: "embeddings" | "diffusion" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "
|
|
133
|
+
addon?: "embeddings" | "diffusion" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "ggml-ocr" | "sdcpp-generation" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
|
|
134
134
|
};
|
|
135
135
|
seed?: boolean | undefined;
|
|
136
136
|
onProgress?: unknown;
|
|
@@ -7,7 +7,7 @@ export declare const ENGINE_TO_ADDON: {
|
|
|
7
7
|
readonly "nmtcpp-translation": "nmt";
|
|
8
8
|
readonly "onnx-tts": "tts";
|
|
9
9
|
readonly "tts-ggml": "tts";
|
|
10
|
-
readonly "
|
|
10
|
+
readonly "ggml-ocr": "ocr";
|
|
11
11
|
readonly "parakeet-transcription": "parakeet";
|
|
12
12
|
readonly "sdcpp-generation": "diffusion";
|
|
13
13
|
readonly "ggml-vla": "vla";
|
|
@@ -11,7 +11,7 @@ export const ENGINE_TO_ADDON = {
|
|
|
11
11
|
[ModelType.nmtcppTranslation]: "nmt",
|
|
12
12
|
[ModelType.onnxTts]: "tts",
|
|
13
13
|
[ModelType.ttsGgml]: "tts",
|
|
14
|
-
[ModelType.
|
|
14
|
+
[ModelType.ggmlOcr]: "ocr",
|
|
15
15
|
[ModelType.parakeetTranscription]: "parakeet",
|
|
16
16
|
[ModelType.sdcppGeneration]: "diffusion",
|
|
17
17
|
[ModelType.ggmlVla]: "vla",
|
|
@@ -27,7 +27,10 @@ const LEGACY_ENGINE_TO_CANONICAL = {
|
|
|
27
27
|
[ADDON_EMBEDDING]: ModelType.llamacppEmbedding,
|
|
28
28
|
[ADDON_NMT]: ModelType.nmtcppTranslation,
|
|
29
29
|
[ADDON_TTS]: ModelType.ttsGgml,
|
|
30
|
-
[ADDON_OCR]: ModelType.
|
|
30
|
+
[ADDON_OCR]: ModelType.ggmlOcr,
|
|
31
|
+
// Pre-GGML package / tag names from the ONNX era — resolve to the GGML engine.
|
|
32
|
+
"@qvac/ocr-onnx": ModelType.ggmlOcr,
|
|
33
|
+
"onnx-ocr": ModelType.ggmlOcr,
|
|
31
34
|
[ADDON_PARAKEET]: ModelType.parakeetTranscription,
|
|
32
35
|
"@qvac/translation-llamacpp": ModelType.nmtcppTranslation,
|
|
33
36
|
"@qvac/vad-silero": "onnx-vad",
|
|
@@ -42,7 +45,7 @@ const LEGACY_ENGINE_TO_CANONICAL = {
|
|
|
42
45
|
translation: ModelType.nmtcppTranslation,
|
|
43
46
|
vad: "onnx-vad",
|
|
44
47
|
tts: ModelType.ttsGgml,
|
|
45
|
-
ocr: ModelType.
|
|
48
|
+
ocr: ModelType.ggmlOcr,
|
|
46
49
|
[ADDON_DIFFUSION]: ModelType.sdcppGeneration,
|
|
47
50
|
diffusion: ModelType.sdcppGeneration,
|
|
48
51
|
[ADDON_VLA]: ModelType.ggmlVla,
|
package/dist/schemas/error.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { QvacErrorBase } from "@qvac/error";
|
|
3
|
+
import { formatZodError } from "../utils/zod-error.js";
|
|
3
4
|
/**
|
|
4
5
|
* Wire shape for errors thrown across the RPC boundary. The fields are
|
|
5
6
|
* the union of (a) the legacy `QvacErrorBase` serialisation (`name`,
|
|
@@ -52,7 +53,11 @@ export function createErrorResponse(error) {
|
|
|
52
53
|
}
|
|
53
54
|
return response;
|
|
54
55
|
}
|
|
55
|
-
const message = error instanceof
|
|
56
|
+
const message = error instanceof z.ZodError
|
|
57
|
+
? formatZodError(error)
|
|
58
|
+
: error instanceof Error
|
|
59
|
+
? error.message
|
|
60
|
+
: String(error);
|
|
56
61
|
const stack = error instanceof Error ? error.stack : undefined;
|
|
57
62
|
return {
|
|
58
63
|
type: "error",
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Upper bound for `reasoning_budget`. Mirrors the llm-llamacpp addon, which
|
|
4
|
+
* stores the budget as a 32-bit `int` and rejects values above
|
|
5
|
+
* `std::numeric_limits<int>::max()`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const REASONING_BUDGET_MAX = 2147483647;
|
|
2
8
|
export declare const VERBOSITY: {
|
|
3
9
|
readonly ERROR: 0;
|
|
4
10
|
readonly WARN: 1;
|
|
@@ -41,7 +47,7 @@ export declare const llmConfigBaseSchema: z.ZodObject<{
|
|
|
41
47
|
}>>;
|
|
42
48
|
"tensor-split": z.ZodOptional<z.ZodString>;
|
|
43
49
|
openclCacheDir: z.ZodOptional<z.ZodString>;
|
|
44
|
-
reasoning_budget: z.ZodOptional<z.
|
|
50
|
+
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
45
51
|
projectionModelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
46
52
|
src: z.ZodString;
|
|
47
53
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -67,7 +73,7 @@ export declare const llmConfigBaseSchema: z.ZodObject<{
|
|
|
67
73
|
"onnx-tts": "onnx-tts";
|
|
68
74
|
"tts-ggml": "tts-ggml";
|
|
69
75
|
"parakeet-transcription": "parakeet-transcription";
|
|
70
|
-
"
|
|
76
|
+
"ggml-ocr": "ggml-ocr";
|
|
71
77
|
"sdcpp-generation": "sdcpp-generation";
|
|
72
78
|
"ggml-vla": "ggml-vla";
|
|
73
79
|
"ggml-classification": "ggml-classification";
|
|
@@ -79,6 +85,11 @@ export declare const llmConfigBaseSchema: z.ZodObject<{
|
|
|
79
85
|
classification: "classification";
|
|
80
86
|
}>, z.ZodLiteral<"vad">]>>;
|
|
81
87
|
}, z.core.$strip>]>>;
|
|
88
|
+
image_tile_mode: z.ZodOptional<z.ZodEnum<{
|
|
89
|
+
disabled: "disabled";
|
|
90
|
+
batched: "batched";
|
|
91
|
+
sequential: "sequential";
|
|
92
|
+
}>>;
|
|
82
93
|
}, z.core.$strip>;
|
|
83
94
|
export type LlmConfigInput = z.infer<typeof llmConfigBaseSchema>;
|
|
84
95
|
export declare const LLM_CONFIG_DEFAULTS: {
|
|
@@ -86,6 +97,7 @@ export declare const LLM_CONFIG_DEFAULTS: {
|
|
|
86
97
|
readonly gpu_layers: 99;
|
|
87
98
|
readonly device: "gpu";
|
|
88
99
|
readonly system_prompt: "You are a helpful assistant.";
|
|
100
|
+
readonly image_tile_mode: "sequential";
|
|
89
101
|
};
|
|
90
102
|
export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
91
103
|
ctx_size: z.ZodOptional<z.ZodNumber>;
|
|
@@ -123,7 +135,7 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
123
135
|
}>>;
|
|
124
136
|
"tensor-split": z.ZodOptional<z.ZodString>;
|
|
125
137
|
openclCacheDir: z.ZodOptional<z.ZodString>;
|
|
126
|
-
reasoning_budget: z.ZodOptional<z.
|
|
138
|
+
reasoning_budget: z.ZodOptional<z.ZodNumber>;
|
|
127
139
|
projectionModelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
128
140
|
src: z.ZodString;
|
|
129
141
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -149,7 +161,7 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
149
161
|
"onnx-tts": "onnx-tts";
|
|
150
162
|
"tts-ggml": "tts-ggml";
|
|
151
163
|
"parakeet-transcription": "parakeet-transcription";
|
|
152
|
-
"
|
|
164
|
+
"ggml-ocr": "ggml-ocr";
|
|
153
165
|
"sdcpp-generation": "sdcpp-generation";
|
|
154
166
|
"ggml-vla": "ggml-vla";
|
|
155
167
|
"ggml-classification": "ggml-classification";
|
|
@@ -161,6 +173,11 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
161
173
|
classification: "classification";
|
|
162
174
|
}>, z.ZodLiteral<"vad">]>>;
|
|
163
175
|
}, z.core.$strip>]>>;
|
|
176
|
+
image_tile_mode: z.ZodOptional<z.ZodEnum<{
|
|
177
|
+
disabled: "disabled";
|
|
178
|
+
batched: "batched";
|
|
179
|
+
sequential: "sequential";
|
|
180
|
+
}>>;
|
|
164
181
|
}, z.core.$strip>, z.ZodTransform<{
|
|
165
182
|
ctx_size: number | undefined;
|
|
166
183
|
temp?: number | undefined;
|
|
@@ -187,7 +204,7 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
187
204
|
"split-mode"?: "none" | "layer" | "row" | undefined;
|
|
188
205
|
"tensor-split"?: string | undefined;
|
|
189
206
|
openclCacheDir?: string | undefined;
|
|
190
|
-
reasoning_budget?:
|
|
207
|
+
reasoning_budget?: number | undefined;
|
|
191
208
|
projectionModelSrc?: string | {
|
|
192
209
|
src: string;
|
|
193
210
|
name?: string | undefined;
|
|
@@ -199,8 +216,9 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
199
216
|
engine?: string | undefined;
|
|
200
217
|
expectedSize?: number | undefined;
|
|
201
218
|
sha256Checksum?: string | undefined;
|
|
202
|
-
addon?: "embeddings" | "diffusion" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "
|
|
219
|
+
addon?: "embeddings" | "diffusion" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "ggml-ocr" | "sdcpp-generation" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
|
|
203
220
|
} | undefined;
|
|
221
|
+
image_tile_mode: "disabled" | "batched" | "sequential" | undefined;
|
|
204
222
|
}, {
|
|
205
223
|
ctx_size?: number | undefined;
|
|
206
224
|
temp?: number | undefined;
|
|
@@ -227,7 +245,7 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
227
245
|
"split-mode"?: "none" | "layer" | "row" | undefined;
|
|
228
246
|
"tensor-split"?: string | undefined;
|
|
229
247
|
openclCacheDir?: string | undefined;
|
|
230
|
-
reasoning_budget?:
|
|
248
|
+
reasoning_budget?: number | undefined;
|
|
231
249
|
projectionModelSrc?: string | {
|
|
232
250
|
src: string;
|
|
233
251
|
name?: string | undefined;
|
|
@@ -239,8 +257,9 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
239
257
|
engine?: string | undefined;
|
|
240
258
|
expectedSize?: number | undefined;
|
|
241
259
|
sha256Checksum?: string | undefined;
|
|
242
|
-
addon?: "embeddings" | "diffusion" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "
|
|
260
|
+
addon?: "embeddings" | "diffusion" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "ggml-ocr" | "sdcpp-generation" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
|
|
243
261
|
} | undefined;
|
|
262
|
+
image_tile_mode?: "disabled" | "batched" | "sequential" | undefined;
|
|
244
263
|
}>>;
|
|
245
264
|
export type LlmConfig = z.infer<typeof llmConfigSchema>;
|
|
246
265
|
export declare const embedConfigBaseSchema: z.ZodObject<{
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { modelSrcInputSchema } from "./model-src-utils.js";
|
|
3
3
|
import { TOOLS_MODE } from "./tools.js";
|
|
4
|
+
/**
|
|
5
|
+
* Upper bound for `reasoning_budget`. Mirrors the llm-llamacpp addon, which
|
|
6
|
+
* stores the budget as a 32-bit `int` and rejects values above
|
|
7
|
+
* `std::numeric_limits<int>::max()`.
|
|
8
|
+
*/
|
|
9
|
+
export const REASONING_BUDGET_MAX = 2147483647;
|
|
4
10
|
export const VERBOSITY = {
|
|
5
11
|
ERROR: 0,
|
|
6
12
|
WARN: 1,
|
|
@@ -57,10 +63,20 @@ export const llmConfigBaseSchema = z.object({
|
|
|
57
63
|
*/
|
|
58
64
|
openclCacheDir: z.string().optional(),
|
|
59
65
|
/**
|
|
60
|
-
* Reasoning channel token budget. `-1` = unrestricted, `0` = disabled
|
|
66
|
+
* Reasoning channel token budget. `-1` = unrestricted, `0` = disabled, any
|
|
67
|
+
* positive integer caps the reasoning channel at that many tokens (the
|
|
68
|
+
* sampler force-emits the closing think tag once the budget is exhausted).
|
|
61
69
|
*/
|
|
62
|
-
reasoning_budget: z.
|
|
70
|
+
reasoning_budget: z.number().int().min(-1).max(REASONING_BUDGET_MAX).optional(),
|
|
63
71
|
projectionModelSrc: modelSrcInputSchema.optional(),
|
|
72
|
+
/**
|
|
73
|
+
* Qwen3.5-VL multi-tile image encoding mode (multimodal models only):
|
|
74
|
+
* - `"sequential"` (default): encode image tiles one tile at a time.
|
|
75
|
+
* - `"batched"`: encode all tiles in a single batched pass.
|
|
76
|
+
* - `"disabled"`: no multi-tile encoding (single tile).
|
|
77
|
+
* Ignored by text-only models. Default is `"sequential"`.
|
|
78
|
+
*/
|
|
79
|
+
image_tile_mode: z.enum(["disabled", "batched", "sequential"]).optional(),
|
|
64
80
|
});
|
|
65
81
|
// Default values - typed as partial of the config
|
|
66
82
|
export const LLM_CONFIG_DEFAULTS = {
|
|
@@ -68,6 +84,7 @@ export const LLM_CONFIG_DEFAULTS = {
|
|
|
68
84
|
gpu_layers: 99,
|
|
69
85
|
device: "gpu",
|
|
70
86
|
system_prompt: "You are a helpful assistant.",
|
|
87
|
+
image_tile_mode: "sequential",
|
|
71
88
|
};
|
|
72
89
|
// Full schema - applies defaults via transform (no duplication)
|
|
73
90
|
export const llmConfigSchema = llmConfigBaseSchema.transform((data) => ({
|