@qvac/inference 0.18.2 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +11 -2
- 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/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/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-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 +7 -1
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.js +26 -4
- package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +19 -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 +578 -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 +45 -0
- package/dist/resources/model-fit/estimators/llm.js +220 -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/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 +14 -0
- package/dist/resources/normalize.d.ts +1 -1
- package/dist/resources/types.d.ts +16 -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 +271 -0
- package/dist/schemas/assess-model-fit.js +153 -0
- package/dist/schemas/audio-gen.d.ts +434 -4
- package/dist/schemas/audio-gen.js +131 -19
- package/dist/schemas/batch-completion-stream.d.ts +2 -2
- package/dist/schemas/batch-completion-stream.js +3 -3
- package/dist/schemas/bci-config.js +73 -27
- package/dist/schemas/bci.d.ts +2 -2
- 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 +662 -331
- package/dist/schemas/common.js +33 -31
- package/dist/schemas/completion-event.d.ts +2 -2
- package/dist/schemas/completion-event.js +1 -1
- package/dist/schemas/completion-stream.d.ts +1 -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 +2933 -1948
- 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 +0 -1
- package/dist/schemas/model-ops.js +1 -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 +14 -1
- 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/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
|
@@ -3,9 +3,9 @@ import TranslationNmtcpp from '@qvac/translation-nmtcpp';
|
|
|
3
3
|
import { definePlugin, defineHandler, translateRequestSchema, translateResponseSchema, ModelType, nmtConfigBaseSchema, ADDON_NMT, BERGAMOT_CJK_LANG_PAIRS } from '../../../schemas/index.js';
|
|
4
4
|
import { createStreamLogger, registerAddonLogger } from '../../../logging/index.js';
|
|
5
5
|
import path from 'bare-path';
|
|
6
|
-
import { translate } from '
|
|
6
|
+
import { translate } from '../../ops/translate.js';
|
|
7
7
|
import { attachModelExecutionMs } from '../../../profiling/model-execution.js';
|
|
8
|
-
import { resolveBergamotVocab } from '
|
|
8
|
+
import { resolveBergamotVocab } from './resolve-vocab.js';
|
|
9
9
|
/**
|
|
10
10
|
* Derive absolute vocab paths from a resolved Bergamot model path.
|
|
11
11
|
* Works for both companion-set layout (colocated files) and any layout where
|
|
@@ -59,7 +59,7 @@ export declare const parakeetPlugin: {
|
|
|
59
59
|
silenceDurationMs: import("zod").ZodNumber;
|
|
60
60
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
61
61
|
source: import("zod").ZodLiteral<"parakeet">;
|
|
62
|
-
}, import("zod/v4/core").$strip>], "source"
|
|
62
|
+
}, import("zod/v4/core").$strip>], "source">, unknown>>;
|
|
63
63
|
type: import("zod").ZodLiteral<"transcribe">;
|
|
64
64
|
}, import("zod/v4/core").$strip>>;
|
|
65
65
|
transcribeStream: import("../../../schemas/index.js").PluginHandlerDefinition<import("zod").ZodObject<{
|
|
@@ -122,7 +122,7 @@ export declare const parakeetPlugin: {
|
|
|
122
122
|
silenceDurationMs: import("zod").ZodNumber;
|
|
123
123
|
}, import("zod/v4/core").$strip>, import("zod").ZodObject<{
|
|
124
124
|
source: import("zod").ZodLiteral<"parakeet">;
|
|
125
|
-
}, import("zod/v4/core").$strip>], "source"
|
|
125
|
+
}, import("zod/v4/core").$strip>], "source">, unknown>>;
|
|
126
126
|
type: import("zod").ZodLiteral<"transcribeStream">;
|
|
127
127
|
}, import("zod/v4/core").$strip>>;
|
|
128
128
|
};
|
|
@@ -2,10 +2,10 @@ 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, parakeetLoadConfigSchema, LEGACY_PARAKEET_ONNX_MODEL_CONFIG_FIELDS, ADDON_ASR } from '../../../schemas/index.js';
|
|
4
4
|
import { ModelLoadFailedError, TranscriptionFailedError, LegacyParakeetModelDeprecatedError } from '../../../errors/index.js';
|
|
5
|
-
import { transcribe, transcribeStream } from '
|
|
5
|
+
import { transcribe, transcribeStream } from '../../ops/transcribe.js';
|
|
6
6
|
import { attachModelExecutionMs } from '../../../profiling/model-execution.js';
|
|
7
|
-
import { buildParakeetEngineConfig } from '
|
|
8
|
-
import { createAsrModelLogger } from '
|
|
7
|
+
import { buildParakeetEngineConfig } from '../asr-ggml/config.js';
|
|
8
|
+
import { createAsrModelLogger } from '../asr-ggml/logging.js';
|
|
9
9
|
function resolveParakeetConfig(cfg) {
|
|
10
10
|
const cfgRecord = cfg;
|
|
11
11
|
const legacyFields = LEGACY_PARAKEET_ONNX_MODEL_CONFIG_FIELDS.filter((name) => cfgRecord[name] !== undefined);
|
|
@@ -12,7 +12,7 @@ function asUpscalerModel(model, modelId) {
|
|
|
12
12
|
return model;
|
|
13
13
|
}
|
|
14
14
|
const entry = getModelEntry(modelId);
|
|
15
|
-
const modelType = entry
|
|
15
|
+
const modelType = entry ? entry.local.modelType : ModelType.sdcppGeneration;
|
|
16
16
|
throw new ModelOperationNotSupportedError(modelId, modelType, 'upscale', ['diffusion'], []);
|
|
17
17
|
}
|
|
18
18
|
export async function* upscale(request) {
|
|
@@ -52,6 +52,7 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
52
52
|
});
|
|
53
53
|
import { VideoStableDiffusion } from '@qvac/diffusion-cpp';
|
|
54
54
|
import Buffer from 'bare-buffer';
|
|
55
|
+
import path from 'bare-path';
|
|
55
56
|
import { getEngineLogger } from '../../../../logging/index.js';
|
|
56
57
|
import { getModel, getModelEntry } from '../../../../runtime/model-registry.js';
|
|
57
58
|
import { getRequestRegistry, withRequestContext } from '../../../../runtime/index.js';
|
|
@@ -59,7 +60,7 @@ import { generateRandomRequestId } from '../../../../runtime/request-id.js';
|
|
|
59
60
|
import { ModelOperationNotSupportedError, PluginRequestValidationFailedError } from '../../../../errors/index.js';
|
|
60
61
|
import { formatZodError } from '../../../../utils/zod-error.js';
|
|
61
62
|
import { ModelType } from '../../../../schemas/index.js';
|
|
62
|
-
import { ltxVideoRequestSchema, singleExpertVideoRequestSchema } from '../../../../schemas/sdcpp-config.js';
|
|
63
|
+
import { ltxVideoRequestSchema, nonLtxVideoRequestSchema, sdcppConfigSchema, singleExpertVideoRequestSchema } from '../../../../schemas/sdcpp-config.js';
|
|
63
64
|
const ltxVideoModels = new WeakSet();
|
|
64
65
|
const moeCapableVideoModels = new WeakSet();
|
|
65
66
|
export function markLtxVideoModel(model) {
|
|
@@ -74,6 +75,11 @@ function parseVideoRequest(schema, request) {
|
|
|
74
75
|
throw new PluginRequestValidationFailedError('videoStream', formatZodError(result.error));
|
|
75
76
|
}
|
|
76
77
|
}
|
|
78
|
+
function validateProviderPaths(request) {
|
|
79
|
+
if (request.lora !== undefined && !path.isAbsolute(request.lora)) {
|
|
80
|
+
throw new PluginRequestValidationFailedError('videoStream', 'lora must be an absolute path on the inference provider');
|
|
81
|
+
}
|
|
82
|
+
}
|
|
77
83
|
// The addon reports `hasAudio` as a numeric flag (1/0); it is surfaced as
|
|
78
84
|
// a boolean so consumers get a readable `stats.hasAudio` instead of a magic
|
|
79
85
|
// number. Everything else passes through and is validated client-side.
|
|
@@ -96,7 +102,7 @@ function asVideoModel(model, modelId) {
|
|
|
96
102
|
return model;
|
|
97
103
|
}
|
|
98
104
|
const entry = getModelEntry(modelId);
|
|
99
|
-
const modelType = entry
|
|
105
|
+
const modelType = entry ? entry.local.modelType : ModelType.sdcppGeneration;
|
|
100
106
|
throw new ModelOperationNotSupportedError(modelId, modelType, 'video', ['diffusion'], []);
|
|
101
107
|
}
|
|
102
108
|
export async function* video(request) {
|
|
@@ -111,8 +117,17 @@ export async function* video(request) {
|
|
|
111
117
|
const model = asVideoModel(getModel(request.modelId), request.modelId);
|
|
112
118
|
if (ltxVideoModels.has(model))
|
|
113
119
|
parseVideoRequest(ltxVideoRequestSchema, request);
|
|
120
|
+
else
|
|
121
|
+
parseVideoRequest(nonLtxVideoRequestSchema, request);
|
|
114
122
|
if (!moeCapableVideoModels.has(model))
|
|
115
123
|
parseVideoRequest(singleExpertVideoRequestSchema, request);
|
|
124
|
+
validateProviderPaths(request);
|
|
125
|
+
const modelEntry = getModelEntry(request.modelId);
|
|
126
|
+
const modelConfig = modelEntry ? sdcppConfigSchema.safeParse(modelEntry.local.config) : null;
|
|
127
|
+
const loraApplyMode = modelConfig?.success ? (modelConfig.data.lora_apply_mode ?? 'auto') : 'auto';
|
|
128
|
+
if (request.lora !== undefined && loraApplyMode !== 'at_runtime') {
|
|
129
|
+
requestLogger.warn(`[video] lora_apply_mode="${loraApplyMode}" may persist the request LoRA across later generations; use "at_runtime" for per-call application.`);
|
|
130
|
+
}
|
|
116
131
|
const onAbort = () => {
|
|
117
132
|
model.cancel().catch((err) => {
|
|
118
133
|
requestLogger.warn(`[cancel] model.cancel() rejected during abort for modelId=${request.modelId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -130,6 +145,12 @@ export async function* video(request) {
|
|
|
130
145
|
...(request.negative_prompt !== undefined && {
|
|
131
146
|
negative_prompt: request.negative_prompt
|
|
132
147
|
}),
|
|
148
|
+
...(request.lora !== undefined && { lora: request.lora }),
|
|
149
|
+
...(request.lora_strength !== undefined && {
|
|
150
|
+
lora_strength: request.lora_strength
|
|
151
|
+
}),
|
|
152
|
+
...(request.stg_scale !== undefined && { stg_scale: request.stg_scale }),
|
|
153
|
+
...(request.stg_block !== undefined && { stg_block: request.stg_block }),
|
|
133
154
|
...(request.width !== undefined && { width: request.width }),
|
|
134
155
|
...(request.height !== undefined && { height: request.height }),
|
|
135
156
|
...(request.video_frames !== undefined && {
|
|
@@ -174,6 +195,15 @@ export async function* video(request) {
|
|
|
174
195
|
...(request.control_frames !== undefined && {
|
|
175
196
|
control_frames: request.control_frames.map((b64) => Buffer.from(b64, 'base64'))
|
|
176
197
|
}),
|
|
198
|
+
...(request.reference_images !== undefined && {
|
|
199
|
+
reference_images: request.reference_images.map((b64) => Buffer.from(b64, 'base64'))
|
|
200
|
+
}),
|
|
201
|
+
...(request.reference_attention_strength !== undefined && {
|
|
202
|
+
reference_attention_strength: request.reference_attention_strength
|
|
203
|
+
}),
|
|
204
|
+
...(request.reference_downscale_factor !== undefined && {
|
|
205
|
+
reference_downscale_factor: request.reference_downscale_factor
|
|
206
|
+
}),
|
|
177
207
|
...(request.vae_tiling !== undefined && { vae_tiling: request.vae_tiling }),
|
|
178
208
|
...(request.vae_tile_size !== undefined && {
|
|
179
209
|
vae_tile_size: request.vae_tile_size
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import WorldStableDiffusion from '@qvac/diffusion-cpp/world';
|
|
2
|
+
import type { WorldConfig } from '@qvac/diffusion-cpp/world';
|
|
3
|
+
import type QvacLogger from '@qvac/logging';
|
|
4
|
+
import type { WorldSceneRequest, WorldSceneStreamResponse, WorldStepRequest, WorldStepStreamResponse } from '../../../../schemas/sdcpp-config.js';
|
|
5
|
+
interface WorldSessionArgs {
|
|
6
|
+
modelId: string;
|
|
7
|
+
files: {
|
|
8
|
+
model: string;
|
|
9
|
+
taehv: string;
|
|
10
|
+
scene: string;
|
|
11
|
+
};
|
|
12
|
+
config: WorldConfig;
|
|
13
|
+
/** umT5-XXL and Wan2.2 VAE, resolved at load; scene creation needs both. */
|
|
14
|
+
encoders: {
|
|
15
|
+
t5?: string | undefined;
|
|
16
|
+
vae?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
/** Resolved `modelConfig.sceneSrc`, copied over the managed pack at load. */
|
|
19
|
+
seedScenePath?: string | undefined;
|
|
20
|
+
logger: QvacLogger;
|
|
21
|
+
/**
|
|
22
|
+
* The native session to drive. Constructed here when omitted, which is what
|
|
23
|
+
* every caller does; injecting one is how the teardown and cancellation paths
|
|
24
|
+
* are exercised, since the addon calls the engine C API directly and offers
|
|
25
|
+
* no substitution point of its own.
|
|
26
|
+
*/
|
|
27
|
+
world?: NativeWorldSession;
|
|
28
|
+
/**
|
|
29
|
+
* Ceiling for a generated pack, defaulting to `MAX_SCENE_PACK_BYTES`.
|
|
30
|
+
* Overridable for the same reason as `world` above: the real limit is far
|
|
31
|
+
* larger than anything a test should write to disk.
|
|
32
|
+
*/
|
|
33
|
+
maxScenePackBytes?: number;
|
|
34
|
+
}
|
|
35
|
+
/** The part of `WorldStableDiffusion` this module actually uses. */
|
|
36
|
+
export type NativeWorldSession = Pick<WorldStableDiffusion, 'load' | 'unload' | 'step' | 'createScene' | 'cancel'>;
|
|
37
|
+
/**
|
|
38
|
+
* All `run()` needs of a job handle is "tell me when it is over". Kept
|
|
39
|
+
* structural rather than importing `QvacResponse`: the addon can resolve a
|
|
40
|
+
* different copy of `@qvac/infer-base` than the SDK does, and a nominal type
|
|
41
|
+
* would make this file fail to compile on the dependency layout rather than on
|
|
42
|
+
* anything real.
|
|
43
|
+
*/
|
|
44
|
+
interface SettleableResponse {
|
|
45
|
+
await(): Promise<unknown>;
|
|
46
|
+
}
|
|
47
|
+
export interface WorldSession {
|
|
48
|
+
load(force?: boolean): Promise<void>;
|
|
49
|
+
unload(): Promise<void>;
|
|
50
|
+
readonly scenePath: string;
|
|
51
|
+
/** Where a replacement world is generated before it is allowed to take over. */
|
|
52
|
+
readonly stagingScenePath: string;
|
|
53
|
+
readonly encoders: {
|
|
54
|
+
t5?: string | undefined;
|
|
55
|
+
vae?: string | undefined;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* `world.numFramePerBlock` as configured, or undefined for the engine default.
|
|
59
|
+
* Exposed because the block's memory cost is count x resolution, and only the
|
|
60
|
+
* scene op knows the resolution.
|
|
61
|
+
*/
|
|
62
|
+
readonly numFramePerBlock: number | undefined;
|
|
63
|
+
ensureActivated(): Promise<void>;
|
|
64
|
+
deactivate(): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Promote a freshly generated pack, returning its bytes only when asked. The
|
|
67
|
+
* previous world is replaced only here, and the read is part of the same
|
|
68
|
+
* locked step so a concurrent unload cannot delete the pack between the two.
|
|
69
|
+
*/
|
|
70
|
+
promoteStagedScene(readBytes: boolean): Promise<Buffer | undefined>;
|
|
71
|
+
/** Drop a failed generation, leaving the previous world usable. */
|
|
72
|
+
discardStagedScene(): Promise<void>;
|
|
73
|
+
/** Wait for native work to finish. See the note on `settleInFlight`. */
|
|
74
|
+
settle(): Promise<void>;
|
|
75
|
+
run<T extends SettleableResponse>(start: () => Promise<T>): Promise<T>;
|
|
76
|
+
step: WorldStableDiffusion['step'];
|
|
77
|
+
createScene: WorldStableDiffusion['createScene'];
|
|
78
|
+
cancel(): Promise<void>;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Server-side path for one session's scene pack. Derived from a hash of the
|
|
82
|
+
* caller-supplied `modelId` rather than the id itself, so the id can never
|
|
83
|
+
* steer the write.
|
|
84
|
+
*
|
|
85
|
+
* Deliberately unique per call, not per `modelId`. A pack keyed only on the
|
|
86
|
+
* model id is shared state across every process using the same cache dir: two
|
|
87
|
+
* workers loading the same model would write each other's world, and a pack
|
|
88
|
+
* orphaned by a crashed session would be adopted by the next `load()` as if the
|
|
89
|
+
* caller had built it — walking a world they never created. Neither is
|
|
90
|
+
* detectable from inside the session.
|
|
91
|
+
*
|
|
92
|
+
* Uniqueness costs nothing here because the managed pack is not a cache: it
|
|
93
|
+
* lives for exactly one loaded session, and callers who want to revisit a world
|
|
94
|
+
* pass the bytes back as `modelConfig.sceneSrc`. The one invariant that does
|
|
95
|
+
* matter — `createScene` writes exactly where the native session was
|
|
96
|
+
* constructed to read — comes from calling this ONCE per session and storing
|
|
97
|
+
* the result in `files.scene`, not from the path being reproducible.
|
|
98
|
+
*
|
|
99
|
+
* No garbage collection, deliberately. `unload()` removes the pack, and so does
|
|
100
|
+
* worker shutdown, so only a crash or SIGKILL leaks one — bounded at roughly
|
|
101
|
+
* 10 MB per lost session, and never adopted by a later run because the name is
|
|
102
|
+
* unique. The obvious mtime-based sweep is NOT safe here: a pack is written once
|
|
103
|
+
* at promotion and never touched again, so a session walking for hours looks
|
|
104
|
+
* exactly as old as an orphan, and ~/.qvac is shared across worker processes.
|
|
105
|
+
* Doing this properly needs a liveness marker like the one
|
|
106
|
+
* `planAutoCacheEvictions` gets from `activeCachePaths` in
|
|
107
|
+
* `server/bare/ops/kv-cache-retention.ts`. Tracked as a follow-up rather than
|
|
108
|
+
* guessed at here.
|
|
109
|
+
*/
|
|
110
|
+
export declare function worldScenePath(modelId: string): string;
|
|
111
|
+
/**
|
|
112
|
+
* Wraps `WorldStableDiffusion` so it satisfies the plugin `load()` contract.
|
|
113
|
+
*
|
|
114
|
+
* Two things make the raw addon unusable as a plugin model. First, `load()`
|
|
115
|
+
* reads the scene pack, which does not exist yet when the caller intends to
|
|
116
|
+
* build a world with `worldCreateScene` — so activation is deferred until a
|
|
117
|
+
* scene is present. Second, the addon's `unload()` is synchronous down to a
|
|
118
|
+
* native thread join, so calling it while a job runs blocks the worker's event
|
|
119
|
+
* loop for the rest of that job (a walk block, or a whole scene encode plus its
|
|
120
|
+
* ~6.9 GB of encoder loads). We therefore track the in-flight job and wait for
|
|
121
|
+
* it before tearing down.
|
|
122
|
+
*/
|
|
123
|
+
export declare function createWorldSession(args: WorldSessionArgs): WorldSession;
|
|
124
|
+
export declare function worldStep(request: WorldStepRequest): AsyncGenerator<WorldStepStreamResponse>;
|
|
125
|
+
export declare function worldCreateScene(request: WorldSceneRequest): AsyncGenerator<WorldSceneStreamResponse>;
|
|
126
|
+
export {};
|