@qvac/inference 0.20.0 → 0.21.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 (213) hide show
  1. package/NOTICE +107 -33
  2. package/README.md +8 -5
  3. package/dist/api/assess-model-fit.d.ts +9 -4
  4. package/dist/api/assess-model-fit.js +9 -4
  5. package/dist/api/bci-transcribe.d.ts +4 -1
  6. package/dist/api/index.d.ts +1 -0
  7. package/dist/api/index.js +1 -0
  8. package/dist/api/rpc-server.d.ts +19 -0
  9. package/dist/api/rpc-server.js +44 -0
  10. package/dist/api/text-to-speech.d.ts +9 -0
  11. package/dist/api/text-to-speech.js +9 -0
  12. package/dist/api/transcribe.d.ts +11 -7
  13. package/dist/api/transcribe.js +47 -15
  14. package/dist/api/video-request.d.ts +5 -5
  15. package/dist/dispatch.js +39 -7
  16. package/dist/errors/index.d.ts +7 -0
  17. package/dist/errors/index.js +15 -0
  18. package/dist/handlers/assess-model-fit.d.ts +18 -6
  19. package/dist/handlers/assess-model-fit.js +215 -35
  20. package/dist/handlers/completion-orchestrate.js +17 -0
  21. package/dist/handlers/get-loaded-model-info.js +4 -1
  22. package/dist/handlers/get-model-info.js +29 -1
  23. package/dist/handlers/load-model/coreml-sidecars.d.ts +25 -0
  24. package/dist/handlers/load-model/coreml-sidecars.js +274 -0
  25. package/dist/handlers/load-model/hyperdrive.js +2 -2
  26. package/dist/handlers/load-model/registry-download-utils.d.ts +1 -0
  27. package/dist/handlers/load-model/registry-download-utils.js +2 -1
  28. package/dist/handlers/load-model/registry.js +59 -0
  29. package/dist/handlers/rpc-server.d.ts +23 -0
  30. package/dist/handlers/rpc-server.js +141 -0
  31. package/dist/index.d.ts +2 -1
  32. package/dist/index.js +2 -1
  33. package/dist/models/registry/models.d.ts +7731 -5672
  34. package/dist/models/registry/models.js +4652 -2526
  35. package/dist/models/registry/resource-profiles.js +481 -94
  36. package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +8 -6
  37. package/dist/plugins/builtin/audiogen-ggml/plugin.js +2 -1
  38. package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +73 -1
  39. package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +37 -19
  40. package/dist/plugins/builtin/ggml-vla/plugin.d.ts +1 -1
  41. package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +9 -5
  42. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +1 -1
  43. package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +16 -7
  44. package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +80 -8
  45. package/dist/plugins/builtin/llamacpp-completion/plugin.js +9 -3
  46. package/dist/plugins/builtin/llamacpp-completion/transform.js +19 -0
  47. package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +5 -3
  48. package/dist/plugins/builtin/llamacpp-embedding/plugin.js +2 -1
  49. package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +121 -0
  50. package/dist/plugins/builtin/parakeet-transcription/plugin.js +56 -27
  51. package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +8 -2
  52. package/dist/plugins/builtin/sdcpp-generation/plugin.js +7 -2
  53. package/dist/plugins/builtin/tts-ggml/ops/parler-options.d.ts +2 -0
  54. package/dist/plugins/builtin/tts-ggml/ops/parler-options.js +5 -1
  55. package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +27 -10
  56. package/dist/plugins/builtin/tts-ggml/plugin.d.ts +181 -0
  57. package/dist/plugins/builtin/tts-ggml/plugin.js +84 -2
  58. package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +136 -0
  59. package/dist/plugins/builtin/whispercpp-transcription/plugin.js +18 -7
  60. package/dist/plugins/ops/bci-transcribe.d.ts +6 -2
  61. package/dist/plugins/ops/bci-transcribe.js +18 -13
  62. package/dist/plugins/ops/load-model.js +2 -2
  63. package/dist/plugins/ops/transcribe.d.ts +4 -2
  64. package/dist/plugins/ops/transcribe.js +39 -2
  65. package/dist/plugins/ops/translate-stats.d.ts +2 -1
  66. package/dist/plugins/ops/translate-stats.js +64 -7
  67. package/dist/plugins/ops/translate.js +20 -4
  68. package/dist/profiling/operation-metrics.js +56 -0
  69. package/dist/registry.js +4 -0
  70. package/dist/resources/model-fit/assess.d.ts +46 -2
  71. package/dist/resources/model-fit/assess.js +67 -3
  72. package/dist/resources/model-fit/estimators/llm.js +2 -2
  73. package/dist/resources/model-fit/estimators/whisper.js +3 -4
  74. package/dist/resources/model-fit/fit-stub/fetch-fit-stub.d.ts +102 -0
  75. package/dist/resources/model-fit/fit-stub/fetch-fit-stub.js +212 -0
  76. package/dist/resources/model-fit/fit-stub/project-fit-from-load.d.ts +27 -0
  77. package/dist/resources/model-fit/fit-stub/project-fit-from-load.js +31 -0
  78. package/dist/resources/model-fit/fit-stub/resolve-load-from-stubs.d.ts +38 -0
  79. package/dist/resources/model-fit/fit-stub/resolve-load-from-stubs.js +138 -0
  80. package/dist/resources/model-fit/floor.js +2 -2
  81. package/dist/resources/model-fit/native-probe/advisory-fit.d.ts +9 -6
  82. package/dist/resources/model-fit/native-probe/advisory-fit.js +129 -80
  83. package/dist/resources/model-fit/native-probe/child-engine-fit.d.ts +2 -0
  84. package/dist/resources/model-fit/native-probe/child-engine-fit.js +41 -0
  85. package/dist/resources/model-fit/native-probe/classify-fit.d.ts +6 -0
  86. package/dist/resources/model-fit/native-probe/classify-fit.js +135 -0
  87. package/dist/resources/model-fit/native-probe/create-fit-request.d.ts +28 -0
  88. package/dist/resources/model-fit/native-probe/create-fit-request.js +51 -0
  89. package/dist/resources/model-fit/native-probe/engine-fit.d.ts +59 -0
  90. package/dist/resources/model-fit/native-probe/engine-fit.js +13 -0
  91. package/dist/resources/model-fit/native-probe/engines/asr.d.ts +10 -0
  92. package/dist/resources/model-fit/native-probe/engines/asr.js +103 -0
  93. package/dist/resources/model-fit/native-probe/engines/audiogen.d.ts +8 -0
  94. package/dist/resources/model-fit/native-probe/engines/audiogen.js +35 -0
  95. package/dist/resources/model-fit/native-probe/engines/diffusion.d.ts +7 -0
  96. package/dist/resources/model-fit/native-probe/engines/diffusion.js +55 -0
  97. package/dist/resources/model-fit/native-probe/engines/gpu.d.ts +10 -0
  98. package/dist/resources/model-fit/native-probe/engines/gpu.js +21 -0
  99. package/dist/resources/model-fit/native-probe/engines/llama.d.ts +13 -0
  100. package/dist/resources/model-fit/native-probe/engines/llama.js +145 -0
  101. package/dist/resources/model-fit/native-probe/engines/tts.d.ts +8 -0
  102. package/dist/resources/model-fit/native-probe/engines/tts.js +106 -0
  103. package/dist/resources/model-fit/native-probe/fit-outcome.d.ts +16 -0
  104. package/dist/resources/model-fit/native-probe/fit-outcome.js +1 -0
  105. package/dist/resources/model-fit/native-probe/fit-process.d.ts +27 -0
  106. package/dist/resources/model-fit/native-probe/fit-process.js +55 -0
  107. package/dist/resources/model-fit/native-probe/fit-runner.d.ts +1 -0
  108. package/dist/resources/model-fit/native-probe/fit-runner.js +58 -0
  109. package/dist/resources/model-fit/native-probe/run-fit.d.ts +24 -0
  110. package/dist/resources/model-fit/native-probe/run-fit.js +20 -0
  111. package/dist/resources/model-fit/native-probe/run-in-process-fit.d.ts +14 -34
  112. package/dist/resources/model-fit/native-probe/run-in-process-fit.js +55 -139
  113. package/dist/resources/model-fit/native-probe/run-isolated-fit.d.ts +5 -12
  114. package/dist/resources/model-fit/native-probe/run-isolated-fit.js +13 -8
  115. package/dist/resources/model-fit/platform.d.ts +9 -0
  116. package/dist/resources/model-fit/platform.js +28 -0
  117. package/dist/rpc/device-map.d.ts +13 -0
  118. package/dist/rpc/device-map.js +22 -0
  119. package/dist/rpc/discovery.d.ts +12 -0
  120. package/dist/rpc/discovery.js +225 -0
  121. package/dist/rpc/ggml-provider.d.ts +4 -0
  122. package/dist/rpc/ggml-provider.js +25 -0
  123. package/dist/rpc/index.d.ts +2 -0
  124. package/dist/rpc/index.js +1 -0
  125. package/dist/rpc/instance.d.ts +6 -0
  126. package/dist/rpc/instance.js +21 -0
  127. package/dist/rpc/inventory.d.ts +5 -0
  128. package/dist/rpc/inventory.js +144 -0
  129. package/dist/rpc/manager.d.ts +14 -0
  130. package/dist/rpc/manager.js +174 -0
  131. package/dist/rpc/network.d.ts +11 -0
  132. package/dist/rpc/network.js +85 -0
  133. package/dist/rpc/provider.d.ts +6 -0
  134. package/dist/rpc/provider.js +24 -0
  135. package/dist/runtime/lifecycle.js +31 -13
  136. package/dist/runtime/request-context.d.ts +1 -1
  137. package/dist/runtime/state.js +5 -0
  138. package/dist/schemas/assess-model-fit.d.ts +284 -77
  139. package/dist/schemas/assess-model-fit.js +93 -55
  140. package/dist/schemas/audio-gen.d.ts +6 -6
  141. package/dist/schemas/audio-gen.js +2 -2
  142. package/dist/schemas/batch-completion-stream.d.ts +13 -5
  143. package/dist/schemas/batch-completion-stream.js +5 -3
  144. package/dist/schemas/bci-config.js +1 -1
  145. package/dist/schemas/bci.d.ts +86 -1
  146. package/dist/schemas/bci.js +21 -2
  147. package/dist/schemas/cancel.d.ts +10 -0
  148. package/dist/schemas/cancel.js +2 -0
  149. package/dist/schemas/common.d.ts +765 -56
  150. package/dist/schemas/common.js +7 -0
  151. package/dist/schemas/completion-event.d.ts +6 -6
  152. package/dist/schemas/completion-stream.d.ts +27 -8
  153. package/dist/schemas/completion-stream.js +41 -4
  154. package/dist/schemas/config.d.ts +236 -30
  155. package/dist/schemas/config.js +10 -0
  156. package/dist/schemas/embed.d.ts +2 -2
  157. package/dist/schemas/error.js +13 -0
  158. package/dist/schemas/errors.d.ts +1 -0
  159. package/dist/schemas/errors.js +5 -0
  160. package/dist/schemas/index.d.ts +1 -0
  161. package/dist/schemas/index.js +1 -0
  162. package/dist/schemas/llamacpp-config.d.ts +105 -14
  163. package/dist/schemas/llamacpp-config.js +113 -3
  164. package/dist/schemas/load-model.d.ts +3102 -627
  165. package/dist/schemas/load-model.js +2 -2
  166. package/dist/schemas/mcp-adapter.d.ts +4 -0
  167. package/dist/schemas/model-config-schemas.d.ts +205 -5
  168. package/dist/schemas/model-info.d.ts +56 -0
  169. package/dist/schemas/model-info.js +5 -1
  170. package/dist/schemas/plugin.d.ts +8 -2
  171. package/dist/schemas/profiling.d.ts +4 -4
  172. package/dist/schemas/reload-config.d.ts +30 -0
  173. package/dist/schemas/rpc-server.d.ts +101 -0
  174. package/dist/schemas/rpc-server.js +87 -0
  175. package/dist/schemas/sdcpp-config.d.ts +7 -3
  176. package/dist/schemas/sdcpp-config.js +37 -2
  177. package/dist/schemas/system-resources.d.ts +4 -4
  178. package/dist/schemas/text-to-speech.d.ts +529 -1
  179. package/dist/schemas/text-to-speech.js +122 -12
  180. package/dist/schemas/tools.d.ts +2 -0
  181. package/dist/schemas/tools.js +8 -0
  182. package/dist/schemas/transcription-config.d.ts +5 -0
  183. package/dist/schemas/transcription-config.js +20 -2
  184. package/dist/schemas/transcription.d.ts +164 -0
  185. package/dist/schemas/transcription.js +71 -4
  186. package/dist/schemas/vla.d.ts +1 -1
  187. package/dist/surface.d.ts +4 -1
  188. package/dist/surface.js +3 -1
  189. package/dist/utils/addon-responses.d.ts +5 -1
  190. package/dist/utils/archive.js +5 -1
  191. package/dist/utils/asr-diagnostics.d.ts +12 -0
  192. package/dist/utils/asr-diagnostics.js +42 -0
  193. package/dist/utils/asr-events.d.ts +1 -0
  194. package/dist/utils/asr-events.js +3 -2
  195. package/dist/utils/cache/paths.js +3 -2
  196. package/dist/utils/mcp-adapter.js +7 -1
  197. package/dist/utils/multi-gpu-mobile.d.ts +1 -1
  198. package/dist/utils/multi-gpu-mobile.js +8 -6
  199. package/dist/utils/path-security.d.ts +5 -0
  200. package/dist/utils/path-security.js +14 -0
  201. package/dist/utils/tool-helpers.d.ts +4 -0
  202. package/dist/utils/tool-helpers.js +2 -0
  203. package/dist/utils/tools/defer.d.ts +93 -0
  204. package/dist/utils/tools/defer.js +290 -0
  205. package/dist/utils/tools/index.d.ts +1 -0
  206. package/dist/utils/tools/index.js +1 -0
  207. package/dist/utils/transcribe-metadata.d.ts +21 -7
  208. package/dist/utils/transcribe-metadata.js +24 -8
  209. package/dist/utils/tts-stats.d.ts +6 -0
  210. package/dist/utils/tts-stats.js +14 -1
  211. package/package.json +44 -30
  212. package/dist/resources/model-fit/native-probe/create-llama-fit-request.d.ts +0 -26
  213. package/dist/resources/model-fit/native-probe/create-llama-fit-request.js +0 -171
