@qvac/sdk 0.15.0 → 0.16.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 +31 -45
- package/dist/client/api/ocr.d.ts +9 -0
- package/dist/client/api/ocr.js +9 -0
- package/dist/client/api/translate.js +6 -17
- package/dist/client/api/video.d.ts +7 -4
- package/dist/client/api/video.js +7 -4
- package/dist/client/api/vla.d.ts +14 -10
- package/dist/client/api/vla.js +14 -10
- package/dist/client/rpc/rpc-error.js +7 -1
- package/dist/examples/diffusion-ideogram.d.ts +2 -0
- package/dist/examples/diffusion-ideogram.js +108 -0
- package/dist/examples/diffusion-img2vid-ltx.d.ts +2 -0
- package/dist/examples/diffusion-img2vid-ltx.js +98 -0
- package/dist/examples/diffusion-txt2vid-ltx.d.ts +2 -0
- package/dist/examples/diffusion-txt2vid-ltx.js +92 -0
- package/dist/examples/logging-streaming.js +5 -1
- package/dist/examples/transcription/parakeet-tdt-filesystem-chunked.d.ts +2 -0
- package/dist/examples/transcription/parakeet-tdt-filesystem-chunked.js +203 -0
- package/dist/examples/vla-groot.d.ts +2 -0
- package/dist/examples/vla-groot.js +118 -0
- package/dist/models/registry/models.d.ts +5711 -9637
- package/dist/models/registry/models.js +2747 -6886
- package/dist/models/update-models/naming.js +5 -1
- package/dist/schemas/batch-completion-stream.d.ts +4 -4
- package/dist/schemas/common.d.ts +385 -4
- package/dist/schemas/common.js +3 -1
- package/dist/schemas/completion-stream.d.ts +186 -2
- package/dist/schemas/completion-stream.js +67 -0
- package/dist/schemas/constants-registry.d.ts +67 -0
- package/dist/schemas/constants-registry.js +51 -0
- package/dist/schemas/delete-cache.js +7 -3
- package/dist/schemas/engine-addon-map.d.ts +1 -0
- package/dist/schemas/engine-addon-map.js +1 -1
- package/dist/schemas/finetune.js +6 -3
- package/dist/schemas/get-loaded-model-info.d.ts +16 -0
- package/dist/schemas/get-loaded-model-info.js +14 -6
- package/dist/schemas/llamacpp-config.d.ts +24 -4
- package/dist/schemas/llamacpp-config.js +1 -6
- package/dist/schemas/load-model.d.ts +1380 -60
- package/dist/schemas/load-model.js +6 -3
- package/dist/schemas/plugin.d.ts +4 -4
- package/dist/schemas/plugin.js +4 -4
- package/dist/schemas/reload-config.js +3 -1
- package/dist/schemas/sdcpp-config.d.ts +239 -0
- package/dist/schemas/sdcpp-config.js +116 -10
- package/dist/schemas/sdk-config.d.ts +790 -40
- package/dist/schemas/sdk-errors-server.js +3 -1
- package/dist/schemas/text-to-speech.d.ts +14 -0
- package/dist/schemas/text-to-speech.js +10 -4
- package/dist/schemas/tools.d.ts +1 -1
- package/dist/schemas/tools.js +2 -1
- package/dist/schemas/translate.js +12 -6
- package/dist/schemas/vla.d.ts +10 -0
- package/dist/schemas/vla.js +31 -11
- package/dist/scripts/contract/build-contract.d.ts +38 -0
- package/dist/scripts/contract/build-contract.js +620 -0
- package/dist/scripts/contract/build-error-codes.d.ts +17 -0
- package/dist/scripts/contract/build-error-codes.js +17 -0
- package/dist/scripts/contract/build-model-type-maps.d.ts +22 -0
- package/dist/scripts/contract/build-model-type-maps.js +16 -0
- package/dist/scripts/contract/build-models-registry.d.ts +17 -0
- package/dist/scripts/contract/build-models-registry.js +31 -0
- package/dist/scripts/contract/plugin-contract.d.ts +23 -0
- package/dist/scripts/contract/plugin-contract.js +28 -0
- package/dist/scripts/export-contract.d.ts +2 -0
- package/dist/scripts/export-contract.js +27 -0
- package/dist/scripts/export-plugin-contract.d.ts +2 -0
- package/dist/scripts/export-plugin-contract.js +18 -0
- package/dist/server/bare/ops/translate.js +16 -3
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +2 -1
- package/dist/server/bare/plugins/ggml-ocr/plugin.js +2 -23
- package/dist/server/bare/plugins/ggml-ocr/resolve-config.d.ts +6 -0
- package/dist/server/bare/plugins/ggml-ocr/resolve-config.js +73 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +5 -0
- package/dist/server/bare/plugins/ggml-vla/plugin.js +1 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +11 -22
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.d.ts +8 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +8 -0
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +8 -3
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +6 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +3 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +31 -2
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +129 -1
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +94 -22
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.js +2 -16
- package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +6 -0
- package/dist/server/bare/plugins/tts-ggml/plugin.js +3 -1
- package/dist/server/bare/types/addon-responses.d.ts +2 -0
- package/dist/server/bare/utils/tts-stats.d.ts +8 -4
- package/dist/server/bare/utils/tts-stats.js +6 -0
- package/dist/server/rpc/create-server.js +23 -1
- package/dist/server/rpc/handler-registry.js +5 -0
- package/dist/server/rpc/handlers/completion-orchestrate.d.ts +42 -0
- package/dist/server/rpc/handlers/completion-orchestrate.js +190 -0
- package/dist/server/rpc/handlers/get-loaded-model-info.js +8 -2
- package/dist/server/rpc/handlers/index.d.ts +2 -0
- package/dist/server/rpc/handlers/index.js +2 -0
- package/dist/server/rpc/method-shapes.d.ts +51 -0
- package/dist/server/rpc/method-shapes.js +48 -0
- package/dist/server/rpc/profiling/operation-metrics.js +20 -0
- package/dist/server/utils/cache/auto-history.js +13 -9
- package/package.json +16 -13
|
@@ -459,7 +459,9 @@ const serverErrorDefinitions = {
|
|
|
459
459
|
// Plugin Errors (53,850-53,899)
|
|
460
460
|
[SDK_SERVER_ERROR_CODES.PLUGIN_NOT_FOUND]: {
|
|
461
461
|
name: 'PLUGIN_NOT_FOUND',
|
|
462
|
-
message: (modelType) =>
|
|
462
|
+
message: (modelType) => modelType === 'onnx-ocr'
|
|
463
|
+
? 'Plugin not found for model type "onnx-ocr": the ONNX OCR engine was removed in @qvac/sdk 0.15.0. Use modelType "ggml-ocr" with GGUF registry models instead (EasyOCR: OCR_LATIN; DocTR: OCR_DOCTR).'
|
|
464
|
+
: `Plugin not found for model type "${modelType}". If using a custom worker bundle, ensure the plugin is included in your qvac.config plugins array and rebuild with "npx qvac bundle sdk".`
|
|
463
465
|
},
|
|
464
466
|
[SDK_SERVER_ERROR_CODES.PLUGIN_HANDLER_NOT_FOUND]: {
|
|
465
467
|
name: 'PLUGIN_HANDLER_NOT_FOUND',
|
|
@@ -34,6 +34,7 @@ export declare const ttsChatterboxRuntimeConfigSchema: z.ZodObject<{
|
|
|
34
34
|
streamChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
35
35
|
streamFirstChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
36
36
|
cfmSteps: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
cfgRate: z.ZodOptional<z.ZodNumber>;
|
|
37
38
|
threads: z.ZodOptional<z.ZodNumber>;
|
|
38
39
|
nGpuLayers: z.ZodOptional<z.ZodNumber>;
|
|
39
40
|
seed: z.ZodOptional<z.ZodNumber>;
|
|
@@ -78,6 +79,7 @@ export declare const ttsSupertonicRuntimeConfigSchema: z.ZodObject<{
|
|
|
78
79
|
ttsNumInferenceSteps: z.ZodOptional<z.ZodNumber>;
|
|
79
80
|
useGPU: z.ZodOptional<z.ZodBoolean>;
|
|
80
81
|
outputSampleRate: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
vulkanCacheDir: z.ZodOptional<z.ZodString>;
|
|
81
83
|
}, z.core.$strip>;
|
|
82
84
|
export declare const ttsRuntimeConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
83
85
|
ttsEngine: z.ZodLiteral<"chatterbox">;
|
|
@@ -111,6 +113,7 @@ export declare const ttsRuntimeConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
111
113
|
streamChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
112
114
|
streamFirstChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
113
115
|
cfmSteps: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
cfgRate: z.ZodOptional<z.ZodNumber>;
|
|
114
117
|
threads: z.ZodOptional<z.ZodNumber>;
|
|
115
118
|
nGpuLayers: z.ZodOptional<z.ZodNumber>;
|
|
116
119
|
seed: z.ZodOptional<z.ZodNumber>;
|
|
@@ -154,6 +157,7 @@ export declare const ttsRuntimeConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
154
157
|
ttsNumInferenceSteps: z.ZodOptional<z.ZodNumber>;
|
|
155
158
|
useGPU: z.ZodOptional<z.ZodBoolean>;
|
|
156
159
|
outputSampleRate: z.ZodOptional<z.ZodNumber>;
|
|
160
|
+
vulkanCacheDir: z.ZodOptional<z.ZodString>;
|
|
157
161
|
}, z.core.$strip>], "ttsEngine">;
|
|
158
162
|
export declare const ttsChatterboxLoadConfigSchema: z.ZodObject<{
|
|
159
163
|
ttsEngine: z.ZodLiteral<"chatterbox">;
|
|
@@ -187,6 +191,7 @@ export declare const ttsChatterboxLoadConfigSchema: z.ZodObject<{
|
|
|
187
191
|
streamChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
188
192
|
streamFirstChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
189
193
|
cfmSteps: z.ZodOptional<z.ZodNumber>;
|
|
194
|
+
cfgRate: z.ZodOptional<z.ZodNumber>;
|
|
190
195
|
threads: z.ZodOptional<z.ZodNumber>;
|
|
191
196
|
nGpuLayers: z.ZodOptional<z.ZodNumber>;
|
|
192
197
|
seed: z.ZodOptional<z.ZodNumber>;
|
|
@@ -453,6 +458,7 @@ export declare const ttsSupertonicLoadConfigSchema: z.ZodObject<{
|
|
|
453
458
|
ttsNumInferenceSteps: z.ZodOptional<z.ZodNumber>;
|
|
454
459
|
useGPU: z.ZodOptional<z.ZodBoolean>;
|
|
455
460
|
outputSampleRate: z.ZodOptional<z.ZodNumber>;
|
|
461
|
+
vulkanCacheDir: z.ZodOptional<z.ZodString>;
|
|
456
462
|
lavasrEnhancerModelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
457
463
|
src: z.ZodString;
|
|
458
464
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -560,6 +566,7 @@ export declare const ttsLoadConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
560
566
|
streamChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
561
567
|
streamFirstChunkTokens: z.ZodOptional<z.ZodNumber>;
|
|
562
568
|
cfmSteps: z.ZodOptional<z.ZodNumber>;
|
|
569
|
+
cfgRate: z.ZodOptional<z.ZodNumber>;
|
|
563
570
|
threads: z.ZodOptional<z.ZodNumber>;
|
|
564
571
|
nGpuLayers: z.ZodOptional<z.ZodNumber>;
|
|
565
572
|
seed: z.ZodOptional<z.ZodNumber>;
|
|
@@ -825,6 +832,7 @@ export declare const ttsLoadConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
825
832
|
ttsNumInferenceSteps: z.ZodOptional<z.ZodNumber>;
|
|
826
833
|
useGPU: z.ZodOptional<z.ZodBoolean>;
|
|
827
834
|
outputSampleRate: z.ZodOptional<z.ZodNumber>;
|
|
835
|
+
vulkanCacheDir: z.ZodOptional<z.ZodString>;
|
|
828
836
|
lavasrEnhancerModelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
829
837
|
src: z.ZodString;
|
|
830
838
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -928,6 +936,8 @@ export declare const ttsRequestSchema: z.ZodObject<{
|
|
|
928
936
|
export declare const ttsStatsSchema: z.ZodObject<{
|
|
929
937
|
audioDuration: z.ZodOptional<z.ZodNumber>;
|
|
930
938
|
totalSamples: z.ZodOptional<z.ZodNumber>;
|
|
939
|
+
enhancerBackendDevice: z.ZodOptional<z.ZodNumber>;
|
|
940
|
+
enhancerBackendId: z.ZodOptional<z.ZodNumber>;
|
|
931
941
|
}, z.core.$strip>;
|
|
932
942
|
export declare const ttsResponseSchema: z.ZodObject<{
|
|
933
943
|
type: z.ZodLiteral<"textToSpeech">;
|
|
@@ -936,6 +946,8 @@ export declare const ttsResponseSchema: z.ZodObject<{
|
|
|
936
946
|
stats: z.ZodOptional<z.ZodObject<{
|
|
937
947
|
audioDuration: z.ZodOptional<z.ZodNumber>;
|
|
938
948
|
totalSamples: z.ZodOptional<z.ZodNumber>;
|
|
949
|
+
enhancerBackendDevice: z.ZodOptional<z.ZodNumber>;
|
|
950
|
+
enhancerBackendId: z.ZodOptional<z.ZodNumber>;
|
|
939
951
|
}, z.core.$strip>>;
|
|
940
952
|
chunkIndex: z.ZodOptional<z.ZodNumber>;
|
|
941
953
|
sentenceChunk: z.ZodOptional<z.ZodString>;
|
|
@@ -972,6 +984,8 @@ export declare const textToSpeechStreamResponseSchema: z.ZodObject<{
|
|
|
972
984
|
stats: z.ZodOptional<z.ZodObject<{
|
|
973
985
|
audioDuration: z.ZodOptional<z.ZodNumber>;
|
|
974
986
|
totalSamples: z.ZodOptional<z.ZodNumber>;
|
|
987
|
+
enhancerBackendDevice: z.ZodOptional<z.ZodNumber>;
|
|
988
|
+
enhancerBackendId: z.ZodOptional<z.ZodNumber>;
|
|
975
989
|
}, z.core.$strip>>;
|
|
976
990
|
chunkIndex: z.ZodOptional<z.ZodNumber>;
|
|
977
991
|
sentenceChunk: z.ZodOptional<z.ZodString>;
|
|
@@ -105,6 +105,7 @@ export const ttsChatterboxRuntimeConfigSchema = z.object({
|
|
|
105
105
|
streamChunkTokens: ttsNonNegativeIntegerSchema.optional(),
|
|
106
106
|
streamFirstChunkTokens: ttsNonNegativeIntegerSchema.optional(),
|
|
107
107
|
cfmSteps: ttsNonNegativeIntegerSchema.optional(),
|
|
108
|
+
cfgRate: z.number().nonnegative().optional(),
|
|
108
109
|
threads: ttsPositiveIntegerSchema.optional(),
|
|
109
110
|
nGpuLayers: ttsIntegerSchema.optional(),
|
|
110
111
|
seed: ttsIntegerSchema.optional()
|
|
@@ -116,7 +117,8 @@ export const ttsSupertonicRuntimeConfigSchema = z.object({
|
|
|
116
117
|
ttsSpeed: z.number().optional(),
|
|
117
118
|
ttsNumInferenceSteps: z.number().optional(),
|
|
118
119
|
useGPU: z.boolean().optional(),
|
|
119
|
-
outputSampleRate: ttsOutputSampleRateSchema.optional()
|
|
120
|
+
outputSampleRate: ttsOutputSampleRateSchema.optional(),
|
|
121
|
+
vulkanCacheDir: z.string().min(1).optional()
|
|
120
122
|
});
|
|
121
123
|
export const ttsRuntimeConfigSchema = z.discriminatedUnion('ttsEngine', [
|
|
122
124
|
ttsChatterboxRuntimeConfigSchema,
|
|
@@ -193,10 +195,12 @@ const legacyTtsOnnxFieldsShape = LEGACY_TTS_ONNX_MODEL_CONFIG_FIELDS.reduce((acc
|
|
|
193
195
|
// `loadConfigSchema`. Permits deprecated ONNX field names so
|
|
194
196
|
// `resolveConfig` can raise LegacyTtsModelDeprecatedError instead of a
|
|
195
197
|
// generic Zod error; other unknown keys are still rejected by `.strict()`.
|
|
196
|
-
export const ttsConfigSchema = z
|
|
198
|
+
export const ttsConfigSchema = z
|
|
199
|
+
.discriminatedUnion('ttsEngine', [
|
|
197
200
|
ttsChatterboxLoadConfigSchema.extend(legacyTtsOnnxFieldsShape).strict(),
|
|
198
201
|
ttsSupertonicLoadConfigSchema.extend(legacyTtsOnnxFieldsShape).strict()
|
|
199
|
-
])
|
|
202
|
+
])
|
|
203
|
+
.superRefine(refineChatterboxTokenizerAssets);
|
|
200
204
|
export const ttsClientParamsSchema = z.object({
|
|
201
205
|
modelId: z.string(),
|
|
202
206
|
inputType: z.string().default('text'),
|
|
@@ -211,7 +215,9 @@ export const ttsRequestSchema = ttsClientParamsSchema.extend({
|
|
|
211
215
|
});
|
|
212
216
|
export const ttsStatsSchema = z.object({
|
|
213
217
|
audioDuration: z.number().optional(),
|
|
214
|
-
totalSamples: z.number().optional()
|
|
218
|
+
totalSamples: z.number().optional(),
|
|
219
|
+
enhancerBackendDevice: z.number().optional(),
|
|
220
|
+
enhancerBackendId: z.number().optional()
|
|
215
221
|
});
|
|
216
222
|
export const ttsResponseSchema = z.object({
|
|
217
223
|
type: z.literal('textToSpeech'),
|
package/dist/schemas/tools.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare const toolSchema: z.ZodObject<{
|
|
|
31
31
|
integer: "integer";
|
|
32
32
|
}>;
|
|
33
33
|
description: z.ZodOptional<z.ZodString>;
|
|
34
|
-
enum: z.ZodOptional<z.ZodArray<z.ZodString
|
|
34
|
+
enum: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>>;
|
|
35
35
|
}, z.core.$strip>>;
|
|
36
36
|
required: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
37
37
|
}, z.core.$strip>;
|
package/dist/schemas/tools.js
CHANGED
|
@@ -14,6 +14,7 @@ export const TOOLS_MODE = {
|
|
|
14
14
|
static: 'static',
|
|
15
15
|
dynamic: 'dynamic'
|
|
16
16
|
};
|
|
17
|
+
const jsonSchemaEnumValueSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]);
|
|
17
18
|
export const toolSchema = z.object({
|
|
18
19
|
type: z.literal('function'),
|
|
19
20
|
name: z.string(),
|
|
@@ -23,7 +24,7 @@ export const toolSchema = z.object({
|
|
|
23
24
|
properties: z.record(z.string(), z.object({
|
|
24
25
|
type: z.enum(['string', 'number', 'integer', 'boolean', 'object', 'array']),
|
|
25
26
|
description: z.string().optional(),
|
|
26
|
-
enum: z.array(
|
|
27
|
+
enum: z.array(jsonSchemaEnumValueSchema).optional()
|
|
27
28
|
})),
|
|
28
29
|
required: z.array(z.string()).optional()
|
|
29
30
|
})
|
|
@@ -58,14 +58,18 @@ const translateRequestIdField = z
|
|
|
58
58
|
.optional()
|
|
59
59
|
.describe('Stable identifier for this in-flight translation, generated by the client at call time. Surfaces on the registry so callers can target it with `cancel({ requestId })`. Optional on the wire — the server falls back to a server-generated id when the field is missing.');
|
|
60
60
|
export const translateRequestSchema = z.discriminatedUnion('modelType', [
|
|
61
|
-
translateParamsNmtSchema
|
|
61
|
+
translateParamsNmtSchema
|
|
62
|
+
.extend({
|
|
62
63
|
type: z.literal('translate'),
|
|
63
64
|
requestId: translateRequestIdField
|
|
64
|
-
})
|
|
65
|
-
|
|
65
|
+
})
|
|
66
|
+
.meta({ title: 'TranslateNmtRequest' }),
|
|
67
|
+
translateParamsLlmSchema
|
|
68
|
+
.extend({
|
|
66
69
|
type: z.literal('translate'),
|
|
67
70
|
requestId: translateRequestIdField
|
|
68
71
|
})
|
|
72
|
+
.meta({ title: 'TranslateLlmRequest' })
|
|
69
73
|
]);
|
|
70
74
|
// Valid model types for translation (aliases and canonical)
|
|
71
75
|
const validTranslationModelTypes = ['nmt', 'nmtcpp-translation', 'llm', 'llamacpp-completion'];
|
|
@@ -78,11 +82,13 @@ export const translateServerParamsSchema = translateParamsSchema
|
|
|
78
82
|
.refine((data) => {
|
|
79
83
|
if (!llmModelTypes.includes(data.modelType))
|
|
80
84
|
return true;
|
|
81
|
-
// For LLM,
|
|
85
|
+
// For LLM, `to` is required; `from` is resolved by the worker
|
|
86
|
+
// (explicit, else auto-detected in server/bare/ops/translate.ts), so an
|
|
87
|
+
// absent `from` is valid here — it no longer has to arrive on the wire.
|
|
82
88
|
const llmData = data;
|
|
83
|
-
return llmData.
|
|
89
|
+
return !!llmData.to;
|
|
84
90
|
}, {
|
|
85
|
-
message: "
|
|
91
|
+
message: "A 'to' language is required for LLM translation models"
|
|
86
92
|
})
|
|
87
93
|
.transform((data) => ({
|
|
88
94
|
...data,
|
package/dist/schemas/vla.d.ts
CHANGED
|
@@ -19,6 +19,11 @@ export declare const vlaHparamsSchema: z.ZodObject<{
|
|
|
19
19
|
discrete: "discrete";
|
|
20
20
|
continuous: "continuous";
|
|
21
21
|
}>>;
|
|
22
|
+
imageInputMode: z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
pixels: "pixels";
|
|
24
|
+
patches: "patches";
|
|
25
|
+
}>>;
|
|
26
|
+
imagePatchElems: z.ZodOptional<z.ZodNumber>;
|
|
22
27
|
}, z.core.$strip>;
|
|
23
28
|
export type VlaHparams = z.infer<typeof vlaHparamsSchema>;
|
|
24
29
|
export declare const vlaStatsSchema: z.ZodObject<{
|
|
@@ -78,6 +83,11 @@ export declare const vlaHparamsResponseSchema: z.ZodObject<{
|
|
|
78
83
|
discrete: "discrete";
|
|
79
84
|
continuous: "continuous";
|
|
80
85
|
}>>;
|
|
86
|
+
imageInputMode: z.ZodOptional<z.ZodEnum<{
|
|
87
|
+
pixels: "pixels";
|
|
88
|
+
patches: "patches";
|
|
89
|
+
}>>;
|
|
90
|
+
imagePatchElems: z.ZodOptional<z.ZodNumber>;
|
|
81
91
|
}, z.core.$strip>;
|
|
82
92
|
backendName: z.ZodNullable<z.ZodString>;
|
|
83
93
|
}, z.core.$strip>;
|
package/dist/schemas/vla.js
CHANGED
|
@@ -31,16 +31,33 @@ export const vlaHparamsSchema = z.object({
|
|
|
31
31
|
.int()
|
|
32
32
|
.positive()
|
|
33
33
|
.optional()
|
|
34
|
-
.describe('Number of camera views the model expects (2 for SmolVLA, 3
|
|
35
|
-
'Pass exactly this many preprocessed frames in `images`.
|
|
36
|
-
'back-compat — older addon builds may omit it.'),
|
|
34
|
+
.describe('Number of camera views the model expects (2 for SmolVLA and GR00T, 3 ' +
|
|
35
|
+
'for π₀.₅). Pass exactly this many preprocessed frames in `images`. ' +
|
|
36
|
+
'Optional for back-compat — older addon builds may omit it.'),
|
|
37
37
|
stateInputMode: z
|
|
38
38
|
.enum(['continuous', 'discrete'])
|
|
39
39
|
.optional()
|
|
40
|
-
.describe("How the robot state is consumed. `'continuous'` (SmolVLA): the
|
|
41
|
-
|
|
42
|
-
'(π₀.₅): the state is tokenised into the language prompt
|
|
43
|
-
'buffer is ignored — pass an empty `Float32Array(0)`.
|
|
40
|
+
.describe("How the robot state is consumed. `'continuous'` (SmolVLA, GR00T): the " +
|
|
41
|
+
'`state` Float32Array is projected by an in-model linear layer. ' +
|
|
42
|
+
"`'discrete'` (π₀.₅): the state is tokenised into the language prompt " +
|
|
43
|
+
'and the `state` buffer is ignored — pass an empty `Float32Array(0)`. ' +
|
|
44
|
+
'Optional for back-compat.'),
|
|
45
|
+
imageInputMode: z
|
|
46
|
+
.enum(['pixels', 'patches'])
|
|
47
|
+
.optional()
|
|
48
|
+
.describe("How images are supplied. `'pixels'` (SmolVLA, π₀.₅): each `images` " +
|
|
49
|
+
'entry is a `3 · imgWidth · imgHeight` CHW plane from ' +
|
|
50
|
+
"`vlaPreprocessImage`. `'patches'` (GR00T): each entry is a " +
|
|
51
|
+
'pre-patchified buffer of length `imagePatchElems`. Optional for ' +
|
|
52
|
+
'back-compat.'),
|
|
53
|
+
imagePatchElems: z
|
|
54
|
+
.number()
|
|
55
|
+
.int()
|
|
56
|
+
.nonnegative()
|
|
57
|
+
.optional()
|
|
58
|
+
.describe("For patch-input models (`imageInputMode === 'patches'`), the exact " +
|
|
59
|
+
'per-camera patch buffer length each `images` entry must have. Absent ' +
|
|
60
|
+
'for pixel-input models.')
|
|
44
61
|
});
|
|
45
62
|
// ============================================
|
|
46
63
|
// Stats
|
|
@@ -75,15 +92,18 @@ export const vlaRunRequestSchema = z.object({
|
|
|
75
92
|
images: z
|
|
76
93
|
.array(z.string().min(1).regex(BASE64_PATTERN))
|
|
77
94
|
.min(1)
|
|
78
|
-
.describe('Base64-encoded preprocessed images. Each entry is the
|
|
79
|
-
'ArrayBuffer of a `Float32Array
|
|
80
|
-
'
|
|
95
|
+
.describe('Base64-encoded preprocessed images, one per camera. Each entry is the ' +
|
|
96
|
+
'underlying ArrayBuffer of a `Float32Array`. For pixel-input models ' +
|
|
97
|
+
'(SmolVLA, π₀.₅) it comes from `vlaPreprocessImage(...)` and its length ' +
|
|
98
|
+
'must equal `3 * imgWidth * imgHeight`. For patch-input models (GR00T, ' +
|
|
99
|
+
"`hparams.imageInputMode === 'patches'`) it is a pre-patchified buffer " +
|
|
100
|
+
'of length `hparams.imagePatchElems`.'),
|
|
81
101
|
imgWidth: z.number().int().positive(),
|
|
82
102
|
imgHeight: z.number().int().positive(),
|
|
83
103
|
state: z
|
|
84
104
|
.string()
|
|
85
105
|
.regex(BASE64_PATTERN)
|
|
86
|
-
.describe('Base64-encoded `Float32Array`. For continuous-state models (SmolVLA) ' +
|
|
106
|
+
.describe('Base64-encoded `Float32Array`. For continuous-state models (SmolVLA, GR00T) ' +
|
|
87
107
|
'this is length `hparams.maxStateDim` — use ' +
|
|
88
108
|
'`vlaPadState(state, hparams.maxStateDim)` to zero-pad. For ' +
|
|
89
109
|
"discrete-state models (π₀.₅, `stateInputMode: 'discrete'`) the state " +
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const contractDir: URL;
|
|
3
|
+
export declare const callShapeByHandlerType: {
|
|
4
|
+
readonly reply: "request-reply";
|
|
5
|
+
readonly stream: "server-stream";
|
|
6
|
+
readonly duplex: "duplex";
|
|
7
|
+
};
|
|
8
|
+
type JsonSchema = Record<string, unknown>;
|
|
9
|
+
export declare function toWireJsonSchema(schema: z.ZodType, io: 'input' | 'output', defName: string): JsonSchema;
|
|
10
|
+
export declare function buildContract(): {
|
|
11
|
+
schemaDocument: {
|
|
12
|
+
$schema: string;
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
15
|
+
$defs: Record<string, JsonSchema>;
|
|
16
|
+
};
|
|
17
|
+
manifest: {
|
|
18
|
+
methods: {
|
|
19
|
+
progress?: {
|
|
20
|
+
condition: string;
|
|
21
|
+
responseSchema: string;
|
|
22
|
+
};
|
|
23
|
+
name: "cancel" | "transcribe" | "translate" | "finetune" | "loadModel" | "downloadAsset" | "rag" | "pluginInvoke" | "pluginInvokeStream" | "modelRegistryList" | "modelRegistrySearch" | "modelRegistryGetModel" | "completionStream" | "completionOrchestrate" | "batchCompletionStream" | "deleteCache" | "heartbeat" | "unloadModel" | "transcribeStream" | "bciTranscribe" | "bciTranscribeStream" | "loggingStream" | "embed" | "textToSpeech" | "textToSpeechStream" | "provide" | "stopProvide" | "getModelInfo" | "getLoadedModelInfo" | "ocrStream" | "diffusionStream" | "videoStream" | "upscaleStream" | "resume" | "suspend" | "state" | "classify";
|
|
24
|
+
callShape: "duplex" | "request-reply" | "server-stream";
|
|
25
|
+
requestSchema: string;
|
|
26
|
+
responseSchema: string;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare function renderContractFiles(): Promise<{
|
|
31
|
+
'schema.json': string;
|
|
32
|
+
'manifest.json': string;
|
|
33
|
+
'models.json': string;
|
|
34
|
+
'model-type-maps.json': string;
|
|
35
|
+
'error-codes.json': string;
|
|
36
|
+
}>;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=build-contract.d.ts.map
|