@qvac/inference 0.18.2 → 0.19.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.
Files changed (396) hide show
  1. package/NOTICE +69 -36
  2. package/README.md +1 -5
  3. package/dist/api/assess-model-fit.d.ts +16 -0
  4. package/dist/api/assess-model-fit.js +27 -0
  5. package/dist/api/audio-gen.d.ts +4 -4
  6. package/dist/api/audio-gen.js +17 -6
  7. package/dist/api/completion-stream.d.ts +1 -1
  8. package/dist/api/completion-stream.js +1 -1
  9. package/dist/api/delete-cache.d.ts +7 -1
  10. package/dist/api/delete-cache.js +11 -1
  11. package/dist/api/download-asset.d.ts +1 -1
  12. package/dist/api/download-asset.js +2 -2
  13. package/dist/api/finetune.js +1 -1
  14. package/dist/api/get-loaded-model-info.d.ts +6 -10
  15. package/dist/api/get-loaded-model-info.js +6 -10
  16. package/dist/api/heartbeat.d.ts +5 -22
  17. package/dist/api/heartbeat.js +6 -23
  18. package/dist/api/index.d.ts +36 -35
  19. package/dist/api/index.js +35 -35
  20. package/dist/api/load-model.d.ts +5 -1
  21. package/dist/api/load-model.js +3 -5
  22. package/dist/api/logging-stream-registry.js +1 -1
  23. package/dist/api/resume.d.ts +0 -3
  24. package/dist/api/resume.js +0 -3
  25. package/dist/api/subscribe-logs.js +1 -1
  26. package/dist/api/suspend.d.ts +0 -4
  27. package/dist/api/suspend.js +0 -4
  28. package/dist/api/translate.d.ts +3 -1
  29. package/dist/api/translate.js +16 -8
  30. package/dist/api/unload-model.js +3 -5
  31. package/dist/api/video-request.d.ts +207 -0
  32. package/dist/api/video-request.js +18 -0
  33. package/dist/api/video.d.ts +22 -2
  34. package/dist/api/video.js +25 -15
  35. package/dist/api/vla-helpers.d.ts +1 -2
  36. package/dist/api/vla-helpers.js +1 -2
  37. package/dist/api/vla.js +1 -1
  38. package/dist/api/world-result.d.ts +71 -0
  39. package/dist/api/world-result.js +293 -0
  40. package/dist/api/world.d.ts +143 -0
  41. package/dist/api/world.js +71 -0
  42. package/dist/config/resolve-config.d.ts +1 -1
  43. package/dist/config/resolve-config.js +1 -1
  44. package/dist/constants/index.d.ts +2 -2
  45. package/dist/constants/index.js +2 -2
  46. package/dist/dispatch.js +15 -28
  47. package/dist/errors/index.d.ts +35 -31
  48. package/dist/errors/index.js +66 -56
  49. package/dist/handlers/assess-model-fit.d.ts +10 -0
  50. package/dist/handlers/assess-model-fit.js +75 -0
  51. package/dist/handlers/cancelHandler.js +1 -1
  52. package/dist/handlers/completion-orchestrate.js +1 -1
  53. package/dist/handlers/delete-cache.js +3 -0
  54. package/dist/handlers/download-asset.js +6 -5
  55. package/dist/handlers/finetune.js +1 -1
  56. package/dist/handlers/get-loaded-model-info.js +0 -12
  57. package/dist/handlers/get-model-info.js +1 -1
  58. package/dist/handlers/get-system-resources.js +8 -0
  59. package/dist/handlers/load-model/download-manager.d.ts +1 -1
  60. package/dist/handlers/load-model/download-stats.d.ts +3 -3
  61. package/dist/handlers/load-model/download-stats.js +5 -5
  62. package/dist/handlers/load-model/handler.js +6 -8
  63. package/dist/handlers/load-model/http-verify.d.ts +20 -0
  64. package/dist/handlers/load-model/http-verify.js +54 -0
  65. package/dist/handlers/load-model/http.d.ts +12 -2
  66. package/dist/handlers/load-model/http.js +119 -230
  67. package/dist/handlers/load-model/hyperdrive.d.ts +1 -1
  68. package/dist/handlers/load-model/hyperdrive.js +1 -1
  69. package/dist/handlers/load-model/index.d.ts +2 -2
  70. package/dist/handlers/load-model/index.js +2 -2
  71. package/dist/handlers/load-model/registry-companion-set.d.ts +1 -1
  72. package/dist/handlers/load-model/registry-companion-set.js +1 -1
  73. package/dist/handlers/load-model/registry-download-utils.d.ts +3 -3
  74. package/dist/handlers/load-model/registry-download-utils.js +2 -2
  75. package/dist/handlers/load-model/registry.d.ts +2 -2
  76. package/dist/handlers/load-model/registry.js +4 -4
  77. package/dist/handlers/load-model/resolve-session.d.ts +8 -1
  78. package/dist/handlers/load-model/resolve-session.js +12 -9
  79. package/dist/handlers/load-model/resolve.d.ts +4 -4
  80. package/dist/handlers/load-model/resolve.js +18 -16
  81. package/dist/handlers/load-model/safe-fetch.d.ts +44 -0
  82. package/dist/handlers/load-model/safe-fetch.js +143 -0
  83. package/dist/handlers/load-model/types.d.ts +9 -0
  84. package/dist/handlers/plugin-dispatch.js +1 -4
  85. package/dist/handlers/plugin-invoke.js +1 -4
  86. package/dist/handlers/types.d.ts +0 -2
  87. package/dist/handlers/unload-model.js +1 -4
  88. package/dist/index.d.ts +1 -1
  89. package/dist/index.js +1 -1
  90. package/dist/logging/addon.d.ts +1 -1
  91. package/dist/logging/addon.js +1 -1
  92. package/dist/logging/index.d.ts +5 -5
  93. package/dist/logging/index.js +4 -4
  94. package/dist/logging/logger.d.ts +1 -1
  95. package/dist/logging/logger.js +2 -2
  96. package/dist/models/registry/index.d.ts +1 -1
  97. package/dist/models/registry/index.js +2 -2
  98. package/dist/models/registry/models.d.ts +250 -0
  99. package/dist/models/registry/models.js +2071 -1806
  100. package/dist/models/registry/resource-profiles.d.ts +18 -0
  101. package/dist/models/registry/resource-profiles.js +4934 -0
  102. package/dist/plugins/builtin/audiogen-ggml/config.d.ts +14 -0
  103. package/dist/plugins/builtin/audiogen-ggml/config.js +23 -0
  104. package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +47 -5
  105. package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +134 -4
  106. package/dist/plugins/builtin/audiogen-ggml/plugin.js +47 -28
  107. package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +1 -1
  108. package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +3 -3
  109. package/dist/plugins/builtin/ggml-classification/plugin.js +1 -1
  110. package/dist/plugins/builtin/ggml-ocr/plugin.js +2 -2
  111. package/dist/plugins/builtin/ggml-vla/plugin.d.ts +1 -1
  112. package/dist/plugins/builtin/ggml-vla/plugin.js +3 -3
  113. package/dist/plugins/builtin/index.d.ts +12 -12
  114. package/dist/plugins/builtin/index.js +12 -12
  115. package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +2 -2
  116. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +1 -0
  117. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.js +3 -0
  118. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +37 -26
  119. package/dist/plugins/builtin/llamacpp-completion/ops/context-overflow.d.ts +12 -11
  120. package/dist/plugins/builtin/llamacpp-completion/ops/context-overflow.js +133 -41
  121. package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.d.ts +15 -4
  122. package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.js +79 -17
  123. package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +22 -8
  124. package/dist/plugins/builtin/llamacpp-completion/plugin.js +10 -13
  125. package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +4 -0
  126. package/dist/plugins/builtin/llamacpp-embedding/plugin.js +13 -2
  127. package/dist/plugins/builtin/nmtcpp-translation/plugin.js +2 -2
  128. package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +2 -2
  129. package/dist/plugins/builtin/parakeet-transcription/plugin.js +3 -3
  130. package/dist/plugins/builtin/sdcpp-generation/ops/upscale.js +1 -1
  131. package/dist/plugins/builtin/sdcpp-generation/ops/video.js +32 -2
  132. package/dist/plugins/builtin/sdcpp-generation/ops/world.d.ts +126 -0
  133. package/dist/plugins/builtin/sdcpp-generation/ops/world.js +820 -0
  134. package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +153 -4
  135. package/dist/plugins/builtin/sdcpp-generation/plugin.js +134 -13
  136. package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.js +1 -1
  137. package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +1 -1
  138. package/dist/plugins/builtin/tts-ggml/plugin.js +2 -2
  139. package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +2 -2
  140. package/dist/plugins/builtin/whispercpp-transcription/plugin.js +3 -3
  141. package/dist/plugins/index.d.ts +1 -1
  142. package/dist/plugins/index.js +2 -2
  143. package/dist/plugins/ops/kv-cache-utils.js +1 -1
  144. package/dist/plugins/ops/load-model.js +1 -1
  145. package/dist/plugins/ops/transcribe.js +2 -2
  146. package/dist/plugins/ops/translate.js +4 -12
  147. package/dist/plugins/ops/unload-model.js +19 -21
  148. package/dist/plugins/registry.d.ts +1 -0
  149. package/dist/plugins/registry.js +12 -0
  150. package/dist/profiling/aggregator.d.ts +1 -1
  151. package/dist/profiling/aggregator.js +1 -1
  152. package/dist/profiling/controller.d.ts +1 -1
  153. package/dist/profiling/controller.js +2 -2
  154. package/dist/profiling/envelope.d.ts +0 -1
  155. package/dist/profiling/envelope.js +0 -10
  156. package/dist/profiling/events.d.ts +2 -3
  157. package/dist/profiling/events.js +2 -9
  158. package/dist/profiling/exporters.d.ts +1 -1
  159. package/dist/profiling/exporters.js +3 -3
  160. package/dist/profiling/index.d.ts +13 -14
  161. package/dist/profiling/index.js +12 -13
  162. package/dist/profiling/operation-metrics.d.ts +1 -1
  163. package/dist/profiling/operation-metrics.js +35 -2
  164. package/dist/profiling/operation-wrappers.js +12 -15
  165. package/dist/profiling/profiler.d.ts +1 -2
  166. package/dist/profiling/profiler.js +7 -26
  167. package/dist/profiling/types.d.ts +1 -1
  168. package/dist/rag/handler.js +1 -1
  169. package/dist/rag/handlers/close-workspace.js +1 -1
  170. package/dist/rag/handlers/delete-embeddings.js +1 -1
  171. package/dist/rag/handlers/delete-workspace.js +2 -6
  172. package/dist/rag/handlers/ingest.js +1 -1
  173. package/dist/rag/handlers/list-workspaces.d.ts +1 -1
  174. package/dist/rag/handlers/list-workspaces.js +1 -1
  175. package/dist/rag/handlers/reindex.js +1 -1
  176. package/dist/rag/handlers/save-embeddings.js +1 -1
  177. package/dist/rag/handlers/search.js +1 -1
  178. package/dist/rag/index.d.ts +11 -11
  179. package/dist/rag/index.js +11 -11
  180. package/dist/rag/rag-workspace-manager.d.ts +4 -2
  181. package/dist/rag/rag-workspace-manager.js +268 -15
  182. package/dist/registry.js +8 -58
  183. package/dist/resources/collector.d.ts +3 -1
  184. package/dist/resources/collector.js +91 -9
  185. package/dist/resources/instance.d.ts +1 -1
  186. package/dist/resources/instance.js +1 -1
  187. package/dist/resources/model-fit/assess.d.ts +36 -0
  188. package/dist/resources/model-fit/assess.js +679 -0
  189. package/dist/resources/model-fit/calibration/darwin-arm64.d.ts +8 -0
  190. package/dist/resources/model-fit/calibration/darwin-arm64.js +36 -0
  191. package/dist/resources/model-fit/calibration/darwin-x64.d.ts +8 -0
  192. package/dist/resources/model-fit/calibration/darwin-x64.js +38 -0
  193. package/dist/resources/model-fit/calibration/fit.d.ts +73 -0
  194. package/dist/resources/model-fit/calibration/fit.js +152 -0
  195. package/dist/resources/model-fit/calibration/index.d.ts +37 -0
  196. package/dist/resources/model-fit/calibration/index.js +75 -0
  197. package/dist/resources/model-fit/calibration/linux-arm64.d.ts +8 -0
  198. package/dist/resources/model-fit/calibration/linux-arm64.js +38 -0
  199. package/dist/resources/model-fit/calibration/linux-x64-vulkan.d.ts +8 -0
  200. package/dist/resources/model-fit/calibration/linux-x64-vulkan.js +39 -0
  201. package/dist/resources/model-fit/calibration/linux-x64.d.ts +8 -0
  202. package/dist/resources/model-fit/calibration/linux-x64.js +38 -0
  203. package/dist/resources/model-fit/calibration/win32-x64-vulkan-shared.d.ts +8 -0
  204. package/dist/resources/model-fit/calibration/win32-x64-vulkan-shared.js +39 -0
  205. package/dist/resources/model-fit/calibration/win32-x64-vulkan.d.ts +8 -0
  206. package/dist/resources/model-fit/calibration/win32-x64-vulkan.js +36 -0
  207. package/dist/resources/model-fit/calibration/win32-x64.d.ts +8 -0
  208. package/dist/resources/model-fit/calibration/win32-x64.js +38 -0
  209. package/dist/resources/model-fit/estimators/llm.d.ts +46 -0
  210. package/dist/resources/model-fit/estimators/llm.js +222 -0
  211. package/dist/resources/model-fit/estimators/whisper.d.ts +10 -0
  212. package/dist/resources/model-fit/estimators/whisper.js +77 -0
  213. package/dist/resources/model-fit/floor.d.ts +31 -0
  214. package/dist/resources/model-fit/floor.js +65 -0
  215. package/dist/resources/model-fit/types.d.ts +120 -0
  216. package/dist/resources/model-fit/types.js +1 -0
  217. package/dist/resources/native.d.ts +1 -1
  218. package/dist/resources/native.js +15 -0
  219. package/dist/resources/normalize.d.ts +1 -1
  220. package/dist/resources/types.d.ts +14 -0
  221. package/dist/runtime/index.d.ts +5 -5
  222. package/dist/runtime/index.js +2 -2
  223. package/dist/runtime/lifecycle.js +5 -7
  224. package/dist/runtime/model-registry.d.ts +0 -14
  225. package/dist/runtime/model-registry.js +17 -40
  226. package/dist/runtime/registry-client.js +1 -1
  227. package/dist/runtime/request-context.d.ts +3 -3
  228. package/dist/runtime/request-context.js +13 -1
  229. package/dist/runtime/request-registry.d.ts +1 -1
  230. package/dist/runtime/request-registry.js +4 -5
  231. package/dist/runtime/state.d.ts +1 -1
  232. package/dist/runtime/state.js +18 -3
  233. package/dist/schemas/assess-model-fit.d.ts +311 -0
  234. package/dist/schemas/assess-model-fit.js +182 -0
  235. package/dist/schemas/audio-gen.d.ts +437 -7
  236. package/dist/schemas/audio-gen.js +131 -19
  237. package/dist/schemas/batch-completion-stream.d.ts +5 -2
  238. package/dist/schemas/batch-completion-stream.js +3 -3
  239. package/dist/schemas/bci-config.js +73 -27
  240. package/dist/schemas/bci.d.ts +3 -3
  241. package/dist/schemas/bci.js +5 -5
  242. package/dist/schemas/cancel.d.ts +5 -0
  243. package/dist/schemas/cancel.js +1 -0
  244. package/dist/schemas/classification.js +13 -6
  245. package/dist/schemas/common.d.ts +695 -335
  246. package/dist/schemas/common.js +33 -31
  247. package/dist/schemas/completion-event.d.ts +5 -2
  248. package/dist/schemas/completion-event.js +2 -1
  249. package/dist/schemas/completion-stream.d.ts +3 -5
  250. package/dist/schemas/completion-stream.js +4 -8
  251. package/dist/schemas/config.d.ts +640 -18
  252. package/dist/schemas/config.js +50 -8
  253. package/dist/schemas/download-asset.d.ts +19 -1
  254. package/dist/schemas/download-asset.js +20 -4
  255. package/dist/schemas/engine-addon-map.d.ts +1 -1
  256. package/dist/schemas/engine-addon-map.js +3 -3
  257. package/dist/schemas/error.d.ts +2 -2
  258. package/dist/schemas/error.js +2 -2
  259. package/dist/schemas/errors.d.ts +2 -6
  260. package/dist/schemas/errors.js +30 -40
  261. package/dist/schemas/heartbeat.d.ts +10 -0
  262. package/dist/schemas/heartbeat.js +8 -0
  263. package/dist/schemas/index.d.ts +46 -44
  264. package/dist/schemas/index.js +45 -43
  265. package/dist/schemas/llamacpp-config.d.ts +32 -10
  266. package/dist/schemas/llamacpp-config.js +11 -8
  267. package/dist/schemas/load-model.d.ts +2902 -1857
  268. package/dist/schemas/load-model.js +52 -52
  269. package/dist/schemas/mcp-adapter.d.ts +1 -1
  270. package/dist/schemas/model-config-schemas.d.ts +2354 -0
  271. package/dist/schemas/model-config-schemas.js +46 -0
  272. package/dist/schemas/model-info.d.ts +10 -20
  273. package/dist/schemas/model-info.js +4 -25
  274. package/dist/schemas/model-ops.d.ts +3 -1
  275. package/dist/schemas/model-ops.js +7 -2
  276. package/dist/schemas/model-resource-profile.d.ts +109 -0
  277. package/dist/schemas/model-resource-profile.js +83 -0
  278. package/dist/schemas/model-src-utils.d.ts +1 -0
  279. package/dist/schemas/model-src-utils.js +33 -13
  280. package/dist/schemas/ocr.js +48 -13
  281. package/dist/schemas/path-validation.js +8 -2
  282. package/dist/schemas/plugin.d.ts +23 -10
  283. package/dist/schemas/plugin.js +11 -0
  284. package/dist/schemas/profiling.d.ts +138 -43
  285. package/dist/schemas/profiling.js +1 -22
  286. package/dist/schemas/rag.js +1 -1
  287. package/dist/schemas/registry.js +1 -1
  288. package/dist/schemas/reload-config.d.ts +0 -2
  289. package/dist/schemas/reload-config.js +2 -3
  290. package/dist/schemas/sdcpp-config.d.ts +344 -4
  291. package/dist/schemas/sdcpp-config.js +504 -17
  292. package/dist/schemas/system-resources.d.ts +138 -0
  293. package/dist/schemas/system-resources.js +3 -1
  294. package/dist/schemas/text-to-speech.js +183 -76
  295. package/dist/schemas/transcription-config.js +253 -85
  296. package/dist/schemas/transcription.d.ts +3 -3
  297. package/dist/schemas/translate.d.ts +2 -2
  298. package/dist/schemas/translate.js +1 -1
  299. package/dist/schemas/translation-config.js +53 -25
  300. package/dist/schemas/vla.d.ts +1 -1
  301. package/dist/selection.d.ts +1 -5
  302. package/dist/selection.js +2 -6
  303. package/dist/surface.d.ts +1 -1
  304. package/dist/utils/addon-responses.d.ts +1 -0
  305. package/dist/utils/aggregate-events.d.ts +1 -1
  306. package/dist/utils/aggregate-events.js +2 -2
  307. package/dist/utils/archive.js +2 -2
  308. package/dist/utils/audio-input.js +1 -1
  309. package/dist/utils/cache/auto-history.d.ts +1 -1
  310. package/dist/utils/cache/auto-history.js +1 -1
  311. package/dist/utils/cache/paths.js +5 -5
  312. package/dist/utils/completion-normalizer.js +1 -1
  313. package/dist/utils/gguf-tensor-extractor.js +1 -1
  314. package/dist/utils/image-dimensions.d.ts +26 -0
  315. package/dist/utils/image-dimensions.js +46 -0
  316. package/dist/utils/index.d.ts +13 -10
  317. package/dist/utils/index.js +13 -10
  318. package/dist/utils/mcp-adapter.d.ts +1 -1
  319. package/dist/utils/mcp-adapter.js +1 -1
  320. package/dist/utils/path-sanitize.d.ts +7 -0
  321. package/dist/utils/path-sanitize.js +36 -0
  322. package/dist/utils/path-security.d.ts +0 -7
  323. package/dist/utils/path-security.js +1 -36
  324. package/dist/utils/shard-utils.js +3 -3
  325. package/dist/utils/tool-integration.js +1 -1
  326. package/dist/utils/tools/dialect.js +1 -1
  327. package/dist/utils/tools/index.d.ts +2 -2
  328. package/dist/utils/tools/index.js +2 -2
  329. package/dist/utils/tools/parser.js +8 -8
  330. package/dist/utils/tools/parsers/dsml.d.ts +1 -1
  331. package/dist/utils/tools/parsers/dsml.js +1 -1
  332. package/dist/utils/tools/parsers/gemma4native.d.ts +1 -1
  333. package/dist/utils/tools/parsers/gemma4native.js +1 -1
  334. package/dist/utils/tools/parsers/harmony.d.ts +1 -1
  335. package/dist/utils/tools/parsers/harmony.js +1 -1
  336. package/dist/utils/tools/parsers/hermes.d.ts +1 -1
  337. package/dist/utils/tools/parsers/hermes.js +1 -1
  338. package/dist/utils/tools/parsers/json.d.ts +1 -1
  339. package/dist/utils/tools/parsers/json.js +1 -1
  340. package/dist/utils/tools/parsers/pythonic.d.ts +1 -1
  341. package/dist/utils/tools/parsers/pythonic.js +1 -1
  342. package/dist/utils/tools/parsers/qwen35.d.ts +1 -1
  343. package/dist/utils/tools/parsers/qwen35.js +3 -3
  344. package/dist/utils/url-security.d.ts +17 -0
  345. package/dist/utils/url-security.js +75 -0
  346. package/package.json +31 -26
  347. package/dist/api/provide.d.ts +0 -23
  348. package/dist/api/provide.js +0 -32
  349. package/dist/api/stop-provider.d.ts +0 -20
  350. package/dist/api/stop-provider.js +0 -30
  351. package/dist/p2p/cancel-delegated.d.ts +0 -3
  352. package/dist/p2p/cancel-delegated.js +0 -64
  353. package/dist/p2p/completion-stream-delegated.d.ts +0 -4
  354. package/dist/p2p/completion-stream-delegated.js +0 -51
  355. package/dist/p2p/delegate-client.d.ts +0 -9
  356. package/dist/p2p/delegate-client.js +0 -219
  357. package/dist/p2p/delegate-connect-diagnostics.d.ts +0 -8
  358. package/dist/p2p/delegate-connect-diagnostics.js +0 -38
  359. package/dist/p2p/delegate-transport.d.ts +0 -18
  360. package/dist/p2p/delegate-transport.js +0 -237
  361. package/dist/p2p/error-handlers.d.ts +0 -4
  362. package/dist/p2p/error-handlers.js +0 -31
  363. package/dist/p2p/handle-request.d.ts +0 -2
  364. package/dist/p2p/handle-request.js +0 -171
  365. package/dist/p2p/handler-utils.d.ts +0 -19
  366. package/dist/p2p/handler-utils.js +0 -180
  367. package/dist/p2p/heartbeat-delegated.d.ts +0 -3
  368. package/dist/p2p/heartbeat-delegated.js +0 -32
  369. package/dist/p2p/load-model-delegated.d.ts +0 -6
  370. package/dist/p2p/load-model-delegated.js +0 -132
  371. package/dist/p2p/progress-throttle.d.ts +0 -7
  372. package/dist/p2p/progress-throttle.js +0 -47
  373. package/dist/p2p/provideHandler/connection.d.ts +0 -2
  374. package/dist/p2p/provideHandler/connection.js +0 -38
  375. package/dist/p2p/provideHandler/handler.d.ts +0 -2
  376. package/dist/p2p/provideHandler/handler.js +0 -66
  377. package/dist/p2p/provideHandler/proxy.d.ts +0 -2
  378. package/dist/p2p/provideHandler/proxy.js +0 -24
  379. package/dist/p2p/provideHandler.d.ts +0 -1
  380. package/dist/p2p/provideHandler.js +0 -2
  381. package/dist/p2p/rpc-utils.d.ts +0 -4
  382. package/dist/p2p/rpc-utils.js +0 -8
  383. package/dist/p2p/stopProvideHandler.d.ts +0 -2
  384. package/dist/p2p/stopProvideHandler.js +0 -29
  385. package/dist/p2p/swarm.d.ts +0 -9
  386. package/dist/p2p/swarm.js +0 -103
  387. package/dist/p2p/transport-selector.d.ts +0 -2
  388. package/dist/p2p/transport-selector.js +0 -18
  389. package/dist/p2p/unload-model-delegated.d.ts +0 -2
  390. package/dist/p2p/unload-model-delegated.js +0 -31
  391. package/dist/profiling/delegation-profiler.d.ts +0 -31
  392. package/dist/profiling/delegation-profiler.js +0 -155
  393. package/dist/schemas/delegate.d.ts +0 -29
  394. package/dist/schemas/delegate.js +0 -40
  395. package/dist/schemas/provide.d.ts +0 -50
  396. package/dist/schemas/provide.js +0 -32
