@qvac/sdk 0.13.5 → 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.
Files changed (221) hide show
  1. package/NOTICE +95 -1151
  2. package/README.md +1 -2
  3. package/bare-imports.json +0 -5
  4. package/dist/client/api/bci-transcribe.js +2 -1
  5. package/dist/client/api/download-asset.js +2 -1
  6. package/dist/client/api/finetune.js +6 -5
  7. package/dist/client/api/index.d.ts +1 -0
  8. package/dist/client/api/index.js +1 -0
  9. package/dist/client/api/load-model.d.ts +11 -8
  10. package/dist/client/api/load-model.js +6 -6
  11. package/dist/client/api/subscribe-logs.d.ts +28 -0
  12. package/dist/client/api/subscribe-logs.js +43 -0
  13. package/dist/client/api/text-to-speech.js +2 -1
  14. package/dist/client/config-loader/config-utils.js +2 -4
  15. package/dist/client/config-loader/resolve-config.bare.js +4 -3
  16. package/dist/client/parse-input.d.ts +3 -0
  17. package/dist/client/parse-input.js +14 -0
  18. package/dist/client/rpc/expo-rpc-client.js +2 -11
  19. package/dist/client/rpc/node-rpc-client.js +8 -2
  20. package/dist/client/rpc/rpc-client.js +39 -7
  21. package/dist/commands/bundle/constants.js +2 -1
  22. package/dist/examples/bci/bci-filesystem-streaming.js +14 -14
  23. package/dist/examples/bci/bci-filesystem.js +17 -13
  24. package/dist/examples/cache-management.js +38 -38
  25. package/dist/examples/cancel-by-request-id.js +9 -9
  26. package/dist/examples/completion-events.js +20 -14
  27. package/dist/examples/completion-stop-reason.js +13 -7
  28. package/dist/examples/concurrent-completion-collision.js +7 -7
  29. package/dist/examples/config-reload.js +7 -8
  30. package/dist/examples/default-config-usage.js +4 -4
  31. package/dist/examples/delegated-inference/composite.js +14 -10
  32. package/dist/examples/delegated-inference/consumer-profiled.js +13 -13
  33. package/dist/examples/delegated-inference/consumer.js +16 -12
  34. package/dist/examples/delegated-inference/provider.js +12 -12
  35. package/dist/examples/diffusion-esrgan-upscale.js +19 -15
  36. package/dist/examples/diffusion-flux2-klein-img2img.js +16 -11
  37. package/dist/examples/diffusion-flux2-klein.js +14 -9
  38. package/dist/examples/diffusion-img2img.js +9 -10
  39. package/dist/examples/diffusion-img2vid.js +17 -12
  40. package/dist/examples/diffusion-simple.js +1 -1
  41. package/dist/examples/diffusion-txt2img.js +14 -9
  42. package/dist/examples/diffusion-txt2vid.js +15 -10
  43. package/dist/examples/download-with-blind-relays.js +16 -21
  44. package/dist/examples/download-with-cancel.js +15 -16
  45. package/dist/examples/embed-multi-gpu.js +3 -4
  46. package/dist/examples/embed-p2p.js +11 -7
  47. package/dist/examples/finetune/llamacpp-finetune.js +7 -7
  48. package/dist/examples/kv-cache-cleanup.js +35 -35
  49. package/dist/examples/kv-cache-custom-key.js +24 -24
  50. package/dist/examples/kv-cache-example.js +9 -9
  51. package/dist/examples/llamacpp-cache.js +18 -14
  52. package/dist/examples/llamacpp-dynamic-tools.js +15 -9
  53. package/dist/examples/llamacpp-filesystem.js +15 -9
  54. package/dist/examples/llamacpp-http.js +12 -10
  55. package/dist/examples/llamacpp-multi-gpu.js +4 -4
  56. package/dist/examples/llamacpp-multimodal.js +13 -9
  57. package/dist/examples/llamacpp-p2p.js +8 -4
  58. package/dist/examples/llamacpp-sharded.js +5 -5
  59. package/dist/examples/llamacpp-structured-output.js +15 -9
  60. package/dist/examples/logging-file-transport.js +3 -3
  61. package/dist/examples/logging-global.d.ts +2 -0
  62. package/dist/examples/logging-global.js +34 -0
  63. package/dist/examples/logging-streaming.js +7 -10
  64. package/dist/examples/mcp-websearch.js +24 -18
  65. package/dist/examples/multi-model-demo.js +17 -11
  66. package/dist/examples/ocr-fasttext.js +14 -16
  67. package/dist/examples/parallel-download.js +7 -7
  68. package/dist/examples/plugins.js +40 -28
  69. package/dist/examples/profiling/basic.js +16 -10
  70. package/dist/examples/profiling/per-call.js +17 -11
  71. package/dist/examples/quickstart.bare.d.ts +2 -0
  72. package/dist/examples/quickstart.bare.js +18 -0
  73. package/dist/examples/quickstart.js +10 -3
  74. package/dist/examples/rag/rag-chromadb.js +18 -14
  75. package/dist/examples/rag/rag-hyperdb/cancellation.js +17 -14
  76. package/dist/examples/rag/rag-hyperdb/ingest.js +14 -12
  77. package/dist/examples/rag/rag-hyperdb/pipeline.js +19 -17
  78. package/dist/examples/rag/rag-hyperdb/workspaces.js +31 -27
  79. package/dist/examples/rag/rag-lancedb.js +12 -8
  80. package/dist/examples/rag/rag-sqlite.js +11 -7
  81. package/dist/examples/registry-query.js +17 -17
  82. package/dist/examples/seed-p2p.js +10 -6
  83. package/dist/examples/suspend-resume.js +20 -16
  84. package/dist/examples/tools/llamacpp-native-tools.js +24 -18
  85. package/dist/examples/tools/llamacpp-tools-gemma4.js +14 -8
  86. package/dist/examples/tools/llamacpp-tools-harmony-multiturn.js +20 -14
  87. package/dist/examples/tools/llamacpp-tools-pythonic.js +14 -8
  88. package/dist/examples/tools/llamacpp-tools-qwen35.js +14 -8
  89. package/dist/examples/transcription/parakeet-ctc-filesystem.js +12 -9
  90. package/dist/examples/transcription/parakeet-microphone-record.js +15 -9
  91. package/dist/examples/transcription/parakeet-microphone-stream.js +15 -9
  92. package/dist/examples/transcription/parakeet-sortformer-streaming.js +12 -6
  93. package/dist/examples/transcription/parakeet-sortformer.js +3 -5
  94. package/dist/examples/transcription/parakeet-tdt-filesystem.js +13 -10
  95. package/dist/examples/transcription/whispercpp-filesystem-streaming.js +16 -17
  96. package/dist/examples/transcription/whispercpp-filesystem.js +14 -10
  97. package/dist/examples/transcription/whispercpp-microphone-conversation.js +10 -10
  98. package/dist/examples/transcription/whispercpp-microphone-record.js +6 -6
  99. package/dist/examples/transcription/whispercpp-prompt.js +14 -10
  100. package/dist/examples/translation/translation-bergamot-batch.js +11 -7
  101. package/dist/examples/translation/translation-bergamot-pivot.js +13 -9
  102. package/dist/examples/translation/translation-bergamot.js +8 -4
  103. package/dist/examples/translation/translation-indic.js +8 -4
  104. package/dist/examples/translation/translation-llm-afriquegemma.js +7 -3
  105. package/dist/examples/translation/translation-llm-context.js +8 -4
  106. package/dist/examples/translation/translation-llm.js +7 -3
  107. package/dist/examples/translation/translation-stream.js +4 -4
  108. package/dist/examples/tts/chatterbox.js +19 -11
  109. package/dist/examples/tts/llm-to-tts-streaming.js +27 -14
  110. package/dist/examples/tts/supertonic-multilingual.js +18 -14
  111. package/dist/examples/tts/supertonic.js +19 -15
  112. package/dist/examples/tts/utils.js +1 -1
  113. package/dist/examples/vla-pi05.js +18 -14
  114. package/dist/examples/vla-smolvla.js +18 -14
  115. package/dist/examples/voice-assistant/voice-assistant.js +12 -12
  116. package/dist/index.d.ts +3 -4
  117. package/dist/index.js +3 -4
  118. package/dist/logging/client-logger.js +2 -1
  119. package/dist/logging/index.d.ts +1 -1
  120. package/dist/logging/index.js +1 -1
  121. package/dist/logging/namespaces.d.ts +1 -0
  122. package/dist/logging/namespaces.js +2 -0
  123. package/dist/logging/server-logger.js +1 -4
  124. package/dist/logging/utils.js +6 -1
  125. package/dist/models/registry/index.d.ts +17 -0
  126. package/dist/models/registry/index.js +20 -1
  127. package/dist/models/registry/models.d.ts +1062 -38
  128. package/dist/models/registry/models.js +3546 -2490
  129. package/dist/pear/pre.js +2 -2
  130. package/dist/schemas/bci-config.d.ts +37 -0
  131. package/dist/schemas/bci-config.js +2 -0
  132. package/dist/schemas/bci.d.ts +2 -0
  133. package/dist/schemas/common.d.ts +171 -94
  134. package/dist/schemas/completion-stream.d.ts +6 -3
  135. package/dist/schemas/completion-stream.js +10 -2
  136. package/dist/schemas/download-asset.d.ts +5 -5
  137. package/dist/schemas/engine-addon-map.d.ts +1 -1
  138. package/dist/schemas/engine-addon-map.js +6 -3
  139. package/dist/schemas/error.js +6 -1
  140. package/dist/schemas/llamacpp-config.d.ts +27 -8
  141. package/dist/schemas/llamacpp-config.js +19 -2
  142. package/dist/schemas/load-model.d.ts +4170 -570
  143. package/dist/schemas/load-model.js +85 -26
  144. package/dist/schemas/logging-stream.js +7 -1
  145. package/dist/schemas/model-src-utils.d.ts +6 -6
  146. package/dist/schemas/model-types.d.ts +14 -15
  147. package/dist/schemas/model-types.js +10 -11
  148. package/dist/schemas/ocr.d.ts +10 -8
  149. package/dist/schemas/ocr.js +8 -6
  150. package/dist/schemas/plugin.d.ts +6 -5
  151. package/dist/schemas/plugin.js +4 -4
  152. package/dist/schemas/rag.d.ts +4 -4
  153. package/dist/schemas/registry.d.ts +8 -8
  154. package/dist/schemas/registry.js +1 -1
  155. package/dist/schemas/reload-config.d.ts +6 -6
  156. package/dist/schemas/sdcpp-config.d.ts +12 -12
  157. package/dist/schemas/sdk-config.d.ts +171 -117
  158. package/dist/schemas/sdk-config.js +5 -5
  159. package/dist/schemas/sdk-errors-client.d.ts +1 -0
  160. package/dist/schemas/sdk-errors-client.js +7 -2
  161. package/dist/schemas/text-to-speech.d.ts +157 -13
  162. package/dist/schemas/text-to-speech.js +70 -7
  163. package/dist/schemas/transcription-config.d.ts +5 -1
  164. package/dist/schemas/transcription-config.js +2 -0
  165. package/dist/schemas/transcription.d.ts +3 -0
  166. package/dist/schemas/transcription.js +2 -1
  167. package/dist/schemas/translate.d.ts +6 -6
  168. package/dist/schemas/translate.js +2 -3
  169. package/dist/schemas/translation-config.d.ts +20 -20
  170. package/dist/server/bare/hyperswarm.js +3 -3
  171. package/dist/server/bare/ops/transcribe.js +46 -15
  172. package/dist/server/bare/plugins/bci-whispercpp-transcription/args.d.ts +3 -0
  173. package/dist/server/bare/plugins/bci-whispercpp-transcription/args.js +13 -0
  174. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +41 -0
  175. package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +6 -11
  176. package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.d.ts +75 -0
  177. package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.js +11 -0
  178. package/dist/server/bare/plugins/{onnx-ocr → ggml-ocr}/plugin.d.ts +16 -10
  179. package/dist/server/bare/plugins/{onnx-ocr → ggml-ocr}/plugin.js +25 -18
  180. package/dist/server/bare/plugins/index.d.ts +1 -1
  181. package/dist/server/bare/plugins/index.js +1 -1
  182. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +10 -0
  183. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +29 -0
  184. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +4 -22
  185. package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +15 -7
  186. package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +7 -7
  187. package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +2 -0
  188. package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +10 -10
  189. package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +14 -8
  190. package/dist/server/bare/plugins/tts-ggml/plugin.js +12 -0
  191. package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +3 -1
  192. package/dist/server/bare/registry/logging-stream-registry.d.ts +4 -2
  193. package/dist/server/bare/registry/logging-stream-registry.js +12 -7
  194. package/dist/server/bare/registry/model-config-utils.js +2 -2
  195. package/dist/server/bare/registry/registry-client.js +1 -1
  196. package/dist/server/bare/runtime-lifecycle.d.ts +9 -0
  197. package/dist/server/bare/runtime-lifecycle.js +24 -0
  198. package/dist/server/bare/types/addon-responses.d.ts +1 -0
  199. package/dist/server/env.js +7 -10
  200. package/dist/server/plugins/registry.js +2 -4
  201. package/dist/server/rpc/handlers/load-model/handler.js +2 -4
  202. package/dist/server/rpc/handlers/load-model/http.js +253 -51
  203. package/dist/server/rpc/handlers/logging-stream.js +4 -2
  204. package/dist/server/rpc/handlers/plugin-invoke.js +5 -16
  205. package/dist/server/utils/completion-normalizer.js +13 -4
  206. package/dist/server/utils/worker-lock.js +5 -5
  207. package/dist/server/worker-core.d.ts +1 -1
  208. package/dist/server/worker-core.js +28 -18
  209. package/dist/utils/errors-client.d.ts +3 -0
  210. package/dist/utils/errors-client.js +5 -0
  211. package/dist/utils/errors-server.d.ts +2 -0
  212. package/dist/utils/errors-server.js +3 -0
  213. package/dist/utils/zod-error.d.ts +3 -0
  214. package/dist/utils/zod-error.js +4 -0
  215. package/package.json +21 -24
  216. package/dist/polyfills/bare-globals.d.ts +0 -2
  217. package/dist/polyfills/bare-globals.js +0 -4
  218. package/dist/polyfills/bare-globals.noop.d.ts +0 -2
  219. package/dist/polyfills/bare-globals.noop.js +0 -1
  220. /package/dist/server/bare/plugins/{onnx-ocr → ggml-ocr}/ops/ocr-stream.d.ts +0 -0
  221. /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.ZodUnion<readonly [z.ZodLiteral<-1>, z.ZodLiteral<0>]>>;
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.ZodUnion<readonly [z.ZodLiteral<-1>, z.ZodLiteral<0>]>>;
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.ZodUnion<readonly [z.ZodLiteral<-1>, z.ZodLiteral<0>]>>;
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
- .union([z.literal(-1), z.literal(0)])
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("Per-request reasoning channel budget. `-1` keeps the model's reasoning channel on; `0` disables it for this request. Equivalent to the load-time `reasoning_budget` config but scoped to a single `run()` call; the prior value is restored afterwards."),
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
- "onnx-ocr": "onnx-ocr";
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" | "onnx-ocr" | "sdcpp-generation" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | 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" | "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" | "onnx-ocr" | "sdcpp-generation" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | 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" | "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
- "onnx-ocr": "onnx-ocr";
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" | "onnx-ocr" | "sdcpp-generation" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | 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" | "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 "onnx-ocr": "ocr";
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.onnxOcr]: "ocr",
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.onnxOcr,
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.onnxOcr,
48
+ ocr: ModelType.ggmlOcr,
46
49
  [ADDON_DIFFUSION]: ModelType.sdcppGeneration,
47
50
  diffusion: ModelType.sdcppGeneration,
48
51
  [ADDON_VLA]: ModelType.ggmlVla,
@@ -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 Error ? error.message : String(error);
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.ZodUnion<readonly [z.ZodLiteral<-1>, z.ZodLiteral<0>]>>;
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
- "onnx-ocr": "onnx-ocr";
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.ZodUnion<readonly [z.ZodLiteral<-1>, z.ZodLiteral<0>]>>;
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
- "onnx-ocr": "onnx-ocr";
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?: 0 | -1 | undefined;
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" | "onnx-ocr" | "sdcpp-generation" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
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?: 0 | -1 | undefined;
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" | "onnx-ocr" | "sdcpp-generation" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
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.union([z.literal(-1), z.literal(0)]).optional(),
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) => ({