@qvac/inference 0.17.0 → 0.18.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 +22 -80
- package/dist/api/completion-stream.d.ts +1 -1
- package/dist/api/completion-stream.js +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/text-to-speech.js +22 -2
- package/dist/api/transcribe.d.ts +19 -2
- package/dist/api/transcribe.js +66 -27
- package/dist/api/translate.js +6 -17
- package/dist/api/vla.d.ts +42 -1
- package/dist/api/vla.js +50 -1
- package/dist/constants/audio.d.ts +2 -1
- package/dist/constants/audio.js +17 -1
- package/dist/errors/index.d.ts +3 -0
- package/dist/errors/index.js +5 -0
- package/dist/handlers/load-model/handler.js +2 -2
- package/dist/handlers/load-model/resolve-session.d.ts +1 -1
- package/dist/handlers/load-model/resolve-session.js +3 -3
- package/dist/handlers/load-model/resolve.d.ts +12 -2
- package/dist/handlers/load-model/resolve.js +90 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/models/registry/models.d.ts +782 -6
- package/dist/models/registry/models.js +2664 -1859
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-input.d.ts +19 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-input.js +153 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +54 -4
- package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +28 -0
- package/dist/plugins/builtin/ggml-ocr/plugin.js +3 -1
- package/dist/plugins/builtin/ggml-vla/ops/vla-set-embodiment.d.ts +2 -0
- package/dist/plugins/builtin/ggml-vla/ops/vla-set-embodiment.js +9 -0
- package/dist/plugins/builtin/ggml-vla/plugin.d.ts +37 -0
- package/dist/plugins/builtin/ggml-vla/plugin.js +21 -4
- package/dist/plugins/builtin/index.d.ts +1 -0
- package/dist/plugins/builtin/index.js +1 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +16 -15
- package/dist/plugins/builtin/llamacpp-completion/ops/cache-logger.d.ts +1 -1
- package/dist/plugins/builtin/llamacpp-completion/ops/cache-logger.js +2 -2
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +6 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.js +10 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.d.ts +1 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +131 -123
- package/dist/plugins/builtin/llamacpp-completion/ops/finetune.js +110 -20
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.d.ts +50 -23
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.js +308 -143
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-state.d.ts +1 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-state.js +2 -2
- package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +6 -6
- package/dist/plugins/builtin/llamacpp-completion/plugin.js +56 -36
- package/dist/plugins/builtin/llamacpp-completion/transform.js +0 -7
- package/dist/plugins/builtin/llamacpp-embedding/plugin.js +2 -3
- package/dist/plugins/builtin/nmtcpp-translation/plugin.js +6 -5
- package/dist/plugins/builtin/parakeet-transcription/plugin.js +27 -16
- package/dist/plugins/builtin/tts-ggml/ops/parler-options.js +23 -3
- package/dist/plugins/builtin/tts-ggml/plugin.d.ts +302 -4
- package/dist/plugins/builtin/tts-ggml/plugin.js +131 -0
- package/dist/plugins/builtin/whispercpp-transcription/plugin.js +48 -39
- package/dist/plugins/ops/cancel.d.ts +1 -1
- package/dist/plugins/ops/cancel.js +1 -1
- package/dist/plugins/ops/kv-cache-retention.js +11 -0
- package/dist/plugins/ops/kv-cache-utils.d.ts +1 -1
- package/dist/plugins/ops/kv-cache-utils.js +40 -12
- package/dist/plugins/ops/transcribe.d.ts +2 -2
- package/dist/plugins/ops/transcribe.js +54 -48
- package/dist/plugins/ops/translate-stats.d.ts +4 -0
- package/dist/plugins/ops/translate-stats.js +11 -0
- package/dist/plugins/ops/translate.js +66 -38
- package/dist/plugins/ops/unload-model.js +30 -24
- package/dist/runtime/model-registry.d.ts +1 -0
- package/dist/runtime/request-context.js +29 -14
- package/dist/runtime/request-registry.d.ts +27 -0
- package/dist/runtime/request-registry.js +246 -76
- package/dist/schemas/audio-gen.d.ts +103 -0
- package/dist/schemas/audio-gen.js +135 -4
- package/dist/schemas/common.d.ts +550 -11
- package/dist/schemas/config.d.ts +60 -24
- package/dist/schemas/errors.d.ts +1 -0
- package/dist/schemas/errors.js +5 -0
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/schemas/llamacpp-config.d.ts +10 -10
- package/dist/schemas/llamacpp-config.js +12 -5
- package/dist/schemas/load-model.d.ts +3691 -336
- package/dist/schemas/load-model.js +37 -19
- package/dist/schemas/text-to-speech.d.ts +1086 -110
- package/dist/schemas/text-to-speech.js +197 -7
- package/dist/schemas/tools.d.ts +0 -16
- package/dist/schemas/tools.js +0 -15
- package/dist/schemas/transcription-config.d.ts +2 -0
- package/dist/schemas/transcription-config.js +6 -0
- package/dist/schemas/transcription.d.ts +3 -0
- package/dist/schemas/vla.d.ts +83 -0
- package/dist/schemas/vla.js +105 -2
- package/dist/surface.d.ts +1 -1
- package/dist/surface.js +1 -1
- package/dist/utils/addon-responses.d.ts +4 -12
- package/dist/utils/audio/decoder.d.ts +37 -1
- package/dist/utils/audio/decoder.js +82 -52
- package/dist/utils/config-transform.d.ts +3 -0
- package/dist/utils/config-transform.js +6 -0
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/shard-utils.d.ts +1 -0
- package/dist/utils/shard-utils.js +14 -0
- package/dist/utils/tool-integration.d.ts +3 -10
- package/dist/utils/tool-integration.js +3 -12
- package/package.json +26 -22
- package/dist/plugins/builtin/llamacpp-completion/ops/batch-cancelled.d.ts +0 -22
- package/dist/plugins/builtin/llamacpp-completion/ops/batch-cancelled.js +0 -30
- package/dist/utils/expand-gguf-shards.d.ts +0 -2
- package/dist/utils/expand-gguf-shards.js +0 -22
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { modelSrcInputSchema } from '../schemas/model-src-utils.js';
|
|
3
|
+
import { audioInputSchema } from '../schemas/transcription.js';
|
|
4
|
+
import { encodeBase64 } from '../utils/encoding.js';
|
|
3
5
|
const base64Schema = z.string().min(1);
|
|
6
|
+
/** Sample rate the ACE-Step engine expects for reference and source audio. */
|
|
7
|
+
export const AUDIOGEN_INPUT_SAMPLE_RATE = 48000;
|
|
8
|
+
/** Channel count (interleaved stereo) the ACE-Step engine expects for input audio. */
|
|
9
|
+
export const AUDIOGEN_INPUT_CHANNELS = 2;
|
|
10
|
+
/**
|
|
11
|
+
* Longest reference/source clip the SDK accepts (10 minutes). Bounds the PCM
|
|
12
|
+
* the server materializes per input — a 48 kHz stereo Float32 clip weighs
|
|
13
|
+
* 384 KB per second — so a request cannot exhaust the inference process.
|
|
14
|
+
*/
|
|
15
|
+
export const AUDIOGEN_INPUT_MAX_SECONDS = 600;
|
|
16
|
+
/**
|
|
17
|
+
* ACE-Step task discriminators reachable through the SDK. `text2music` is the
|
|
18
|
+
* default caption-driven generation; `cover-nofsq` re-renders `sourceAudio`
|
|
19
|
+
* with a new caption while keeping its structure. The engine also reserves an
|
|
20
|
+
* FSQ-roundtrip `cover` task that is not implemented yet, so it is not offered
|
|
21
|
+
* here.
|
|
22
|
+
*/
|
|
23
|
+
export const AUDIOGEN_TASK_TYPES = ['text2music', 'cover-nofsq'];
|
|
24
|
+
export const audioGenTaskTypeSchema = z.enum(AUDIOGEN_TASK_TYPES);
|
|
4
25
|
export const audioGenRuntimeConfigSchema = z
|
|
5
26
|
.object({
|
|
6
27
|
useGPU: z.boolean().optional(),
|
|
@@ -19,7 +40,31 @@ export const audioGenConfigSchema = audioGenRuntimeConfigSchema
|
|
|
19
40
|
vaeModelSrc: modelSrcInputSchema
|
|
20
41
|
})
|
|
21
42
|
.strict();
|
|
22
|
-
const
|
|
43
|
+
const unitIntervalSchema = z.number().min(0).max(1);
|
|
44
|
+
/**
|
|
45
|
+
* Wire form of a reference/source audio input. `filePath` inputs are decoded
|
|
46
|
+
* server-side (any format the SDK's audio decoder supports, plus raw PCM);
|
|
47
|
+
* `base64` inputs must already be interleaved stereo 48 kHz Float32 LE PCM.
|
|
48
|
+
*/
|
|
49
|
+
export const audioGenAudioInputSchema = audioInputSchema;
|
|
50
|
+
/**
|
|
51
|
+
* Client form of a reference/source audio input: a file path, or raw
|
|
52
|
+
* interleaved stereo 48 kHz Float32 LE PCM bytes. Normalized to the wire form.
|
|
53
|
+
*/
|
|
54
|
+
export const audioGenClientAudioInputSchema = z
|
|
55
|
+
.union([z.string().min(1), z.instanceof(Uint8Array)])
|
|
56
|
+
.transform((value) => {
|
|
57
|
+
if (typeof value === 'string')
|
|
58
|
+
return { type: 'filePath', value };
|
|
59
|
+
return { type: 'base64', value: bytesToBase64(value) };
|
|
60
|
+
});
|
|
61
|
+
function bytesToBase64(bytes) {
|
|
62
|
+
if (typeof Buffer !== 'undefined' && Buffer.isBuffer(bytes)) {
|
|
63
|
+
return bytes.toString('base64');
|
|
64
|
+
}
|
|
65
|
+
return encodeBase64(bytes);
|
|
66
|
+
}
|
|
67
|
+
const audioGenGenerationShape = {
|
|
23
68
|
modelId: z.string().min(1),
|
|
24
69
|
caption: z.string().trim().min(1, 'caption must not be empty or whitespace-only'),
|
|
25
70
|
lyrics: z.string().optional(),
|
|
@@ -32,16 +77,102 @@ const audioGenParamsShape = {
|
|
|
32
77
|
.number()
|
|
33
78
|
.positive()
|
|
34
79
|
.optional()
|
|
35
|
-
.describe('Approximate requested duration in seconds. ACE-Step rounds to its latent frame grid; use output frames or stats.audioDurationMs as authoritative.')
|
|
80
|
+
.describe('Approximate requested duration in seconds. ACE-Step rounds to its latent frame grid; use output frames or stats.audioDurationMs as authoritative.'),
|
|
81
|
+
lmTemperature: z
|
|
82
|
+
.number()
|
|
83
|
+
.nonnegative()
|
|
84
|
+
.optional()
|
|
85
|
+
.describe('LM sampling temperature (ACE-Step default: 0.85).'),
|
|
86
|
+
lmTopP: unitIntervalSchema
|
|
87
|
+
.optional()
|
|
88
|
+
.describe('LM nucleus-sampling probability (ACE-Step default: 0.9).'),
|
|
89
|
+
lmTopK: z
|
|
90
|
+
.number()
|
|
91
|
+
.int()
|
|
92
|
+
.nonnegative()
|
|
93
|
+
.optional()
|
|
94
|
+
.describe('LM top-k cutoff; 0 disables top-k filtering.'),
|
|
95
|
+
lmCfgScale: z
|
|
96
|
+
.number()
|
|
97
|
+
.nonnegative()
|
|
98
|
+
.optional()
|
|
99
|
+
.describe('Classifier-free guidance scale used by the LM.'),
|
|
100
|
+
lmPhase1: z
|
|
101
|
+
.boolean()
|
|
102
|
+
.optional()
|
|
103
|
+
.describe('Allow the LM to infer missing metadata before semantic-code generation.'),
|
|
104
|
+
dcwEnabled: z
|
|
105
|
+
.boolean()
|
|
106
|
+
.optional()
|
|
107
|
+
.describe('Apply the official ACE-Step Haar DCW correction during DiT sampling (default: true).'),
|
|
108
|
+
dcwScaler: z
|
|
109
|
+
.number()
|
|
110
|
+
.nonnegative()
|
|
111
|
+
.optional()
|
|
112
|
+
.describe('DCW low-frequency correction strength (official default: 0.05).'),
|
|
113
|
+
dcwHighScaler: z
|
|
114
|
+
.number()
|
|
115
|
+
.nonnegative()
|
|
116
|
+
.optional()
|
|
117
|
+
.describe('DCW high-frequency correction strength (official default: 0.02).'),
|
|
118
|
+
taskType: audioGenTaskTypeSchema
|
|
119
|
+
.optional()
|
|
120
|
+
.describe('Generation task: text2music (default) or cover-nofsq (requires sourceAudio).'),
|
|
121
|
+
audioCoverStrength: unitIntervalSchema
|
|
122
|
+
.optional()
|
|
123
|
+
.describe('Fraction of DiT steps that keep the source context (0..1, default 1). cover-nofsq currently requires 1.'),
|
|
124
|
+
coverNoiseStrength: unitIntervalSchema
|
|
125
|
+
.optional()
|
|
126
|
+
.describe('Blend of the initial DiT noise toward the clean source latent (0..1). 0 = pure noise, 1 ≈ source latent. Default 0.')
|
|
127
|
+
};
|
|
128
|
+
const audioGenParamsShape = {
|
|
129
|
+
...audioGenGenerationShape,
|
|
130
|
+
referenceAudio: audioGenAudioInputSchema
|
|
131
|
+
.optional()
|
|
132
|
+
.describe('Optional timbre reference audio; omit to keep the engine default.'),
|
|
133
|
+
sourceAudio: audioGenAudioInputSchema
|
|
134
|
+
.optional()
|
|
135
|
+
.describe('Source audio to re-render; required for cover tasks.')
|
|
36
136
|
};
|
|
37
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Cross-field rules for cover tasks: `sourceAudio` is mandatory, and the engine
|
|
139
|
+
* currently only implements full source context, so an explicit
|
|
140
|
+
* `audioCoverStrength` must be `1` until context switching lands upstream.
|
|
141
|
+
*/
|
|
142
|
+
function validateCoverTask(value, ctx) {
|
|
143
|
+
if (value.taskType !== 'cover-nofsq')
|
|
144
|
+
return;
|
|
145
|
+
if (value.sourceAudio === undefined) {
|
|
146
|
+
ctx.addIssue({
|
|
147
|
+
code: 'custom',
|
|
148
|
+
path: ['sourceAudio'],
|
|
149
|
+
message: "taskType 'cover-nofsq' requires sourceAudio"
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
if (value.audioCoverStrength !== undefined && value.audioCoverStrength !== 1) {
|
|
153
|
+
ctx.addIssue({
|
|
154
|
+
code: 'custom',
|
|
155
|
+
path: ['audioCoverStrength'],
|
|
156
|
+
message: "taskType 'cover-nofsq' currently requires audioCoverStrength 1"
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
export const audioGenClientParamsSchema = z
|
|
161
|
+
.object({
|
|
162
|
+
...audioGenGenerationShape,
|
|
163
|
+
referenceAudio: audioGenClientAudioInputSchema.optional(),
|
|
164
|
+
sourceAudio: audioGenClientAudioInputSchema.optional()
|
|
165
|
+
})
|
|
166
|
+
.strict()
|
|
167
|
+
.superRefine(validateCoverTask);
|
|
38
168
|
export const audioGenStreamRequestSchema = z
|
|
39
169
|
.object({
|
|
40
170
|
...audioGenParamsShape,
|
|
41
171
|
type: z.literal('audioGenStream'),
|
|
42
172
|
requestId: z.string().min(1).optional()
|
|
43
173
|
})
|
|
44
|
-
.strict()
|
|
174
|
+
.strict()
|
|
175
|
+
.superRefine(validateCoverTask);
|
|
45
176
|
export const audioGenProgressSchema = z.object({
|
|
46
177
|
stage: z.string(),
|
|
47
178
|
step: z.number().int().nonnegative(),
|