@@ -50,13 +50,27 @@ export interface GPUInfoContext {
50
50
  sample(index: number): NativeGPUUsage;
51
51
  destroy(): void;
52
52
  }
53
+ /**
54
+ * The process's own memory position, as opposed to the system-wide view.
55
+ *
56
+ * @property usedBytes - The process's resident footprint (RSS).
57
+ * @property availableBytes - How much more this process may allocate before
58
+ * the OS intervenes. `undefined` where the platform states no such limit.
59
+ */
60
+ export interface ProcessMemorySample {
61
+ usedBytes: number | undefined;
62
+ availableBytes: number | undefined;
63
+ }
53
64
  export interface ResourceCollectorDependencies {
54
65
  cpuArchitectures: readonly number[];
55
66
  gpuTypes: readonly number[];
67
+ /** Runtime platform, used to grade what a GPU memory reading can mean. */
68
+ platform: string;
56
69
  createCPUInfo(): CPUInfoContext | undefined;
57
70
  createGPUInfo(): GPUInfoContext | undefined;
58
71
  createGPUId(): string;
59
72
  now(): number;
73
+ sampleProcessMemory(): ProcessMemorySample;
60
74
  }
61
75
  export interface SystemResourceCollector {
62
76
  getCapabilities(): SystemResourceCapabilities;
@@ -1,5 +1,5 @@
1
- export { createDisposableScope } from '../runtime/disposable-scope.js';
2
- export type { DisposableScope } from '../runtime/disposable-scope.js';
3
- export type { RequestContext, RequestKind, RequestState, RequestLogContext } from '../runtime/request-context.js';
4
- export { createRequestRegistry, getRequestRegistry, withRequestContext } from '../runtime/request-context.js';
5
- export type { BeginOpts, CancelByModelId, CancelByRequestId, CancelTarget, ConcurrencyPolicy, ManagedRequestContext, RequestOutcome, RequestRegistry } from '../runtime/request-registry.js';
1
+ export { createDisposableScope } from './disposable-scope.js';
2
+ export type { DisposableScope } from './disposable-scope.js';
3
+ export type { RequestContext, RequestKind, RequestState, RequestLogContext } from './request-context.js';
4
+ export { createRequestRegistry, getRequestRegistry, withRequestContext } from './request-context.js';
5
+ export type { BeginOpts, CancelByModelId, CancelByRequestId, CancelTarget, ConcurrencyPolicy, ManagedRequestContext, RequestOutcome, RequestRegistry } from './request-registry.js';
@@ -1,2 +1,2 @@
1
- export { createDisposableScope } from '../runtime/disposable-scope.js';
2
- export { createRequestRegistry, getRequestRegistry, withRequestContext } from '../runtime/request-context.js';
1
+ export { createDisposableScope } from './disposable-scope.js';
2
+ export { createRequestRegistry, getRequestRegistry, withRequestContext } from './request-context.js';
@@ -1,13 +1,12 @@
1
- import { destroySwarm } from '../p2p/swarm.js';
2
- import { initEnv } from '../runtime/env.js';
1
+ import { initEnv } from './env.js';
3
2
  import { closeAllRagInstances } from '../rag/index.js';
4
3
  import { cleanupDownloads } from '../handlers/load-model/download-manager.js';
5
- import { unloadAllModels } from '../runtime/model-registry.js';
6
- import { closeRegistryClient } from '../runtime/registry-client.js';
7
- import { clearAllLoggingStreams, startLogBuffering, stopLogBufferingWithTimeout } from '../runtime/logging-stream-registry.js';
4
+ import { unloadAllModels } from './model-registry.js';
5
+ import { closeRegistryClient } from './registry-client.js';
6
+ import { clearAllLoggingStreams, startLogBuffering, stopLogBufferingWithTimeout } from './logging-stream-registry.js';
8
7
  import { clearAllAddonLoggers, getEngineLogger, LOG_ID, ALL_LOG_ID } from '../logging/index.js';
9
8
  import { clearPlugins } from '../plugins/index.js';
10
- import { acquireCacheLock, releaseCacheLock } from '../runtime/cache-lock.js';
9
+ import { acquireCacheLock, releaseCacheLock } from './cache-lock.js';
11
10
  import { nativeResourceCollectorDependencies } from '../resources/native.js';
12
11
  import { destroyResourceCollector, initializeResourceCollector } from '../resources/instance.js';
13
12
  // The host application owns the Bare runtime lifecycle: this module sets up the
@@ -59,7 +58,6 @@ async function runCleanup() {
59
58
  destroyResourceCollector();
60
59
  clearRegistries();
61
60
  await Promise.allSettled([
62
- destroySwarm(),
63
61
  closeAllRagInstances(),
64
62
  cleanupDownloads(),
65
63
  unloadAllModels(),
@@ -19,11 +19,6 @@ export interface AnyModel {
19
19
  reload?(config: unknown): Promise<void>;
20
20
  addon?: AddonInterface;
21
21
  }
22
- interface DelegateOptions {
23
- providerPublicKey: string;
24
- timeout?: number | undefined;
25
- healthCheckTimeout?: number | undefined;
26
- }
27
22
  interface LocalOptions {
28
23
  model: AnyModel;
29
24
  path: string;
@@ -34,11 +29,6 @@ interface LocalOptions {
34
29
  }
35
30
  export type ModelEntry = {
36
31
  id: string;
37
- isDelegated: true;
38
- delegated: DelegateOptions;
39
- } | {
40
- id: string;
41
- isDelegated: false;
42
32
  local: LocalOptions;
43
33
  };
44
34
  export declare function registerModel(id: string, options: {
@@ -47,10 +37,6 @@ export declare function registerModel(id: string, options: {
47
37
  config: unknown;
48
38
  modelType: CanonicalModelType;
49
39
  name?: string | undefined;
50
- } | {
51
- providerPublicKey: string;
52
- timeout?: number;
53
- healthCheckTimeout?: number;
54
40
  }): void;
55
41
  export declare function getModelEntry(id: string): ModelEntry | null;
56
42
  export declare function getModel(id: string): AnyModel;
@@ -1,4 +1,4 @@
1
- import { ModelAlreadyRegisteredError, ModelNotFoundError, ModelIsDelegatedError } from '../errors/index.js';
1
+ import { ModelAlreadyRegisteredError, ModelNotFoundError } from '../errors/index.js';
2
2
  import { getEngineLogger } from '../logging/index.js';
3
3
  const logger = getEngineLogger();
4
4
  // Global registry state - using stateless functions to manage it
@@ -7,36 +7,19 @@ export function registerModel(id, options) {
7
7
  if (modelRegistry.has(id)) {
8
8
  throw new ModelAlreadyRegisteredError(id);
9
9
  }
10
- const isDelegated = 'providerPublicKey' in options;
11
- if (isDelegated) {
12
- const { providerPublicKey, timeout, healthCheckTimeout } = options;
13
- modelRegistry.set(id, {
14
- id,
15
- isDelegated: true,
16
- delegated: {
17
- providerPublicKey,
18
- timeout,
19
- healthCheckTimeout
20
- }
21
- });
22
- logger.info(`Delegated model registered: ${id} -> provider: ${providerPublicKey}, timeout: ${timeout}ms`);
23
- }
24
- else {
25
- modelRegistry.set(id, {
26
- id,
27
- isDelegated: false,
28
- local: {
29
- model: options.model,
30
- path: options.path,
31
- loadedAt: new Date(),
32
- config: options.config,
33
- modelType: options.modelType,
34
- name: options.name
35
- }
36
- });
37
- const nameStr = options.name ? ` (${options.name})` : '';
38
- logger.info(`Local model registered: ${id}${nameStr} -> ${options.path}`);
39
- }
10
+ modelRegistry.set(id, {
11
+ id,
12
+ local: {
13
+ model: options.model,
14
+ path: options.path,
15
+ loadedAt: new Date(),
16
+ config: options.config,
17
+ modelType: options.modelType,
18
+ name: options.name
19
+ }
20
+ });
21
+ const nameStr = options.name ? ` (${options.name})` : '';
22
+ logger.info(`Local model registered: ${id}${nameStr} -> ${options.path}`);
40
23
  }
41
24
  export function getModelEntry(id) {
42
25
  return modelRegistry.get(id) || null;
@@ -46,9 +29,6 @@ export function getModel(id) {
46
29
  if (!entry) {
47
30
  throw new ModelNotFoundError(id);
48
31
  }
49
- if (entry.isDelegated) {
50
- throw new ModelIsDelegatedError(id);
51
- }
52
32
  return entry.local.model;
53
33
  }
54
34
  export function isModelLoaded(id) {
@@ -68,7 +48,7 @@ export function getAllModelIds() {
68
48
  }
69
49
  export function getModelInfo(id) {
70
50
  const entry = modelRegistry.get(id);
71
- if (!entry || entry.isDelegated) {
51
+ if (!entry) {
72
52
  return null;
73
53
  }
74
54
  const result = {
@@ -84,7 +64,7 @@ export function getModelInfo(id) {
84
64
  }
85
65
  export function getModelConfig(id) {
86
66
  const entry = modelRegistry.get(id);
87
- if (!entry || entry.isDelegated) {
67
+ if (!entry) {
88
68
  throw new ModelNotFoundError(id);
89
69
  }
90
70
  return entry.local.config;
@@ -94,9 +74,6 @@ export function updateModelConfig(id, config) {
94
74
  if (!entry) {
95
75
  throw new ModelNotFoundError(id);
96
76
  }
97
- if (entry.isDelegated) {
98
- throw new ModelIsDelegatedError(id);
99
- }
100
77
  entry.local.config = config;
101
78
  }
102
79
  export function clearRegistry() {
@@ -114,7 +91,7 @@ export async function unloadAllModels() {
114
91
  for (const modelId of modelIds) {
115
92
  const entry = modelRegistry.get(modelId);
116
93
  try {
117
- if (entry && !entry.isDelegated) {
94
+ if (entry) {
118
95
  if (entry.local.model.unload) {
119
96
  await entry.local.model.unload();
120
97
  }
@@ -1,6 +1,6 @@
1
1
  import { QVACRegistryClient } from '@qvac/registry-client';
2
2
  import { getCacheDir } from '../utils/cache/paths.js';
3
- import { registerSwarm, unregisterSwarm, registerCorestore, unregisterCorestore } from '../runtime/runtime-lifecycle.js';
3
+ import { registerSwarm, unregisterSwarm, registerCorestore, unregisterCorestore } from './runtime-lifecycle.js';
4
4
  import { getEngineLogger } from '../logging/index.js';
5
5
  import { DEFAULT_REGISTRY_CORE_KEY } from '../constants/index.js';
6
6
  const logger = getEngineLogger();
@@ -1,6 +1,6 @@
1
1
  import type { AbortSignal } from 'bare-abort-controller';
2
- import type { DisposableScope } from '../runtime/disposable-scope.js';
3
- import { createRequestRegistry as createRegistry, type RequestRegistry } from '../runtime/request-registry.js';
2
+ import type { DisposableScope } from './disposable-scope.js';
3
+ import { createRequestRegistry as createRegistry, type RequestRegistry } from './request-registry.js';
4
4
  import type { Logger } from '../logging/types.js';
5
5
  /**
6
6
  * Coarse classification of a long-running request. Used by
@@ -11,7 +11,7 @@ import type { Logger } from '../logging/types.js';
11
11
  * The set is intentionally open-coded — adding a new kind is a one-line
12
12
  * change and the union surfaces in editor autocomplete at every call site.
13
13
  */
14
- export type RequestKind = 'completion' | 'batchCompletion' | 'embeddings' | 'transcribe' | 'translate' | 'diffusion' | 'audiogen' | 'tts' | 'ocr' | 'vla' | 'finetune' | 'loadModel' | 'downloadAsset' | 'rag';
14
+ export type RequestKind = 'completion' | 'batchCompletion' | 'embeddings' | 'transcribe' | 'translate' | 'diffusion' | 'world' | 'audiogen' | 'tts' | 'ocr' | 'vla' | 'finetune' | 'loadModel' | 'downloadAsset' | 'rag';
15
15
  /**
16
16
  * Lifecycle states a request transitions through. A new context starts in
17
17
  * `"running"`. `cancel(...)` flips it to `"cancelling"` and aborts the
@@ -1,4 +1,4 @@
1
- import { createRequestRegistry as createRegistry } from '../runtime/request-registry.js';
1
+ import { createRequestRegistry as createRegistry } from './request-registry.js';
2
2
  /**
3
3
  * Shared singleton. Every long-running request registers under this
4
4
  * registry, so a `cancel({ requestId })` call can find its target without
@@ -65,6 +65,18 @@ function installDefaultPolicies(r) {
65
65
  onOverflow: 'queue',
66
66
  maxQueueDepthPerModel: 64
67
67
  });
68
+ // An ABot-World session runs one job at a time: the addon rejects a second
69
+ // step while a block is still streaming, and scene creation shares the same
70
+ // lane. Reject rather than queue, unlike every other policy here, because a
71
+ // walk is driven by live key input and a backlog of stale keypresses is worse
72
+ // for the caller than a prompt refusal it can drop. Making the registry
73
+ // authoritative also means the refusal arrives as a typed SDK error rather
74
+ // than the addon's opaque busy string.
75
+ r.policy({
76
+ kind: 'world',
77
+ maxConcurrentPerModel: 1,
78
+ onOverflow: 'reject'
79
+ });
68
80
  }
69
81
  export function getRequestRegistry() {
70
82
  if (!registry) {
@@ -1,5 +1,5 @@
1
1
  import { type AbortSignal } from 'bare-abort-controller';
2
- import type { RequestContext, RequestKind } from '../runtime/request-context.js';
2
+ import type { RequestContext, RequestKind } from './request-context.js';
3
3
  import type { Logger } from '../logging/types.js';
4
4
  /**
5
5
  * Outcome the caller declares when terminating a request through
@@ -1,5 +1,5 @@
1
1
  import { AbortController } from 'bare-abort-controller';
2
- import { createDisposableScope } from '../runtime/disposable-scope.js';
2
+ import { createDisposableScope } from './disposable-scope.js';
3
3
  import { RequestIdConflictError, RequestRejectedByPolicyError } from '../errors/index.js';
4
4
  import { getEngineLogger } from '../logging/index.js';
5
5
  /**
@@ -9,10 +9,9 @@ import { getEngineLogger } from '../logging/index.js';
9
9
  * the matching operation's `begin(...)`: a `cancel` issued at the same
10
10
  * time as the matching `completion(...)` either lands first (and we need
11
11
  * to remember it long enough for `begin(...)` to follow) or lands second
12
- * (and we never touch this set). For a local call the gap is tiny; a
13
- * delegated call adds the provider round-trip. 30 seconds is overkill for
14
- * that but gives slow networks / pause-the-debugger scenarios enough
15
- * slack while still bounding worst-case retention.
12
+ * (and we never touch this set). The gap is tiny, so 30 seconds is overkill
13
+ * but gives slow networks / pause-the-debugger scenarios enough slack while
14
+ * still bounding worst-case retention.
16
15
  *
17
16
  * The size cap protects against a buggy or malicious caller firing a
18
17
  * stream of cancels for ids that never get a `begin(...)` follow-up —
@@ -1,5 +1,5 @@
1
1
  import type { QvacConfig, RuntimeContext, CanonicalModelType } from '../schemas/index.js';
2
- export { CANONICAL_TO_ALIAS, MODEL_CONFIG_SCHEMAS, BUILTIN_DEVICE_PATTERNS, matchesPattern, findAllMatchingPatterns, getDefaultsFromPattern, resolveModelConfigWithContext } from '../runtime/model-config-utils.js';
2
+ export { CANONICAL_TO_ALIAS, MODEL_CONFIG_SCHEMAS, BUILTIN_DEVICE_PATTERNS, matchesPattern, findAllMatchingPatterns, getDefaultsFromPattern, resolveModelConfigWithContext } from './model-config-utils.js';
3
3
  /**
4
4
  * Sets the QVAC configuration. This can only be called ONCE during initialization.
5
5
  * After the first call, the config becomes immutable and any subsequent calls will throw.
@@ -3,8 +3,8 @@ import path from 'bare-path';
3
3
  import { getQvacPath } from '../utils/qvac-paths.js';
4
4
  import { CacheDirNotAbsoluteError, CacheDirNotWritableError, ConfigAlreadySetError } from '../errors/index.js';
5
5
  import { getEngineLogger, setGlobalConsoleOutput, setGlobalLogLevel } from '../logging/index.js';
6
- export { CANONICAL_TO_ALIAS, MODEL_CONFIG_SCHEMAS, BUILTIN_DEVICE_PATTERNS, matchesPattern, findAllMatchingPatterns, getDefaultsFromPattern, resolveModelConfigWithContext } from '../runtime/model-config-utils.js';
7
- import { BUILTIN_DEVICE_PATTERNS, resolveModelConfigWithContext } from '../runtime/model-config-utils.js';
6
+ export { CANONICAL_TO_ALIAS, MODEL_CONFIG_SCHEMAS, BUILTIN_DEVICE_PATTERNS, matchesPattern, findAllMatchingPatterns, getDefaultsFromPattern, resolveModelConfigWithContext } from './model-config-utils.js';
7
+ import { BUILTIN_DEVICE_PATTERNS, resolveModelConfigWithContext } from './model-config-utils.js';
8
8
  const logger = getEngineLogger();
9
9
  // ============================================
10
10
  // Global configuration
@@ -15,9 +15,12 @@ const configRegistry = {
15
15
  loggerLevel: undefined,
16
16
  loggerConsoleOutput: undefined,
17
17
  httpDownloadConcurrency: undefined,
18
+ requireHttpChecksum: undefined,
19
+ requireSecureTransport: undefined,
18
20
  registryDownloadMaxRetries: undefined,
19
21
  registryStreamTimeoutMs: undefined,
20
- deviceDefaults: undefined
22
+ deviceDefaults: undefined,
23
+ ragTurbovec: undefined
21
24
  };
22
25
  let configIsSet = false;
23
26
  /**
@@ -68,6 +71,14 @@ export function setConfig(config) {
68
71
  configRegistry.httpDownloadConcurrency = config.httpDownloadConcurrency;
69
72
  logger.info(`HTTP download concurrency set to: ${config.httpDownloadConcurrency}`);
70
73
  }
74
+ if (config.requireHttpChecksum !== undefined && config.requireHttpChecksum !== null) {
75
+ configRegistry.requireHttpChecksum = config.requireHttpChecksum;
76
+ logger.info(`Require HTTP checksum: ${config.requireHttpChecksum}`);
77
+ }
78
+ if (config.requireSecureTransport !== undefined && config.requireSecureTransport !== null) {
79
+ configRegistry.requireSecureTransport = config.requireSecureTransport;
80
+ logger.info(`Require secure transport: ${config.requireSecureTransport}`);
81
+ }
71
82
  if (config.registryDownloadMaxRetries !== undefined &&
72
83
  config.registryDownloadMaxRetries !== null) {
73
84
  configRegistry.registryDownloadMaxRetries = config.registryDownloadMaxRetries;
@@ -81,6 +92,10 @@ export function setConfig(config) {
81
92
  configRegistry.deviceDefaults = config.deviceDefaults;
82
93
  logger.info(`✅ Device defaults configured: ${config.deviceDefaults.length} pattern(s)`);
83
94
  }
95
+ if (config.ragTurbovec !== undefined && config.ragTurbovec !== null) {
96
+ configRegistry.ragTurbovec = config.ragTurbovec;
97
+ logger.info(`✅ New RAG workspaces will use ${config.ragTurbovec ? 'TurboVec' : 'HyperDB'} (ragTurbovec: ${config.ragTurbovec})`);
98
+ }
84
99
  // Mark config as set - now it's immutable
85
100
  configIsSet = true;
86
101
  }
@@ -0,0 +1,311 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Advisory outcome of a pre-download fit assessment.
4
+ *
5
+ * `unknown` is a first-class answer, not a failure: it is what the SDK returns
6
+ * whenever the evidence does not support a defensible claim either way.
7
+ */
8
+ export declare const modelFitVerdictSchema: z.ZodEnum<{
9
+ unknown: "unknown";
10
+ "likely-fits": "likely-fits";
11
+ "likely-too-large": "likely-too-large";
12
+ }>;
13
+ /**
14
+ * Normalized workload shapes. An engine's estimator declares which kinds it
15
+ * supports; anything else assesses as `unknown`.
16
+ *
17
+ * Phase 1 covers LLM context and an audio window. Further kinds (fixed-cost
18
+ * loads, text, image, video) are additive in later phases — a kind joins the
19
+ * union only once an estimator actually handles it.
20
+ */
21
+ export declare const modelFitWorkloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
22
+ kind: z.ZodLiteral<"llm">;
23
+ contextTokens: z.ZodNumber;
24
+ }, z.core.$strip>, z.ZodObject<{
25
+ kind: z.ZodLiteral<"audio">;
26
+ windowMs: z.ZodNumber;
27
+ streaming: z.ZodBoolean;
28
+ batch: z.ZodOptional<z.ZodNumber>;
29
+ }, z.core.$strip>], "kind">;
30
+ /**
31
+ * The part of a model constant an assessment reads. Pass a catalog constant
32
+ * directly — the extra fields are ignored.
33
+ *
34
+ * Only the checksum (the profile lookup key) and the name (the result label)
35
+ * are read; everything else — engine, byte totals, transformer facts — comes
36
+ * from the resolved resource profile, not from the caller.
37
+ */
38
+ export declare const modelFitModelRefSchema: z.ZodObject<{
39
+ sha256Checksum: z.ZodString;
40
+ name: z.ZodString;
41
+ }, z.core.$strip>;
42
+ /**
43
+ * One model the caller is considering, with the workload it would run.
44
+ *
45
+ * @property model - A catalog model constant. The generated resource profile,
46
+ * looked up by checksum, supplies the byte totals and transformer facts.
47
+ * @property artifacts - Extra catalog constants a compound load needs (a VAD
48
+ * model, a pivot model). Their artifact bytes are added to this candidate.
49
+ */
50
+ export declare const modelFitCandidateSchema: z.ZodObject<{
51
+ model: z.ZodObject<{
52
+ sha256Checksum: z.ZodString;
53
+ name: z.ZodString;
54
+ }, z.core.$strip>;
55
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
56
+ sha256Checksum: z.ZodString;
57
+ name: z.ZodString;
58
+ }, z.core.$strip>>>;
59
+ workload: z.ZodDiscriminatedUnion<[z.ZodObject<{
60
+ kind: z.ZodLiteral<"llm">;
61
+ contextTokens: z.ZodNumber;
62
+ }, z.core.$strip>, z.ZodObject<{
63
+ kind: z.ZodLiteral<"audio">;
64
+ windowMs: z.ZodNumber;
65
+ streaming: z.ZodBoolean;
66
+ batch: z.ZodOptional<z.ZodNumber>;
67
+ }, z.core.$strip>], "kind">;
68
+ }, z.core.$strip>;
69
+ /**
70
+ * How the caller intends to run the candidates. This is a **declared
71
+ * assumption** used for aggregation, not a scheduling instruction — the SDK
72
+ * neither enforces nor reserves anything.
73
+ *
74
+ * - `sequential`: every model stays resident, but only the largest single
75
+ * working-memory peak is counted.
76
+ * - `concurrent`: every model stays resident and every peak is counted.
77
+ */
78
+ export declare const modelFitExecutionSchema: z.ZodEnum<{
79
+ sequential: "sequential";
80
+ concurrent: "concurrent";
81
+ }>;
82
+ export declare const assessModelFitInputSchema: z.ZodObject<{
83
+ models: z.ZodArray<z.ZodObject<{
84
+ model: z.ZodObject<{
85
+ sha256Checksum: z.ZodString;
86
+ name: z.ZodString;
87
+ }, z.core.$strip>;
88
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
89
+ sha256Checksum: z.ZodString;
90
+ name: z.ZodString;
91
+ }, z.core.$strip>>>;
92
+ workload: z.ZodDiscriminatedUnion<[z.ZodObject<{
93
+ kind: z.ZodLiteral<"llm">;
94
+ contextTokens: z.ZodNumber;
95
+ }, z.core.$strip>, z.ZodObject<{
96
+ kind: z.ZodLiteral<"audio">;
97
+ windowMs: z.ZodNumber;
98
+ streaming: z.ZodBoolean;
99
+ batch: z.ZodOptional<z.ZodNumber>;
100
+ }, z.core.$strip>], "kind">;
101
+ }, z.core.$strip>>;
102
+ execution: z.ZodDefault<z.ZodEnum<{
103
+ sequential: "sequential";
104
+ concurrent: "concurrent";
105
+ }>>;
106
+ policy: z.ZodDefault<z.ZodLiteral<"interactive-v1">>;
107
+ }, z.core.$strip>;
108
+ /**
109
+ * What evidence the budget was derived from.
110
+ *
111
+ * - `system-memory`: total system RAM minus current use. The desktop model,
112
+ * and Android's — the low-memory killer acts system-wide.
113
+ * - `process-memory`: this process's own ceiling. iOS jetsam terminates an app
114
+ * on its per-process footprint against a limit well below device RAM, so a
115
+ * system-wide budget there would defend verdicts the OS does not honor.
116
+ */
117
+ export declare const modelFitBasisSchema: z.ZodEnum<{
118
+ "system-memory": "system-memory";
119
+ "process-memory": "process-memory";
120
+ "device-memory": "device-memory";
121
+ "device-budget": "device-budget";
122
+ }>;
123
+ /**
124
+ * What kind of evidence a verdict rests on.
125
+ *
126
+ * - `calibration`: a two-sided estimate from coefficients measured on this
127
+ * platform. The only evidence that can support `likely-fits`.
128
+ * - `computed-only`: a floor computed from catalog facts alone — artifact bytes,
129
+ * plus the KV cache for llama.cpp models. It omits every engine cost that
130
+ * only a real load can tell, so it can refuse a model but never confirm one.
131
+ * This is what an uncalibrated platform, including Android and iOS, reports.
132
+ */
133
+ export declare const modelFitEvidenceSchema: z.ZodEnum<{
134
+ calibration: "calibration";
135
+ "computed-only": "computed-only";
136
+ }>;
137
+ export declare const modelFitBudgetSchema: z.ZodObject<{
138
+ totalBytes: z.ZodNumber;
139
+ usedBytes: z.ZodNumber;
140
+ availableBytes: z.ZodNumber;
141
+ reservedBytes: z.ZodNumber;
142
+ availableAfterReserveBytes: z.ZodNumber;
143
+ }, z.core.$strip>;
144
+ export declare const modelFitModelResultSchema: z.ZodObject<{
145
+ name: z.ZodString;
146
+ verdict: z.ZodEnum<{
147
+ unknown: "unknown";
148
+ "likely-fits": "likely-fits";
149
+ "likely-too-large": "likely-too-large";
150
+ }>;
151
+ evidence: z.ZodOptional<z.ZodEnum<{
152
+ calibration: "calibration";
153
+ "computed-only": "computed-only";
154
+ }>>;
155
+ estimate: z.ZodOptional<z.ZodObject<{
156
+ lowerBoundBytes: z.ZodNumber;
157
+ upperBoundBytes: z.ZodNumber;
158
+ }, z.core.$strip>>;
159
+ floorBytes: z.ZodOptional<z.ZodNumber>;
160
+ estimatorVersion: z.ZodOptional<z.ZodString>;
161
+ reasons: z.ZodArray<z.ZodString>;
162
+ }, z.core.$strip>;
163
+ export declare const assessModelFitResultSchema: z.ZodObject<{
164
+ verdict: z.ZodEnum<{
165
+ unknown: "unknown";
166
+ "likely-fits": "likely-fits";
167
+ "likely-too-large": "likely-too-large";
168
+ }>;
169
+ basis: z.ZodEnum<{
170
+ "system-memory": "system-memory";
171
+ "process-memory": "process-memory";
172
+ "device-memory": "device-memory";
173
+ "device-budget": "device-budget";
174
+ }>;
175
+ execution: z.ZodEnum<{
176
+ sequential: "sequential";
177
+ concurrent: "concurrent";
178
+ }>;
179
+ evidence: z.ZodOptional<z.ZodEnum<{
180
+ calibration: "calibration";
181
+ "computed-only": "computed-only";
182
+ }>>;
183
+ budget: z.ZodOptional<z.ZodObject<{
184
+ totalBytes: z.ZodNumber;
185
+ usedBytes: z.ZodNumber;
186
+ availableBytes: z.ZodNumber;
187
+ reservedBytes: z.ZodNumber;
188
+ availableAfterReserveBytes: z.ZodNumber;
189
+ }, z.core.$strip>>;
190
+ estimate: z.ZodOptional<z.ZodObject<{
191
+ lowerBoundBytes: z.ZodNumber;
192
+ upperBoundBytes: z.ZodNumber;
193
+ }, z.core.$strip>>;
194
+ floorBytes: z.ZodOptional<z.ZodNumber>;
195
+ models: z.ZodArray<z.ZodObject<{
196
+ name: z.ZodString;
197
+ verdict: z.ZodEnum<{
198
+ unknown: "unknown";
199
+ "likely-fits": "likely-fits";
200
+ "likely-too-large": "likely-too-large";
201
+ }>;
202
+ evidence: z.ZodOptional<z.ZodEnum<{
203
+ calibration: "calibration";
204
+ "computed-only": "computed-only";
205
+ }>>;
206
+ estimate: z.ZodOptional<z.ZodObject<{
207
+ lowerBoundBytes: z.ZodNumber;
208
+ upperBoundBytes: z.ZodNumber;
209
+ }, z.core.$strip>>;
210
+ floorBytes: z.ZodOptional<z.ZodNumber>;
211
+ estimatorVersion: z.ZodOptional<z.ZodString>;
212
+ reasons: z.ZodArray<z.ZodString>;
213
+ }, z.core.$strip>>;
214
+ reasons: z.ZodArray<z.ZodString>;
215
+ assumptions: z.ZodArray<z.ZodString>;
216
+ }, z.core.$strip>;
217
+ export declare const assessModelFitRequestSchema: z.ZodObject<{
218
+ models: z.ZodArray<z.ZodObject<{
219
+ model: z.ZodObject<{
220
+ sha256Checksum: z.ZodString;
221
+ name: z.ZodString;
222
+ }, z.core.$strip>;
223
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
224
+ sha256Checksum: z.ZodString;
225
+ name: z.ZodString;
226
+ }, z.core.$strip>>>;
227
+ workload: z.ZodDiscriminatedUnion<[z.ZodObject<{
228
+ kind: z.ZodLiteral<"llm">;
229
+ contextTokens: z.ZodNumber;
230
+ }, z.core.$strip>, z.ZodObject<{
231
+ kind: z.ZodLiteral<"audio">;
232
+ windowMs: z.ZodNumber;
233
+ streaming: z.ZodBoolean;
234
+ batch: z.ZodOptional<z.ZodNumber>;
235
+ }, z.core.$strip>], "kind">;
236
+ }, z.core.$strip>>;
237
+ execution: z.ZodDefault<z.ZodEnum<{
238
+ sequential: "sequential";
239
+ concurrent: "concurrent";
240
+ }>>;
241
+ policy: z.ZodDefault<z.ZodLiteral<"interactive-v1">>;
242
+ type: z.ZodLiteral<"assessModelFit">;
243
+ }, z.core.$strip>;
244
+ export declare const assessModelFitResponseSchema: z.ZodObject<{
245
+ verdict: z.ZodEnum<{
246
+ unknown: "unknown";
247
+ "likely-fits": "likely-fits";
248
+ "likely-too-large": "likely-too-large";
249
+ }>;
250
+ basis: z.ZodEnum<{
251
+ "system-memory": "system-memory";
252
+ "process-memory": "process-memory";
253
+ "device-memory": "device-memory";
254
+ "device-budget": "device-budget";
255
+ }>;
256
+ execution: z.ZodEnum<{
257
+ sequential: "sequential";
258
+ concurrent: "concurrent";
259
+ }>;
260
+ evidence: z.ZodOptional<z.ZodEnum<{
261
+ calibration: "calibration";
262
+ "computed-only": "computed-only";
263
+ }>>;
264
+ budget: z.ZodOptional<z.ZodObject<{
265
+ totalBytes: z.ZodNumber;
266
+ usedBytes: z.ZodNumber;
267
+ availableBytes: z.ZodNumber;
268
+ reservedBytes: z.ZodNumber;
269
+ availableAfterReserveBytes: z.ZodNumber;
270
+ }, z.core.$strip>>;
271
+ estimate: z.ZodOptional<z.ZodObject<{
272
+ lowerBoundBytes: z.ZodNumber;
273
+ upperBoundBytes: z.ZodNumber;
274
+ }, z.core.$strip>>;
275
+ floorBytes: z.ZodOptional<z.ZodNumber>;
276
+ models: z.ZodArray<z.ZodObject<{
277
+ name: z.ZodString;
278
+ verdict: z.ZodEnum<{
279
+ unknown: "unknown";
280
+ "likely-fits": "likely-fits";
281
+ "likely-too-large": "likely-too-large";
282
+ }>;
283
+ evidence: z.ZodOptional<z.ZodEnum<{
284
+ calibration: "calibration";
285
+ "computed-only": "computed-only";
286
+ }>>;
287
+ estimate: z.ZodOptional<z.ZodObject<{
288
+ lowerBoundBytes: z.ZodNumber;
289
+ upperBoundBytes: z.ZodNumber;
290
+ }, z.core.$strip>>;
291
+ floorBytes: z.ZodOptional<z.ZodNumber>;
292
+ estimatorVersion: z.ZodOptional<z.ZodString>;
293
+ reasons: z.ZodArray<z.ZodString>;
294
+ }, z.core.$strip>>;
295
+ reasons: z.ZodArray<z.ZodString>;
296
+ assumptions: z.ZodArray<z.ZodString>;
297
+ type: z.ZodLiteral<"assessModelFit">;
298
+ }, z.core.$strip>;
299
+ export type ModelFitVerdict = z.infer<typeof modelFitVerdictSchema>;
300
+ export type ModelFitModelRef = z.infer<typeof modelFitModelRefSchema>;
301
+ export type ModelFitWorkload = z.infer<typeof modelFitWorkloadSchema>;
302
+ export type ModelFitCandidate = z.infer<typeof modelFitCandidateSchema>;
303
+ export type ModelFitExecution = z.infer<typeof modelFitExecutionSchema>;
304
+ export type ModelFitBasis = z.infer<typeof modelFitBasisSchema>;
305
+ export type ModelFitEvidence = z.infer<typeof modelFitEvidenceSchema>;
306
+ export type ModelFitBudget = z.infer<typeof modelFitBudgetSchema>;
307
+ export type ModelFitModelResult = z.infer<typeof modelFitModelResultSchema>;
308
+ export type AssessModelFitInput = z.input<typeof assessModelFitInputSchema>;
309
+ export type AssessModelFitResult = z.infer<typeof assessModelFitResultSchema>;
310
+ export type AssessModelFitRequest = z.infer<typeof assessModelFitRequestSchema>;
311
+ export type AssessModelFitResponse = z.infer<typeof assessModelFitResponseSchema>;