@qvac/inference 0.21.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +30 -1
- package/README.md +44 -1
- package/dist/api/assess-model-fit.d.ts +4 -4
- package/dist/api/assess-model-fit.js +4 -4
- package/dist/api/audio-gen.d.ts +4 -1
- package/dist/api/audio-gen.js +4 -1
- package/dist/api/batch-completion.js +1 -1
- package/dist/api/completion-stream.js +1 -1
- package/dist/api/decide.d.ts +26 -0
- package/dist/api/decide.js +26 -0
- package/dist/api/get-model-info.d.ts +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/text-to-speech.d.ts +1 -0
- package/dist/api/text-to-speech.js +15 -19
- package/dist/api/transcribe.js +5 -2
- package/dist/api/video-request.d.ts +5 -5
- package/dist/api/video.d.ts +5 -4
- package/dist/api/video.js +5 -4
- package/dist/errors/index.d.ts +3 -0
- package/dist/errors/index.js +5 -0
- package/dist/handlers/assess-model-fit.d.ts +5 -3
- package/dist/handlers/assess-model-fit.js +80 -28
- package/dist/handlers/get-loaded-model-info.js +1 -2
- package/dist/handlers/load-model/safe-fetch.js +5 -6
- package/dist/handlers/registry.d.ts +3 -1
- package/dist/handlers/registry.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/logging/logger.js +1 -1
- package/dist/logging/utils.js +1 -1
- package/dist/models/registry/models.d.ts +563 -816
- package/dist/models/registry/models.js +2873 -3110
- package/dist/models/registry/resource-profiles.d.ts +1 -2
- package/dist/models/registry/resource-profiles.js +203 -2
- package/dist/plugins/builtin/asr-ggml/config.d.ts +7 -1
- package/dist/plugins/builtin/asr-ggml/config.js +6 -0
- package/dist/plugins/builtin/asr-ggml/logging.d.ts +1 -1
- package/dist/plugins/builtin/audiogen-ggml/config.d.ts +1 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-edit-stream.js +28 -10
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-input.d.ts +27 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-input.js +23 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +6 -27
- package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +147 -60
- package/dist/plugins/builtin/audiogen-ggml/plugin.js +1 -0
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +40 -24
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +1 -1
- package/dist/plugins/builtin/ggml-classification/plugin.d.ts +4 -4
- package/dist/plugins/builtin/ggml-ocr/params.d.ts +18 -0
- package/dist/plugins/builtin/ggml-ocr/params.js +37 -0
- package/dist/plugins/builtin/ggml-ocr/plugin.d.ts +18 -10
- package/dist/plugins/builtin/ggml-ocr/plugin.js +16 -38
- package/dist/plugins/builtin/ggml-vla/plugin.d.ts +21 -14
- package/dist/plugins/builtin/ggml-vla/plugin.js +1 -1
- package/dist/plugins/builtin/index.d.ts +2 -0
- package/dist/plugins/builtin/index.js +2 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.d.ts +9 -7
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +109 -189
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.d.ts +32 -90
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.js +60 -211
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-state.d.ts +2 -49
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-state.js +2 -46
- package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +185 -87
- package/dist/plugins/builtin/llamacpp-completion/plugin.js +4 -5
- package/dist/plugins/builtin/llamacpp-completion/transform.js +1 -1
- package/dist/plugins/builtin/llamacpp-decision/helpers.d.ts +6 -0
- package/dist/plugins/builtin/llamacpp-decision/helpers.js +97 -0
- package/dist/plugins/builtin/llamacpp-decision/ops/decide.d.ts +91 -0
- package/dist/plugins/builtin/llamacpp-decision/ops/decide.js +129 -0
- package/dist/plugins/builtin/llamacpp-decision/plugin.d.ts +216 -0
- package/dist/plugins/builtin/llamacpp-decision/plugin.js +43 -0
- package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +12 -5
- package/dist/plugins/builtin/llamacpp-embedding/plugin.js +1 -1
- package/dist/plugins/builtin/llamacpp-embedding/transform.js +3 -0
- package/dist/plugins/builtin/moss-transcribe/plugin.d.ts +143 -0
- package/dist/plugins/builtin/moss-transcribe/plugin.js +96 -0
- package/dist/plugins/builtin/nmtcpp-translation/load-files.d.ts +6 -0
- package/dist/plugins/builtin/nmtcpp-translation/load-files.js +70 -0
- package/dist/plugins/builtin/nmtcpp-translation/plugin.d.ts +25 -13
- package/dist/plugins/builtin/nmtcpp-translation/plugin.js +9 -73
- package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +52 -31
- package/dist/plugins/builtin/parakeet-transcription/plugin.js +18 -3
- package/dist/plugins/builtin/sdcpp-generation/ops/video.js +10 -6
- package/dist/plugins/builtin/sdcpp-generation/ops/world.d.ts +2 -2
- package/dist/plugins/builtin/sdcpp-generation/ops/world.js +1 -1
- package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +59 -33
- package/dist/plugins/builtin/sdcpp-generation/plugin.js +12 -9
- package/dist/plugins/builtin/tts-ggml/ops/moss-options.d.ts +22 -0
- package/dist/plugins/builtin/tts-ggml/ops/moss-options.js +79 -0
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.js +4 -1
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +17 -5
- package/dist/plugins/builtin/tts-ggml/plugin.d.ts +164 -29
- package/dist/plugins/builtin/tts-ggml/plugin.js +38 -1
- package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +58 -35
- package/dist/plugins/builtin/whispercpp-transcription/plugin.js +6 -2
- package/dist/plugins/ops/kv-cache-utils.d.ts +1 -1
- package/dist/plugins/ops/kv-cache-utils.js +10 -25
- package/dist/plugins/ops/load-model.js +21 -16
- package/dist/plugins/ops/transcribe.js +17 -1
- package/dist/registry.js +1 -0
- package/dist/resources/model-fit/assess.d.ts +15 -23
- package/dist/resources/model-fit/assess.js +207 -271
- package/dist/resources/model-fit/fit-stub/fetch-fit-stub.d.ts +3 -1
- package/dist/resources/model-fit/fit-stub/fetch-fit-stub.js +6 -1
- package/dist/resources/model-fit/fit-stub/project-fit-from-load.js +2 -0
- package/dist/resources/model-fit/fit-stub/resolve-load-from-stubs.d.ts +5 -3
- package/dist/resources/model-fit/fit-stub/resolve-load-from-stubs.js +9 -1
- package/dist/resources/model-fit/floor.d.ts +10 -10
- package/dist/resources/model-fit/floor.js +13 -13
- package/dist/resources/model-fit/kv-cache.d.ts +23 -0
- package/dist/resources/model-fit/kv-cache.js +85 -0
- package/dist/resources/model-fit/native-probe/advisory-fit.d.ts +11 -6
- package/dist/resources/model-fit/native-probe/advisory-fit.js +12 -27
- package/dist/resources/model-fit/native-probe/child-engine-fit.js +8 -0
- package/dist/resources/model-fit/native-probe/classify-fit.js +32 -1
- package/dist/resources/model-fit/native-probe/create-fit-request.d.ts +4 -1
- package/dist/resources/model-fit/native-probe/create-fit-request.js +24 -14
- package/dist/resources/model-fit/native-probe/engine-fit.d.ts +14 -0
- package/dist/resources/model-fit/native-probe/engine-fit.js +1 -1
- package/dist/resources/model-fit/native-probe/engines/asr.d.ts +4 -0
- package/dist/resources/model-fit/native-probe/engines/asr.js +23 -0
- package/dist/resources/model-fit/native-probe/engines/audiogen.js +29 -1
- package/dist/resources/model-fit/native-probe/engines/diffusion.js +16 -6
- package/dist/resources/model-fit/native-probe/engines/llama.d.ts +0 -1
- package/dist/resources/model-fit/native-probe/engines/llama.js +19 -123
- package/dist/resources/model-fit/native-probe/engines/nmt.d.ts +8 -0
- package/dist/resources/model-fit/native-probe/engines/nmt.js +11 -0
- package/dist/resources/model-fit/native-probe/engines/ocr.d.ts +9 -0
- package/dist/resources/model-fit/native-probe/engines/ocr.js +13 -0
- package/dist/resources/model-fit/native-probe/engines/tts.d.ts +2 -0
- package/dist/resources/model-fit/native-probe/engines/tts.js +49 -3
- package/dist/resources/model-fit/native-probe/run-in-process-fit.d.ts +5 -3
- package/dist/resources/model-fit/native-probe/run-in-process-fit.js +38 -23
- package/dist/resources/model-fit/platform.d.ts +4 -4
- package/dist/resources/model-fit/platform.js +6 -8
- package/dist/resources/model-fit/types.d.ts +3 -117
- package/dist/rpc/inventory.js +5 -7
- package/dist/runtime/env.d.ts +0 -2
- package/dist/runtime/env.js +2 -9
- package/dist/runtime/model-config-utils.js +6 -1
- package/dist/runtime/request-context.d.ts +1 -1
- package/dist/runtime/request-context.js +8 -0
- package/dist/runtime/state.js +5 -0
- package/dist/schemas/assess-model-fit.d.ts +100 -43
- package/dist/schemas/assess-model-fit.js +66 -29
- package/dist/schemas/audio-gen.d.ts +186 -18
- package/dist/schemas/audio-gen.js +180 -48
- package/dist/schemas/batch-completion-stream.d.ts +202 -34
- package/dist/schemas/bci-config.d.ts +2 -0
- package/dist/schemas/bci.d.ts +23 -2
- package/dist/schemas/cancel.d.ts +5 -0
- package/dist/schemas/cancel.js +1 -0
- package/dist/schemas/common.d.ts +1083 -158
- package/dist/schemas/common.js +5 -2
- package/dist/schemas/completion-stream.d.ts +232 -37
- package/dist/schemas/completion-stream.js +64 -20
- package/dist/schemas/config.d.ts +477 -12
- package/dist/schemas/config.js +21 -1
- package/dist/schemas/decision.d.ts +602 -0
- package/dist/schemas/decision.js +205 -0
- package/dist/schemas/download-asset.d.ts +7 -3
- package/dist/schemas/engine-addon-map.d.ts +7 -0
- package/dist/schemas/engine-addon-map.js +23 -3
- package/dist/schemas/errors.d.ts +1 -0
- package/dist/schemas/errors.js +5 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/llamacpp-config.d.ts +42 -2
- package/dist/schemas/llamacpp-config.js +27 -0
- package/dist/schemas/load-model.d.ts +5247 -1309
- package/dist/schemas/load-model.js +88 -9
- package/dist/schemas/model-config-schemas.d.ts +233 -8
- package/dist/schemas/model-config-schemas.js +4 -1
- package/dist/schemas/model-fit-policy.d.ts +17 -0
- package/dist/schemas/model-fit-policy.js +17 -0
- package/dist/schemas/model-info.d.ts +20 -2
- package/dist/schemas/model-info.js +2 -1
- package/dist/schemas/model-resource-profile.d.ts +3 -4
- package/dist/schemas/model-resource-profile.js +1 -4
- package/dist/schemas/model-src-utils.d.ts +10 -2
- package/dist/schemas/model-types.d.ts +10 -1
- package/dist/schemas/model-types.js +3 -0
- package/dist/schemas/ocr.d.ts +74 -0
- package/dist/schemas/ocr.js +42 -0
- package/dist/schemas/plugin.d.ts +8 -2
- package/dist/schemas/plugin.js +6 -0
- package/dist/schemas/profiling.d.ts +4 -4
- package/dist/schemas/registry.d.ts +26 -0
- package/dist/schemas/registry.js +3 -0
- package/dist/schemas/reload-config.d.ts +10 -2
- package/dist/schemas/rpc-server.js +3 -3
- package/dist/schemas/sdcpp-config.d.ts +26 -0
- package/dist/schemas/sdcpp-config.js +8 -7
- package/dist/schemas/system-resources.d.ts +4 -4
- package/dist/schemas/text-to-speech.d.ts +402 -3
- package/dist/schemas/text-to-speech.js +129 -11
- package/dist/schemas/tools.d.ts +13 -4
- package/dist/schemas/tools.js +18 -6
- package/dist/schemas/transcription-config.d.ts +15 -0
- package/dist/schemas/transcription-config.js +38 -3
- package/dist/schemas/transcription.d.ts +46 -4
- package/dist/schemas/transcription.js +51 -4
- package/dist/schemas/translation-config.d.ts +30 -10
- package/dist/schemas/vla.d.ts +9 -2
- package/dist/schemas/vla.js +9 -5
- package/dist/surface.d.ts +1 -1
- package/dist/surface.js +1 -1
- package/dist/utils/addon-responses.d.ts +1 -0
- package/dist/utils/asr-events.d.ts +1 -0
- package/dist/utils/asr-events.js +2 -1
- package/dist/utils/cache/types.d.ts +7 -0
- package/dist/utils/mcp-adapter.js +12 -8
- package/dist/utils/tool-helpers.d.ts +1 -1
- package/dist/utils/tool-helpers.js +20 -52
- package/dist/utils/tools/parsers/dsml.js +8 -5
- package/dist/utils/tools/parsers/qwen35.js +7 -4
- package/dist/utils/tools/shared.d.ts +3 -0
- package/dist/utils/tools/shared.js +62 -0
- package/dist/utils/transcribe-metadata.d.ts +8 -1
- package/dist/utils/transcribe-metadata.js +13 -3
- package/dist/utils/tts-stats.d.ts +1 -0
- package/package.json +41 -32
- package/dist/resources/model-fit/calibration/darwin-arm64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/darwin-arm64.js +0 -36
- package/dist/resources/model-fit/calibration/darwin-x64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/darwin-x64.js +0 -38
- package/dist/resources/model-fit/calibration/fit.d.ts +0 -73
- package/dist/resources/model-fit/calibration/fit.js +0 -152
- package/dist/resources/model-fit/calibration/index.d.ts +0 -37
- package/dist/resources/model-fit/calibration/index.js +0 -75
- package/dist/resources/model-fit/calibration/linux-arm64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/linux-arm64.js +0 -38
- package/dist/resources/model-fit/calibration/linux-x64-vulkan.d.ts +0 -8
- package/dist/resources/model-fit/calibration/linux-x64-vulkan.js +0 -39
- package/dist/resources/model-fit/calibration/linux-x64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/linux-x64.js +0 -38
- package/dist/resources/model-fit/calibration/win32-x64-vulkan-shared.d.ts +0 -8
- package/dist/resources/model-fit/calibration/win32-x64-vulkan-shared.js +0 -39
- package/dist/resources/model-fit/calibration/win32-x64-vulkan.d.ts +0 -8
- package/dist/resources/model-fit/calibration/win32-x64-vulkan.js +0 -36
- package/dist/resources/model-fit/calibration/win32-x64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/win32-x64.js +0 -38
- package/dist/resources/model-fit/estimators/llm.d.ts +0 -46
- package/dist/resources/model-fit/estimators/llm.js +0 -222
- package/dist/resources/model-fit/estimators/whisper.d.ts +0 -10
- package/dist/resources/model-fit/estimators/whisper.js +0 -76
|
@@ -2,6 +2,14 @@ import { z } from 'zod';
|
|
|
2
2
|
import { modelRegistryEntrySchema } from './registry.js';
|
|
3
3
|
import { modelSrcInputSchema } from './model-src-utils.js';
|
|
4
4
|
import { modelTypeInputSchema } from './model-types.js';
|
|
5
|
+
import { transcribeParamsSchema } from './transcription.js';
|
|
6
|
+
export const transcriptionFitWorkloadSchema = transcribeParamsSchema
|
|
7
|
+
.pick({ prompt: true, hotwords: true, maxNewTokens: true })
|
|
8
|
+
.extend({ audioSeconds: z.number().positive().describe('Longest whole recording to project.') })
|
|
9
|
+
.strict()
|
|
10
|
+
.refine((value) => value.prompt === undefined || !value.hotwords?.length, {
|
|
11
|
+
message: 'MOSS prompt cannot be combined with hotwords'
|
|
12
|
+
});
|
|
5
13
|
/**
|
|
6
14
|
* Advisory outcome of a pre-download fit assessment.
|
|
7
15
|
*
|
|
@@ -26,7 +34,7 @@ export const modelFitModelRefSchema = modelRegistryEntrySchema
|
|
|
26
34
|
registryPath: z
|
|
27
35
|
.string()
|
|
28
36
|
.optional()
|
|
29
|
-
.describe('Registry coordinates. Present on a catalog constant; without them no fit stub can be resolved and the assessment falls back to
|
|
37
|
+
.describe('Registry coordinates. Present on a catalog constant; without them no fit stub can be resolved and the assessment falls back to the computed floor.'),
|
|
30
38
|
registrySource: z
|
|
31
39
|
.string()
|
|
32
40
|
.optional()
|
|
@@ -42,6 +50,32 @@ export const modelFitModelRefSchema = modelRegistryEntrySchema
|
|
|
42
50
|
* - `concurrent`: every model stays resident and every peak is counted.
|
|
43
51
|
*/
|
|
44
52
|
export const modelFitExecutionSchema = z.enum(['sequential', 'concurrent']);
|
|
53
|
+
/** Fit-only workload used to estimate MOSS text-to-speech memory requirements. */
|
|
54
|
+
export const ttsFitWorkloadSchema = z.union([
|
|
55
|
+
z
|
|
56
|
+
.strictObject({
|
|
57
|
+
promptRows: z
|
|
58
|
+
.number()
|
|
59
|
+
.int()
|
|
60
|
+
.positive()
|
|
61
|
+
.max(2147483647)
|
|
62
|
+
.describe('Complete native prompt rows, including dialogue and references.'),
|
|
63
|
+
referenceSamples: z
|
|
64
|
+
.number()
|
|
65
|
+
.int()
|
|
66
|
+
.nonnegative()
|
|
67
|
+
.max(2147483647)
|
|
68
|
+
.describe('Total mono reference audio samples.'),
|
|
69
|
+
streaming: z.boolean().describe('Whether the MOSS workload uses native streaming.')
|
|
70
|
+
})
|
|
71
|
+
.meta({ title: 'MossTtsFitWorkload' }),
|
|
72
|
+
z
|
|
73
|
+
.strictObject({
|
|
74
|
+
prompt: z.string().min(1).describe('Sound-effect description.'),
|
|
75
|
+
seconds: z.number().positive().max(30).describe('Sound-effect duration in seconds, up to 30.')
|
|
76
|
+
})
|
|
77
|
+
.meta({ title: 'MossSoundEffectFitWorkload' })
|
|
78
|
+
]);
|
|
45
79
|
/**
|
|
46
80
|
* A load to assess, in `loadModel`'s own parameters. The engine's plugin
|
|
47
81
|
* resolves it, so the config and the artifact keys the fitter reads are the
|
|
@@ -51,12 +85,18 @@ export const modelFitExecutionSchema = z.enum(['sequential', 'concurrent']);
|
|
|
51
85
|
* artifact, or to the file itself where it is already on disk.
|
|
52
86
|
*/
|
|
53
87
|
export const modelFitCandidateSchema = z.object({
|
|
88
|
+
transcriptionWorkload: transcriptionFitWorkloadSchema
|
|
89
|
+
.optional()
|
|
90
|
+
.describe('MOSS fit-only workload. Required for a native MOSS projection; does not configure loading.'),
|
|
54
91
|
modelSrc: modelSrcInputSchema
|
|
55
92
|
.optional()
|
|
56
93
|
.describe('The model to assess, as `loadModel` takes it. Optional for the loads `loadModel` also takes without one, where every source is a config field.'),
|
|
57
94
|
modelType: modelTypeInputSchema
|
|
58
95
|
.optional()
|
|
59
96
|
.describe('Engine that would run the load. Inferred from `modelSrc` when omitted, as `loadModel` infers it; required only where the source does not name one.'),
|
|
97
|
+
ttsWorkload: ttsFitWorkloadSchema
|
|
98
|
+
.optional()
|
|
99
|
+
.describe('Fit-only MOSS-TTS/TTSD or MOSS-SoundEffect workload; never passed to model loading.'),
|
|
60
100
|
modelConfig: z
|
|
61
101
|
.record(z.string(), z.unknown())
|
|
62
102
|
.optional()
|
|
@@ -75,10 +115,6 @@ export const assessModelFitInputSchema = z.object({
|
|
|
75
115
|
.default('interactive-v1')
|
|
76
116
|
.describe('Headroom policy. `interactive-v1` withholds 20% of the memory available right now, capped at 2 GiB on desktop and 1 GiB on mobile.')
|
|
77
117
|
});
|
|
78
|
-
const byteRangeSchema = z.object({
|
|
79
|
-
lowerBoundBytes: z.number(),
|
|
80
|
-
upperBoundBytes: z.number()
|
|
81
|
-
});
|
|
82
118
|
/**
|
|
83
119
|
* What evidence the budget was derived from.
|
|
84
120
|
*
|
|
@@ -97,17 +133,14 @@ export const modelFitBasisSchema = z.enum([
|
|
|
97
133
|
/**
|
|
98
134
|
* What kind of evidence a verdict rests on.
|
|
99
135
|
*
|
|
100
|
-
* - `
|
|
101
|
-
*
|
|
136
|
+
* - `native-fit`: the engine's own fitter, run against the model or the
|
|
137
|
+
* registry's weightless description of it. It is the answer the loader would
|
|
138
|
+
* give on this machine, and the only evidence that can confirm a fit.
|
|
102
139
|
* - `computed-only`: a floor computed from catalog facts alone — artifact bytes,
|
|
103
140
|
* plus the KV cache for llama.cpp models. It omits every engine cost that
|
|
104
141
|
* only a real load can tell, so it can refuse a model but never confirm one.
|
|
105
|
-
* This is what an uncalibrated platform, including Android and iOS, reports.
|
|
106
|
-
* - `native-fit`: the engine's own fitter, run against the registry's weightless
|
|
107
|
-
* description of the artifact. It is the answer the loader would give on this
|
|
108
|
-
* machine, not a model of it, so it outranks `calibration` where both exist.
|
|
109
142
|
*/
|
|
110
|
-
export const modelFitEvidenceSchema = z.enum(['
|
|
143
|
+
export const modelFitEvidenceSchema = z.enum(['computed-only', 'native-fit']);
|
|
111
144
|
export const modelFitBudgetSchema = z.object({
|
|
112
145
|
totalBytes: z
|
|
113
146
|
.number()
|
|
@@ -129,9 +162,6 @@ export const modelFitModelResultSchema = z.object({
|
|
|
129
162
|
evidence: modelFitEvidenceSchema
|
|
130
163
|
.optional()
|
|
131
164
|
.describe('What the verdict rests on. Absent when nothing could be computed for this model, e.g. no catalog profile.'),
|
|
132
|
-
estimate: byteRangeSchema
|
|
133
|
-
.optional()
|
|
134
|
-
.describe('Two-sided bound from calibrated coefficients. Absent under computed-only evidence, or when this model assessed as `unknown` for want of any evidence.'),
|
|
135
165
|
floorBytes: z
|
|
136
166
|
.number()
|
|
137
167
|
.optional()
|
|
@@ -152,11 +182,8 @@ export const assessModelFitResultSchema = z.object({
|
|
|
152
182
|
execution: modelFitExecutionSchema.describe('The declared execution mode this result assumed.'),
|
|
153
183
|
evidence: modelFitEvidenceSchema
|
|
154
184
|
.optional()
|
|
155
|
-
.describe('The weakest evidence among the candidates: `computed-only` as soon as one model has only a floor, since the combined verdict can then never be `likely-fits`. Absent whenever any candidate could not be assessed at all, so an `unknown` that carries `evidence` is a near-miss or
|
|
185
|
+
.describe('The weakest evidence among the candidates: `computed-only` as soon as one model has only a floor, since the combined verdict can then never be `likely-fits`. Absent whenever any candidate could not be assessed at all, so an `unknown` that carries `evidence` is a near-miss or a floor, never a missing model.'),
|
|
156
186
|
budget: modelFitBudgetSchema.optional().describe('Absent when memory evidence was unusable.'),
|
|
157
|
-
estimate: byteRangeSchema
|
|
158
|
-
.optional()
|
|
159
|
-
.describe('Combined two-sided bound. Absent when the combined verdict is `unknown` for want of evidence, and under computed-only evidence, which has no upper bound.'),
|
|
160
187
|
floorBytes: z
|
|
161
188
|
.number()
|
|
162
189
|
.optional()
|
|
@@ -169,19 +196,18 @@ export const assessModelFitResultSchema = z.object({
|
|
|
169
196
|
});
|
|
170
197
|
// ============== Native probe (pre-load) ==============
|
|
171
198
|
/**
|
|
172
|
-
* The other fit question
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
199
|
+
* The other fit question: `assessModelFit` above answers "should I download
|
|
200
|
+
* this?" about a set of models against a memory budget, while the native probe
|
|
201
|
+
* answers "will the load I am about to run fit?" by handing one model file and
|
|
202
|
+
* the resolved settings to the fitter of the engine that would run it. Two
|
|
203
|
+
* scopes, so two verdict vocabularies:
|
|
177
204
|
*
|
|
178
|
-
* - `likely-fits` / `likely-too-large` hedge because
|
|
205
|
+
* - `likely-fits` / `likely-too-large` hedge because the set is judged against a
|
|
206
|
+
* sampled budget that the rest of the machine moves.
|
|
179
207
|
* - `fit` / `does-not-fit` do not, because the probe measured this build of this
|
|
180
208
|
* file against this device.
|
|
181
209
|
*
|
|
182
|
-
*
|
|
183
|
-
* it saw the artifact and the resolved load settings. `assessModelFit` is the
|
|
184
|
-
* answer available before the bytes are on disk. Neither denies a load today.
|
|
210
|
+
* Neither denies a load.
|
|
185
211
|
*/
|
|
186
212
|
export const nativeProbeVerdictSchema = z.enum(['fit', 'does-not-fit', 'unknown']);
|
|
187
213
|
export const nativeProbePlanSchema = z.object({
|
|
@@ -198,7 +224,7 @@ export const nativeProbePlanSchema = z.object({
|
|
|
198
224
|
* the engine separates them, and are absent together where it reports only a
|
|
199
225
|
* total. They are summed across devices, as `deviceBytes` is, so a load spread
|
|
200
226
|
* over more than one device is described by its totals and `deviceName` names
|
|
201
|
-
* the first.
|
|
227
|
+
* the first non-CPU row.
|
|
202
228
|
*
|
|
203
229
|
* `deviceFreeBytes` is the backend's own gauge. A device sharing the host pool,
|
|
204
230
|
* as Apple silicon and Adreno/Mali do, reports what it could address rather
|
|
@@ -222,6 +248,17 @@ export const nativeProbeProjectionSchema = z.object({
|
|
|
222
248
|
.describe('Compute buffers and graph arenas, within `deviceBytes`.'),
|
|
223
249
|
deviceFreeBytes: z.number().optional().describe('Device memory free when the probe ran.'),
|
|
224
250
|
deviceTotalBytes: z.number().optional().describe('Device memory installed.'),
|
|
251
|
+
devices: z
|
|
252
|
+
.array(z.object({
|
|
253
|
+
name: z.string().describe('Device name as the engine registered it.'),
|
|
254
|
+
totalBytes: z.number().describe('Device memory installed.'),
|
|
255
|
+
freeBytes: z.number().describe('Device memory free when the probe ran.'),
|
|
256
|
+
weightsBytes: z.number().describe('Model weights placed on this device.'),
|
|
257
|
+
contextBytes: z.number().describe('Context and KV cache placed on this device.'),
|
|
258
|
+
computeBytes: z.number().describe('Compute buffers placed on this device.')
|
|
259
|
+
}))
|
|
260
|
+
.optional()
|
|
261
|
+
.describe('One row per device the load was placed on, including the CPU backend, host excluded — `hostBytes` carries that. The flattened totals sum these rows, and `deviceName` names the first non-CPU row.'),
|
|
225
262
|
report: z
|
|
226
263
|
.string()
|
|
227
264
|
.optional()
|