@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.
- package/NOTICE +107 -33
- package/README.md +8 -5
- package/dist/api/assess-model-fit.d.ts +9 -4
- package/dist/api/assess-model-fit.js +9 -4
- package/dist/api/bci-transcribe.d.ts +4 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/rpc-server.d.ts +19 -0
- package/dist/api/rpc-server.js +44 -0
- package/dist/api/text-to-speech.d.ts +9 -0
- package/dist/api/text-to-speech.js +9 -0
- package/dist/api/transcribe.d.ts +11 -7
- package/dist/api/transcribe.js +47 -15
- package/dist/api/video-request.d.ts +5 -5
- package/dist/dispatch.js +39 -7
- package/dist/errors/index.d.ts +7 -0
- package/dist/errors/index.js +15 -0
- package/dist/handlers/assess-model-fit.d.ts +18 -6
- package/dist/handlers/assess-model-fit.js +215 -35
- package/dist/handlers/completion-orchestrate.js +17 -0
- package/dist/handlers/get-loaded-model-info.js +4 -1
- package/dist/handlers/get-model-info.js +29 -1
- package/dist/handlers/load-model/coreml-sidecars.d.ts +25 -0
- package/dist/handlers/load-model/coreml-sidecars.js +274 -0
- package/dist/handlers/load-model/hyperdrive.js +2 -2
- package/dist/handlers/load-model/registry-download-utils.d.ts +1 -0
- package/dist/handlers/load-model/registry-download-utils.js +2 -1
- package/dist/handlers/load-model/registry.js +59 -0
- package/dist/handlers/rpc-server.d.ts +23 -0
- package/dist/handlers/rpc-server.js +141 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/models/registry/models.d.ts +7731 -5672
- package/dist/models/registry/models.js +4652 -2526
- package/dist/models/registry/resource-profiles.js +481 -94
- package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +8 -6
- package/dist/plugins/builtin/audiogen-ggml/plugin.js +2 -1
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +73 -1
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +37 -19
- package/dist/plugins/builtin/ggml-vla/plugin.d.ts +1 -1
- package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +9 -5
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +1 -1
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +16 -7
- package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +80 -8
- package/dist/plugins/builtin/llamacpp-completion/plugin.js +9 -3
- package/dist/plugins/builtin/llamacpp-completion/transform.js +19 -0
- package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +5 -3
- package/dist/plugins/builtin/llamacpp-embedding/plugin.js +2 -1
- package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +121 -0
- package/dist/plugins/builtin/parakeet-transcription/plugin.js +56 -27
- package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +8 -2
- package/dist/plugins/builtin/sdcpp-generation/plugin.js +7 -2
- package/dist/plugins/builtin/tts-ggml/ops/parler-options.d.ts +2 -0
- package/dist/plugins/builtin/tts-ggml/ops/parler-options.js +5 -1
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +27 -10
- package/dist/plugins/builtin/tts-ggml/plugin.d.ts +181 -0
- package/dist/plugins/builtin/tts-ggml/plugin.js +84 -2
- package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +136 -0
- package/dist/plugins/builtin/whispercpp-transcription/plugin.js +18 -7
- package/dist/plugins/ops/bci-transcribe.d.ts +6 -2
- package/dist/plugins/ops/bci-transcribe.js +18 -13
- package/dist/plugins/ops/load-model.js +2 -2
- package/dist/plugins/ops/transcribe.d.ts +4 -2
- package/dist/plugins/ops/transcribe.js +39 -2
- package/dist/plugins/ops/translate-stats.d.ts +2 -1
- package/dist/plugins/ops/translate-stats.js +64 -7
- package/dist/plugins/ops/translate.js +20 -4
- package/dist/profiling/operation-metrics.js +56 -0
- package/dist/registry.js +4 -0
- package/dist/resources/model-fit/assess.d.ts +46 -2
- package/dist/resources/model-fit/assess.js +67 -3
- package/dist/resources/model-fit/estimators/llm.js +2 -2
- package/dist/resources/model-fit/estimators/whisper.js +3 -4
- package/dist/resources/model-fit/fit-stub/fetch-fit-stub.d.ts +102 -0
- package/dist/resources/model-fit/fit-stub/fetch-fit-stub.js +212 -0
- package/dist/resources/model-fit/fit-stub/project-fit-from-load.d.ts +27 -0
- package/dist/resources/model-fit/fit-stub/project-fit-from-load.js +31 -0
- package/dist/resources/model-fit/fit-stub/resolve-load-from-stubs.d.ts +38 -0
- package/dist/resources/model-fit/fit-stub/resolve-load-from-stubs.js +138 -0
- package/dist/resources/model-fit/floor.js +2 -2
- package/dist/resources/model-fit/native-probe/advisory-fit.d.ts +9 -6
- package/dist/resources/model-fit/native-probe/advisory-fit.js +129 -80
- package/dist/resources/model-fit/native-probe/child-engine-fit.d.ts +2 -0
- package/dist/resources/model-fit/native-probe/child-engine-fit.js +41 -0
- package/dist/resources/model-fit/native-probe/classify-fit.d.ts +6 -0
- package/dist/resources/model-fit/native-probe/classify-fit.js +135 -0
- package/dist/resources/model-fit/native-probe/create-fit-request.d.ts +28 -0
- package/dist/resources/model-fit/native-probe/create-fit-request.js +51 -0
- package/dist/resources/model-fit/native-probe/engine-fit.d.ts +59 -0
- package/dist/resources/model-fit/native-probe/engine-fit.js +13 -0
- package/dist/resources/model-fit/native-probe/engines/asr.d.ts +10 -0
- package/dist/resources/model-fit/native-probe/engines/asr.js +103 -0
- package/dist/resources/model-fit/native-probe/engines/audiogen.d.ts +8 -0
- package/dist/resources/model-fit/native-probe/engines/audiogen.js +35 -0
- package/dist/resources/model-fit/native-probe/engines/diffusion.d.ts +7 -0
- package/dist/resources/model-fit/native-probe/engines/diffusion.js +55 -0
- package/dist/resources/model-fit/native-probe/engines/gpu.d.ts +10 -0
- package/dist/resources/model-fit/native-probe/engines/gpu.js +21 -0
- package/dist/resources/model-fit/native-probe/engines/llama.d.ts +13 -0
- package/dist/resources/model-fit/native-probe/engines/llama.js +145 -0
- package/dist/resources/model-fit/native-probe/engines/tts.d.ts +8 -0
- package/dist/resources/model-fit/native-probe/engines/tts.js +106 -0
- package/dist/resources/model-fit/native-probe/fit-outcome.d.ts +16 -0
- package/dist/resources/model-fit/native-probe/fit-outcome.js +1 -0
- package/dist/resources/model-fit/native-probe/fit-process.d.ts +27 -0
- package/dist/resources/model-fit/native-probe/fit-process.js +55 -0
- package/dist/resources/model-fit/native-probe/fit-runner.d.ts +1 -0
- package/dist/resources/model-fit/native-probe/fit-runner.js +58 -0
- package/dist/resources/model-fit/native-probe/run-fit.d.ts +24 -0
- package/dist/resources/model-fit/native-probe/run-fit.js +20 -0
- package/dist/resources/model-fit/native-probe/run-in-process-fit.d.ts +14 -34
- package/dist/resources/model-fit/native-probe/run-in-process-fit.js +55 -139
- package/dist/resources/model-fit/native-probe/run-isolated-fit.d.ts +5 -12
- package/dist/resources/model-fit/native-probe/run-isolated-fit.js +13 -8
- package/dist/resources/model-fit/platform.d.ts +9 -0
- package/dist/resources/model-fit/platform.js +28 -0
- package/dist/rpc/device-map.d.ts +13 -0
- package/dist/rpc/device-map.js +22 -0
- package/dist/rpc/discovery.d.ts +12 -0
- package/dist/rpc/discovery.js +225 -0
- package/dist/rpc/ggml-provider.d.ts +4 -0
- package/dist/rpc/ggml-provider.js +25 -0
- package/dist/rpc/index.d.ts +2 -0
- package/dist/rpc/index.js +1 -0
- package/dist/rpc/instance.d.ts +6 -0
- package/dist/rpc/instance.js +21 -0
- package/dist/rpc/inventory.d.ts +5 -0
- package/dist/rpc/inventory.js +144 -0
- package/dist/rpc/manager.d.ts +14 -0
- package/dist/rpc/manager.js +174 -0
- package/dist/rpc/network.d.ts +11 -0
- package/dist/rpc/network.js +85 -0
- package/dist/rpc/provider.d.ts +6 -0
- package/dist/rpc/provider.js +24 -0
- package/dist/runtime/lifecycle.js +31 -13
- package/dist/runtime/request-context.d.ts +1 -1
- package/dist/runtime/state.js +5 -0
- package/dist/schemas/assess-model-fit.d.ts +284 -77
- package/dist/schemas/assess-model-fit.js +93 -55
- package/dist/schemas/audio-gen.d.ts +6 -6
- package/dist/schemas/audio-gen.js +2 -2
- package/dist/schemas/batch-completion-stream.d.ts +13 -5
- package/dist/schemas/batch-completion-stream.js +5 -3
- package/dist/schemas/bci-config.js +1 -1
- package/dist/schemas/bci.d.ts +86 -1
- package/dist/schemas/bci.js +21 -2
- package/dist/schemas/cancel.d.ts +10 -0
- package/dist/schemas/cancel.js +2 -0
- package/dist/schemas/common.d.ts +765 -56
- package/dist/schemas/common.js +7 -0
- package/dist/schemas/completion-event.d.ts +6 -6
- package/dist/schemas/completion-stream.d.ts +27 -8
- package/dist/schemas/completion-stream.js +41 -4
- package/dist/schemas/config.d.ts +236 -30
- package/dist/schemas/config.js +10 -0
- package/dist/schemas/embed.d.ts +2 -2
- package/dist/schemas/error.js +13 -0
- package/dist/schemas/errors.d.ts +1 -0
- package/dist/schemas/errors.js +5 -0
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/llamacpp-config.d.ts +105 -14
- package/dist/schemas/llamacpp-config.js +113 -3
- package/dist/schemas/load-model.d.ts +3102 -627
- package/dist/schemas/load-model.js +2 -2
- package/dist/schemas/mcp-adapter.d.ts +4 -0
- package/dist/schemas/model-config-schemas.d.ts +205 -5
- package/dist/schemas/model-info.d.ts +56 -0
- package/dist/schemas/model-info.js +5 -1
- package/dist/schemas/plugin.d.ts +8 -2
- package/dist/schemas/profiling.d.ts +4 -4
- package/dist/schemas/reload-config.d.ts +30 -0
- package/dist/schemas/rpc-server.d.ts +101 -0
- package/dist/schemas/rpc-server.js +87 -0
- package/dist/schemas/sdcpp-config.d.ts +7 -3
- package/dist/schemas/sdcpp-config.js +37 -2
- package/dist/schemas/system-resources.d.ts +4 -4
- package/dist/schemas/text-to-speech.d.ts +529 -1
- package/dist/schemas/text-to-speech.js +122 -12
- package/dist/schemas/tools.d.ts +2 -0
- package/dist/schemas/tools.js +8 -0
- package/dist/schemas/transcription-config.d.ts +5 -0
- package/dist/schemas/transcription-config.js +20 -2
- package/dist/schemas/transcription.d.ts +164 -0
- package/dist/schemas/transcription.js +71 -4
- package/dist/schemas/vla.d.ts +1 -1
- package/dist/surface.d.ts +4 -1
- package/dist/surface.js +3 -1
- package/dist/utils/addon-responses.d.ts +5 -1
- package/dist/utils/archive.js +5 -1
- package/dist/utils/asr-diagnostics.d.ts +12 -0
- package/dist/utils/asr-diagnostics.js +42 -0
- package/dist/utils/asr-events.d.ts +1 -0
- package/dist/utils/asr-events.js +3 -2
- package/dist/utils/cache/paths.js +3 -2
- package/dist/utils/mcp-adapter.js +7 -1
- package/dist/utils/multi-gpu-mobile.d.ts +1 -1
- package/dist/utils/multi-gpu-mobile.js +8 -6
- package/dist/utils/path-security.d.ts +5 -0
- package/dist/utils/path-security.js +14 -0
- package/dist/utils/tool-helpers.d.ts +4 -0
- package/dist/utils/tool-helpers.js +2 -0
- package/dist/utils/tools/defer.d.ts +93 -0
- package/dist/utils/tools/defer.js +290 -0
- package/dist/utils/tools/index.d.ts +1 -0
- package/dist/utils/tools/index.js +1 -0
- package/dist/utils/transcribe-metadata.d.ts +21 -7
- package/dist/utils/transcribe-metadata.js +24 -8
- package/dist/utils/tts-stats.d.ts +6 -0
- package/dist/utils/tts-stats.js +14 -1
- package/package.json +44 -30
- package/dist/resources/model-fit/native-probe/create-llama-fit-request.d.ts +0 -26
- package/dist/resources/model-fit/native-probe/create-llama-fit-request.js +0 -171
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { modelRegistryEntrySchema } from './registry.js';
|
|
3
|
+
import { modelSrcInputSchema } from './model-src-utils.js';
|
|
4
|
+
import { modelTypeInputSchema } from './model-types.js';
|
|
3
5
|
/**
|
|
4
6
|
* Advisory outcome of a pre-download fit assessment.
|
|
5
7
|
*
|
|
@@ -7,37 +9,6 @@ import { modelRegistryEntrySchema } from './registry.js';
|
|
|
7
9
|
* whenever the evidence does not support a defensible claim either way.
|
|
8
10
|
*/
|
|
9
11
|
export const modelFitVerdictSchema = z.enum(['likely-fits', 'likely-too-large', 'unknown']);
|
|
10
|
-
/**
|
|
11
|
-
* Normalized workload shapes. An engine's estimator declares which kinds it
|
|
12
|
-
* supports; anything else assesses as `unknown`.
|
|
13
|
-
*
|
|
14
|
-
* Phase 1 covers LLM context and an audio window. Further kinds (fixed-cost
|
|
15
|
-
* loads, text, image, video) are additive in later phases — a kind joins the
|
|
16
|
-
* union only once an estimator actually handles it.
|
|
17
|
-
*/
|
|
18
|
-
export const modelFitWorkloadSchema = z.discriminatedUnion('kind', [
|
|
19
|
-
z
|
|
20
|
-
.object({
|
|
21
|
-
kind: z.literal('llm'),
|
|
22
|
-
contextTokens: z
|
|
23
|
-
.number()
|
|
24
|
-
.int()
|
|
25
|
-
.positive()
|
|
26
|
-
.describe('Context window the caller intends to use, in tokens.')
|
|
27
|
-
})
|
|
28
|
-
.describe('Token-context workload for llama.cpp completion and embedding models.'),
|
|
29
|
-
z
|
|
30
|
-
.object({
|
|
31
|
-
kind: z.literal('audio'),
|
|
32
|
-
windowMs: z
|
|
33
|
-
.number()
|
|
34
|
-
.positive()
|
|
35
|
-
.describe('Audio window handed to the engine per call, in milliseconds.'),
|
|
36
|
-
streaming: z.boolean().describe('Whether the caller streams continuously.'),
|
|
37
|
-
batch: z.number().int().positive().optional().describe('Concurrent windows per call.')
|
|
38
|
-
})
|
|
39
|
-
.describe('Audio-window workload for speech-to-text models.')
|
|
40
|
-
]);
|
|
41
12
|
/**
|
|
42
13
|
* The part of a model constant an assessment reads. Pass a catalog constant
|
|
43
14
|
* directly — the extra fields are ignored.
|
|
@@ -46,25 +17,20 @@ export const modelFitWorkloadSchema = z.discriminatedUnion('kind', [
|
|
|
46
17
|
* are read; everything else — engine, byte totals, transformer facts — comes
|
|
47
18
|
* from the resolved resource profile, not from the caller.
|
|
48
19
|
*/
|
|
49
|
-
export const modelFitModelRefSchema = modelRegistryEntrySchema
|
|
20
|
+
export const modelFitModelRefSchema = modelRegistryEntrySchema
|
|
21
|
+
.pick({
|
|
50
22
|
name: true,
|
|
51
23
|
sha256Checksum: true
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
*/
|
|
61
|
-
export const modelFitCandidateSchema = z.object({
|
|
62
|
-
model: modelFitModelRefSchema.describe('Catalog model constant to assess.'),
|
|
63
|
-
artifacts: z
|
|
64
|
-
.array(modelFitModelRefSchema)
|
|
24
|
+
})
|
|
25
|
+
.extend({
|
|
26
|
+
registryPath: z
|
|
27
|
+
.string()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('Registry coordinates. Present on a catalog constant; without them no fit stub can be resolved and the assessment falls back to calibration.'),
|
|
30
|
+
registrySource: z
|
|
31
|
+
.string()
|
|
65
32
|
.optional()
|
|
66
|
-
.describe('
|
|
67
|
-
workload: modelFitWorkloadSchema.describe('Workload the caller intends to run.')
|
|
33
|
+
.describe('Registry source identifier, e.g. `huggingface`.')
|
|
68
34
|
});
|
|
69
35
|
/**
|
|
70
36
|
* How the caller intends to run the candidates. This is a **declared
|
|
@@ -76,11 +42,31 @@ export const modelFitCandidateSchema = z.object({
|
|
|
76
42
|
* - `concurrent`: every model stays resident and every peak is counted.
|
|
77
43
|
*/
|
|
78
44
|
export const modelFitExecutionSchema = z.enum(['sequential', 'concurrent']);
|
|
45
|
+
/**
|
|
46
|
+
* A load to assess, in `loadModel`'s own parameters. The engine's plugin
|
|
47
|
+
* resolves it, so the config and the artifact keys the fitter reads are the
|
|
48
|
+
* ones the load would run with.
|
|
49
|
+
*
|
|
50
|
+
* Each source resolves to the registry's weightless description of the
|
|
51
|
+
* artifact, or to the file itself where it is already on disk.
|
|
52
|
+
*/
|
|
53
|
+
export const modelFitCandidateSchema = z.object({
|
|
54
|
+
modelSrc: modelSrcInputSchema
|
|
55
|
+
.optional()
|
|
56
|
+
.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
|
+
modelType: modelTypeInputSchema
|
|
58
|
+
.optional()
|
|
59
|
+
.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.'),
|
|
60
|
+
modelConfig: z
|
|
61
|
+
.record(z.string(), z.unknown())
|
|
62
|
+
.optional()
|
|
63
|
+
.describe('The config `loadModel` would be given, including any companion model sources.')
|
|
64
|
+
});
|
|
79
65
|
export const assessModelFitInputSchema = z.object({
|
|
80
66
|
models: z
|
|
81
67
|
.array(modelFitCandidateSchema)
|
|
82
68
|
.min(1)
|
|
83
|
-
.describe('
|
|
69
|
+
.describe('Models to assess together under one memory budget.'),
|
|
84
70
|
execution: modelFitExecutionSchema
|
|
85
71
|
.default('sequential')
|
|
86
72
|
.describe('Declared co-residency assumption for aggregation. Not a scheduling instruction: the SDK does not serialize, reserve, or enforce anything.'),
|
|
@@ -117,8 +103,11 @@ export const modelFitBasisSchema = z.enum([
|
|
|
117
103
|
* plus the KV cache for llama.cpp models. It omits every engine cost that
|
|
118
104
|
* only a real load can tell, so it can refuse a model but never confirm one.
|
|
119
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.
|
|
120
109
|
*/
|
|
121
|
-
export const modelFitEvidenceSchema = z.enum(['calibration', 'computed-only']);
|
|
110
|
+
export const modelFitEvidenceSchema = z.enum(['calibration', 'computed-only', 'native-fit']);
|
|
122
111
|
export const modelFitBudgetSchema = z.object({
|
|
123
112
|
totalBytes: z
|
|
124
113
|
.number()
|
|
@@ -151,6 +140,10 @@ export const modelFitModelResultSchema = z.object({
|
|
|
151
140
|
.string()
|
|
152
141
|
.optional()
|
|
153
142
|
.describe('Estimator that produced the bounds, e.g. `llm-v1`, or `floor-v1` for a computed floor.'),
|
|
143
|
+
device: z
|
|
144
|
+
.string()
|
|
145
|
+
.optional()
|
|
146
|
+
.describe('Where this load resolved to execute, after the host’s own device defaults: `gpu` or `cpu`. The llama fitters read device memory alone and decline a `cpu` load, which then carries no `native-fit` evidence; the speech and voice fitters answer for one like any other. Absent for an engine that expresses no placement.'),
|
|
154
147
|
reasons: z.array(z.string()).describe('Why this model got this verdict.')
|
|
155
148
|
});
|
|
156
149
|
export const assessModelFitResultSchema = z.object({
|
|
@@ -179,8 +172,8 @@ export const assessModelFitResultSchema = z.object({
|
|
|
179
172
|
* The other fit question, kept in this file on purpose: `assessModelFit` above
|
|
180
173
|
* answers "should I download this?" from calibrated coefficients and a checksum,
|
|
181
174
|
* while the native probe answers "will the load I am about to run fit?" by
|
|
182
|
-
*
|
|
183
|
-
* verdict vocabularies:
|
|
175
|
+
* handing the model file and the resolved settings to the fitter of the engine
|
|
176
|
+
* that would run it. Two evidence classes, so two verdict vocabularies:
|
|
184
177
|
*
|
|
185
178
|
* - `likely-fits` / `likely-too-large` hedge because a formula is an estimate.
|
|
186
179
|
* - `fit` / `does-not-fit` do not, because the probe measured this build of this
|
|
@@ -196,22 +189,67 @@ export const nativeProbePlanSchema = z.object({
|
|
|
196
189
|
nGpuLayers: z.number().int().describe('Layers the probe would offload.'),
|
|
197
190
|
nGpuDevices: z.number().int().describe('GPU devices the offload would span.')
|
|
198
191
|
});
|
|
192
|
+
/**
|
|
193
|
+
* What the fitter measured. Each field is optional because the engines do not
|
|
194
|
+
* all measure the same things: the diffusion fitter answers with a placement
|
|
195
|
+
* and a per-module table rather than a total, so it fills `report` alone.
|
|
196
|
+
*
|
|
197
|
+
* `weightsBytes`, `contextBytes` and `computeBytes` divide `deviceBytes` where
|
|
198
|
+
* the engine separates them, and are absent together where it reports only a
|
|
199
|
+
* total. They are summed across devices, as `deviceBytes` is, so a load spread
|
|
200
|
+
* over more than one device is described by its totals and `deviceName` names
|
|
201
|
+
* the first.
|
|
202
|
+
*
|
|
203
|
+
* `deviceFreeBytes` is the backend's own gauge. A device sharing the host pool,
|
|
204
|
+
* as Apple silicon and Adreno/Mali do, reports what it could address rather
|
|
205
|
+
* than what the machine would give back, so it is an upper bound there.
|
|
206
|
+
*/
|
|
207
|
+
export const nativeProbeProjectionSchema = z.object({
|
|
208
|
+
deviceName: z.string().optional().describe('Device the projection was made against.'),
|
|
209
|
+
deviceBytes: z
|
|
210
|
+
.number()
|
|
211
|
+
.optional()
|
|
212
|
+
.describe('Peak the load would place on the device, under the workload the probe assumed.'),
|
|
213
|
+
hostBytes: z.number().optional().describe('Peak the load would place in host RAM.'),
|
|
214
|
+
weightsBytes: z.number().optional().describe('Model weights, within `deviceBytes`.'),
|
|
215
|
+
contextBytes: z
|
|
216
|
+
.number()
|
|
217
|
+
.optional()
|
|
218
|
+
.describe('Context, KV cache and decoder state, within `deviceBytes`.'),
|
|
219
|
+
computeBytes: z
|
|
220
|
+
.number()
|
|
221
|
+
.optional()
|
|
222
|
+
.describe('Compute buffers and graph arenas, within `deviceBytes`.'),
|
|
223
|
+
deviceFreeBytes: z.number().optional().describe('Device memory free when the probe ran.'),
|
|
224
|
+
deviceTotalBytes: z.number().optional().describe('Device memory installed.'),
|
|
225
|
+
report: z
|
|
226
|
+
.string()
|
|
227
|
+
.optional()
|
|
228
|
+
.describe("The engine's own per-module memory table, suitable for a log line.")
|
|
229
|
+
});
|
|
199
230
|
export const nativeProbeFitSchema = z
|
|
200
231
|
.object({
|
|
201
|
-
verdict: nativeProbeVerdictSchema.describe('Advisory outcome. `unknown` means no verdict was obtainable — the check was disabled, the load shape is unsupported, or the
|
|
232
|
+
verdict: nativeProbeVerdictSchema.describe('Advisory outcome. `unknown` means no verdict was obtainable — the check was disabled, the load shape is unsupported, or the fitter produced no usable answer.'),
|
|
202
233
|
basis: z
|
|
203
234
|
.literal('native-probe')
|
|
204
|
-
.describe(
|
|
235
|
+
.describe("Evidence class: the engine's own fitter, run against the model file and the resolved load settings."),
|
|
236
|
+
engine: z
|
|
237
|
+
.string()
|
|
238
|
+
.optional()
|
|
239
|
+
.describe('Engine package whose fitter produced this outcome. Absent when none ran.'),
|
|
205
240
|
estimatorVersion: z
|
|
206
241
|
.string()
|
|
207
|
-
.describe('Version of the probe integration that produced this outcome, covering the load-setting partitioning and the headroom policy
|
|
242
|
+
.describe('Version of the probe integration that produced this outcome, covering the load-setting partitioning and the headroom policy. Under `native-probe-v2` the engine withholds 1024 MiB plus the on-disk bytes of every model already resident in this worker, and a `fit` is then judged against the same budget `assessModelFit` reports, under the basis that platform uses and less the `interactive-v1` reserve, counting device memory only where it comes out of system RAM.'),
|
|
208
243
|
reason: z
|
|
209
244
|
.string()
|
|
210
245
|
.describe('Machine-readable reason for the verdict. Never parsed out of log text.'),
|
|
211
246
|
message: z.string().optional().describe('Human-readable detail, when the reason has any.'),
|
|
212
247
|
plan: nativeProbePlanSchema
|
|
213
248
|
.optional()
|
|
214
|
-
.describe('Placement the probe projected. Present
|
|
249
|
+
.describe('Placement the probe projected. Present wherever the fitter resolved one.'),
|
|
250
|
+
projection: nativeProbeProjectionSchema
|
|
251
|
+
.optional()
|
|
252
|
+
.describe('What the fitter measured. Present on `fit` and `does-not-fit` alike, since a load that does not fit is where the figures matter most.')
|
|
215
253
|
})
|
|
216
254
|
.meta({ title: 'NativeProbeFit' });
|
|
217
255
|
export const assessModelFitRequestSchema = assessModelFitInputSchema.extend({
|
|
@@ -1013,8 +1013,8 @@ export declare const audioUnderstandResponseSchema: z.ZodObject<{
|
|
|
1013
1013
|
diagnostics: z.ZodOptional<z.ZodObject<{
|
|
1014
1014
|
selectedBackend: z.ZodString;
|
|
1015
1015
|
selectedDevice: z.ZodEnum<{
|
|
1016
|
-
gpu: "gpu";
|
|
1017
1016
|
cpu: "cpu";
|
|
1017
|
+
gpu: "gpu";
|
|
1018
1018
|
}>;
|
|
1019
1019
|
graphicsApi: z.ZodOptional<z.ZodEnum<{
|
|
1020
1020
|
vulkan: "vulkan";
|
|
@@ -1036,8 +1036,8 @@ export declare const audioUnderstandResponseSchema: z.ZodObject<{
|
|
|
1036
1036
|
fallback: z.ZodOptional<z.ZodObject<{
|
|
1037
1037
|
requestedBackend: z.ZodOptional<z.ZodString>;
|
|
1038
1038
|
requestedDevice: z.ZodOptional<z.ZodEnum<{
|
|
1039
|
-
gpu: "gpu";
|
|
1040
1039
|
cpu: "cpu";
|
|
1040
|
+
gpu: "gpu";
|
|
1041
1041
|
}>>;
|
|
1042
1042
|
reason: z.ZodString;
|
|
1043
1043
|
}, z.core.$strip>>;
|
|
@@ -1089,8 +1089,8 @@ export declare const audioGenStreamResponseSchema: z.ZodObject<{
|
|
|
1089
1089
|
diagnostics: z.ZodOptional<z.ZodObject<{
|
|
1090
1090
|
selectedBackend: z.ZodString;
|
|
1091
1091
|
selectedDevice: z.ZodEnum<{
|
|
1092
|
-
gpu: "gpu";
|
|
1093
1092
|
cpu: "cpu";
|
|
1093
|
+
gpu: "gpu";
|
|
1094
1094
|
}>;
|
|
1095
1095
|
graphicsApi: z.ZodOptional<z.ZodEnum<{
|
|
1096
1096
|
vulkan: "vulkan";
|
|
@@ -1112,8 +1112,8 @@ export declare const audioGenStreamResponseSchema: z.ZodObject<{
|
|
|
1112
1112
|
fallback: z.ZodOptional<z.ZodObject<{
|
|
1113
1113
|
requestedBackend: z.ZodOptional<z.ZodString>;
|
|
1114
1114
|
requestedDevice: z.ZodOptional<z.ZodEnum<{
|
|
1115
|
-
gpu: "gpu";
|
|
1116
1115
|
cpu: "cpu";
|
|
1116
|
+
gpu: "gpu";
|
|
1117
1117
|
}>>;
|
|
1118
1118
|
reason: z.ZodString;
|
|
1119
1119
|
}, z.core.$strip>>;
|
|
@@ -1166,8 +1166,8 @@ export declare const audioEditStreamResponseSchema: z.ZodObject<{
|
|
|
1166
1166
|
diagnostics: z.ZodOptional<z.ZodObject<{
|
|
1167
1167
|
selectedBackend: z.ZodString;
|
|
1168
1168
|
selectedDevice: z.ZodEnum<{
|
|
1169
|
-
gpu: "gpu";
|
|
1170
1169
|
cpu: "cpu";
|
|
1170
|
+
gpu: "gpu";
|
|
1171
1171
|
}>;
|
|
1172
1172
|
graphicsApi: z.ZodOptional<z.ZodEnum<{
|
|
1173
1173
|
vulkan: "vulkan";
|
|
@@ -1189,8 +1189,8 @@ export declare const audioEditStreamResponseSchema: z.ZodObject<{
|
|
|
1189
1189
|
fallback: z.ZodOptional<z.ZodObject<{
|
|
1190
1190
|
requestedBackend: z.ZodOptional<z.ZodString>;
|
|
1191
1191
|
requestedDevice: z.ZodOptional<z.ZodEnum<{
|
|
1192
|
-
gpu: "gpu";
|
|
1193
1192
|
cpu: "cpu";
|
|
1193
|
+
gpu: "gpu";
|
|
1194
1194
|
}>>;
|
|
1195
1195
|
reason: z.ZodString;
|
|
1196
1196
|
}, z.core.$strip>>;
|
|
@@ -120,7 +120,7 @@ const minimaxRuntimeConfigShape = {
|
|
|
120
120
|
.min(0)
|
|
121
121
|
.max(MINIMAX_MAX_INFERENCE_STEPS)
|
|
122
122
|
.optional()
|
|
123
|
-
.describe('MiniMax flow sampling steps; `0` uses the
|
|
123
|
+
.describe('MiniMax flow sampling steps; `0` uses the engine default (20).'),
|
|
124
124
|
cfgScale: minimaxCfgScaleSchema.optional()
|
|
125
125
|
};
|
|
126
126
|
const acestepAudioGenRuntimeConfigSchema = z
|
|
@@ -266,7 +266,7 @@ const audioGenGenerationShape = {
|
|
|
266
266
|
.min(0)
|
|
267
267
|
.max(MINIMAX_MAX_INFERENCE_STEPS)
|
|
268
268
|
.optional()
|
|
269
|
-
.describe('MiniMax flow steps for this generation; 0 uses the
|
|
269
|
+
.describe('MiniMax flow steps for this generation; 0 uses the engine default (20). MiniMax only; rejected by ACE-Step.'),
|
|
270
270
|
cfgScale: minimaxCfgScaleSchema
|
|
271
271
|
.optional()
|
|
272
272
|
.describe('MiniMax flow classifier-free guidance scale for this generation. MiniMax only; rejected by ACE-Step.'),
|
|
@@ -40,6 +40,8 @@ export declare const batchPromptSchema: z.ZodObject<{
|
|
|
40
40
|
type: z.ZodLiteral<"function">;
|
|
41
41
|
name: z.ZodString;
|
|
42
42
|
description: z.ZodString;
|
|
43
|
+
deferLoading: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
group: z.ZodOptional<z.ZodString>;
|
|
43
45
|
parameters: z.ZodObject<{
|
|
44
46
|
type: z.ZodLiteral<"object">;
|
|
45
47
|
properties: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -98,6 +100,8 @@ declare const batchPromptStreamSchema: z.ZodObject<{
|
|
|
98
100
|
type: z.ZodLiteral<"function">;
|
|
99
101
|
name: z.ZodString;
|
|
100
102
|
description: z.ZodString;
|
|
103
|
+
deferLoading: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
group: z.ZodOptional<z.ZodString>;
|
|
101
105
|
parameters: z.ZodObject<{
|
|
102
106
|
type: z.ZodLiteral<"object">;
|
|
103
107
|
properties: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -157,6 +161,8 @@ export declare const batchCompletionClientParamsSchema: z.ZodObject<{
|
|
|
157
161
|
type: z.ZodLiteral<"function">;
|
|
158
162
|
name: z.ZodString;
|
|
159
163
|
description: z.ZodString;
|
|
164
|
+
deferLoading: z.ZodOptional<z.ZodBoolean>;
|
|
165
|
+
group: z.ZodOptional<z.ZodString>;
|
|
160
166
|
parameters: z.ZodObject<{
|
|
161
167
|
type: z.ZodLiteral<"object">;
|
|
162
168
|
properties: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -244,6 +250,8 @@ export declare const batchCompletionStreamRequestSchema: z.ZodObject<{
|
|
|
244
250
|
type: z.ZodLiteral<"function">;
|
|
245
251
|
name: z.ZodString;
|
|
246
252
|
description: z.ZodString;
|
|
253
|
+
deferLoading: z.ZodOptional<z.ZodBoolean>;
|
|
254
|
+
group: z.ZodOptional<z.ZodString>;
|
|
247
255
|
parameters: z.ZodObject<{
|
|
248
256
|
type: z.ZodLiteral<"object">;
|
|
249
257
|
properties: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
@@ -313,8 +321,8 @@ export declare const batchCompletionEventSchema: z.ZodObject<{
|
|
|
313
321
|
avgConcurrentSeq: z.ZodOptional<z.ZodNumber>;
|
|
314
322
|
toolDefinitionsDropped: z.ZodOptional<z.ZodNumber>;
|
|
315
323
|
backendDevice: z.ZodOptional<z.ZodEnum<{
|
|
316
|
-
gpu: "gpu";
|
|
317
324
|
cpu: "cpu";
|
|
325
|
+
gpu: "gpu";
|
|
318
326
|
}>>;
|
|
319
327
|
}, z.core.$strip>;
|
|
320
328
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -332,8 +340,8 @@ export declare const batchCompletionEventSchema: z.ZodObject<{
|
|
|
332
340
|
seq: z.ZodNumber;
|
|
333
341
|
stopReason: z.ZodOptional<z.ZodEnum<{
|
|
334
342
|
cancelled: "cancelled";
|
|
335
|
-
eos: "eos";
|
|
336
343
|
length: "length";
|
|
344
|
+
eos: "eos";
|
|
337
345
|
stopSequence: "stopSequence";
|
|
338
346
|
}>>;
|
|
339
347
|
raw: z.ZodOptional<z.ZodObject<{
|
|
@@ -394,8 +402,8 @@ export declare const batchCompletionStreamResponseSchema: z.ZodObject<{
|
|
|
394
402
|
avgConcurrentSeq: z.ZodOptional<z.ZodNumber>;
|
|
395
403
|
toolDefinitionsDropped: z.ZodOptional<z.ZodNumber>;
|
|
396
404
|
backendDevice: z.ZodOptional<z.ZodEnum<{
|
|
397
|
-
gpu: "gpu";
|
|
398
405
|
cpu: "cpu";
|
|
406
|
+
gpu: "gpu";
|
|
399
407
|
}>>;
|
|
400
408
|
}, z.core.$strip>;
|
|
401
409
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -413,8 +421,8 @@ export declare const batchCompletionStreamResponseSchema: z.ZodObject<{
|
|
|
413
421
|
seq: z.ZodNumber;
|
|
414
422
|
stopReason: z.ZodOptional<z.ZodEnum<{
|
|
415
423
|
cancelled: "cancelled";
|
|
416
|
-
eos: "eos";
|
|
417
424
|
length: "length";
|
|
425
|
+
eos: "eos";
|
|
418
426
|
stopSequence: "stopSequence";
|
|
419
427
|
}>>;
|
|
420
428
|
raw: z.ZodOptional<z.ZodObject<{
|
|
@@ -433,8 +441,8 @@ export declare const batchCompletionStreamResponseSchema: z.ZodObject<{
|
|
|
433
441
|
avgConcurrentSeq: z.ZodOptional<z.ZodNumber>;
|
|
434
442
|
toolDefinitionsDropped: z.ZodOptional<z.ZodNumber>;
|
|
435
443
|
backendDevice: z.ZodOptional<z.ZodEnum<{
|
|
436
|
-
gpu: "gpu";
|
|
437
444
|
cpu: "cpu";
|
|
445
|
+
gpu: "gpu";
|
|
438
446
|
}>>;
|
|
439
447
|
}, z.core.$strip>>;
|
|
440
448
|
}, z.core.$strict>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { completionEventSchema, completionStatsSchema } from './completion-event.js';
|
|
3
|
-
import { completionParamsSchema, generationParamsSchema, refineToolChoiceMatchesTools, responseFormatSchema, toolDialectSchema } from './completion-stream.js';
|
|
3
|
+
import { completionParamsSchema, generationParamsSchema, refineReservedToolNames, refineToolChoiceMatchesTools, responseFormatSchema, toolDialectSchema } from './completion-stream.js';
|
|
4
4
|
import { toolSchema } from './tools.js';
|
|
5
5
|
const mcpClientInputSchema = z.custom();
|
|
6
6
|
const batchPromptBaseSchema = z
|
|
@@ -40,14 +40,16 @@ export const batchPromptSchema = batchPromptBaseSchema
|
|
|
40
40
|
})
|
|
41
41
|
.strict()
|
|
42
42
|
.superRefine(refineNoToolsWithStructuredOutput)
|
|
43
|
-
.superRefine(refineToolChoiceMatchesTools)
|
|
43
|
+
.superRefine(refineToolChoiceMatchesTools)
|
|
44
|
+
.superRefine(refineReservedToolNames);
|
|
44
45
|
const batchPromptStreamSchema = batchPromptBaseSchema
|
|
45
46
|
.extend({
|
|
46
47
|
tools: z.array(toolSchema).optional().describe('Resolved per-prompt tools the model can call.')
|
|
47
48
|
})
|
|
48
49
|
.strict()
|
|
49
50
|
.superRefine(refineNoToolsWithStructuredOutput)
|
|
50
|
-
.superRefine(refineToolChoiceMatchesTools)
|
|
51
|
+
.superRefine(refineToolChoiceMatchesTools)
|
|
52
|
+
.superRefine(refineReservedToolNames);
|
|
51
53
|
const batchCompletionClientParamsBaseSchema = z
|
|
52
54
|
.object({
|
|
53
55
|
modelId: z.string().describe('The identifier of the model to use for batch completion.'),
|
|
@@ -45,7 +45,7 @@ const bciWhisperConfigSchema = z
|
|
|
45
45
|
detect_language: z
|
|
46
46
|
.boolean()
|
|
47
47
|
.optional()
|
|
48
|
-
.describe("
|
|
48
|
+
.describe("Detect the spoken language and stop: whisper.cpp returns straight after detection, so the transcript comes back empty. Use `language: 'auto'` to detect and transcribe in one call."),
|
|
49
49
|
greedy_best_of: z
|
|
50
50
|
.number()
|
|
51
51
|
.int()
|
package/dist/schemas/bci.d.ts
CHANGED
|
@@ -36,6 +36,20 @@ export declare const bciTranscribeRequestSchema: z.ZodObject<{
|
|
|
36
36
|
type: z.ZodLiteral<"bciTranscribe">;
|
|
37
37
|
requestId: z.ZodOptional<z.ZodString>;
|
|
38
38
|
}, z.core.$strip>;
|
|
39
|
+
/**
|
|
40
|
+
* A streamed BCI segment. Only the sliding-window stream produces
|
|
41
|
+
* `windowStartTimestep`, so it is not on the shared segment shape.
|
|
42
|
+
*/
|
|
43
|
+
export declare const bciStreamSegmentSchema: z.ZodObject<{
|
|
44
|
+
text: z.ZodString;
|
|
45
|
+
startMs: z.ZodNumber;
|
|
46
|
+
endMs: z.ZodNumber;
|
|
47
|
+
append: z.ZodBoolean;
|
|
48
|
+
id: z.ZodNumber;
|
|
49
|
+
isEndOfTurn: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
startsWord: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
windowStartTimestep: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
}, z.core.$strip>;
|
|
39
53
|
export declare const bciTranscribeResponseSchema: z.ZodObject<{
|
|
40
54
|
text: z.ZodOptional<z.ZodString>;
|
|
41
55
|
done: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -55,6 +69,18 @@ export declare const bciTranscribeResponseSchema: z.ZodObject<{
|
|
|
55
69
|
gpuUnsupported: z.ZodOptional<z.ZodNumber>;
|
|
56
70
|
gpuMemTotalMb: z.ZodOptional<z.ZodNumber>;
|
|
57
71
|
gpuMemFreeMb: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
totalTime: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
totalWallMs: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
totalSamples: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
processCalls: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
whisperSampleMs: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
whisperBatchdMs: z.ZodOptional<z.ZodNumber>;
|
|
78
|
+
whisperPromptMs: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
totalTranscriptions: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
modelLoadMs: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
totalEncodedFrames: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
encoderOnCoreml: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
encoderUsedCoreml: z.ZodOptional<z.ZodNumber>;
|
|
58
84
|
}, z.core.$strip>>;
|
|
59
85
|
error: z.ZodOptional<z.ZodString>;
|
|
60
86
|
segment: z.ZodOptional<z.ZodObject<{
|
|
@@ -63,8 +89,51 @@ export declare const bciTranscribeResponseSchema: z.ZodObject<{
|
|
|
63
89
|
endMs: z.ZodNumber;
|
|
64
90
|
append: z.ZodBoolean;
|
|
65
91
|
id: z.ZodNumber;
|
|
92
|
+
isEndOfTurn: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
startsWord: z.ZodOptional<z.ZodBoolean>;
|
|
66
94
|
}, z.core.$strip>>;
|
|
67
95
|
type: z.ZodLiteral<"bciTranscribe">;
|
|
96
|
+
diagnostics: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
selectedBackend: z.ZodString;
|
|
98
|
+
selectedDevice: z.ZodEnum<{
|
|
99
|
+
cpu: "cpu";
|
|
100
|
+
gpu: "gpu";
|
|
101
|
+
}>;
|
|
102
|
+
graphicsApi: z.ZodOptional<z.ZodEnum<{
|
|
103
|
+
vulkan: "vulkan";
|
|
104
|
+
metal: "metal";
|
|
105
|
+
opencl: "opencl";
|
|
106
|
+
cuda: "cuda";
|
|
107
|
+
opengl: "opengl";
|
|
108
|
+
webgpu: "webgpu";
|
|
109
|
+
direct3d11: "direct3d11";
|
|
110
|
+
direct3d12: "direct3d12";
|
|
111
|
+
levelZero: "levelZero";
|
|
112
|
+
rocm: "rocm";
|
|
113
|
+
}>>;
|
|
114
|
+
driver: z.ZodOptional<z.ZodObject<{
|
|
115
|
+
name: z.ZodString;
|
|
116
|
+
version: z.ZodOptional<z.ZodString>;
|
|
117
|
+
}, z.core.$strip>>;
|
|
118
|
+
gpuId: z.ZodOptional<z.ZodString>;
|
|
119
|
+
fallback: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
requestedBackend: z.ZodOptional<z.ZodString>;
|
|
121
|
+
requestedDevice: z.ZodOptional<z.ZodEnum<{
|
|
122
|
+
cpu: "cpu";
|
|
123
|
+
gpu: "gpu";
|
|
124
|
+
}>>;
|
|
125
|
+
reason: z.ZodString;
|
|
126
|
+
}, z.core.$strip>>;
|
|
127
|
+
probe: z.ZodOptional<z.ZodObject<{
|
|
128
|
+
status: z.ZodEnum<{
|
|
129
|
+
unknown: "unknown";
|
|
130
|
+
compatible: "compatible";
|
|
131
|
+
incompatible: "incompatible";
|
|
132
|
+
}>;
|
|
133
|
+
backend: z.ZodString;
|
|
134
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
135
|
+
}, z.core.$strip>>;
|
|
136
|
+
}, z.core.$strip>>;
|
|
68
137
|
}, z.core.$strip>;
|
|
69
138
|
/**
|
|
70
139
|
* Per-call overrides for the BCI addon's sliding-window streaming
|
|
@@ -112,16 +181,31 @@ export declare const bciTranscribeStreamResponseSchema: z.ZodObject<{
|
|
|
112
181
|
gpuUnsupported: z.ZodOptional<z.ZodNumber>;
|
|
113
182
|
gpuMemTotalMb: z.ZodOptional<z.ZodNumber>;
|
|
114
183
|
gpuMemFreeMb: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
totalTime: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
totalWallMs: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
totalSamples: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
processCalls: z.ZodOptional<z.ZodNumber>;
|
|
188
|
+
whisperSampleMs: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
whisperBatchdMs: z.ZodOptional<z.ZodNumber>;
|
|
190
|
+
whisperPromptMs: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
totalTranscriptions: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
modelLoadMs: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
totalEncodedFrames: z.ZodOptional<z.ZodNumber>;
|
|
194
|
+
encoderOnCoreml: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
encoderUsedCoreml: z.ZodOptional<z.ZodNumber>;
|
|
115
196
|
}, z.core.$strip>>;
|
|
116
197
|
error: z.ZodOptional<z.ZodString>;
|
|
198
|
+
type: z.ZodLiteral<"bciTranscribeStream">;
|
|
117
199
|
segment: z.ZodOptional<z.ZodObject<{
|
|
118
200
|
text: z.ZodString;
|
|
119
201
|
startMs: z.ZodNumber;
|
|
120
202
|
endMs: z.ZodNumber;
|
|
121
203
|
append: z.ZodBoolean;
|
|
122
204
|
id: z.ZodNumber;
|
|
205
|
+
isEndOfTurn: z.ZodOptional<z.ZodBoolean>;
|
|
206
|
+
startsWord: z.ZodOptional<z.ZodBoolean>;
|
|
207
|
+
windowStartTimestep: z.ZodOptional<z.ZodNumber>;
|
|
123
208
|
}, z.core.$strip>>;
|
|
124
|
-
type: z.ZodLiteral<"bciTranscribeStream">;
|
|
125
209
|
}, z.core.$strip>;
|
|
126
210
|
export type NeuralInput = z.infer<typeof neuralInputSchema>;
|
|
127
211
|
export type BciTranscribeParams = z.infer<typeof bciTranscribeParamsSchema>;
|
|
@@ -131,6 +215,7 @@ export type BciTranscribeClientParamsParsed = z.output<typeof bciTranscribeClien
|
|
|
131
215
|
export type BciStreamOpts = z.infer<typeof bciStreamOptsSchema>;
|
|
132
216
|
export type BciTranscribeStreamRequest = z.infer<typeof bciTranscribeStreamRequestSchema>;
|
|
133
217
|
export type BciTranscribeStreamResponse = z.infer<typeof bciTranscribeStreamResponseSchema>;
|
|
218
|
+
export type BciStreamSegment = z.infer<typeof bciStreamSegmentSchema>;
|
|
134
219
|
/** Client parameters for `bciTranscribe()`. */
|
|
135
220
|
export interface BciTranscribeClientParams {
|
|
136
221
|
/** Identifier returned by `loadModel()` for a loaded BCI model. */
|
package/dist/schemas/bci.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { inferenceBackendDiagnosticsSchema } from './system-resources.js';
|
|
2
3
|
import { transcribeSegmentSchema, transcribeStatsSchema } from './transcription.js';
|
|
3
4
|
// Neural-signal binary input. The BCI addon consumes a raw neural buffer
|
|
4
5
|
// (not audio): pass it inline as base64 or point at a local `.bin` file.
|
|
@@ -42,8 +43,25 @@ const bciTranscriptionResultBase = z.object({
|
|
|
42
43
|
error: z.string().optional(),
|
|
43
44
|
segment: transcribeSegmentSchema.optional()
|
|
44
45
|
});
|
|
46
|
+
/**
|
|
47
|
+
* A streamed BCI segment. Only the sliding-window stream produces
|
|
48
|
+
* `windowStartTimestep`, so it is not on the shared segment shape.
|
|
49
|
+
*/
|
|
50
|
+
export const bciStreamSegmentSchema = transcribeSegmentSchema.extend({
|
|
51
|
+
windowStartTimestep: z
|
|
52
|
+
.number()
|
|
53
|
+
.int()
|
|
54
|
+
.nonnegative()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe("Absolute index of the 20 ms timestep at which this segment's owning decode window began. Emitted with `emit: 'delta'` only: the segment's own timestamps are window-local, so add `windowStartTimestep * 20` ms to `startMs` / `endMs` to place them on the stream timeline.")
|
|
57
|
+
});
|
|
45
58
|
export const bciTranscribeResponseSchema = bciTranscriptionResultBase.extend({
|
|
46
|
-
type: z.literal('bciTranscribe')
|
|
59
|
+
type: z.literal('bciTranscribe'),
|
|
60
|
+
// Batch only: the addon reports no stats for a stream, so no backend
|
|
61
|
+
// verdict can be derived there.
|
|
62
|
+
diagnostics: inferenceBackendDiagnosticsSchema
|
|
63
|
+
.optional()
|
|
64
|
+
.describe('Backend selection detail for the completed run, on the terminal frame. Carries the same payload the engine attaches to the internal diagnostics symbol, so an RPC client can read it.')
|
|
47
65
|
});
|
|
48
66
|
/**
|
|
49
67
|
* Per-call overrides for the BCI addon's sliding-window streaming
|
|
@@ -85,5 +103,6 @@ export const bciTranscribeStreamRequestSchema = bciTranscribeBaseSchema.extend({
|
|
|
85
103
|
.describe('Stable identifier for this in-flight duplex BCI transcription, generated by the caller at call time. Surfaces on the registry so callers can target it with `cancel({ requestId })`. Optional — falls back to a generated id when the field is missing.')
|
|
86
104
|
});
|
|
87
105
|
export const bciTranscribeStreamResponseSchema = bciTranscriptionResultBase.extend({
|
|
88
|
-
type: z.literal('bciTranscribeStream')
|
|
106
|
+
type: z.literal('bciTranscribeStream'),
|
|
107
|
+
segment: bciStreamSegmentSchema.optional()
|
|
89
108
|
});
|
package/dist/schemas/cancel.d.ts
CHANGED
|
@@ -30,6 +30,8 @@ declare const cancelKindSchema: z.ZodEnum<{
|
|
|
30
30
|
finetune: "finetune";
|
|
31
31
|
loadModel: "loadModel";
|
|
32
32
|
downloadAsset: "downloadAsset";
|
|
33
|
+
rpcServer: "rpcServer";
|
|
34
|
+
rpcDiscovery: "rpcDiscovery";
|
|
33
35
|
rag: "rag";
|
|
34
36
|
}>;
|
|
35
37
|
/**
|
|
@@ -80,6 +82,8 @@ declare const cancelBroadParamsSchema: z.ZodObject<{
|
|
|
80
82
|
finetune: "finetune";
|
|
81
83
|
loadModel: "loadModel";
|
|
82
84
|
downloadAsset: "downloadAsset";
|
|
85
|
+
rpcServer: "rpcServer";
|
|
86
|
+
rpcDiscovery: "rpcDiscovery";
|
|
83
87
|
rag: "rag";
|
|
84
88
|
}>>;
|
|
85
89
|
}, z.core.$strip>;
|
|
@@ -105,6 +109,8 @@ declare const cancelParamsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
105
109
|
finetune: "finetune";
|
|
106
110
|
loadModel: "loadModel";
|
|
107
111
|
downloadAsset: "downloadAsset";
|
|
112
|
+
rpcServer: "rpcServer";
|
|
113
|
+
rpcDiscovery: "rpcDiscovery";
|
|
108
114
|
rag: "rag";
|
|
109
115
|
}>>;
|
|
110
116
|
}, z.core.$strip>], "operation">;
|
|
@@ -132,6 +138,8 @@ export declare const cancelRequestSchema: z.ZodIntersection<z.ZodObject<{
|
|
|
132
138
|
finetune: "finetune";
|
|
133
139
|
loadModel: "loadModel";
|
|
134
140
|
downloadAsset: "downloadAsset";
|
|
141
|
+
rpcServer: "rpcServer";
|
|
142
|
+
rpcDiscovery: "rpcDiscovery";
|
|
135
143
|
rag: "rag";
|
|
136
144
|
}>>;
|
|
137
145
|
}, z.core.$strip>], "operation">>;
|
|
@@ -172,6 +180,8 @@ export declare const cancelBroadSugarSchema: z.ZodObject<{
|
|
|
172
180
|
finetune: "finetune";
|
|
173
181
|
loadModel: "loadModel";
|
|
174
182
|
downloadAsset: "downloadAsset";
|
|
183
|
+
rpcServer: "rpcServer";
|
|
184
|
+
rpcDiscovery: "rpcDiscovery";
|
|
175
185
|
rag: "rag";
|
|
176
186
|
}>>;
|
|
177
187
|
}, z.core.$strict>;
|
package/dist/schemas/cancel.js
CHANGED