@qvac/inference 0.19.1 → 0.20.1
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 +57 -17
- package/dist/api/assess-model-fit.d.ts +9 -4
- package/dist/api/assess-model-fit.js +9 -4
- package/dist/api/audio-gen.d.ts +42 -1
- package/dist/api/audio-gen.js +137 -51
- package/dist/api/index.d.ts +2 -1
- package/dist/api/index.js +2 -1
- package/dist/api/text-to-speech.d.ts +31 -4
- package/dist/api/text-to-speech.js +117 -21
- package/dist/api/vector-index.d.ts +142 -0
- package/dist/api/vector-index.js +168 -0
- package/dist/api/world.d.ts +2 -2
- package/dist/errors/index.d.ts +12 -0
- package/dist/errors/index.js +21 -0
- package/dist/handlers/assess-model-fit.d.ts +30 -6
- package/dist/handlers/assess-model-fit.js +68 -6
- 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/vector-index.d.ts +2 -0
- package/dist/handlers/vector-index.js +40 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/models/registry/models.d.ts +351 -12
- package/dist/models/registry/models.js +2271 -1957
- package/dist/models/registry/resource-profiles.js +135 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-edit-stream.d.ts +2 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-edit-stream.js +65 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-input.d.ts +9 -1
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-input.js +24 -7
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-run.d.ts +46 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-run.js +218 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.d.ts +1 -1
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +56 -225
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-understand.d.ts +8 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-understand.js +28 -0
- package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +248 -0
- package/dist/plugins/builtin/audiogen-ggml/plugin.js +17 -1
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +5 -2
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +1 -2
- package/dist/plugins/builtin/ggml-ocr/plugin.d.ts +1 -1
- package/dist/plugins/builtin/ggml-ocr/plugin.js +1 -2
- package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +6 -4
- package/dist/plugins/builtin/llamacpp-completion/ops/cache-logger.d.ts +1 -2
- package/dist/plugins/builtin/llamacpp-completion/ops/cache-logger.js +0 -4
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +1 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.js +3 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.d.ts +9 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +96 -89
- package/dist/plugins/builtin/llamacpp-completion/ops/context-overflow.d.ts +0 -1
- package/dist/plugins/builtin/llamacpp-completion/ops/context-overflow.js +0 -31
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.d.ts +40 -24
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.js +187 -123
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-state.d.ts +11 -4
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-state.js +18 -16
- package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +69 -4
- package/dist/plugins/builtin/llamacpp-completion/plugin.js +1 -2
- package/dist/plugins/builtin/llamacpp-completion/transform.js +19 -0
- package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +1 -2
- package/dist/plugins/builtin/llamacpp-embedding/plugin.js +2 -38
- package/dist/plugins/builtin/llamacpp-embedding/transform.d.ts +9 -0
- package/dist/plugins/builtin/llamacpp-embedding/transform.js +42 -0
- package/dist/plugins/builtin/nmtcpp-translation/plugin.d.ts +1 -1
- package/dist/plugins/builtin/nmtcpp-translation/plugin.js +1 -2
- package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +1 -1
- package/dist/plugins/builtin/parakeet-transcription/plugin.js +1 -2
- package/dist/plugins/builtin/sdcpp-generation/ops/video.d.ts +1 -0
- package/dist/plugins/builtin/sdcpp-generation/ops/video.js +8 -2
- package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +9 -4
- package/dist/plugins/builtin/sdcpp-generation/plugin.js +51 -19
- package/dist/plugins/builtin/tts-ggml/ops/cancel-binding.d.ts +29 -0
- package/dist/plugins/builtin/tts-ggml/ops/cancel-binding.js +66 -0
- package/dist/plugins/builtin/tts-ggml/ops/parler-options.js +10 -0
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.d.ts +3 -5
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.js +143 -28
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.d.ts +5 -2
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +182 -66
- package/dist/plugins/builtin/tts-ggml/plugin.d.ts +267 -22
- package/dist/plugins/builtin/tts-ggml/plugin.js +94 -35
- package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +1 -1
- package/dist/plugins/builtin/whispercpp-transcription/plugin.js +1 -2
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/ops/load-model.js +22 -2
- package/dist/plugins/ops/translate.js +58 -12
- package/dist/plugins/ops/translatepsy-utils.d.ts +17 -0
- package/dist/plugins/ops/translatepsy-utils.js +32 -0
- package/dist/plugins/registry.d.ts +15 -0
- package/dist/plugins/registry.js +133 -15
- package/dist/plugins/turbovec-backend.d.ts +17 -0
- package/dist/plugins/turbovec-backend.js +99 -0
- package/dist/registry.js +4 -0
- package/dist/resources/model-fit/assess.d.ts +10 -1
- package/dist/resources/model-fit/assess.js +43 -0
- package/dist/resources/model-fit/fit-stub/fetch-fit-stub.d.ts +83 -0
- package/dist/resources/model-fit/fit-stub/fetch-fit-stub.js +133 -0
- package/dist/resources/model-fit/fit-stub/index.d.ts +2 -0
- package/dist/resources/model-fit/fit-stub/index.js +2 -0
- package/dist/resources/model-fit/fit-stub/project-fit-from-stub.d.ts +31 -0
- package/dist/resources/model-fit/fit-stub/project-fit-from-stub.js +36 -0
- package/dist/resources/model-fit/native-probe/advisory-fit.d.ts +46 -0
- package/dist/resources/model-fit/native-probe/advisory-fit.js +214 -0
- package/dist/resources/model-fit/native-probe/create-llama-fit-request.d.ts +26 -0
- package/dist/resources/model-fit/native-probe/create-llama-fit-request.js +191 -0
- package/dist/resources/model-fit/native-probe/run-in-process-fit.d.ts +42 -0
- package/dist/resources/model-fit/native-probe/run-in-process-fit.js +192 -0
- package/dist/resources/model-fit/native-probe/run-isolated-fit.d.ts +70 -0
- package/dist/resources/model-fit/native-probe/run-isolated-fit.js +372 -0
- package/dist/runtime/env.d.ts +2 -0
- package/dist/runtime/env.js +9 -2
- package/dist/runtime/lifecycle.js +2 -0
- package/dist/runtime/model-registry.d.ts +3 -1
- package/dist/runtime/model-registry.js +2 -1
- package/dist/runtime/request-context.js +17 -0
- package/dist/runtime/vector-index-backend.d.ts +25 -0
- package/dist/runtime/vector-index-backend.js +1 -0
- package/dist/runtime/vector-index-registry.d.ts +76 -0
- package/dist/runtime/vector-index-registry.js +161 -0
- package/dist/schemas/assess-model-fit.d.ts +67 -0
- package/dist/schemas/assess-model-fit.js +56 -2
- package/dist/schemas/audio-gen.d.ts +479 -4
- package/dist/schemas/audio-gen.js +376 -17
- package/dist/schemas/batch-completion-stream.d.ts +7 -0
- package/dist/schemas/batch-completion-stream.js +5 -3
- package/dist/schemas/common.d.ts +816 -15
- package/dist/schemas/common.js +8 -1
- package/dist/schemas/completion-event.d.ts +11 -1
- package/dist/schemas/completion-event.js +3 -0
- package/dist/schemas/completion-stream.d.ts +20 -0
- package/dist/schemas/completion-stream.js +41 -4
- package/dist/schemas/config.d.ts +186 -30
- package/dist/schemas/errors.d.ts +4 -0
- package/dist/schemas/errors.js +22 -0
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/llamacpp-config.d.ts +88 -8
- package/dist/schemas/llamacpp-config.js +108 -8
- package/dist/schemas/load-model.d.ts +2906 -206
- package/dist/schemas/model-config-schemas.d.ts +251 -5
- package/dist/schemas/plugin.d.ts +10 -0
- package/dist/schemas/sdcpp-config.d.ts +221 -4
- package/dist/schemas/sdcpp-config.js +128 -22
- package/dist/schemas/text-to-speech.d.ts +780 -19
- package/dist/schemas/text-to-speech.js +298 -44
- package/dist/schemas/transcription-config.js +7 -4
- package/dist/schemas/vector-index.d.ts +194 -0
- package/dist/schemas/vector-index.js +185 -0
- package/dist/utils/addon-responses.d.ts +29 -3
- package/dist/utils/aggregate-events.d.ts +3 -1
- package/dist/utils/aggregate-events.js +7 -1
- package/dist/utils/tts-stats.d.ts +15 -11
- package/dist/utils/tts-stats.js +33 -11
- package/package.json +29 -26
|
@@ -42,7 +42,6 @@ export declare const llmPlugin: {
|
|
|
42
42
|
'split-mode': import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
43
43
|
none: "none";
|
|
44
44
|
layer: "layer";
|
|
45
|
-
row: "row";
|
|
46
45
|
tensor: "tensor";
|
|
47
46
|
}>>;
|
|
48
47
|
'flash-attn': import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
@@ -51,6 +50,29 @@ export declare const llmPlugin: {
|
|
|
51
50
|
auto: "auto";
|
|
52
51
|
}>>;
|
|
53
52
|
'tensor-split': import("zod").ZodOptional<import("zod").ZodString>;
|
|
53
|
+
'batch-size': import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
54
|
+
'ubatch-size': import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
55
|
+
'cpu-moe': import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
56
|
+
'n-cpu-moe': import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
57
|
+
'kv-offload': import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
58
|
+
'image-max-tokens': import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
59
|
+
'image-min-tokens': import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
60
|
+
threads: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
61
|
+
'threads-batch': import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
62
|
+
'cpu-mask': import("zod").ZodOptional<import("zod").ZodString>;
|
|
63
|
+
'cpu-mask-batch': import("zod").ZodOptional<import("zod").ZodString>;
|
|
64
|
+
'override-tensor': import("zod").ZodOptional<import("zod").ZodString>;
|
|
65
|
+
'n-cpu-ffn': import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
66
|
+
'moe-cache-mib': import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodNumber, import("zod").ZodLiteral<"auto">]>>;
|
|
67
|
+
'prefetch-weights': import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodBoolean, import("zod").ZodLiteral<"auto">]>>;
|
|
68
|
+
'tensor-read-lazy': import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
69
|
+
on: "on";
|
|
70
|
+
off: "off";
|
|
71
|
+
auto: "auto";
|
|
72
|
+
}>>;
|
|
73
|
+
fit: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
74
|
+
'fit-target': import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodNumber, import("zod").ZodString]>>;
|
|
75
|
+
'fit-ctx': import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
54
76
|
openclCacheDir: import("zod").ZodOptional<import("zod").ZodString>;
|
|
55
77
|
reasoning_budget: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
56
78
|
projectionModelSrc: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
@@ -126,9 +148,28 @@ export declare const llmPlugin: {
|
|
|
126
148
|
'cache-type-k'?: string | undefined;
|
|
127
149
|
'cache-type-v'?: string | undefined;
|
|
128
150
|
'main-gpu'?: number | "integrated" | "dedicated" | undefined;
|
|
129
|
-
'split-mode'?: "none" | "layer" | "
|
|
151
|
+
'split-mode'?: "none" | "layer" | "tensor" | undefined;
|
|
130
152
|
'flash-attn'?: "on" | "off" | "auto" | undefined;
|
|
131
153
|
'tensor-split'?: string | undefined;
|
|
154
|
+
'batch-size'?: number | undefined;
|
|
155
|
+
'ubatch-size'?: number | undefined;
|
|
156
|
+
'cpu-moe'?: boolean | undefined;
|
|
157
|
+
'n-cpu-moe'?: number | undefined;
|
|
158
|
+
'kv-offload'?: boolean | undefined;
|
|
159
|
+
'image-max-tokens'?: number | undefined;
|
|
160
|
+
'image-min-tokens'?: number | undefined;
|
|
161
|
+
threads?: number | undefined;
|
|
162
|
+
'threads-batch'?: number | undefined;
|
|
163
|
+
'cpu-mask'?: string | undefined;
|
|
164
|
+
'cpu-mask-batch'?: string | undefined;
|
|
165
|
+
'override-tensor'?: string | undefined;
|
|
166
|
+
'n-cpu-ffn'?: number | undefined;
|
|
167
|
+
'moe-cache-mib'?: number | "auto" | undefined;
|
|
168
|
+
'prefetch-weights'?: boolean | "auto" | undefined;
|
|
169
|
+
'tensor-read-lazy'?: "on" | "off" | "auto" | undefined;
|
|
170
|
+
fit?: boolean | undefined;
|
|
171
|
+
'fit-target'?: string | number | undefined;
|
|
172
|
+
'fit-ctx'?: number | undefined;
|
|
132
173
|
openclCacheDir?: string | undefined;
|
|
133
174
|
reasoning_budget?: number | undefined;
|
|
134
175
|
image_tile_mode?: "disabled" | "batched" | "sequential" | undefined;
|
|
@@ -159,9 +200,28 @@ export declare const llmPlugin: {
|
|
|
159
200
|
'cache-type-k'?: string | undefined;
|
|
160
201
|
'cache-type-v'?: string | undefined;
|
|
161
202
|
'main-gpu'?: number | "integrated" | "dedicated" | undefined;
|
|
162
|
-
'split-mode'?: "none" | "layer" | "
|
|
203
|
+
'split-mode'?: "none" | "layer" | "tensor" | undefined;
|
|
163
204
|
'flash-attn'?: "on" | "off" | "auto" | undefined;
|
|
164
205
|
'tensor-split'?: string | undefined;
|
|
206
|
+
'batch-size'?: number | undefined;
|
|
207
|
+
'ubatch-size'?: number | undefined;
|
|
208
|
+
'cpu-moe'?: boolean | undefined;
|
|
209
|
+
'n-cpu-moe'?: number | undefined;
|
|
210
|
+
'kv-offload'?: boolean | undefined;
|
|
211
|
+
'image-max-tokens'?: number | undefined;
|
|
212
|
+
'image-min-tokens'?: number | undefined;
|
|
213
|
+
threads?: number | undefined;
|
|
214
|
+
'threads-batch'?: number | undefined;
|
|
215
|
+
'cpu-mask'?: string | undefined;
|
|
216
|
+
'cpu-mask-batch'?: string | undefined;
|
|
217
|
+
'override-tensor'?: string | undefined;
|
|
218
|
+
'n-cpu-ffn'?: number | undefined;
|
|
219
|
+
'moe-cache-mib'?: number | "auto" | undefined;
|
|
220
|
+
'prefetch-weights'?: boolean | "auto" | undefined;
|
|
221
|
+
'tensor-read-lazy'?: "on" | "off" | "auto" | undefined;
|
|
222
|
+
fit?: boolean | undefined;
|
|
223
|
+
'fit-target'?: string | number | undefined;
|
|
224
|
+
'fit-ctx'?: number | undefined;
|
|
165
225
|
openclCacheDir?: string | undefined;
|
|
166
226
|
reasoning_budget?: number | undefined;
|
|
167
227
|
image_tile_mode?: "disabled" | "batched" | "sequential" | undefined;
|
|
@@ -209,6 +269,7 @@ export declare const llmPlugin: {
|
|
|
209
269
|
repeat_penalty: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
210
270
|
reasoning_budget: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
211
271
|
remove_thinking_from_context: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
272
|
+
tool_choice: import("zod").ZodOptional<import("zod").ZodString>;
|
|
212
273
|
}, import("zod/v4/core").$strict>>;
|
|
213
274
|
responseFormat: import("zod").ZodOptional<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
214
275
|
type: import("zod").ZodLiteral<"text">;
|
|
@@ -297,6 +358,7 @@ export declare const llmPlugin: {
|
|
|
297
358
|
generatedTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
298
359
|
emittedTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
299
360
|
avgConcurrentSeq: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
361
|
+
toolDefinitionsDropped: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
300
362
|
backendDevice: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
301
363
|
gpu: "gpu";
|
|
302
364
|
cpu: "cpu";
|
|
@@ -335,6 +397,7 @@ export declare const llmPlugin: {
|
|
|
335
397
|
generatedTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
336
398
|
emittedTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
337
399
|
avgConcurrentSeq: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
400
|
+
toolDefinitionsDropped: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
338
401
|
backendDevice: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
339
402
|
gpu: "gpu";
|
|
340
403
|
cpu: "cpu";
|
|
@@ -384,6 +447,7 @@ export declare const llmPlugin: {
|
|
|
384
447
|
repeat_penalty: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
385
448
|
reasoning_budget: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
386
449
|
remove_thinking_from_context: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
450
|
+
tool_choice: import("zod").ZodOptional<import("zod").ZodString>;
|
|
387
451
|
}, import("zod/v4/core").$strict>>;
|
|
388
452
|
captureThinking: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
389
453
|
emitRawDeltas: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
@@ -459,6 +523,7 @@ export declare const llmPlugin: {
|
|
|
459
523
|
generatedTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
460
524
|
emittedTokens: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
461
525
|
avgConcurrentSeq: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
526
|
+
toolDefinitionsDropped: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
462
527
|
backendDevice: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
463
528
|
gpu: "gpu";
|
|
464
529
|
cpu: "cpu";
|
|
@@ -679,7 +744,7 @@ export declare const llmPlugin: {
|
|
|
679
744
|
}, import("zod/v4/core").$strip>>;
|
|
680
745
|
};
|
|
681
746
|
logging: {
|
|
682
|
-
module: import("@qvac/llm-llamacpp/addonLogging")
|
|
747
|
+
module: () => Promise<typeof import("@qvac/llm-llamacpp/addonLogging")>;
|
|
683
748
|
namespace: "llamacpp-completion";
|
|
684
749
|
};
|
|
685
750
|
};
|
|
@@ -51,7 +51,6 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
51
51
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
52
|
});
|
|
53
53
|
import LlmLlamacpp from '@qvac/llm-llamacpp';
|
|
54
|
-
import llmAddonLogging from '@qvac/llm-llamacpp/addonLogging';
|
|
55
54
|
import { definePlugin, defineHandler, finetuneRequestSchema, batchCompletionStreamRequestSchema, batchCompletionStreamResponseSchema, completionStreamRequestSchema, completionStreamResponseSchema, finetuneResponseSchema, translateRequestSchema, translateResponseSchema, ModelType, llmConfigBaseSchema, ADDON_LLM } from '../../../schemas/index.js';
|
|
56
55
|
import { createStreamLogger, registerAddonLogger, getEngineLogger } from '../../../logging/index.js';
|
|
57
56
|
import { getFirstShardPath } from '../../../utils/index.js';
|
|
@@ -492,7 +491,7 @@ export const llmPlugin = definePlugin({
|
|
|
492
491
|
})
|
|
493
492
|
},
|
|
494
493
|
logging: {
|
|
495
|
-
module:
|
|
494
|
+
module: () => import('@qvac/llm-llamacpp/addonLogging'),
|
|
496
495
|
namespace: ModelType.llamacppCompletion
|
|
497
496
|
}
|
|
498
497
|
});
|
|
@@ -23,5 +23,24 @@ export function transformLlmConfig(llmConfig) {
|
|
|
23
23
|
transformed['openclCacheDir'] = transformed['opencl_cache_dir'];
|
|
24
24
|
delete transformed['opencl_cache_dir'];
|
|
25
25
|
}
|
|
26
|
+
if ('cpu-moe' in transformed) {
|
|
27
|
+
if (transformed['cpu-moe'] === 'true') {
|
|
28
|
+
transformed['cpu-moe'] = '';
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
delete transformed['cpu-moe'];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if ('kv-offload' in transformed) {
|
|
35
|
+
const enabled = transformed['kv-offload'] === 'true';
|
|
36
|
+
delete transformed['kv-offload'];
|
|
37
|
+
transformed[enabled ? 'kv-offload' : 'no-kv-offload'] = '';
|
|
38
|
+
}
|
|
39
|
+
if (transformed['prefetch-weights'] === 'true') {
|
|
40
|
+
transformed['prefetch-weights'] = '1';
|
|
41
|
+
}
|
|
42
|
+
else if (transformed['prefetch-weights'] === 'false') {
|
|
43
|
+
transformed['prefetch-weights'] = '0';
|
|
44
|
+
}
|
|
26
45
|
return transformed;
|
|
27
46
|
}
|
|
@@ -35,7 +35,6 @@ export declare const embeddingsPlugin: {
|
|
|
35
35
|
splitMode: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
36
36
|
none: "none";
|
|
37
37
|
layer: "layer";
|
|
38
|
-
row: "row";
|
|
39
38
|
}>>;
|
|
40
39
|
tensorSplit: import("zod").ZodOptional<import("zod").ZodString>;
|
|
41
40
|
verbosity: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
@@ -74,7 +73,7 @@ export declare const embeddingsPlugin: {
|
|
|
74
73
|
turbovecIndexProvider: TurboVecIndexProvider;
|
|
75
74
|
};
|
|
76
75
|
logging: {
|
|
77
|
-
module: import("@qvac/embed-llamacpp/addonLogging")
|
|
76
|
+
module: () => Promise<typeof import("@qvac/embed-llamacpp/addonLogging")>;
|
|
78
77
|
namespace: "llamacpp-embedding";
|
|
79
78
|
};
|
|
80
79
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import EmbedLlamacpp, { IdMapIndex } from '@qvac/embed-llamacpp';
|
|
2
|
-
import embedAddonLogging from '@qvac/embed-llamacpp/addonLogging';
|
|
3
2
|
import { definePlugin, defineHandler, embedRequestSchema, embedResponseSchema, ModelType, embedConfigBaseSchema, ADDON_EMBEDDING } from '../../../schemas/index.js';
|
|
4
3
|
import { createStreamLogger, registerAddonLogger, getEngineLogger } from '../../../logging/index.js';
|
|
5
4
|
import { getFirstShardPath } from '../../../utils/index.js';
|
|
@@ -7,6 +6,7 @@ import { embed } from '../../ops/embed.js';
|
|
|
7
6
|
import { forwardModelExecution } from '../../../profiling/model-execution.js';
|
|
8
7
|
import { isMobile } from '../../../runtime/state.js';
|
|
9
8
|
import { stripMultiGpuKeys } from '../../../utils/multi-gpu-mobile.js';
|
|
9
|
+
import { transformEmbedConfig } from './transform.js';
|
|
10
10
|
const turbovecIndexProvider = {
|
|
11
11
|
create(options) {
|
|
12
12
|
return new IdMapIndex(options);
|
|
@@ -15,42 +15,6 @@ const turbovecIndexProvider = {
|
|
|
15
15
|
return IdMapIndex.load(snapshotPath);
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
-
function transformEmbedConfig(embedConfig) {
|
|
19
|
-
const config = {
|
|
20
|
-
device: embedConfig.device,
|
|
21
|
-
gpu_layers: `${embedConfig.gpuLayers}`,
|
|
22
|
-
batch_size: `${embedConfig.batchSize}`
|
|
23
|
-
};
|
|
24
|
-
if (embedConfig.flashAttention) {
|
|
25
|
-
config.flash_attn = embedConfig.flashAttention;
|
|
26
|
-
}
|
|
27
|
-
if (embedConfig.pooling) {
|
|
28
|
-
config.pooling = embedConfig.pooling;
|
|
29
|
-
}
|
|
30
|
-
if (embedConfig.attention) {
|
|
31
|
-
config.attention = embedConfig.attention;
|
|
32
|
-
}
|
|
33
|
-
if (typeof embedConfig.embdNormalize === 'number') {
|
|
34
|
-
config.embd_normalize = `${embedConfig.embdNormalize}`;
|
|
35
|
-
}
|
|
36
|
-
if (embedConfig.mainGpu !== undefined) {
|
|
37
|
-
config['main-gpu'] =
|
|
38
|
-
typeof embedConfig.mainGpu === 'number' ? `${embedConfig.mainGpu}` : embedConfig.mainGpu;
|
|
39
|
-
}
|
|
40
|
-
if (embedConfig.splitMode) {
|
|
41
|
-
config['split-mode'] = embedConfig.splitMode;
|
|
42
|
-
}
|
|
43
|
-
if (embedConfig.tensorSplit) {
|
|
44
|
-
config['tensor-split'] = embedConfig.tensorSplit;
|
|
45
|
-
}
|
|
46
|
-
if (typeof embedConfig.verbosity === 'number') {
|
|
47
|
-
config.verbosity = `${embedConfig.verbosity}`;
|
|
48
|
-
}
|
|
49
|
-
if (embedConfig.openclCacheDir) {
|
|
50
|
-
config.openclCacheDir = embedConfig.openclCacheDir;
|
|
51
|
-
}
|
|
52
|
-
return config;
|
|
53
|
-
}
|
|
54
18
|
function createEmbeddingsModel(modelId, modelPath, embedConfig) {
|
|
55
19
|
const logger = createStreamLogger(modelId, ModelType.llamacppEmbedding);
|
|
56
20
|
registerAddonLogger(modelId, ModelType.llamacppEmbedding, logger);
|
|
@@ -105,7 +69,7 @@ export const embeddingsPlugin = definePlugin({
|
|
|
105
69
|
turbovecIndexProvider
|
|
106
70
|
},
|
|
107
71
|
logging: {
|
|
108
|
-
module:
|
|
72
|
+
module: () => import('@qvac/embed-llamacpp/addonLogging'),
|
|
109
73
|
namespace: ModelType.llamacppEmbedding
|
|
110
74
|
}
|
|
111
75
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { GGMLConfig } from '@qvac/embed-llamacpp';
|
|
2
|
+
import { type EmbedConfig } from '../../../schemas/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Converts an EmbedConfig into the flat string-keyed map the C++ addon expects.
|
|
5
|
+
*
|
|
6
|
+
* Extracted from the plugin so the advisory fit check can build its request
|
|
7
|
+
* from the same transform the real embedding load uses.
|
|
8
|
+
*/
|
|
9
|
+
export declare function transformEmbedConfig(embedConfig: EmbedConfig): GGMLConfig;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts an EmbedConfig into the flat string-keyed map the C++ addon expects.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from the plugin so the advisory fit check can build its request
|
|
5
|
+
* from the same transform the real embedding load uses.
|
|
6
|
+
*/
|
|
7
|
+
export function transformEmbedConfig(embedConfig) {
|
|
8
|
+
const config = {
|
|
9
|
+
device: embedConfig.device,
|
|
10
|
+
gpu_layers: `${embedConfig.gpuLayers}`,
|
|
11
|
+
batch_size: `${embedConfig.batchSize}`
|
|
12
|
+
};
|
|
13
|
+
if (embedConfig.flashAttention) {
|
|
14
|
+
config.flash_attn = embedConfig.flashAttention;
|
|
15
|
+
}
|
|
16
|
+
if (embedConfig.pooling) {
|
|
17
|
+
config.pooling = embedConfig.pooling;
|
|
18
|
+
}
|
|
19
|
+
if (embedConfig.attention) {
|
|
20
|
+
config.attention = embedConfig.attention;
|
|
21
|
+
}
|
|
22
|
+
if (typeof embedConfig.embdNormalize === 'number') {
|
|
23
|
+
config.embd_normalize = `${embedConfig.embdNormalize}`;
|
|
24
|
+
}
|
|
25
|
+
if (embedConfig.mainGpu !== undefined) {
|
|
26
|
+
config['main-gpu'] =
|
|
27
|
+
typeof embedConfig.mainGpu === 'number' ? `${embedConfig.mainGpu}` : embedConfig.mainGpu;
|
|
28
|
+
}
|
|
29
|
+
if (embedConfig.splitMode) {
|
|
30
|
+
config['split-mode'] = embedConfig.splitMode;
|
|
31
|
+
}
|
|
32
|
+
if (embedConfig.tensorSplit) {
|
|
33
|
+
config['tensor-split'] = embedConfig.tensorSplit;
|
|
34
|
+
}
|
|
35
|
+
if (typeof embedConfig.verbosity === 'number') {
|
|
36
|
+
config.verbosity = `${embedConfig.verbosity}`;
|
|
37
|
+
}
|
|
38
|
+
if (embedConfig.openclCacheDir) {
|
|
39
|
+
config.openclCacheDir = embedConfig.openclCacheDir;
|
|
40
|
+
}
|
|
41
|
+
return config;
|
|
42
|
+
}
|
|
@@ -451,7 +451,7 @@ export declare const nmtPlugin: {
|
|
|
451
451
|
}, import("zod/v4/core").$strip>>;
|
|
452
452
|
};
|
|
453
453
|
logging: {
|
|
454
|
-
module: import("@qvac/translation-nmtcpp/addonLogging")
|
|
454
|
+
module: () => Promise<typeof import("@qvac/translation-nmtcpp/addonLogging")>;
|
|
455
455
|
namespace: "nmtcpp-translation";
|
|
456
456
|
};
|
|
457
457
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import nmtAddonLogging from '@qvac/translation-nmtcpp/addonLogging';
|
|
2
1
|
import TranslationNmtcpp from '@qvac/translation-nmtcpp';
|
|
3
2
|
import { definePlugin, defineHandler, translateRequestSchema, translateResponseSchema, ModelType, nmtConfigBaseSchema, ADDON_NMT, BERGAMOT_CJK_LANG_PAIRS } from '../../../schemas/index.js';
|
|
4
3
|
import { createStreamLogger, registerAddonLogger } from '../../../logging/index.js';
|
|
@@ -138,7 +137,7 @@ export const nmtPlugin = definePlugin({
|
|
|
138
137
|
})
|
|
139
138
|
},
|
|
140
139
|
logging: {
|
|
141
|
-
module:
|
|
140
|
+
module: () => import('@qvac/translation-nmtcpp/addonLogging'),
|
|
142
141
|
namespace: ModelType.nmtcppTranslation
|
|
143
142
|
}
|
|
144
143
|
});
|
|
@@ -127,7 +127,7 @@ export declare const parakeetPlugin: {
|
|
|
127
127
|
}, import("zod/v4/core").$strip>>;
|
|
128
128
|
};
|
|
129
129
|
logging: {
|
|
130
|
-
module: import("@qvac/asr-ggml/addonLogging")
|
|
130
|
+
module: () => Promise<typeof import("@qvac/asr-ggml/addonLogging")>;
|
|
131
131
|
namespace: "@qvac/asr-ggml";
|
|
132
132
|
};
|
|
133
133
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import asrAddonLogging from '@qvac/asr-ggml/addonLogging';
|
|
2
1
|
import ASRGgml from '@qvac/asr-ggml';
|
|
3
2
|
import { definePlugin, defineHandler, defineDuplexHandler, transcribeRequestSchema, transcribeResponseSchema, transcribeStreamRequestSchema, transcribeStreamResponseSchema, ModelType, parakeetLoadConfigSchema, LEGACY_PARAKEET_ONNX_MODEL_CONFIG_FIELDS, ADDON_ASR } from '../../../schemas/index.js';
|
|
4
3
|
import { ModelLoadFailedError, TranscriptionFailedError, LegacyParakeetModelDeprecatedError } from '../../../errors/index.js';
|
|
@@ -135,7 +134,7 @@ export const parakeetPlugin = definePlugin({
|
|
|
135
134
|
})
|
|
136
135
|
},
|
|
137
136
|
logging: {
|
|
138
|
-
module:
|
|
137
|
+
module: () => import('@qvac/asr-ggml/addonLogging'),
|
|
139
138
|
namespace: ADDON_ASR
|
|
140
139
|
}
|
|
141
140
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VideoStableDiffusion } from '@qvac/diffusion-cpp';
|
|
2
2
|
import { type VideoRequest, type VideoStreamResponse } from '../../../../schemas/sdcpp-config.js';
|
|
3
3
|
export declare function markLtxVideoModel(model: VideoStableDiffusion): void;
|
|
4
|
+
export declare function markH3VideoModel(model: VideoStableDiffusion): void;
|
|
4
5
|
export declare function markMoeCapableVideoModel(model: VideoStableDiffusion): void;
|
|
5
6
|
export declare function video(request: VideoRequest): AsyncGenerator<VideoStreamResponse>;
|
|
@@ -60,12 +60,16 @@ import { generateRandomRequestId } from '../../../../runtime/request-id.js';
|
|
|
60
60
|
import { ModelOperationNotSupportedError, PluginRequestValidationFailedError } from '../../../../errors/index.js';
|
|
61
61
|
import { formatZodError } from '../../../../utils/zod-error.js';
|
|
62
62
|
import { ModelType } from '../../../../schemas/index.js';
|
|
63
|
-
import { ltxVideoRequestSchema, nonLtxVideoRequestSchema, sdcppConfigSchema, singleExpertVideoRequestSchema } from '../../../../schemas/sdcpp-config.js';
|
|
63
|
+
import { ltxVideoRequestSchema, h3VideoRequestSchema, wanVideoRequestSchema, nonLtxVideoRequestSchema, sdcppConfigSchema, singleExpertVideoRequestSchema } from '../../../../schemas/sdcpp-config.js';
|
|
64
64
|
const ltxVideoModels = new WeakSet();
|
|
65
|
+
const h3VideoModels = new WeakSet();
|
|
65
66
|
const moeCapableVideoModels = new WeakSet();
|
|
66
67
|
export function markLtxVideoModel(model) {
|
|
67
68
|
ltxVideoModels.add(model);
|
|
68
69
|
}
|
|
70
|
+
export function markH3VideoModel(model) {
|
|
71
|
+
h3VideoModels.add(model);
|
|
72
|
+
}
|
|
69
73
|
export function markMoeCapableVideoModel(model) {
|
|
70
74
|
moeCapableVideoModels.add(model);
|
|
71
75
|
}
|
|
@@ -117,8 +121,10 @@ export async function* video(request) {
|
|
|
117
121
|
const model = asVideoModel(getModel(request.modelId), request.modelId);
|
|
118
122
|
if (ltxVideoModels.has(model))
|
|
119
123
|
parseVideoRequest(ltxVideoRequestSchema, request);
|
|
120
|
-
else
|
|
124
|
+
else {
|
|
121
125
|
parseVideoRequest(nonLtxVideoRequestSchema, request);
|
|
126
|
+
parseVideoRequest(h3VideoModels.has(model) ? h3VideoRequestSchema : wanVideoRequestSchema, request);
|
|
127
|
+
}
|
|
122
128
|
if (!moeCapableVideoModels.has(model))
|
|
123
129
|
parseVideoRequest(singleExpertVideoRequestSchema, request);
|
|
124
130
|
validateProviderPaths(request);
|
|
@@ -38,6 +38,7 @@ export declare const diffusionPlugin: {
|
|
|
38
38
|
auto: "auto";
|
|
39
39
|
f32: "f32";
|
|
40
40
|
f16: "f16";
|
|
41
|
+
q8_0: "q8_0";
|
|
41
42
|
bf16: "bf16";
|
|
42
43
|
q2_k: "q2_k";
|
|
43
44
|
q3_k: "q3_k";
|
|
@@ -48,7 +49,6 @@ export declare const diffusionPlugin: {
|
|
|
48
49
|
q5_1: "q5_1";
|
|
49
50
|
q5_k: "q5_k";
|
|
50
51
|
q6_k: "q6_k";
|
|
51
|
-
q8_0: "q8_0";
|
|
52
52
|
}>>;
|
|
53
53
|
rng: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
54
54
|
cpu: "cpu";
|
|
@@ -60,12 +60,17 @@ export declare const diffusionPlugin: {
|
|
|
60
60
|
cuda: "cuda";
|
|
61
61
|
std_default: "std_default";
|
|
62
62
|
}>>;
|
|
63
|
-
clip_on_cpu: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
64
|
-
vae_on_cpu: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
65
63
|
vae_auto_cpu_fallback: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
66
64
|
vae_auto_cpu_fallback_memory_ratio: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
67
65
|
vae_tiling: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
68
66
|
offload_to_cpu: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
67
|
+
control_net_cpu: import("zod").ZodOptional<import("zod").ZodCustom<never, never>>;
|
|
68
|
+
clip_on_cpu: import("zod").ZodOptional<import("zod").ZodCustom<never, never>>;
|
|
69
|
+
vae_on_cpu: import("zod").ZodOptional<import("zod").ZodCustom<never, never>>;
|
|
70
|
+
backend: import("zod").ZodOptional<import("zod").ZodString>;
|
|
71
|
+
params_backend: import("zod").ZodOptional<import("zod").ZodString>;
|
|
72
|
+
max_vram: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodNumber, import("zod").ZodString]>>;
|
|
73
|
+
stream_layers: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
69
74
|
flash_attn: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
70
75
|
diffusion_fa: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
71
76
|
lora_apply_mode: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
@@ -899,7 +904,7 @@ export declare const diffusionPlugin: {
|
|
|
899
904
|
}, import("zod/v4/core").$strip>>;
|
|
900
905
|
};
|
|
901
906
|
logging: {
|
|
902
|
-
module: import("@qvac/diffusion-cpp/addonLogging")
|
|
907
|
+
module: () => Promise<typeof import("@qvac/diffusion-cpp/addonLogging")>;
|
|
903
908
|
namespace: "sdcpp-generation";
|
|
904
909
|
};
|
|
905
910
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import ImgStableDiffusion, { EsrganUpscaler, VideoStableDiffusion } from '@qvac/diffusion-cpp';
|
|
2
|
-
import addonLogging from '@qvac/diffusion-cpp/addonLogging';
|
|
3
2
|
import { definePlugin, defineHandler, sdcppConfigSchema, diffusionRequestSchema, diffusionStreamResponseSchema, videoRequestSchema, videoStreamResponseSchema, upscaleRequestSchema, upscaleStreamResponseSchema, worldSceneRequestSchema, worldSceneStreamResponseSchema, worldStepRequestSchema, worldStepStreamResponseSchema, ModelType, ADDON_DIFFUSION } from '../../../schemas/index.js';
|
|
4
3
|
import { createStreamLogger, registerAddonLogger, getEngineLogger } from '../../../logging/index.js';
|
|
5
4
|
import { ModelLoadFailedError } from '../../../errors/index.js';
|
|
6
5
|
import { isMobile } from '../../../runtime/state.js';
|
|
7
6
|
import { stripMultiGpuKeys } from '../../../utils/multi-gpu-mobile.js';
|
|
8
7
|
import { diffusion } from './ops/diffusion.js';
|
|
9
|
-
import { markLtxVideoModel, markMoeCapableVideoModel, video } from './ops/video.js';
|
|
8
|
+
import { markLtxVideoModel, markH3VideoModel, markMoeCapableVideoModel, video } from './ops/video.js';
|
|
10
9
|
import { upscale } from './ops/upscale.js';
|
|
11
10
|
import { createWorldSession, worldCreateScene, worldScenePath, worldStep } from './ops/world.js';
|
|
12
11
|
// Single source of truth for `SdcppConfig.upscaler.*` → addon-config key
|
|
@@ -111,6 +110,7 @@ export const diffusionPlugin = definePlugin({
|
|
|
111
110
|
const worldEquivalent = {
|
|
112
111
|
device: 'world.backend',
|
|
113
112
|
'main-gpu': 'world.backend',
|
|
113
|
+
backend: 'world.backend',
|
|
114
114
|
threads: 'world.threads',
|
|
115
115
|
offload_to_cpu: 'world.offloadParamsToCpu'
|
|
116
116
|
};
|
|
@@ -145,20 +145,29 @@ export const diffusionPlugin = definePlugin({
|
|
|
145
145
|
return { config: cfg };
|
|
146
146
|
}
|
|
147
147
|
const { clipLModelSrc, clipGModelSrc, clipVisionModelSrc, t5XxlModelSrc, llmModelSrc, vaeModelSrc, highNoiseDiffusionModelSrc, uncondModelSrc, audioVaeModelSrc, embeddingsConnectorsModelSrc, taehvModelSrc, sceneSrc, upscaler, ...rest } = cfg;
|
|
148
|
-
// audioVae / embeddingsConnectors are LTX-2 video companions. Reject them
|
|
149
|
-
// up front — before any companion download — when the selected layout
|
|
150
|
-
// can't consume them, instead of silently resolving the file and then
|
|
151
|
-
// dropping it in createModel. Both fields are new, so this cannot break
|
|
152
|
-
// existing callers.
|
|
153
148
|
if (embeddingsConnectorsModelSrc && cfg.mode !== 'video') {
|
|
154
149
|
throw new ModelLoadFailedError('modelConfig.embeddingsConnectorsModelSrc selects the LTX-2 video ' +
|
|
155
150
|
"layout and is only valid with mode: 'video'.");
|
|
156
151
|
}
|
|
157
|
-
if (audioVaeModelSrc &&
|
|
158
|
-
throw new ModelLoadFailedError(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
152
|
+
if (audioVaeModelSrc && cfg.mode !== 'video') {
|
|
153
|
+
throw new ModelLoadFailedError("modelConfig.audioVaeModelSrc requires mode: 'video' (LTX-2 or MiniMax-H3).");
|
|
154
|
+
}
|
|
155
|
+
// `t5XxlModelSrc` selects Wan and `llmModelSrc` is ignored for that layout.
|
|
156
|
+
// Without T5, `llmModelSrc` plus both VAEs selects MiniMax-H3. Reject the
|
|
157
|
+
// companions H3 cannot consume before any of them is downloaded.
|
|
158
|
+
if (cfg.mode === 'video' &&
|
|
159
|
+
!embeddingsConnectorsModelSrc &&
|
|
160
|
+
(audioVaeModelSrc || (llmModelSrc && !t5XxlModelSrc))) {
|
|
161
|
+
if (!audioVaeModelSrc || !llmModelSrc || !vaeModelSrc) {
|
|
162
|
+
throw new ModelLoadFailedError('MiniMax-H3 requires llmModelSrc, vaeModelSrc and audioVaeModelSrc.');
|
|
163
|
+
}
|
|
164
|
+
if (t5XxlModelSrc ||
|
|
165
|
+
highNoiseDiffusionModelSrc ||
|
|
166
|
+
clipVisionModelSrc ||
|
|
167
|
+
clipLModelSrc ||
|
|
168
|
+
clipGModelSrc) {
|
|
169
|
+
throw new ModelLoadFailedError('MiniMax-H3 cannot use Wan T5, high-noise, CLIP-vision or CLIP-L/G companions.');
|
|
170
|
+
}
|
|
162
171
|
}
|
|
163
172
|
// Video does not apply ESRGAN, so the whole `upscaler` object is dropped.
|
|
164
173
|
// World does not either, but it REJECTS the field above rather than dropping
|
|
@@ -287,15 +296,17 @@ export const diffusionPlugin = definePlugin({
|
|
|
287
296
|
return { model };
|
|
288
297
|
}
|
|
289
298
|
if (config.mode === 'video') {
|
|
290
|
-
//
|
|
291
|
-
//
|
|
292
|
-
//
|
|
293
|
-
//
|
|
294
|
-
//
|
|
299
|
+
// Companion layout selection, mirroring how the addon self-detects it:
|
|
300
|
+
// the LTX-2 text-embedding connectors switch to the LTX-2 layout (Gemma
|
|
301
|
+
// via llm + video VAE + connectors, optional audio VAE —
|
|
302
|
+
// `SdModel::isLtxModel_ = !embeddingsConnectorsPath.empty()`); without
|
|
303
|
+
// them, an audio VAE (or an llm with no Wan T5) means MiniMax-H3
|
|
304
|
+
// (llm + video VAE + audio VAE); everything else is Wan via t5Xxl.
|
|
305
|
+
// Native code verifies the model's tensors.
|
|
295
306
|
const embeddingsConnectorsModelPath = artifacts?.['embeddingsConnectorsModelPath'];
|
|
296
307
|
if (!artifacts?.['vaeModelPath']) {
|
|
297
308
|
throw new ModelLoadFailedError('modelConfig.vaeModelSrc is required in video mode. ' +
|
|
298
|
-
'Provide the Wan
|
|
309
|
+
'Provide the Wan, LTX-2 or MiniMax-H3 video VAE before loading the video pipeline.');
|
|
299
310
|
}
|
|
300
311
|
const vaeModelPath = artifacts['vaeModelPath'];
|
|
301
312
|
let files;
|
|
@@ -315,6 +326,25 @@ export const diffusionPlugin = definePlugin({
|
|
|
315
326
|
...(artifacts['esrganModelPath'] && { esrgan: artifacts['esrganModelPath'] })
|
|
316
327
|
};
|
|
317
328
|
}
|
|
329
|
+
else if (artifacts['audioVaeModelPath'] ||
|
|
330
|
+
(artifacts['llmModelPath'] && !artifacts['t5XxlModelPath'])) {
|
|
331
|
+
if (!artifacts['audioVaeModelPath'] || !artifacts['llmModelPath']) {
|
|
332
|
+
throw new ModelLoadFailedError('MiniMax-H3 requires llmModelSrc, vaeModelSrc and audioVaeModelSrc.');
|
|
333
|
+
}
|
|
334
|
+
if (artifacts['t5XxlModelPath'] ||
|
|
335
|
+
artifacts['highNoiseDiffusionModelPath'] ||
|
|
336
|
+
artifacts['clipVisionModelPath'] ||
|
|
337
|
+
artifacts['clipLModelPath'] ||
|
|
338
|
+
artifacts['clipGModelPath']) {
|
|
339
|
+
throw new ModelLoadFailedError('MiniMax-H3 cannot use Wan T5, high-noise, CLIP-vision or CLIP-L/G companions.');
|
|
340
|
+
}
|
|
341
|
+
files = {
|
|
342
|
+
model: modelPath,
|
|
343
|
+
vae: vaeModelPath,
|
|
344
|
+
llm: artifacts['llmModelPath'],
|
|
345
|
+
audioVae: artifacts['audioVaeModelPath']
|
|
346
|
+
};
|
|
347
|
+
}
|
|
318
348
|
else {
|
|
319
349
|
if (!artifacts['t5XxlModelPath']) {
|
|
320
350
|
throw new ModelLoadFailedError('modelConfig.t5XxlModelSrc is required in video mode. ' +
|
|
@@ -344,6 +374,8 @@ export const diffusionPlugin = definePlugin({
|
|
|
344
374
|
});
|
|
345
375
|
if (embeddingsConnectorsModelPath)
|
|
346
376
|
markLtxVideoModel(model);
|
|
377
|
+
else if (files.audioVae)
|
|
378
|
+
markH3VideoModel(model);
|
|
347
379
|
if (files.highNoiseDiffusionModel)
|
|
348
380
|
markMoeCapableVideoModel(model);
|
|
349
381
|
return { model };
|
|
@@ -425,7 +457,7 @@ export const diffusionPlugin = definePlugin({
|
|
|
425
457
|
})
|
|
426
458
|
},
|
|
427
459
|
logging: {
|
|
428
|
-
module: addonLogging,
|
|
460
|
+
module: () => import('@qvac/diffusion-cpp/addonLogging'),
|
|
429
461
|
namespace: ModelType.sdcppGeneration
|
|
430
462
|
}
|
|
431
463
|
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AbortSignal } from 'bare-abort-controller';
|
|
2
|
+
/**
|
|
3
|
+
* The abort is persistent state, not a one-shot poke. The addon's `cancel()`
|
|
4
|
+
* only reaches a native job that is live at that instant, and every chunked
|
|
5
|
+
* path (`stream: true`, `sentenceStream`, the duplex session) runs one native
|
|
6
|
+
* job per sentence — so a cancel that lands between two jobs is a native
|
|
7
|
+
* no-op and synthesis would carry on. Ops call this on every chunk: once the
|
|
8
|
+
* signal is aborted it re-issues the cancel (the next job is live by then),
|
|
9
|
+
* and returns true so the caller drops the output instead of forwarding it.
|
|
10
|
+
*/
|
|
11
|
+
export declare function cancelIfAborted(model: unknown, signal: AbortSignal): Promise<boolean>;
|
|
12
|
+
/**
|
|
13
|
+
* Open the request-registry context that makes the model-scoped hard cancel
|
|
14
|
+
* both TTS handlers advertise actually work, and bind its abort signal to the
|
|
15
|
+
* addon's `cancel()`.
|
|
16
|
+
*
|
|
17
|
+
* `cancel: { scope: 'model', hard: true }` is a claim the runtime does not
|
|
18
|
+
* enforce on its own: `cancelByModelId` walks the request registry, so a run
|
|
19
|
+
* that never opened a context is invisible to it — a caller's `cancel()` would
|
|
20
|
+
* resolve with `cancelled: 0` while the native job ran to completion. Same
|
|
21
|
+
* shape as the transcription and audiogen ops.
|
|
22
|
+
*
|
|
23
|
+
* The returned context is an async disposable: callers must take it with
|
|
24
|
+
* `await using`, and must bail out when `ctx.signal.aborted` is already true on
|
|
25
|
+
* return — a queued request can resume from `begin()` already aborted, and it
|
|
26
|
+
* never owned the model slot, so cancelling then would interrupt the run that
|
|
27
|
+
* does.
|
|
28
|
+
*/
|
|
29
|
+
export declare function bindTtsCancel(model: unknown, modelId: string, requestId?: string): Promise<import("../../../../runtime/index.js").ManagedRequestContext>;
|