@@ -11,22 +11,17 @@ export declare const modelFitVerdictSchema: z.ZodEnum<{
11
11
  "likely-too-large": "likely-too-large";
12
12
  }>;
13
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.
14
+ * What the estimator sizes a load by, read out of its config. An engine whose
15
+ * estimator declares no kind for it assesses as `unknown`.
20
16
  */
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">;
17
+ export type ModelFitWorkload = {
18
+ kind: 'llm';
19
+ contextTokens?: number;
20
+ } | {
21
+ kind: 'audio';
22
+ windowMs: number;
23
+ streaming: boolean;
24
+ };
30
25
  /**
31
26
  * The part of a model constant an assessment reads. Pass a catalog constant
32
27
  * directly — the extra fields are ignored.
@@ -38,34 +33,19 @@ export declare const modelFitWorkloadSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
38
33
  export declare const modelFitModelRefSchema: z.ZodObject<{
39
34
  sha256Checksum: z.ZodString;
40
35
  name: z.ZodString;
36
+ registryPath: z.ZodOptional<z.ZodString>;
37
+ registrySource: z.ZodOptional<z.ZodString>;
41
38
  }, z.core.$strip>;
42
39
  /**
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.
40
+ * What the estimator is given for one candidate: the catalog facts its checksum
41
+ * resolves to, and the workload read out of the load's config.
49
42
  */
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>;
43
+ export interface ModelFitEstimateTarget {
44
+ model: ModelFitModelRef;
45
+ workload: ModelFitWorkload;
46
+ artifacts?: ModelFitModelRef[];
47
+ device?: string;
48
+ }
69
49
  /**
70
50
  * How the caller intends to run the candidates. This is a **declared
71
51
  * assumption** used for aggregation, not a scheduling instruction — the SDK
@@ -79,25 +59,152 @@ export declare const modelFitExecutionSchema: z.ZodEnum<{
79
59
  sequential: "sequential";
80
60
  concurrent: "concurrent";
81
61
  }>;
62
+ /**
63
+ * A load to assess, in `loadModel`'s own parameters. The engine's plugin
64
+ * resolves it, so the config and the artifact keys the fitter reads are the
65
+ * ones the load would run with.
66
+ *
67
+ * Each source resolves to the registry's weightless description of the
68
+ * artifact, or to the file itself where it is already on disk.
69
+ */
70
+ export declare const modelFitCandidateSchema: z.ZodObject<{
71
+ modelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
72
+ src: z.ZodString;
73
+ name: z.ZodOptional<z.ZodString>;
74
+ modelId: z.ZodOptional<z.ZodString>;
75
+ registryPath: z.ZodOptional<z.ZodString>;
76
+ registrySource: z.ZodOptional<z.ZodString>;
77
+ blobCoreKey: z.ZodOptional<z.ZodString>;
78
+ blobIndex: z.ZodOptional<z.ZodNumber>;
79
+ engine: z.ZodOptional<z.ZodString>;
80
+ expectedSize: z.ZodOptional<z.ZodNumber>;
81
+ sha256Checksum: z.ZodOptional<z.ZodString>;
82
+ addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
83
+ embeddings: "embeddings";
84
+ diffusion: "diffusion";
85
+ audiogen: "audiogen";
86
+ tts: "tts";
87
+ ocr: "ocr";
88
+ vla: "vla";
89
+ "llamacpp-completion": "llamacpp-completion";
90
+ "whispercpp-transcription": "whispercpp-transcription";
91
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
92
+ "llamacpp-embedding": "llamacpp-embedding";
93
+ "nmtcpp-translation": "nmtcpp-translation";
94
+ "onnx-tts": "onnx-tts";
95
+ "tts-ggml": "tts-ggml";
96
+ "parakeet-transcription": "parakeet-transcription";
97
+ "ggml-ocr": "ggml-ocr";
98
+ "sdcpp-generation": "sdcpp-generation";
99
+ "audiogen-ggml": "audiogen-ggml";
100
+ "ggml-vla": "ggml-vla";
101
+ "ggml-classification": "ggml-classification";
102
+ llm: "llm";
103
+ whisper: "whisper";
104
+ bci: "bci";
105
+ nmt: "nmt";
106
+ parakeet: "parakeet";
107
+ classification: "classification";
108
+ }>, z.ZodLiteral<"vad">]>>;
109
+ }, z.core.$strip>]>>;
110
+ modelType: z.ZodOptional<z.ZodEnum<{
111
+ embeddings: "embeddings";
112
+ diffusion: "diffusion";
113
+ audiogen: "audiogen";
114
+ tts: "tts";
115
+ ocr: "ocr";
116
+ vla: "vla";
117
+ "llamacpp-completion": "llamacpp-completion";
118
+ "whispercpp-transcription": "whispercpp-transcription";
119
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
120
+ "llamacpp-embedding": "llamacpp-embedding";
121
+ "nmtcpp-translation": "nmtcpp-translation";
122
+ "onnx-tts": "onnx-tts";
123
+ "tts-ggml": "tts-ggml";
124
+ "parakeet-transcription": "parakeet-transcription";
125
+ "ggml-ocr": "ggml-ocr";
126
+ "sdcpp-generation": "sdcpp-generation";
127
+ "audiogen-ggml": "audiogen-ggml";
128
+ "ggml-vla": "ggml-vla";
129
+ "ggml-classification": "ggml-classification";
130
+ llm: "llm";
131
+ whisper: "whisper";
132
+ bci: "bci";
133
+ nmt: "nmt";
134
+ parakeet: "parakeet";
135
+ classification: "classification";
136
+ }>>;
137
+ modelConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
138
+ }, z.core.$strip>;
82
139
  export declare const assessModelFitInputSchema: z.ZodObject<{
83
140
  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">;
141
+ modelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
142
+ src: z.ZodString;
143
+ name: z.ZodOptional<z.ZodString>;
144
+ modelId: z.ZodOptional<z.ZodString>;
145
+ registryPath: z.ZodOptional<z.ZodString>;
146
+ registrySource: z.ZodOptional<z.ZodString>;
147
+ blobCoreKey: z.ZodOptional<z.ZodString>;
148
+ blobIndex: z.ZodOptional<z.ZodNumber>;
149
+ engine: z.ZodOptional<z.ZodString>;
150
+ expectedSize: z.ZodOptional<z.ZodNumber>;
151
+ sha256Checksum: z.ZodOptional<z.ZodString>;
152
+ addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
153
+ embeddings: "embeddings";
154
+ diffusion: "diffusion";
155
+ audiogen: "audiogen";
156
+ tts: "tts";
157
+ ocr: "ocr";
158
+ vla: "vla";
159
+ "llamacpp-completion": "llamacpp-completion";
160
+ "whispercpp-transcription": "whispercpp-transcription";
161
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
162
+ "llamacpp-embedding": "llamacpp-embedding";
163
+ "nmtcpp-translation": "nmtcpp-translation";
164
+ "onnx-tts": "onnx-tts";
165
+ "tts-ggml": "tts-ggml";
166
+ "parakeet-transcription": "parakeet-transcription";
167
+ "ggml-ocr": "ggml-ocr";
168
+ "sdcpp-generation": "sdcpp-generation";
169
+ "audiogen-ggml": "audiogen-ggml";
170
+ "ggml-vla": "ggml-vla";
171
+ "ggml-classification": "ggml-classification";
172
+ llm: "llm";
173
+ whisper: "whisper";
174
+ bci: "bci";
175
+ nmt: "nmt";
176
+ parakeet: "parakeet";
177
+ classification: "classification";
178
+ }>, z.ZodLiteral<"vad">]>>;
179
+ }, z.core.$strip>]>>;
180
+ modelType: z.ZodOptional<z.ZodEnum<{
181
+ embeddings: "embeddings";
182
+ diffusion: "diffusion";
183
+ audiogen: "audiogen";
184
+ tts: "tts";
185
+ ocr: "ocr";
186
+ vla: "vla";
187
+ "llamacpp-completion": "llamacpp-completion";
188
+ "whispercpp-transcription": "whispercpp-transcription";
189
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
190
+ "llamacpp-embedding": "llamacpp-embedding";
191
+ "nmtcpp-translation": "nmtcpp-translation";
192
+ "onnx-tts": "onnx-tts";
193
+ "tts-ggml": "tts-ggml";
194
+ "parakeet-transcription": "parakeet-transcription";
195
+ "ggml-ocr": "ggml-ocr";
196
+ "sdcpp-generation": "sdcpp-generation";
197
+ "audiogen-ggml": "audiogen-ggml";
198
+ "ggml-vla": "ggml-vla";
199
+ "ggml-classification": "ggml-classification";
200
+ llm: "llm";
201
+ whisper: "whisper";
202
+ bci: "bci";
203
+ nmt: "nmt";
204
+ parakeet: "parakeet";
205
+ classification: "classification";
206
+ }>>;
207
+ modelConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
101
208
  }, z.core.$strip>>;
