@qvac/inference 0.18.2 → 0.19.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 +69 -36
- package/README.md +1 -5
- package/dist/api/assess-model-fit.d.ts +16 -0
- package/dist/api/assess-model-fit.js +27 -0
- package/dist/api/audio-gen.d.ts +4 -4
- package/dist/api/audio-gen.js +17 -6
- package/dist/api/completion-stream.d.ts +1 -1
- package/dist/api/completion-stream.js +1 -1
- package/dist/api/delete-cache.d.ts +7 -1
- package/dist/api/delete-cache.js +11 -1
- package/dist/api/download-asset.d.ts +1 -1
- package/dist/api/download-asset.js +2 -2
- package/dist/api/finetune.js +1 -1
- package/dist/api/get-loaded-model-info.d.ts +6 -10
- package/dist/api/get-loaded-model-info.js +6 -10
- package/dist/api/heartbeat.d.ts +5 -22
- package/dist/api/heartbeat.js +6 -23
- package/dist/api/index.d.ts +36 -35
- package/dist/api/index.js +35 -35
- package/dist/api/load-model.d.ts +5 -1
- package/dist/api/load-model.js +3 -5
- package/dist/api/logging-stream-registry.js +1 -1
- package/dist/api/resume.d.ts +0 -3
- package/dist/api/resume.js +0 -3
- package/dist/api/subscribe-logs.js +1 -1
- package/dist/api/suspend.d.ts +0 -4
- package/dist/api/suspend.js +0 -4
- package/dist/api/translate.d.ts +3 -1
- package/dist/api/translate.js +16 -8
- package/dist/api/unload-model.js +3 -5
- package/dist/api/video-request.d.ts +207 -0
- package/dist/api/video-request.js +18 -0
- package/dist/api/video.d.ts +22 -2
- package/dist/api/video.js +25 -15
- package/dist/api/vla-helpers.d.ts +1 -2
- package/dist/api/vla-helpers.js +1 -2
- package/dist/api/vla.js +1 -1
- package/dist/api/world-result.d.ts +71 -0
- package/dist/api/world-result.js +293 -0
- package/dist/api/world.d.ts +143 -0
- package/dist/api/world.js +71 -0
- package/dist/config/resolve-config.d.ts +1 -1
- package/dist/config/resolve-config.js +1 -1
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/index.js +2 -2
- package/dist/dispatch.js +15 -28
- package/dist/errors/index.d.ts +35 -31
- package/dist/errors/index.js +66 -56
- package/dist/handlers/assess-model-fit.d.ts +10 -0
- package/dist/handlers/assess-model-fit.js +75 -0
- package/dist/handlers/cancelHandler.js +1 -1
- package/dist/handlers/completion-orchestrate.js +1 -1
- package/dist/handlers/delete-cache.js +3 -0
- package/dist/handlers/download-asset.js +6 -5
- package/dist/handlers/finetune.js +1 -1
- package/dist/handlers/get-loaded-model-info.js +0 -12
- package/dist/handlers/get-model-info.js +1 -1
- package/dist/handlers/get-system-resources.js +8 -0
- package/dist/handlers/load-model/download-manager.d.ts +1 -1
- package/dist/handlers/load-model/download-stats.d.ts +3 -3
- package/dist/handlers/load-model/download-stats.js +5 -5
- package/dist/handlers/load-model/handler.js +6 -8
- package/dist/handlers/load-model/http-verify.d.ts +20 -0
- package/dist/handlers/load-model/http-verify.js +54 -0
- package/dist/handlers/load-model/http.d.ts +12 -2
- package/dist/handlers/load-model/http.js +119 -230
- package/dist/handlers/load-model/hyperdrive.d.ts +1 -1
- package/dist/handlers/load-model/hyperdrive.js +1 -1
- package/dist/handlers/load-model/index.d.ts +2 -2
- package/dist/handlers/load-model/index.js +2 -2
- package/dist/handlers/load-model/registry-companion-set.d.ts +1 -1
- package/dist/handlers/load-model/registry-companion-set.js +1 -1
- package/dist/handlers/load-model/registry-download-utils.d.ts +3 -3
- package/dist/handlers/load-model/registry-download-utils.js +2 -2
- package/dist/handlers/load-model/registry.d.ts +2 -2
- package/dist/handlers/load-model/registry.js +4 -4
- package/dist/handlers/load-model/resolve-session.d.ts +8 -1
- package/dist/handlers/load-model/resolve-session.js +12 -9
- package/dist/handlers/load-model/resolve.d.ts +4 -4
- package/dist/handlers/load-model/resolve.js +18 -16
- package/dist/handlers/load-model/safe-fetch.d.ts +44 -0
- package/dist/handlers/load-model/safe-fetch.js +143 -0
- package/dist/handlers/load-model/types.d.ts +9 -0
- package/dist/handlers/plugin-dispatch.js +1 -4
- package/dist/handlers/plugin-invoke.js +1 -4
- package/dist/handlers/types.d.ts +0 -2
- package/dist/handlers/unload-model.js +1 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/logging/addon.d.ts +1 -1
- package/dist/logging/addon.js +1 -1
- package/dist/logging/index.d.ts +5 -5
- package/dist/logging/index.js +4 -4
- package/dist/logging/logger.d.ts +1 -1
- package/dist/logging/logger.js +2 -2
- package/dist/models/registry/index.d.ts +1 -1
- package/dist/models/registry/index.js +2 -2
- package/dist/models/registry/models.d.ts +250 -0
- package/dist/models/registry/models.js +2071 -1806
- package/dist/models/registry/resource-profiles.d.ts +18 -0
- package/dist/models/registry/resource-profiles.js +4934 -0
- package/dist/plugins/builtin/audiogen-ggml/config.d.ts +14 -0
- package/dist/plugins/builtin/audiogen-ggml/config.js +23 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +47 -5
- package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +134 -4
- package/dist/plugins/builtin/audiogen-ggml/plugin.js +47 -28
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +1 -1
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +3 -3
- package/dist/plugins/builtin/ggml-classification/plugin.js +1 -1
- package/dist/plugins/builtin/ggml-ocr/plugin.js +2 -2
- package/dist/plugins/builtin/ggml-vla/plugin.d.ts +1 -1
- package/dist/plugins/builtin/ggml-vla/plugin.js +3 -3
- package/dist/plugins/builtin/index.d.ts +12 -12
- package/dist/plugins/builtin/index.js +12 -12
- package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +2 -2
- 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.js +37 -26
- package/dist/plugins/builtin/llamacpp-completion/ops/context-overflow.d.ts +12 -11
- package/dist/plugins/builtin/llamacpp-completion/ops/context-overflow.js +133 -41
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.d.ts +15 -4
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.js +79 -17
- package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +22 -8
- package/dist/plugins/builtin/llamacpp-completion/plugin.js +10 -13
- package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +4 -0
- package/dist/plugins/builtin/llamacpp-embedding/plugin.js +13 -2
- package/dist/plugins/builtin/nmtcpp-translation/plugin.js +2 -2
- package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +2 -2
- package/dist/plugins/builtin/parakeet-transcription/plugin.js +3 -3
- package/dist/plugins/builtin/sdcpp-generation/ops/upscale.js +1 -1
- package/dist/plugins/builtin/sdcpp-generation/ops/video.js +32 -2
- package/dist/plugins/builtin/sdcpp-generation/ops/world.d.ts +126 -0
- package/dist/plugins/builtin/sdcpp-generation/ops/world.js +820 -0
- package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +153 -4
- package/dist/plugins/builtin/sdcpp-generation/plugin.js +134 -13
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.js +1 -1
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +1 -1
- package/dist/plugins/builtin/tts-ggml/plugin.js +2 -2
- package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +2 -2
- package/dist/plugins/builtin/whispercpp-transcription/plugin.js +3 -3
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +2 -2
- package/dist/plugins/ops/kv-cache-utils.js +1 -1
- package/dist/plugins/ops/load-model.js +1 -1
- package/dist/plugins/ops/transcribe.js +2 -2
- package/dist/plugins/ops/translate.js +4 -12
- package/dist/plugins/ops/unload-model.js +19 -21
- package/dist/plugins/registry.d.ts +1 -0
- package/dist/plugins/registry.js +12 -0
- package/dist/profiling/aggregator.d.ts +1 -1
- package/dist/profiling/aggregator.js +1 -1
- package/dist/profiling/controller.d.ts +1 -1
- package/dist/profiling/controller.js +2 -2
- package/dist/profiling/envelope.d.ts +0 -1
- package/dist/profiling/envelope.js +0 -10
- package/dist/profiling/events.d.ts +2 -3
- package/dist/profiling/events.js +2 -9
- package/dist/profiling/exporters.d.ts +1 -1
- package/dist/profiling/exporters.js +3 -3
- package/dist/profiling/index.d.ts +13 -14
- package/dist/profiling/index.js +12 -13
- package/dist/profiling/operation-metrics.d.ts +1 -1
- package/dist/profiling/operation-metrics.js +35 -2
- package/dist/profiling/operation-wrappers.js +12 -15
- package/dist/profiling/profiler.d.ts +1 -2
- package/dist/profiling/profiler.js +7 -26
- package/dist/profiling/types.d.ts +1 -1
- package/dist/rag/handler.js +1 -1
- package/dist/rag/handlers/close-workspace.js +1 -1
- package/dist/rag/handlers/delete-embeddings.js +1 -1
- package/dist/rag/handlers/delete-workspace.js +2 -6
- package/dist/rag/handlers/ingest.js +1 -1
- package/dist/rag/handlers/list-workspaces.d.ts +1 -1
- package/dist/rag/handlers/list-workspaces.js +1 -1
- package/dist/rag/handlers/reindex.js +1 -1
- package/dist/rag/handlers/save-embeddings.js +1 -1
- package/dist/rag/handlers/search.js +1 -1
- package/dist/rag/index.d.ts +11 -11
- package/dist/rag/index.js +11 -11
- package/dist/rag/rag-workspace-manager.d.ts +4 -2
- package/dist/rag/rag-workspace-manager.js +268 -15
- package/dist/registry.js +8 -58
- package/dist/resources/collector.d.ts +3 -1
- package/dist/resources/collector.js +91 -9
- package/dist/resources/instance.d.ts +1 -1
- package/dist/resources/instance.js +1 -1
- package/dist/resources/model-fit/assess.d.ts +36 -0
- package/dist/resources/model-fit/assess.js +679 -0
- package/dist/resources/model-fit/calibration/darwin-arm64.d.ts +8 -0
- package/dist/resources/model-fit/calibration/darwin-arm64.js +36 -0
- package/dist/resources/model-fit/calibration/darwin-x64.d.ts +8 -0
- package/dist/resources/model-fit/calibration/darwin-x64.js +38 -0
- package/dist/resources/model-fit/calibration/fit.d.ts +73 -0
- package/dist/resources/model-fit/calibration/fit.js +152 -0
- package/dist/resources/model-fit/calibration/index.d.ts +37 -0
- package/dist/resources/model-fit/calibration/index.js +75 -0
- package/dist/resources/model-fit/calibration/linux-arm64.d.ts +8 -0
- package/dist/resources/model-fit/calibration/linux-arm64.js +38 -0
- package/dist/resources/model-fit/calibration/linux-x64-vulkan.d.ts +8 -0
- package/dist/resources/model-fit/calibration/linux-x64-vulkan.js +39 -0
- package/dist/resources/model-fit/calibration/linux-x64.d.ts +8 -0
- package/dist/resources/model-fit/calibration/linux-x64.js +38 -0
- package/dist/resources/model-fit/calibration/win32-x64-vulkan-shared.d.ts +8 -0
- package/dist/resources/model-fit/calibration/win32-x64-vulkan-shared.js +39 -0
- package/dist/resources/model-fit/calibration/win32-x64-vulkan.d.ts +8 -0
- package/dist/resources/model-fit/calibration/win32-x64-vulkan.js +36 -0
- package/dist/resources/model-fit/calibration/win32-x64.d.ts +8 -0
- package/dist/resources/model-fit/calibration/win32-x64.js +38 -0
- package/dist/resources/model-fit/estimators/llm.d.ts +46 -0
- package/dist/resources/model-fit/estimators/llm.js +222 -0
- package/dist/resources/model-fit/estimators/whisper.d.ts +10 -0
- package/dist/resources/model-fit/estimators/whisper.js +77 -0
- package/dist/resources/model-fit/floor.d.ts +31 -0
- package/dist/resources/model-fit/floor.js +65 -0
- package/dist/resources/model-fit/types.d.ts +120 -0
- package/dist/resources/model-fit/types.js +1 -0
- package/dist/resources/native.d.ts +1 -1
- package/dist/resources/native.js +15 -0
- package/dist/resources/normalize.d.ts +1 -1
- package/dist/resources/types.d.ts +14 -0
- package/dist/runtime/index.d.ts +5 -5
- package/dist/runtime/index.js +2 -2
- package/dist/runtime/lifecycle.js +5 -7
- package/dist/runtime/model-registry.d.ts +0 -14
- package/dist/runtime/model-registry.js +17 -40
- package/dist/runtime/registry-client.js +1 -1
- package/dist/runtime/request-context.d.ts +3 -3
- package/dist/runtime/request-context.js +13 -1
- package/dist/runtime/request-registry.d.ts +1 -1
- package/dist/runtime/request-registry.js +4 -5
- package/dist/runtime/state.d.ts +1 -1
- package/dist/runtime/state.js +18 -3
- package/dist/schemas/assess-model-fit.d.ts +311 -0
- package/dist/schemas/assess-model-fit.js +182 -0
- package/dist/schemas/audio-gen.d.ts +437 -7
- package/dist/schemas/audio-gen.js +131 -19
- package/dist/schemas/batch-completion-stream.d.ts +5 -2
- package/dist/schemas/batch-completion-stream.js +3 -3
- package/dist/schemas/bci-config.js +73 -27
- package/dist/schemas/bci.d.ts +3 -3
- package/dist/schemas/bci.js +5 -5
- package/dist/schemas/cancel.d.ts +5 -0
- package/dist/schemas/cancel.js +1 -0
- package/dist/schemas/classification.js +13 -6
- package/dist/schemas/common.d.ts +695 -335
- package/dist/schemas/common.js +33 -31
- package/dist/schemas/completion-event.d.ts +5 -2
- package/dist/schemas/completion-event.js +2 -1
- package/dist/schemas/completion-stream.d.ts +3 -5
- package/dist/schemas/completion-stream.js +4 -8
- package/dist/schemas/config.d.ts +640 -18
- package/dist/schemas/config.js +50 -8
- package/dist/schemas/download-asset.d.ts +19 -1
- package/dist/schemas/download-asset.js +20 -4
- package/dist/schemas/engine-addon-map.d.ts +1 -1
- package/dist/schemas/engine-addon-map.js +3 -3
- package/dist/schemas/error.d.ts +2 -2
- package/dist/schemas/error.js +2 -2
- package/dist/schemas/errors.d.ts +2 -6
- package/dist/schemas/errors.js +30 -40
- package/dist/schemas/heartbeat.d.ts +10 -0
- package/dist/schemas/heartbeat.js +8 -0
- package/dist/schemas/index.d.ts +46 -44
- package/dist/schemas/index.js +45 -43
- package/dist/schemas/llamacpp-config.d.ts +32 -10
- package/dist/schemas/llamacpp-config.js +11 -8
- package/dist/schemas/load-model.d.ts +2902 -1857
- package/dist/schemas/load-model.js +52 -52
- package/dist/schemas/mcp-adapter.d.ts +1 -1
- package/dist/schemas/model-config-schemas.d.ts +2354 -0
- package/dist/schemas/model-config-schemas.js +46 -0
- package/dist/schemas/model-info.d.ts +10 -20
- package/dist/schemas/model-info.js +4 -25
- package/dist/schemas/model-ops.d.ts +3 -1
- package/dist/schemas/model-ops.js +7 -2
- package/dist/schemas/model-resource-profile.d.ts +109 -0
- package/dist/schemas/model-resource-profile.js +83 -0
- package/dist/schemas/model-src-utils.d.ts +1 -0
- package/dist/schemas/model-src-utils.js +33 -13
- package/dist/schemas/ocr.js +48 -13
- package/dist/schemas/path-validation.js +8 -2
- package/dist/schemas/plugin.d.ts +23 -10
- package/dist/schemas/plugin.js +11 -0
- package/dist/schemas/profiling.d.ts +138 -43
- package/dist/schemas/profiling.js +1 -22
- package/dist/schemas/rag.js +1 -1
- package/dist/schemas/registry.js +1 -1
- package/dist/schemas/reload-config.d.ts +0 -2
- package/dist/schemas/reload-config.js +2 -3
- package/dist/schemas/sdcpp-config.d.ts +344 -4
- package/dist/schemas/sdcpp-config.js +504 -17
- package/dist/schemas/system-resources.d.ts +138 -0
- package/dist/schemas/system-resources.js +3 -1
- package/dist/schemas/text-to-speech.js +183 -76
- package/dist/schemas/transcription-config.js +253 -85
- package/dist/schemas/transcription.d.ts +3 -3
- package/dist/schemas/translate.d.ts +2 -2
- package/dist/schemas/translate.js +1 -1
- package/dist/schemas/translation-config.js +53 -25
- package/dist/schemas/vla.d.ts +1 -1
- package/dist/selection.d.ts +1 -5
- package/dist/selection.js +2 -6
- package/dist/surface.d.ts +1 -1
- package/dist/utils/addon-responses.d.ts +1 -0
- package/dist/utils/aggregate-events.d.ts +1 -1
- package/dist/utils/aggregate-events.js +2 -2
- package/dist/utils/archive.js +2 -2
- package/dist/utils/audio-input.js +1 -1
- package/dist/utils/cache/auto-history.d.ts +1 -1
- package/dist/utils/cache/auto-history.js +1 -1
- package/dist/utils/cache/paths.js +5 -5
- package/dist/utils/completion-normalizer.js +1 -1
- package/dist/utils/gguf-tensor-extractor.js +1 -1
- package/dist/utils/image-dimensions.d.ts +26 -0
- package/dist/utils/image-dimensions.js +46 -0
- package/dist/utils/index.d.ts +13 -10
- package/dist/utils/index.js +13 -10
- package/dist/utils/mcp-adapter.d.ts +1 -1
- package/dist/utils/mcp-adapter.js +1 -1
- package/dist/utils/path-sanitize.d.ts +7 -0
- package/dist/utils/path-sanitize.js +36 -0
- package/dist/utils/path-security.d.ts +0 -7
- package/dist/utils/path-security.js +1 -36
- package/dist/utils/shard-utils.js +3 -3
- package/dist/utils/tool-integration.js +1 -1
- package/dist/utils/tools/dialect.js +1 -1
- package/dist/utils/tools/index.d.ts +2 -2
- package/dist/utils/tools/index.js +2 -2
- package/dist/utils/tools/parser.js +8 -8
- package/dist/utils/tools/parsers/dsml.d.ts +1 -1
- package/dist/utils/tools/parsers/dsml.js +1 -1
- package/dist/utils/tools/parsers/gemma4native.d.ts +1 -1
- package/dist/utils/tools/parsers/gemma4native.js +1 -1
- package/dist/utils/tools/parsers/harmony.d.ts +1 -1
- package/dist/utils/tools/parsers/harmony.js +1 -1
- package/dist/utils/tools/parsers/hermes.d.ts +1 -1
- package/dist/utils/tools/parsers/hermes.js +1 -1
- package/dist/utils/tools/parsers/json.d.ts +1 -1
- package/dist/utils/tools/parsers/json.js +1 -1
- package/dist/utils/tools/parsers/pythonic.d.ts +1 -1
- package/dist/utils/tools/parsers/pythonic.js +1 -1
- package/dist/utils/tools/parsers/qwen35.d.ts +1 -1
- package/dist/utils/tools/parsers/qwen35.js +3 -3
- package/dist/utils/url-security.d.ts +17 -0
- package/dist/utils/url-security.js +75 -0
- package/package.json +31 -26
- package/dist/api/provide.d.ts +0 -23
- package/dist/api/provide.js +0 -32
- package/dist/api/stop-provider.d.ts +0 -20
- package/dist/api/stop-provider.js +0 -30
- package/dist/p2p/cancel-delegated.d.ts +0 -3
- package/dist/p2p/cancel-delegated.js +0 -64
- package/dist/p2p/completion-stream-delegated.d.ts +0 -4
- package/dist/p2p/completion-stream-delegated.js +0 -51
- package/dist/p2p/delegate-client.d.ts +0 -9
- package/dist/p2p/delegate-client.js +0 -219
- package/dist/p2p/delegate-connect-diagnostics.d.ts +0 -8
- package/dist/p2p/delegate-connect-diagnostics.js +0 -38
- package/dist/p2p/delegate-transport.d.ts +0 -18
- package/dist/p2p/delegate-transport.js +0 -237
- package/dist/p2p/error-handlers.d.ts +0 -4
- package/dist/p2p/error-handlers.js +0 -31
- package/dist/p2p/handle-request.d.ts +0 -2
- package/dist/p2p/handle-request.js +0 -171
- package/dist/p2p/handler-utils.d.ts +0 -19
- package/dist/p2p/handler-utils.js +0 -180
- package/dist/p2p/heartbeat-delegated.d.ts +0 -3
- package/dist/p2p/heartbeat-delegated.js +0 -32
- package/dist/p2p/load-model-delegated.d.ts +0 -6
- package/dist/p2p/load-model-delegated.js +0 -132
- package/dist/p2p/progress-throttle.d.ts +0 -7
- package/dist/p2p/progress-throttle.js +0 -47
- package/dist/p2p/provideHandler/connection.d.ts +0 -2
- package/dist/p2p/provideHandler/connection.js +0 -38
- package/dist/p2p/provideHandler/handler.d.ts +0 -2
- package/dist/p2p/provideHandler/handler.js +0 -66
- package/dist/p2p/provideHandler/proxy.d.ts +0 -2
- package/dist/p2p/provideHandler/proxy.js +0 -24
- package/dist/p2p/provideHandler.d.ts +0 -1
- package/dist/p2p/provideHandler.js +0 -2
- package/dist/p2p/rpc-utils.d.ts +0 -4
- package/dist/p2p/rpc-utils.js +0 -8
- package/dist/p2p/stopProvideHandler.d.ts +0 -2
- package/dist/p2p/stopProvideHandler.js +0 -29
- package/dist/p2p/swarm.d.ts +0 -9
- package/dist/p2p/swarm.js +0 -103
- package/dist/p2p/transport-selector.d.ts +0 -2
- package/dist/p2p/transport-selector.js +0 -18
- package/dist/p2p/unload-model-delegated.d.ts +0 -2
- package/dist/p2p/unload-model-delegated.js +0 -31
- package/dist/profiling/delegation-profiler.d.ts +0 -31
- package/dist/profiling/delegation-profiler.js +0 -155
- package/dist/schemas/delegate.d.ts +0 -29
- package/dist/schemas/delegate.js +0 -40
- package/dist/schemas/provide.d.ts +0 -50
- package/dist/schemas/provide.js +0 -32
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { type CreateModelParams, type PluginModelResult, type ResolveContext, type ResolveResult, type SdcppConfig } from '../../../schemas/index.js';
|
|
2
|
-
type DiffusionArtifactKey = 'clipLModelPath' | 'clipGModelPath' | 'clipVisionModelPath' | 't5XxlModelPath' | 'llmModelPath' | 'vaeModelPath' | 'highNoiseDiffusionModelPath' | 'uncondModelPath' | 'audioVaeModelPath' | 'embeddingsConnectorsModelPath' | 'esrganModelPath';
|
|
2
|
+
type DiffusionArtifactKey = 'clipLModelPath' | 'clipGModelPath' | 'clipVisionModelPath' | 't5XxlModelPath' | 'llmModelPath' | 'vaeModelPath' | 'highNoiseDiffusionModelPath' | 'uncondModelPath' | 'audioVaeModelPath' | 'embeddingsConnectorsModelPath' | 'esrganModelPath' | 'taehvModelPath' | 'seedScenePath';
|
|
3
3
|
/**
|
|
4
4
|
* Stable-diffusion.cpp plugin for image diffusion, upscaling, and Wan video.
|
|
5
5
|
*
|
|
6
6
|
* Video mode is supported on React Native, but the QVAC-published Wan model
|
|
7
|
-
* set is too large to load on typical mobile devices.
|
|
8
|
-
* pass a `delegate` to `loadModel(...)` to run video generation on a
|
|
9
|
-
* desktop peer instead of loading the model on-device.
|
|
7
|
+
* set is too large to load on typical mobile devices.
|
|
10
8
|
*/
|
|
11
9
|
export declare const diffusionPlugin: {
|
|
12
10
|
modelType: "sdcpp-generation";
|
|
@@ -15,6 +13,7 @@ export declare const diffusionPlugin: {
|
|
|
15
13
|
loadConfigSchema: import("zod").ZodObject<{
|
|
16
14
|
mode: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
17
15
|
diffusion: "diffusion";
|
|
16
|
+
world: "world";
|
|
18
17
|
upscale: "upscale";
|
|
19
18
|
video: "video";
|
|
20
19
|
}>>;
|
|
@@ -63,6 +62,8 @@ export declare const diffusionPlugin: {
|
|
|
63
62
|
}>>;
|
|
64
63
|
clip_on_cpu: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
65
64
|
vae_on_cpu: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
65
|
+
vae_auto_cpu_fallback: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
66
|
+
vae_auto_cpu_fallback_memory_ratio: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
66
67
|
vae_tiling: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
67
68
|
offload_to_cpu: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
68
69
|
flash_attn: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
@@ -463,6 +464,95 @@ export declare const diffusionPlugin: {
|
|
|
463
464
|
classification: "classification";
|
|
464
465
|
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
465
466
|
}, import("zod/v4/core").$strip>]>>;
|
|
467
|
+
taehvModelSrc: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
468
|
+
src: import("zod").ZodString;
|
|
469
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
470
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
471
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
472
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
473
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
474
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
475
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
476
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
477
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
478
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
479
|
+
embeddings: "embeddings";
|
|
480
|
+
diffusion: "diffusion";
|
|
481
|
+
audiogen: "audiogen";
|
|
482
|
+
tts: "tts";
|
|
483
|
+
ocr: "ocr";
|
|
484
|
+
vla: "vla";
|
|
485
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
486
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
487
|
+
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
488
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
489
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
490
|
+
"onnx-tts": "onnx-tts";
|
|
491
|
+
"tts-ggml": "tts-ggml";
|
|
492
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
493
|
+
"ggml-ocr": "ggml-ocr";
|
|
494
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
495
|
+
"audiogen-ggml": "audiogen-ggml";
|
|
496
|
+
"ggml-vla": "ggml-vla";
|
|
497
|
+
"ggml-classification": "ggml-classification";
|
|
498
|
+
llm: "llm";
|
|
499
|
+
whisper: "whisper";
|
|
500
|
+
bci: "bci";
|
|
501
|
+
nmt: "nmt";
|
|
502
|
+
parakeet: "parakeet";
|
|
503
|
+
classification: "classification";
|
|
504
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
505
|
+
}, import("zod/v4/core").$strip>]>>;
|
|
506
|
+
sceneSrc: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
507
|
+
src: import("zod").ZodString;
|
|
508
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
509
|
+
modelId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
510
|
+
registryPath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
511
|
+
registrySource: import("zod").ZodOptional<import("zod").ZodString>;
|
|
512
|
+
blobCoreKey: import("zod").ZodOptional<import("zod").ZodString>;
|
|
513
|
+
blobIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
514
|
+
engine: import("zod").ZodOptional<import("zod").ZodString>;
|
|
515
|
+
expectedSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
516
|
+
sha256Checksum: import("zod").ZodOptional<import("zod").ZodString>;
|
|
517
|
+
addon: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodEnum<{
|
|
518
|
+
embeddings: "embeddings";
|
|
519
|
+
diffusion: "diffusion";
|
|
520
|
+
audiogen: "audiogen";
|
|
521
|
+
tts: "tts";
|
|
522
|
+
ocr: "ocr";
|
|
523
|
+
vla: "vla";
|
|
524
|
+
"llamacpp-completion": "llamacpp-completion";
|
|
525
|
+
"whispercpp-transcription": "whispercpp-transcription";
|
|
526
|
+
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
527
|
+
"llamacpp-embedding": "llamacpp-embedding";
|
|
528
|
+
"nmtcpp-translation": "nmtcpp-translation";
|
|
529
|
+
"onnx-tts": "onnx-tts";
|
|
530
|
+
"tts-ggml": "tts-ggml";
|
|
531
|
+
"parakeet-transcription": "parakeet-transcription";
|
|
532
|
+
"ggml-ocr": "ggml-ocr";
|
|
533
|
+
"sdcpp-generation": "sdcpp-generation";
|
|
534
|
+
"audiogen-ggml": "audiogen-ggml";
|
|
535
|
+
"ggml-vla": "ggml-vla";
|
|
536
|
+
"ggml-classification": "ggml-classification";
|
|
537
|
+
llm: "llm";
|
|
538
|
+
whisper: "whisper";
|
|
539
|
+
bci: "bci";
|
|
540
|
+
nmt: "nmt";
|
|
541
|
+
parakeet: "parakeet";
|
|
542
|
+
classification: "classification";
|
|
543
|
+
}>, import("zod").ZodLiteral<"vad">]>>;
|
|
544
|
+
}, import("zod/v4/core").$strip>]>>;
|
|
545
|
+
world: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
546
|
+
seed: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
547
|
+
threads: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodLiteral<-1>, import("zod").ZodNumber]>>;
|
|
548
|
+
backend: import("zod").ZodOptional<import("zod").ZodString>;
|
|
549
|
+
numFramePerBlock: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
550
|
+
localAttnSize: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
551
|
+
offloadParamsToCpu: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
552
|
+
frameJpegQuality: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
553
|
+
kvCache: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
554
|
+
profile: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
555
|
+
}, import("zod/v4/core").$strict>>;
|
|
466
556
|
upscaler: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
467
557
|
type: import("zod").ZodOptional<import("zod").ZodLiteral<"esrgan">>;
|
|
468
558
|
model_src: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
@@ -597,6 +687,10 @@ export declare const diffusionPlugin: {
|
|
|
597
687
|
requestId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
598
688
|
prompt: import("zod").ZodString;
|
|
599
689
|
negative_prompt: import("zod").ZodOptional<import("zod").ZodString>;
|
|
690
|
+
lora: import("zod").ZodOptional<import("zod").ZodString>;
|
|
691
|
+
lora_strength: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
692
|
+
stg_scale: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
693
|
+
stg_block: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
600
694
|
width: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
601
695
|
height: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
602
696
|
video_frames: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
@@ -631,6 +725,7 @@ export declare const diffusionPlugin: {
|
|
|
631
725
|
smoothstep: "smoothstep";
|
|
632
726
|
kl_optimal: "kl_optimal";
|
|
633
727
|
bong_tangent: "bong_tangent";
|
|
728
|
+
ltx2: "ltx2";
|
|
634
729
|
}>>;
|
|
635
730
|
cfg_scale: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
636
731
|
flow_shift: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
@@ -689,6 +784,9 @@ export declare const diffusionPlugin: {
|
|
|
689
784
|
}>;
|
|
690
785
|
init_image: import("zod").ZodOptional<import("zod").ZodString>;
|
|
691
786
|
strength: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
787
|
+
reference_images: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
788
|
+
reference_attention_strength: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
789
|
+
reference_downscale_factor: import("zod").ZodOptional<import("zod").ZodLiteral<1>>;
|
|
692
790
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
693
791
|
type: import("zod").ZodLiteral<"videoStream">;
|
|
694
792
|
step: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
@@ -748,6 +846,57 @@ export declare const diffusionPlugin: {
|
|
|
748
846
|
}>>;
|
|
749
847
|
}, import("zod/v4/core").$strip>>;
|
|
750
848
|
}, import("zod/v4/core").$strip>>;
|
|
849
|
+
worldStepStream: import("../../../schemas/index.js").PluginHandlerDefinition<import("zod").ZodObject<{
|
|
850
|
+
modelId: import("zod").ZodString;
|
|
851
|
+
requestId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
852
|
+
keys: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodEnum<{
|
|
853
|
+
W: "W";
|
|
854
|
+
A: "A";
|
|
855
|
+
S: "S";
|
|
856
|
+
D: "D";
|
|
857
|
+
I: "I";
|
|
858
|
+
J: "J";
|
|
859
|
+
K: "K";
|
|
860
|
+
L: "L";
|
|
861
|
+
}>>>;
|
|
862
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
863
|
+
type: import("zod").ZodLiteral<"worldStepStream">;
|
|
864
|
+
step: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
865
|
+
totalSteps: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
866
|
+
elapsedMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
867
|
+
data: import("zod").ZodOptional<import("zod").ZodString>;
|
|
868
|
+
frameIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
869
|
+
done: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
870
|
+
stats: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
871
|
+
modelLoadMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
872
|
+
stepMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
873
|
+
totalStepMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
874
|
+
totalSteps: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
875
|
+
totalFrames: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
876
|
+
frames: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
877
|
+
width: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
878
|
+
height: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
879
|
+
actionMask: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
880
|
+
}, import("zod/v4/core").$strip>>;
|
|
881
|
+
}, import("zod/v4/core").$strip>>;
|
|
882
|
+
worldSceneStream: import("../../../schemas/index.js").PluginHandlerDefinition<import("zod").ZodObject<{
|
|
883
|
+
modelId: import("zod").ZodString;
|
|
884
|
+
requestId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
885
|
+
prompt: import("zod").ZodString;
|
|
886
|
+
image: import("zod").ZodString;
|
|
887
|
+
width: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
888
|
+
height: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
889
|
+
returnPack: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
890
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
891
|
+
type: import("zod").ZodLiteral<"worldSceneStream">;
|
|
892
|
+
data: import("zod").ZodOptional<import("zod").ZodString>;
|
|
893
|
+
done: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
894
|
+
stats: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
895
|
+
sceneCreateMs: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
896
|
+
width: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
897
|
+
height: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
898
|
+
}, import("zod/v4/core").$strip>>;
|
|
899
|
+
}, import("zod/v4/core").$strip>>;
|
|
751
900
|
};
|
|
752
901
|
logging: {
|
|
753
902
|
module: import("@qvac/diffusion-cpp/addonLogging").AddonLogging;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import ImgStableDiffusion, { EsrganUpscaler, VideoStableDiffusion } from '@qvac/diffusion-cpp';
|
|
2
2
|
import addonLogging from '@qvac/diffusion-cpp/addonLogging';
|
|
3
|
-
import { definePlugin, defineHandler, sdcppConfigSchema, diffusionRequestSchema, diffusionStreamResponseSchema, videoRequestSchema, videoStreamResponseSchema, upscaleRequestSchema, upscaleStreamResponseSchema, ModelType, ADDON_DIFFUSION } from '../../../schemas/index.js';
|
|
3
|
+
import { definePlugin, defineHandler, sdcppConfigSchema, diffusionRequestSchema, diffusionStreamResponseSchema, videoRequestSchema, videoStreamResponseSchema, upscaleRequestSchema, upscaleStreamResponseSchema, worldSceneRequestSchema, worldSceneStreamResponseSchema, worldStepRequestSchema, worldStepStreamResponseSchema, ModelType, ADDON_DIFFUSION } from '../../../schemas/index.js';
|
|
4
4
|
import { createStreamLogger, registerAddonLogger, getEngineLogger } from '../../../logging/index.js';
|
|
5
5
|
import { ModelLoadFailedError } from '../../../errors/index.js';
|
|
6
6
|
import { isMobile } from '../../../runtime/state.js';
|
|
7
7
|
import { stripMultiGpuKeys } from '../../../utils/multi-gpu-mobile.js';
|
|
8
|
-
import { diffusion } from '
|
|
9
|
-
import { markLtxVideoModel, markMoeCapableVideoModel, video } from '
|
|
10
|
-
import { upscale } from '
|
|
8
|
+
import { diffusion } from './ops/diffusion.js';
|
|
9
|
+
import { markLtxVideoModel, markMoeCapableVideoModel, video } from './ops/video.js';
|
|
10
|
+
import { upscale } from './ops/upscale.js';
|
|
11
|
+
import { createWorldSession, worldCreateScene, worldScenePath, worldStep } from './ops/world.js';
|
|
11
12
|
// Single source of truth for `SdcppConfig.upscaler.*` → addon-config key
|
|
12
13
|
// mapping. Used by both the diffusion-mode (post-generation upscaler) and the
|
|
13
14
|
// standalone-upscale-mode branches; keeping the mapping in one place avoids
|
|
@@ -44,9 +45,7 @@ function toEsrganAddonConfig(config) {
|
|
|
44
45
|
* Stable-diffusion.cpp plugin for image diffusion, upscaling, and Wan video.
|
|
45
46
|
*
|
|
46
47
|
* Video mode is supported on React Native, but the QVAC-published Wan model
|
|
47
|
-
* set is too large to load on typical mobile devices.
|
|
48
|
-
* pass a `delegate` to `loadModel(...)` to run video generation on a
|
|
49
|
-
* desktop peer instead of loading the model on-device.
|
|
48
|
+
* set is too large to load on typical mobile devices.
|
|
50
49
|
*/
|
|
51
50
|
export const diffusionPlugin = definePlugin({
|
|
52
51
|
modelType: ModelType.sdcppGeneration,
|
|
@@ -74,13 +73,78 @@ export const diffusionPlugin = definePlugin({
|
|
|
74
73
|
'cannot be combined with modelConfig.embeddingsConnectorsModelSrc ' +
|
|
75
74
|
'(which selects the LTX-2 layout).');
|
|
76
75
|
}
|
|
76
|
+
// ABot-World fields describe a walk session and have no meaning in any
|
|
77
|
+
// other layout, so reject them up front rather than resolving files the
|
|
78
|
+
// selected mode will drop.
|
|
79
|
+
if (cfg.mode !== 'world') {
|
|
80
|
+
const stray = ['taehvModelSrc', 'sceneSrc', 'world'].find((key) => cfg[key] !== undefined);
|
|
81
|
+
if (stray) {
|
|
82
|
+
throw new ModelLoadFailedError(`modelConfig.${stray} is ABot-World only. Use mode: 'world' or remove it.`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
// The mirror of the rule above, as an ALLOW-list rather than a deny-list.
|
|
87
|
+
// Only `config.world` and the four world artifact sources reach the walk
|
|
88
|
+
// session; every other field the SCHEMA KNOWS is accepted by it and then
|
|
89
|
+
// silently dropped.
|
|
90
|
+
//
|
|
91
|
+
// Scope worth being exact about: `sdcppConfigSchema` is not `.strict()`,
|
|
92
|
+
// so a field it does not know — a typo'd `taehvModelSrcc`, say — is
|
|
93
|
+
// stripped by Zod before this ever runs, and this list cannot see it.
|
|
94
|
+
// That is whole-schema behaviour shared with every other mode, not
|
|
95
|
+
// something world can change here. That splits into two kinds of harm, and a deny-list
|
|
96
|
+
// would have to be extended by hand every time a diffusion or video field
|
|
97
|
+
// is added:
|
|
98
|
+
// - compute keys such as `device: 'cpu'` — the escape hatch every other
|
|
99
|
+
// mode honours — hand back a GPU session with no feedback;
|
|
100
|
+
// - companion SOURCES such as `clipLModelSrc` are resolved below, which
|
|
101
|
+
// DOWNLOADS them, before createModel throws them away.
|
|
102
|
+
const worldSupported = new Set([
|
|
103
|
+
'mode',
|
|
104
|
+
'taehvModelSrc',
|
|
105
|
+
'sceneSrc',
|
|
106
|
+
'world',
|
|
107
|
+
't5XxlModelSrc',
|
|
108
|
+
'vaeModelSrc'
|
|
109
|
+
]);
|
|
110
|
+
// Where world has a nested equivalent, name it — the rest just say so.
|
|
111
|
+
const worldEquivalent = {
|
|
112
|
+
device: 'world.backend',
|
|
113
|
+
'main-gpu': 'world.backend',
|
|
114
|
+
threads: 'world.threads',
|
|
115
|
+
offload_to_cpu: 'world.offloadParamsToCpu'
|
|
116
|
+
};
|
|
117
|
+
const unsupported = Object.keys(cfg).filter((key) => !worldSupported.has(key) && cfg[key] !== undefined);
|
|
118
|
+
if (unsupported.length > 0) {
|
|
119
|
+
const key = unsupported[0];
|
|
120
|
+
const pointer = worldEquivalent[key];
|
|
121
|
+
throw new ModelLoadFailedError(`modelConfig.${key} does not reach the ABot-World session. ` +
|
|
122
|
+
(pointer
|
|
123
|
+
? `Use modelConfig.${pointer} instead, which is forwarded to it.`
|
|
124
|
+
: 'World mode accepts only taehvModelSrc, sceneSrc, t5XxlModelSrc, ' +
|
|
125
|
+
'vaeModelSrc and the world block; nothing else reaches the walk ' +
|
|
126
|
+
'session.') +
|
|
127
|
+
(unsupported.length > 1 ? ` Also unsupported: ${unsupported.slice(1).join(', ')}.` : ''));
|
|
128
|
+
}
|
|
129
|
+
if (!cfg.taehvModelSrc) {
|
|
130
|
+
throw new ModelLoadFailedError('modelConfig.taehvModelSrc is required in world mode. Provide the taew2_2 ' +
|
|
131
|
+
'pixel decoder before loading the walk session.');
|
|
132
|
+
}
|
|
133
|
+
// A session that can neither walk an existing world nor build one is
|
|
134
|
+
// inert; say so now rather than after downloading ~5.5 GB of DiT.
|
|
135
|
+
if (!cfg.sceneSrc && (!cfg.t5XxlModelSrc || !cfg.vaeModelSrc)) {
|
|
136
|
+
throw new ModelLoadFailedError('World mode needs either modelConfig.sceneSrc (walk an existing world) or ' +
|
|
137
|
+
'both modelConfig.t5XxlModelSrc (umT5-XXL) and modelConfig.vaeModelSrc ' +
|
|
138
|
+
'(Wan2.2 VAE) so worldCreateScene can build one.');
|
|
139
|
+
}
|
|
140
|
+
}
|
|
77
141
|
// Standalone-upscaler mode never references auxiliary models: the primary
|
|
78
142
|
// modelSrc IS the ESRGAN file. Skip resolution to avoid downloading
|
|
79
143
|
// unused encoders/VAEs and to keep load fast.
|
|
80
144
|
if (cfg.mode === 'upscale') {
|
|
81
145
|
return { config: cfg };
|
|
82
146
|
}
|
|
83
|
-
const { clipLModelSrc, clipGModelSrc, clipVisionModelSrc, t5XxlModelSrc, llmModelSrc, vaeModelSrc, highNoiseDiffusionModelSrc, uncondModelSrc, audioVaeModelSrc, embeddingsConnectorsModelSrc, upscaler, ...rest } = cfg;
|
|
147
|
+
const { clipLModelSrc, clipGModelSrc, clipVisionModelSrc, t5XxlModelSrc, llmModelSrc, vaeModelSrc, highNoiseDiffusionModelSrc, uncondModelSrc, audioVaeModelSrc, embeddingsConnectorsModelSrc, taehvModelSrc, sceneSrc, upscaler, ...rest } = cfg;
|
|
84
148
|
// audioVae / embeddingsConnectors are LTX-2 video companions. Reject them
|
|
85
149
|
// up front — before any companion download — when the selected layout
|
|
86
150
|
// can't consume them, instead of silently resolving the file and then
|
|
@@ -96,7 +160,9 @@ export const diffusionPlugin = definePlugin({
|
|
|
96
160
|
'(which selects the LTX-2 layout). Add embeddingsConnectorsModelSrc ' +
|
|
97
161
|
'or remove audioVaeModelSrc.');
|
|
98
162
|
}
|
|
99
|
-
// Video
|
|
163
|
+
// Video does not apply ESRGAN, so the whole `upscaler` object is dropped.
|
|
164
|
+
// World does not either, but it REJECTS the field above rather than dropping
|
|
165
|
+
// it silently, so it cannot reach here.
|
|
100
166
|
const effectiveUpscaler = cfg.mode === 'video' ? undefined : upscaler;
|
|
101
167
|
const { model_src: esrganModelSrc, ...upscalerRuntime } = effectiveUpscaler ?? {};
|
|
102
168
|
const runtimeConfig = {
|
|
@@ -114,14 +180,16 @@ export const diffusionPlugin = definePlugin({
|
|
|
114
180
|
uncondModelSrc,
|
|
115
181
|
audioVaeModelSrc,
|
|
116
182
|
embeddingsConnectorsModelSrc,
|
|
117
|
-
esrganModelSrc
|
|
183
|
+
esrganModelSrc,
|
|
184
|
+
taehvModelSrc,
|
|
185
|
+
sceneSrc
|
|
118
186
|
};
|
|
119
187
|
const hasSources = Object.values(sources).some(Boolean);
|
|
120
188
|
if (!hasSources) {
|
|
121
189
|
return { config: runtimeConfig };
|
|
122
190
|
}
|
|
123
191
|
const resolve = ctx.resolveModelPath;
|
|
124
|
-
const [clipLModelPath, clipGModelPath, clipVisionModelPath, t5XxlModelPath, llmModelPath, vaeModelPath, highNoiseDiffusionModelPath, uncondModelPath, audioVaeModelPath, embeddingsConnectorsModelPath, esrganModelPath] = await Promise.all([
|
|
192
|
+
const [clipLModelPath, clipGModelPath, clipVisionModelPath, t5XxlModelPath, llmModelPath, vaeModelPath, highNoiseDiffusionModelPath, uncondModelPath, audioVaeModelPath, embeddingsConnectorsModelPath, esrganModelPath, taehvModelPath, seedScenePath] = await Promise.all([
|
|
125
193
|
clipLModelSrc ? resolve(clipLModelSrc) : undefined,
|
|
126
194
|
clipGModelSrc ? resolve(clipGModelSrc) : undefined,
|
|
127
195
|
clipVisionModelSrc ? resolve(clipVisionModelSrc) : undefined,
|
|
@@ -132,7 +200,9 @@ export const diffusionPlugin = definePlugin({
|
|
|
132
200
|
uncondModelSrc ? resolve(uncondModelSrc) : undefined,
|
|
133
201
|
audioVaeModelSrc ? resolve(audioVaeModelSrc) : undefined,
|
|
134
202
|
embeddingsConnectorsModelSrc ? resolve(embeddingsConnectorsModelSrc) : undefined,
|
|
135
|
-
esrganModelSrc ? resolve(esrganModelSrc) : undefined
|
|
203
|
+
esrganModelSrc ? resolve(esrganModelSrc) : undefined,
|
|
204
|
+
taehvModelSrc ? resolve(taehvModelSrc) : undefined,
|
|
205
|
+
sceneSrc ? resolve(sceneSrc) : undefined
|
|
136
206
|
]);
|
|
137
207
|
return {
|
|
138
208
|
config: runtimeConfig,
|
|
@@ -147,7 +217,9 @@ export const diffusionPlugin = definePlugin({
|
|
|
147
217
|
...(uncondModelPath && { uncondModelPath }),
|
|
148
218
|
...(audioVaeModelPath && { audioVaeModelPath }),
|
|
149
219
|
...(embeddingsConnectorsModelPath && { embeddingsConnectorsModelPath }),
|
|
150
|
-
...(esrganModelPath && { esrganModelPath })
|
|
220
|
+
...(esrganModelPath && { esrganModelPath }),
|
|
221
|
+
...(taehvModelPath && { taehvModelPath }),
|
|
222
|
+
...(seedScenePath && { seedScenePath })
|
|
151
223
|
}
|
|
152
224
|
};
|
|
153
225
|
},
|
|
@@ -185,6 +257,35 @@ export const diffusionPlugin = definePlugin({
|
|
|
185
257
|
});
|
|
186
258
|
return { model };
|
|
187
259
|
}
|
|
260
|
+
if (config.mode === 'world') {
|
|
261
|
+
if (!artifacts?.['taehvModelPath']) {
|
|
262
|
+
throw new ModelLoadFailedError('modelConfig.taehvModelSrc is required in world mode. ' +
|
|
263
|
+
'Provide the taew2_2 pixel decoder before loading the walk session.');
|
|
264
|
+
}
|
|
265
|
+
// Only the `world` block reaches the native session. The flat
|
|
266
|
+
// stable-diffusion.cpp keys describe a sampler pipeline the walk session
|
|
267
|
+
// does not have, and unknown keys are silently ignored natively — so
|
|
268
|
+
// forwarding them would look supported and do nothing.
|
|
269
|
+
const model = createWorldSession({
|
|
270
|
+
modelId,
|
|
271
|
+
files: {
|
|
272
|
+
model: modelPath,
|
|
273
|
+
taehv: artifacts['taehvModelPath'],
|
|
274
|
+
scene: worldScenePath(modelId)
|
|
275
|
+
},
|
|
276
|
+
// Cast rather than rebuild: `exactOptionalPropertyTypes` will not widen
|
|
277
|
+
// the schema's `x?: T` into the addon's `x?: T` without it, and the
|
|
278
|
+
// addon already drops undefined values before stringifying them.
|
|
279
|
+
config: (config.world ?? {}),
|
|
280
|
+
encoders: {
|
|
281
|
+
t5: artifacts['t5XxlModelPath'],
|
|
282
|
+
vae: artifacts['vaeModelPath']
|
|
283
|
+
},
|
|
284
|
+
seedScenePath: artifacts['seedScenePath'],
|
|
285
|
+
logger
|
|
286
|
+
});
|
|
287
|
+
return { model };
|
|
288
|
+
}
|
|
188
289
|
if (config.mode === 'video') {
|
|
189
290
|
// Layout is selected the same way the addon self-detects it: the
|
|
190
291
|
// presence of the LTX-2 text-embedding connectors switches from the
|
|
@@ -301,6 +402,26 @@ export const diffusionPlugin = definePlugin({
|
|
|
301
402
|
// back to soft-cancel.
|
|
302
403
|
cancel: { scope: 'none' },
|
|
303
404
|
handler: upscale
|
|
405
|
+
}),
|
|
406
|
+
worldStepStream: defineHandler({
|
|
407
|
+
requestSchema: worldStepRequestSchema,
|
|
408
|
+
responseSchema: worldStepStreamResponseSchema,
|
|
409
|
+
streaming: true,
|
|
410
|
+
// Block-granular, not mid-block: the engine has no abort hook, so the
|
|
411
|
+
// current block finishes internally. Cancel stops frame delivery and
|
|
412
|
+
// makes the step reject rather than resolve truncated, so it is a real
|
|
413
|
+
// cancel from the caller's side — it just does not shorten the compute.
|
|
414
|
+
cancel: { scope: 'model', hard: false },
|
|
415
|
+
handler: worldStep
|
|
416
|
+
}),
|
|
417
|
+
worldSceneStream: defineHandler({
|
|
418
|
+
requestSchema: worldSceneRequestSchema,
|
|
419
|
+
responseSchema: worldSceneStreamResponseSchema,
|
|
420
|
+
streaming: true,
|
|
421
|
+
// Scene creation is uninterruptible — the engine accepts no abort
|
|
422
|
+
// predicate for it, so the SDK falls back to soft-cancel.
|
|
423
|
+
cancel: { scope: 'none' },
|
|
424
|
+
handler: worldCreateScene
|
|
304
425
|
})
|
|
305
426
|
},
|
|
306
427
|
logging: {
|
|
@@ -5,7 +5,7 @@ import { nowMs } from '../../../../profiling/index.js';
|
|
|
5
5
|
import { buildStreamResult, hasDefinedValues } from '../../../../profiling/model-execution.js';
|
|
6
6
|
import { TextToSpeechStreamFailedError } from '../../../../errors/index.js';
|
|
7
7
|
import { collectTtsStats } from '../../../../utils/tts-stats.js';
|
|
8
|
-
import { assertParlerJobOptionsSupported, getParlerJobOptions } from '
|
|
8
|
+
import { assertParlerJobOptionsSupported, getParlerJobOptions } from './parler-options.js';
|
|
9
9
|
function hasRunStreaming(model) {
|
|
10
10
|
return (typeof model === 'object' &&
|
|
11
11
|
model !== null &&
|
|
@@ -4,7 +4,7 @@ import { nowMs } from '../../../../profiling/index.js';
|
|
|
4
4
|
import { buildStreamResult, hasDefinedValues } from '../../../../profiling/model-execution.js';
|
|
5
5
|
import { TextToSpeechFailedError } from '../../../../errors/index.js';
|
|
6
6
|
import { collectTtsStats } from '../../../../utils/tts-stats.js';
|
|
7
|
-
import { assertParlerJobOptionsSupported, getParlerJobOptions } from '
|
|
7
|
+
import { assertParlerJobOptionsSupported, getParlerJobOptions } from './parler-options.js';
|
|
8
8
|
function hasRunStream(model) {
|
|
9
9
|
return (typeof model === 'object' &&
|
|
10
10
|
model !== null &&
|
|
@@ -3,8 +3,8 @@ import TTSGgml from '@qvac/tts-ggml';
|
|
|
3
3
|
import { definePlugin, defineHandler, defineDuplexHandler, ttsRequestSchema, ttsResponseSchema, textToSpeechStreamRequestSchema, textToSpeechStreamResponseSchema, ModelType, ttsConfigSchema, ADDON_TTS, LEGACY_TTS_ONNX_MODEL_CONFIG_FIELDS } from '../../../schemas/index.js';
|
|
4
4
|
import { createStreamLogger, registerAddonLogger } from '../../../logging/index.js';
|
|
5
5
|
import { TtsArtifactsRequiredError, LegacyTtsModelDeprecatedError } from '../../../errors/index.js';
|
|
6
|
-
import { textToSpeech } from '
|
|
7
|
-
import { textToSpeechStream } from '
|
|
6
|
+
import { textToSpeech } from './ops/text-to-speech.js';
|
|
7
|
+
import { textToSpeechStream } from './ops/text-to-speech-stream.js';
|
|
8
8
|
import { attachModelExecutionMs } from '../../../profiling/model-execution.js';
|
|
9
9
|
function rejectLegacyOnnxFields(cfg) {
|
|
10
10
|
const record = cfg;
|
|
@@ -272,7 +272,7 @@ export declare const whisperPlugin: {
|
|
|
272
272
|
silenceDurationMs: import("zod").ZodNumber;
|
|
273
273
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
274
274
|
source: import("zod").ZodLiteral<"parakeet">;
|
|
275
|
-
}, import("zod/v4/core").$strip>], "source"
|
|
275
|
+
}, import("zod/v4/core").$strip>], "source">, unknown>>;
|
|
276
276
|
type: import("zod").ZodLiteral<"transcribe">;
|
|
277
277
|
}, import("zod/v4/core").$strip>>;
|
|
278
278
|
transcribeStream: import("../../../schemas/index.js").PluginHandlerDefinition<import("zod").ZodObject<{
|
|
@@ -335,7 +335,7 @@ export declare const whisperPlugin: {
|
|
|
335
335
|
silenceDurationMs: import("zod").ZodNumber;
|
|
336
336
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
337
337
|
source: import("zod").ZodLiteral<"parakeet">;
|
|
338
|
-
}, import("zod/v4/core").$strip>], "source"
|
|
338
|
+
}, import("zod/v4/core").$strip>], "source">, unknown>>;
|
|
339
339
|
type: import("zod").ZodLiteral<"transcribeStream">;
|
|
340
340
|
}, import("zod/v4/core").$strip>>;
|
|
341
341
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import asrAddonLogging from '@qvac/asr-ggml/addonLogging';
|
|
2
2
|
import ASRGgml from '@qvac/asr-ggml';
|
|
3
3
|
import { definePlugin, defineHandler, defineDuplexHandler, transcribeRequestSchema, transcribeResponseSchema, transcribeStreamRequestSchema, transcribeStreamResponseSchema, ModelType, whisperConfigSchema, ADDON_ASR } from '../../../schemas/index.js';
|
|
4
|
-
import { transcribe, transcribeStream } from '
|
|
4
|
+
import { transcribe, transcribeStream } from '../../ops/transcribe.js';
|
|
5
5
|
import { attachModelExecutionMs } from '../../../profiling/model-execution.js';
|
|
6
|
-
import { buildWhisperEngineConfig } from '
|
|
7
|
-
import { createAsrModelLogger } from '
|
|
6
|
+
import { buildWhisperEngineConfig } from '../asr-ggml/config.js';
|
|
7
|
+
import { createAsrModelLogger } from '../asr-ggml/logging.js';
|
|
8
8
|
function createWhisperModel(modelId, modelPath, whisperConfig, vadModelPath) {
|
|
9
9
|
const logger = createAsrModelLogger(modelId, ModelType.whispercppTranscription);
|
|
10
10
|
const model = new ASRGgml({
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as hostApi from '../api/index.js';
|
|
2
2
|
import type { QvacPlugin } from '../schemas/plugin.js';
|
|
3
|
-
export { registerPlugin, registerPlugins, getPlugin, getPluginHandler, hasPlugin, getAllPlugins, clearPlugins, unregisterPlugin } from '
|
|
3
|
+
export { registerPlugin, registerPlugins, getPlugin, getPluginHandler, getTurboVecIndexProvider, hasPlugin, getAllPlugins, clearPlugins, unregisterPlugin } from './registry.js';
|
|
4
4
|
/**
|
|
5
5
|
* Register a set of plugins and return the host API bound to them. The
|
|
6
6
|
* ergonomic entry point for assembling an explicit plugin subset — we ship
|
package/dist/plugins/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { registerPlugins } from '
|
|
1
|
+
import { registerPlugins } from './registry.js';
|
|
2
2
|
import * as hostApi from '../api/index.js';
|
|
3
|
-
export { registerPlugin, registerPlugins, getPlugin, getPluginHandler, hasPlugin, getAllPlugins, clearPlugins, unregisterPlugin } from '
|
|
3
|
+
export { registerPlugin, registerPlugins, getPlugin, getPluginHandler, getTurboVecIndexProvider, hasPlugin, getAllPlugins, clearPlugins, unregisterPlugin } from './registry.js';
|
|
4
4
|
/**
|
|
5
5
|
* Register a set of plugins and return the host API bound to them. The
|
|
6
6
|
* ergonomic entry point for assembling an explicit plugin subset — we ship
|
|
@@ -5,7 +5,7 @@ import { getAutoCacheLookupHistory, getKVCacheDir, validateAndJoinPath } from '.
|
|
|
5
5
|
import { getEngineLogger } from '../../logging/index.js';
|
|
6
6
|
import { PathTraversalError } from '../../errors/index.js';
|
|
7
7
|
import { Buffer } from 'bare-buffer';
|
|
8
|
-
import { markAutoCacheKey } from '
|
|
8
|
+
import { markAutoCacheKey } from './kv-cache-retention.js';
|
|
9
9
|
const logger = getEngineLogger();
|
|
10
10
|
// In-memory KV-cache state lives in `KvCacheSession` (the single
|
|
11
11
|
// mutation point for all three KV-cache bookkeeping layers). This
|
|
@@ -5,7 +5,7 @@ import { isModelLoaded, registerModel } from '../../runtime/model-registry.js';
|
|
|
5
5
|
import { startLogBuffering, stopLogBufferingWithTimeout } from '../../runtime/logging-stream-registry.js';
|
|
6
6
|
import { detectShardedModel, generateShardFilenames, validateShardedModelCache } from '../../utils/index.js';
|
|
7
7
|
import { PluginNotFoundError, ModelFileNotFoundError, ModelFileNotFoundInDirError, ModelFileLocateFailedError } from '../../errors/index.js';
|
|
8
|
-
import { getPlugin } from '
|
|
8
|
+
import { getPlugin } from '../index.js';
|
|
9
9
|
import { promises as fsPromises } from 'bare-fs';
|
|
10
10
|
import path from 'bare-path';
|
|
11
11
|
import { getEngineLogger } from '../../logging/index.js';
|
|
@@ -61,7 +61,7 @@ import { assertMetadataSupported, toTranscribeSegment } from '../../utils/transc
|
|
|
61
61
|
import { getRequestRegistry, withRequestContext } from '../../runtime/index.js';
|
|
62
62
|
import { generateRandomRequestId } from '../../runtime/request-id.js';
|
|
63
63
|
import { isEndOfTurnEvent, isVadEvent, toEndOfTurnEvent, toVadStateEvent } from '../../utils/asr-events.js';
|
|
64
|
-
import { buildWhisperReloadConfig } from '
|
|
64
|
+
import { buildWhisperReloadConfig } from '../builtin/asr-ggml/config.js';
|
|
65
65
|
export { assertMetadataSupported, toTranscribeSegment };
|
|
66
66
|
function hasRunStreaming(model) {
|
|
67
67
|
return 'runStreaming' in model && typeof model.runStreaming === 'function';
|
|
@@ -72,7 +72,7 @@ const SILENCE_MARKERS = {
|
|
|
72
72
|
};
|
|
73
73
|
function getEngineModelType(modelId) {
|
|
74
74
|
const entry = getModelEntry(modelId);
|
|
75
|
-
if (!entry
|
|
75
|
+
if (!entry)
|
|
76
76
|
return '';
|
|
77
77
|
return entry.local.modelType;
|
|
78
78
|
}
|
|
@@ -55,10 +55,10 @@ import { translateServerParamsSchema, normalizeModelType, ModelType, AFRICAN_LAN
|
|
|
55
55
|
import { getLangName, detectOne } from '@qvac/langdetect-text';
|
|
56
56
|
import { nowMs } from '../../profiling/index.js';
|
|
57
57
|
import { buildStreamResult } from '../../profiling/model-execution.js';
|
|
58
|
-
import { buildNmtTranslationStats } from '
|
|
59
|
-
import {
|
|
58
|
+
import { buildNmtTranslationStats } from './translate-stats.js';
|
|
59
|
+
import { ModelNotFoundError, ModelTypeMismatchError, TranslationFailedError } from '../../errors/index.js';
|
|
60
60
|
import { getRequestRegistry, withRequestContext } from '../../runtime/index.js';
|
|
61
|
-
import { isAddonContextOverflowError } from '
|
|
61
|
+
import { isAddonContextOverflowError } from '../builtin/llamacpp-completion/ops/context-overflow.js';
|
|
62
62
|
import { generateRandomRequestId } from '../../runtime/request-id.js';
|
|
63
63
|
import { getModelParallel } from '../../utils/config-transform.js';
|
|
64
64
|
import { getEngineLogger } from '../../logging/index.js';
|
|
@@ -92,9 +92,6 @@ export async function* translate(params, requestId) {
|
|
|
92
92
|
if (!entry) {
|
|
93
93
|
throw new ModelNotFoundError(modelId);
|
|
94
94
|
}
|
|
95
|
-
if (entry.isDelegated) {
|
|
96
|
-
throw new ModelIsDelegatedError(modelId);
|
|
97
|
-
}
|
|
98
95
|
const canonicalModelType = entry.local.modelType;
|
|
99
96
|
const model = entry.local.model;
|
|
100
97
|
if (inputModelType !== undefined) {
|
|
@@ -175,15 +172,10 @@ export async function* translate(params, requestId) {
|
|
|
175
172
|
if (ctx.signal.aborted) {
|
|
176
173
|
return { modelExecutionMs };
|
|
177
174
|
}
|
|
178
|
-
|
|
179
|
-
for (let i = 0; i < translations.length; i++) {
|
|
175
|
+
for (const translation of translations) {
|
|
180
176
|
if (ctx.signal.aborted)
|
|
181
177
|
break;
|
|
182
|
-
const translation = translations[i];
|
|
183
178
|
yield translation;
|
|
184
|
-
if (i < translations.length - 1) {
|
|
185
|
-
yield '\n';
|
|
186
|
-
}
|
|
187
179
|
}
|
|
188
180
|
return { modelExecutionMs };
|
|
189
181
|
}
|