102
209
  execution: z.ZodDefault<z.ZodEnum<{
103
210
  sequential: "sequential";
@@ -129,10 +236,14 @@ export declare const modelFitBasisSchema: z.ZodEnum<{
129
236
  * plus the KV cache for llama.cpp models. It omits every engine cost that
130
237
  * only a real load can tell, so it can refuse a model but never confirm one.
131
238
  * This is what an uncalibrated platform, including Android and iOS, reports.
239
+ * - `native-fit`: the engine's own fitter, run against the registry's weightless
240
+ * description of the artifact. It is the answer the loader would give on this
241
+ * machine, not a model of it, so it outranks `calibration` where both exist.
132
242
  */
133
243
  export declare const modelFitEvidenceSchema: z.ZodEnum<{
134
244
  calibration: "calibration";
135
245
  "computed-only": "computed-only";
246
+ "native-fit": "native-fit";
136
247
  }>;
137
248
  export declare const modelFitBudgetSchema: z.ZodObject<{
138
249
  totalBytes: z.ZodNumber;
@@ -151,6 +262,7 @@ export declare const modelFitModelResultSchema: z.ZodObject<{
151
262
  evidence: z.ZodOptional<z.ZodEnum<{
152
263
  calibration: "calibration";
153
264
  "computed-only": "computed-only";
265
+ "native-fit": "native-fit";
154
266
  }>>;
155
267
  estimate: z.ZodOptional<z.ZodObject<{
156
268
  lowerBoundBytes: z.ZodNumber;
@@ -158,6 +270,7 @@ export declare const modelFitModelResultSchema: z.ZodObject<{
158
270
  }, z.core.$strip>>;
159
271
  floorBytes: z.ZodOptional<z.ZodNumber>;
160
272
  estimatorVersion: z.ZodOptional<z.ZodString>;
273
+ device: z.ZodOptional<z.ZodString>;
161
274
  reasons: z.ZodArray<z.ZodString>;
162
275
  }, z.core.$strip>;
163
276
  export declare const assessModelFitResultSchema: z.ZodObject<{
@@ -179,6 +292,7 @@ export declare const assessModelFitResultSchema: z.ZodObject<{
179
292
  evidence: z.ZodOptional<z.ZodEnum<{
180
293
  calibration: "calibration";
181
294
  "computed-only": "computed-only";
295
+ "native-fit": "native-fit";
182
296
  }>>;
183
297
  budget: z.ZodOptional<z.ZodObject<{
184
298
  totalBytes: z.ZodNumber;
@@ -202,6 +316,7 @@ export declare const assessModelFitResultSchema: z.ZodObject<{
202
316
  evidence: z.ZodOptional<z.ZodEnum<{
203
317
  calibration: "calibration";
204
318
  "computed-only": "computed-only";
319
+ "native-fit": "native-fit";
205
320
  }>>;
206
321
  estimate: z.ZodOptional<z.ZodObject<{
207
322
  lowerBoundBytes: z.ZodNumber;
@@ -209,6 +324,7 @@ export declare const assessModelFitResultSchema: z.ZodObject<{
209
324
  }, z.core.$strip>>;
210
325
  floorBytes: z.ZodOptional<z.ZodNumber>;
211
326
  estimatorVersion: z.ZodOptional<z.ZodString>;
327
+ device: z.ZodOptional<z.ZodString>;
212
328
  reasons: z.ZodArray<z.ZodString>;
213
329
  }, z.core.$strip>>;
214
330
  reasons: z.ZodArray<z.ZodString>;
@@ -218,8 +334,8 @@ export declare const assessModelFitResultSchema: z.ZodObject<{
218
334
  * The other fit question, kept in this file on purpose: `assessModelFit` above
219
335
  * answers "should I download this?" from calibrated coefficients and a checksum,
220
336
  * while the native probe answers "will the load I am about to run fit?" by
221
- * reading the GGUF on disk in a disposable child. Two evidence classes, so two
222
- * verdict vocabularies:
337
+ * handing the model file and the resolved settings to the fitter of the engine
338
+ * that would run it. Two evidence classes, so two verdict vocabularies:
223
339
  *
224
340
  * - `likely-fits` / `likely-too-large` hedge because a formula is an estimate.
225
341
  * - `fit` / `does-not-fit` do not, because the probe measured this build of this
@@ -239,6 +355,32 @@ export declare const nativeProbePlanSchema: z.ZodObject<{
239
355
  nGpuLayers: z.ZodNumber;
240
356
  nGpuDevices: z.ZodNumber;
241
357
  }, z.core.$strip>;
358
+ /**
359
+ * What the fitter measured. Each field is optional because the engines do not
360
+ * all measure the same things: the diffusion fitter answers with a placement
361
+ * and a per-module table rather than a total, so it fills `report` alone.
362
+ *
363
+ * `weightsBytes`, `contextBytes` and `computeBytes` divide `deviceBytes` where
364
+ * the engine separates them, and are absent together where it reports only a
365
+ * total. They are summed across devices, as `deviceBytes` is, so a load spread
366
+ * over more than one device is described by its totals and `deviceName` names
367
+ * the first.
368
+ *
369
+ * `deviceFreeBytes` is the backend's own gauge. A device sharing the host pool,
370
+ * as Apple silicon and Adreno/Mali do, reports what it could address rather
371
+ * than what the machine would give back, so it is an upper bound there.
372
+ */
373
+ export declare const nativeProbeProjectionSchema: z.ZodObject<{
374
+ deviceName: z.ZodOptional<z.ZodString>;
375
+ deviceBytes: z.ZodOptional<z.ZodNumber>;
376
+ hostBytes: z.ZodOptional<z.ZodNumber>;
377
+ weightsBytes: z.ZodOptional<z.ZodNumber>;
378
+ contextBytes: z.ZodOptional<z.ZodNumber>;
379
+ computeBytes: z.ZodOptional<z.ZodNumber>;
380
+ deviceFreeBytes: z.ZodOptional<z.ZodNumber>;
381
+ deviceTotalBytes: z.ZodOptional<z.ZodNumber>;
382
+ report: z.ZodOptional<z.ZodString>;
383
+ }, z.core.$strip>;
242
384
  export declare const nativeProbeFitSchema: z.ZodObject<{
243
385
  verdict: z.ZodEnum<{
244
386
  unknown: "unknown";
@@ -246,6 +388,7 @@ export declare const nativeProbeFitSchema: z.ZodObject<{
246
388
  "does-not-fit": "does-not-fit";
247
389
  }>;
248
390
  basis: z.ZodLiteral<"native-probe">;
391
+ engine: z.ZodOptional<z.ZodString>;
249
392
  estimatorVersion: z.ZodString;
250
393
  reason: z.ZodString;
251
394
  message: z.ZodOptional<z.ZodString>;
@@ -254,26 +397,87 @@ export declare const nativeProbeFitSchema: z.ZodObject<{
254
397
  nGpuLayers: z.ZodNumber;
255
398
  nGpuDevices: z.ZodNumber;
256
399
  }, z.core.$strip>>;
400
+ projection: z.ZodOptional<z.ZodObject<{
401
+ deviceName: z.ZodOptional<z.ZodString>;
402
+ deviceBytes: z.ZodOptional<z.ZodNumber>;
403
+ hostBytes: z.ZodOptional<z.ZodNumber>;
404
+ weightsBytes: z.ZodOptional<z.ZodNumber>;
405
+ contextBytes: z.ZodOptional<z.ZodNumber>;
406
+ computeBytes: z.ZodOptional<z.ZodNumber>;
407
+ deviceFreeBytes: z.ZodOptional<z.ZodNumber>;
408
+ deviceTotalBytes: z.ZodOptional<z.ZodNumber>;
409
+ report: z.ZodOptional<z.ZodString>;
410
+ }, z.core.$strip>>;
257
411
  }, z.core.$strip>;
258
412
  export declare const assessModelFitRequestSchema: z.ZodObject<{
259
413
  models: z.ZodArray<z.ZodObject<{
260
- model: z.ZodObject<{
261
- sha256Checksum: z.ZodString;
262
- name: z.ZodString;
263
- }, z.core.$strip>;
264
- artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
265
- sha256Checksum: z.ZodString;
266
- name: z.ZodString;
267
- }, z.core.$strip>>>;
268
- workload: z.ZodDiscriminatedUnion<[z.ZodObject<{
269
- kind: z.ZodLiteral<"llm">;
270
- contextTokens: z.ZodNumber;
271
- }, z.core.$strip>, z.ZodObject<{
272
- kind: z.ZodLiteral<"audio">;
273
- windowMs: z.ZodNumber;
274
- streaming: z.ZodBoolean;
275
- batch: z.ZodOptional<z.ZodNumber>;
276
- }, z.core.$strip>], "kind">;
414
+ modelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
415
+ src: z.ZodString;
416
+ name: z.ZodOptional<z.ZodString>;
417
+ modelId: z.ZodOptional<z.ZodString>;
418
+ registryPath: z.ZodOptional<z.ZodString>;
419
+ registrySource: z.ZodOptional<z.ZodString>;
420
+ blobCoreKey: z.ZodOptional<z.ZodString>;
421
+ blobIndex: z.ZodOptional<z.ZodNumber>;
422
+ engine: z.ZodOptional<z.ZodString>;
423
+ expectedSize: z.ZodOptional<z.ZodNumber>;
424
+ sha256Checksum: z.ZodOptional<z.ZodString>;
425
+ addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
426
+ embeddings: "embeddings";
427
+ diffusion: "diffusion";
428
+ audiogen: "audiogen";
429
+ tts: "tts";
430
+ ocr: "ocr";
431
+ vla: "vla";
432
+ "llamacpp-completion": "llamacpp-completion";
433
+ "whispercpp-transcription": "whispercpp-transcription";
434
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
435
+ "llamacpp-embedding": "llamacpp-embedding";
436
+ "nmtcpp-translation": "nmtcpp-translation";
437
+ "onnx-tts": "onnx-tts";
438
+ "tts-ggml": "tts-ggml";
439
+ "parakeet-transcription": "parakeet-transcription";
440
+ "ggml-ocr": "ggml-ocr";
441
+ "sdcpp-generation": "sdcpp-generation";
442
+ "audiogen-ggml": "audiogen-ggml";
443
+ "ggml-vla": "ggml-vla";
444
+ "ggml-classification": "ggml-classification";
445
+ llm: "llm";
446
+ whisper: "whisper";
447
+ bci: "bci";
448
+ nmt: "nmt";
449
+ parakeet: "parakeet";
450
+ classification: "classification";
451
+ }>, z.ZodLiteral<"vad">]>>;
452
+ }, z.core.$strip>]>>;
453
+ modelType: z.ZodOptional<z.ZodEnum<{
454
+ embeddings: "embeddings";
455
+ diffusion: "diffusion";
456
+ audiogen: "audiogen";
457
+ tts: "tts";
458
+ ocr: "ocr";
459
+ vla: "vla";
460
+ "llamacpp-completion": "llamacpp-completion";
461
+ "whispercpp-transcription": "whispercpp-transcription";
462
+ "bci-whispercpp-transcription": "bci-whispercpp-transcription";
463
+ "llamacpp-embedding": "llamacpp-embedding";
464
+ "nmtcpp-translation": "nmtcpp-translation";
465
+ "onnx-tts": "onnx-tts";
466
+ "tts-ggml": "tts-ggml";
467
+ "parakeet-transcription": "parakeet-transcription";
468
+ "ggml-ocr": "ggml-ocr";
469
+ "sdcpp-generation": "sdcpp-generation";
470
+ "audiogen-ggml": "audiogen-ggml";
471
+ "ggml-vla": "ggml-vla";
472
+ "ggml-classification": "ggml-classification";
473
+ llm: "llm";
474
+ whisper: "whisper";
475
+ bci: "bci";
476
+ nmt: "nmt";
477
+ parakeet: "parakeet";
478
+ classification: "classification";
479
+ }>>;
480
+ modelConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
277
481
  }, z.core.$strip>>;
278
482
  execution: z.ZodDefault<z.ZodEnum<{
279
483
  sequential: "sequential";
@@ -301,6 +505,7 @@ export declare const assessModelFitResponseSchema: z.ZodObject<{
301
505
  evidence: z.ZodOptional<z.ZodEnum<{
302
506
  calibration: "calibration";
303
507
  "computed-only": "computed-only";
508
+ "native-fit": "native-fit";
304
509
  }>>;
305
510
  budget: z.ZodOptional<z.ZodObject<{
306
511
  totalBytes: z.ZodNumber;
@@ -324,6 +529,7 @@ export declare const assessModelFitResponseSchema: z.ZodObject<{
324
529
  evidence: z.ZodOptional<z.ZodEnum<{
325
530
  calibration: "calibration";
326
531
  "computed-only": "computed-only";
532
+ "native-fit": "native-fit";
327
533
  }>>;
328
534
  estimate: z.ZodOptional<z.ZodObject<{
329
535
  lowerBoundBytes: z.ZodNumber;
@@ -331,6 +537,7 @@ export declare const assessModelFitResponseSchema: z.ZodObject<{
331
537
  }, z.core.$strip>>;
332
538
  floorBytes: z.ZodOptional<z.ZodNumber>;
333
539
  estimatorVersion: z.ZodOptional<z.ZodString>;
540
+ device: z.ZodOptional<z.ZodString>;
334
541
  reasons: z.ZodArray<z.ZodString>;
335
542
  }, z.core.$strip>>;
336
543
  reasons: z.ZodArray<z.ZodString>;
@@ -339,10 +546,10 @@ export declare const assessModelFitResponseSchema: z.ZodObject<{
339
546
  }, z.core.$strip>;
340
547
  export type NativeProbeVerdict = z.infer<typeof nativeProbeVerdictSchema>;
341
548
  export type NativeProbePlan = z.infer<typeof nativeProbePlanSchema>;
549
+ export type NativeProbeProjection = z.infer<typeof nativeProbeProjectionSchema>;
342
550
  export type NativeProbeFit = z.infer<typeof nativeProbeFitSchema>;
343
551
  export type ModelFitVerdict = z.infer<typeof modelFitVerdictSchema>;
344
552
  export type ModelFitModelRef = z.infer<typeof modelFitModelRefSchema>;
345
- export type ModelFitWorkload = z.infer<typeof modelFitWorkloadSchema>;
346
553
  export type ModelFitCandidate = z.infer<typeof modelFitCandidateSchema>;
347
554
  export type ModelFitExecution = z.infer<typeof modelFitExecutionSchema>;
348
555
  export type ModelFitBasis = z.infer<typeof modelFitBasisSchema>;