@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getAppLogger, ALL_LOG_ID } from '../logging/index.js';
|
|
2
|
-
import { loggingStream } from '
|
|
2
|
+
import { loggingStream } from './logging-stream.js';
|
|
3
3
|
const logger = getAppLogger();
|
|
4
4
|
/**
|
|
5
5
|
* Subscribes to every log through a single stream: the engine's own logs, per-model
|
package/dist/api/suspend.d.ts
CHANGED
|
@@ -14,10 +14,6 @@
|
|
|
14
14
|
* - P2P / Hyperdrive downloads: stall cleanly, continue after `resume()`
|
|
15
15
|
* - HTTP downloads: bypass suspend entirely (bytes keep flowing)
|
|
16
16
|
* - Local native inference: runs to completion regardless
|
|
17
|
-
* - Delegated reply RPCs: stall, then auto-recover after `resume()`
|
|
18
|
-
* (subject to delegate `timeout`)
|
|
19
|
-
* - Delegated stream RPCs: severed, consumer iterator hangs silently;
|
|
20
|
-
* re-issue after `resume()` works normally.
|
|
21
17
|
*
|
|
22
18
|
* @throws {RPCError} When one or more resources fail to suspend. The runtime
|
|
23
19
|
* still commits to `"suspended"` so callers can recover with `resume()`.
|
package/dist/api/suspend.js
CHANGED
|
@@ -16,10 +16,6 @@ import { InvalidResponseError } from '../errors/index.js';
|
|
|
16
16
|
* - P2P / Hyperdrive downloads: stall cleanly, continue after `resume()`
|
|
17
17
|
* - HTTP downloads: bypass suspend entirely (bytes keep flowing)
|
|
18
18
|
* - Local native inference: runs to completion regardless
|
|
19
|
-
* - Delegated reply RPCs: stall, then auto-recover after `resume()`
|
|
20
|
-
* (subject to delegate `timeout`)
|
|
21
|
-
* - Delegated stream RPCs: severed, consumer iterator hangs silently;
|
|
22
|
-
* re-issue after `resume()` works normally.
|
|
23
19
|
*
|
|
24
20
|
* @throws {RPCError} When one or more resources fail to suspend. The runtime
|
|
25
21
|
* still commits to `"suspended"` so callers can recover with `resume()`.
|
package/dist/api/translate.d.ts
CHANGED
|
@@ -10,7 +10,8 @@ import { type TranslateClientParams, type TranslationStats, type RPCOptions } fr
|
|
|
10
10
|
* @param params.to - Target language code
|
|
11
11
|
* @param params.stream - Whether to stream tokens (true) or return complete response (false). Defaults to true.
|
|
12
12
|
* @param options - Optional RPC options (timeout, profiling, force new connection, etc.).
|
|
13
|
-
* @returns Object with tokenStream generator
|
|
13
|
+
* @returns Object with a tokenStream generator, `translations` (one entry per
|
|
14
|
+
* input, in order), `text` (those entries joined by newlines) and stats
|
|
14
15
|
* @throws {QvacErrorBase} When translation fails with an error message or when language detection fails
|
|
15
16
|
* @example
|
|
16
17
|
* ```typescript
|
|
@@ -43,5 +44,6 @@ import { type TranslateClientParams, type TranslationStats, type RPCOptions } fr
|
|
|
43
44
|
export declare function translate(params: TranslateClientParams, options?: RPCOptions): {
|
|
44
45
|
tokenStream: AsyncGenerator<string>;
|
|
45
46
|
stats: Promise<TranslationStats | undefined>;
|
|
47
|
+
translations: Promise<string[]>;
|
|
46
48
|
text: Promise<string>;
|
|
47
49
|
};
|
package/dist/api/translate.js
CHANGED
|
@@ -11,7 +11,8 @@ import { translateResponseSchema } from '../schemas/index.js';
|
|
|
11
11
|
* @param params.to - Target language code
|
|
12
12
|
* @param params.stream - Whether to stream tokens (true) or return complete response (false). Defaults to true.
|
|
13
13
|
* @param options - Optional RPC options (timeout, profiling, force new connection, etc.).
|
|
14
|
-
* @returns Object with tokenStream generator
|
|
14
|
+
* @returns Object with a tokenStream generator, `translations` (one entry per
|
|
15
|
+
* input, in order), `text` (those entries joined by newlines) and stats
|
|
15
16
|
* @throws {QvacErrorBase} When translation fails with an error message or when language detection fails
|
|
16
17
|
* @example
|
|
17
18
|
* ```typescript
|
|
@@ -70,10 +71,10 @@ export function translate(params, options) {
|
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
})();
|
|
73
|
-
const textPromise = Promise.resolve('');
|
|
74
74
|
return {
|
|
75
75
|
tokenStream,
|
|
76
|
-
|
|
76
|
+
translations: Promise.resolve([]),
|
|
77
|
+
text: Promise.resolve(''),
|
|
77
78
|
stats: statsPromise
|
|
78
79
|
};
|
|
79
80
|
}
|
|
@@ -81,23 +82,30 @@ export function translate(params, options) {
|
|
|
81
82
|
const tokenStream = (async function* () {
|
|
82
83
|
//Empty generator for non-streaming mode
|
|
83
84
|
})();
|
|
84
|
-
const
|
|
85
|
-
|
|
85
|
+
const batched = Array.isArray(params.text);
|
|
86
|
+
const translationsPromise = (async () => {
|
|
87
|
+
const collected = batched ? [] : [''];
|
|
86
88
|
for await (const response of streamRpc(request, options)) {
|
|
87
89
|
if (response.type === 'translate') {
|
|
88
90
|
const streamResponse = translateResponseSchema.parse(response);
|
|
89
|
-
buffer += streamResponse.token;
|
|
90
91
|
if (streamResponse.done) {
|
|
91
92
|
stats = streamResponse.stats;
|
|
92
93
|
statsResolver(stats);
|
|
93
94
|
}
|
|
95
|
+
else if (batched) {
|
|
96
|
+
collected.push(streamResponse.token);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
collected[0] += streamResponse.token;
|
|
100
|
+
}
|
|
94
101
|
}
|
|
95
102
|
}
|
|
96
|
-
return
|
|
103
|
+
return collected;
|
|
97
104
|
})();
|
|
98
105
|
return {
|
|
99
106
|
tokenStream,
|
|
100
|
-
|
|
107
|
+
translations: translationsPromise,
|
|
108
|
+
text: translationsPromise.then((entries) => entries.join('\n')),
|
|
101
109
|
stats: statsPromise
|
|
102
110
|
};
|
|
103
111
|
}
|
package/dist/api/unload-model.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { send, close } from '../dispatch.js';
|
|
2
|
-
import { stopLoggingStreamForModel } from '
|
|
2
|
+
import { stopLoggingStreamForModel } from './logging-stream-registry.js';
|
|
3
3
|
import { InvalidResponseError, ModelUnloadFailedError } from '../errors/index.js';
|
|
4
4
|
import { getAppLogger } from '../logging/index.js';
|
|
5
5
|
const logger = getAppLogger();
|
|
@@ -33,10 +33,8 @@ export async function unloadModel(params) {
|
|
|
33
33
|
}
|
|
34
34
|
stopLoggingStreamForModel(params.modelId);
|
|
35
35
|
const shouldAutoClose = params.autoClose ?? false;
|
|
36
|
-
if (shouldAutoClose &&
|
|
37
|
-
|
|
38
|
-
response.hasActiveProviders === false) {
|
|
39
|
-
logger.info('🧹 No models or providers active, automatically tearing down the engine...');
|
|
36
|
+
if (shouldAutoClose && response.hasActiveModels === false) {
|
|
37
|
+
logger.info('🧹 No models active, automatically tearing down the engine...');
|
|
40
38
|
await close();
|
|
41
39
|
}
|
|
42
40
|
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import type { VideoClientParams } from '../schemas/sdcpp-config.js';
|
|
2
|
+
export declare function createVideoStreamRequest(params: VideoClientParams, requestId: string): {
|
|
3
|
+
type: "videoStream";
|
|
4
|
+
requestId: string;
|
|
5
|
+
reference_images?: string[];
|
|
6
|
+
init_image?: string;
|
|
7
|
+
control_frames?: string[];
|
|
8
|
+
modelId: string;
|
|
9
|
+
seed?: number | undefined;
|
|
10
|
+
vae_tiling?: boolean | undefined;
|
|
11
|
+
prompt: string;
|
|
12
|
+
negative_prompt?: string | undefined;
|
|
13
|
+
width?: number | undefined;
|
|
14
|
+
height?: number | undefined;
|
|
15
|
+
steps?: number | undefined;
|
|
16
|
+
cfg_scale?: number | undefined;
|
|
17
|
+
sampling_method?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
18
|
+
scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | "ltx2" | undefined;
|
|
19
|
+
cache_preset?: string | undefined;
|
|
20
|
+
stg_scale?: number | undefined;
|
|
21
|
+
stg_block?: number | undefined;
|
|
22
|
+
video_frames?: number | undefined;
|
|
23
|
+
fps?: number | undefined;
|
|
24
|
+
flow_shift?: number | undefined;
|
|
25
|
+
high_noise_steps?: number | undefined;
|
|
26
|
+
high_noise_sampler?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
27
|
+
high_noise_scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | undefined;
|
|
28
|
+
high_noise_cfg_scale?: number | undefined;
|
|
29
|
+
high_noise_flow_shift?: number | undefined;
|
|
30
|
+
moe_boundary?: number | undefined;
|
|
31
|
+
vace_strength?: number | undefined;
|
|
32
|
+
vae_tile_size?: string | number | undefined;
|
|
33
|
+
vae_tile_overlap?: number | undefined;
|
|
34
|
+
temporal_tiling?: boolean | undefined;
|
|
35
|
+
cache_mode?: "disabled" | "easycache" | "ucache" | "dbcache" | "taylorseer" | "cache-dit" | undefined;
|
|
36
|
+
cache_threshold?: number | undefined;
|
|
37
|
+
lora?: never;
|
|
38
|
+
lora_strength?: never;
|
|
39
|
+
mode: "txt2vid";
|
|
40
|
+
strength?: never;
|
|
41
|
+
reference_attention_strength?: never;
|
|
42
|
+
reference_downscale_factor?: never;
|
|
43
|
+
} | {
|
|
44
|
+
type: "videoStream";
|
|
45
|
+
requestId: string;
|
|
46
|
+
reference_images?: string[];
|
|
47
|
+
init_image?: string;
|
|
48
|
+
control_frames?: string[];
|
|
49
|
+
modelId: string;
|
|
50
|
+
seed?: number | undefined;
|
|
51
|
+
vae_tiling?: boolean | undefined;
|
|
52
|
+
prompt: string;
|
|
53
|
+
negative_prompt?: string | undefined;
|
|
54
|
+
width?: number | undefined;
|
|
55
|
+
height?: number | undefined;
|
|
56
|
+
steps?: number | undefined;
|
|
57
|
+
cfg_scale?: number | undefined;
|
|
58
|
+
sampling_method?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
59
|
+
scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | "ltx2" | undefined;
|
|
60
|
+
cache_preset?: string | undefined;
|
|
61
|
+
stg_scale?: number | undefined;
|
|
62
|
+
stg_block?: number | undefined;
|
|
63
|
+
video_frames?: number | undefined;
|
|
64
|
+
fps?: number | undefined;
|
|
65
|
+
flow_shift?: number | undefined;
|
|
66
|
+
high_noise_steps?: number | undefined;
|
|
67
|
+
high_noise_sampler?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
68
|
+
high_noise_scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | undefined;
|
|
69
|
+
high_noise_cfg_scale?: number | undefined;
|
|
70
|
+
high_noise_flow_shift?: number | undefined;
|
|
71
|
+
moe_boundary?: number | undefined;
|
|
72
|
+
vace_strength?: number | undefined;
|
|
73
|
+
vae_tile_size?: string | number | undefined;
|
|
74
|
+
vae_tile_overlap?: number | undefined;
|
|
75
|
+
temporal_tiling?: boolean | undefined;
|
|
76
|
+
cache_mode?: "disabled" | "easycache" | "ucache" | "dbcache" | "taylorseer" | "cache-dit" | undefined;
|
|
77
|
+
cache_threshold?: number | undefined;
|
|
78
|
+
lora: string;
|
|
79
|
+
lora_strength?: number;
|
|
80
|
+
mode: "txt2vid";
|
|
81
|
+
strength?: never;
|
|
82
|
+
reference_attention_strength?: never;
|
|
83
|
+
reference_downscale_factor?: never;
|
|
84
|
+
} | {
|
|
85
|
+
type: "videoStream";
|
|
86
|
+
requestId: string;
|
|
87
|
+
reference_images?: string[];
|
|
88
|
+
init_image?: string;
|
|
89
|
+
control_frames?: string[];
|
|
90
|
+
modelId: string;
|
|
91
|
+
seed?: number | undefined;
|
|
92
|
+
vae_tiling?: boolean | undefined;
|
|
93
|
+
prompt: string;
|
|
94
|
+
negative_prompt?: string | undefined;
|
|
95
|
+
width?: number | undefined;
|
|
96
|
+
height?: number | undefined;
|
|
97
|
+
steps?: number | undefined;
|
|
98
|
+
cfg_scale?: number | undefined;
|
|
99
|
+
sampling_method?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
100
|
+
scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | "ltx2" | undefined;
|
|
101
|
+
cache_preset?: string | undefined;
|
|
102
|
+
stg_scale?: number | undefined;
|
|
103
|
+
stg_block?: number | undefined;
|
|
104
|
+
video_frames: number;
|
|
105
|
+
fps?: number | undefined;
|
|
106
|
+
flow_shift?: number | undefined;
|
|
107
|
+
high_noise_steps?: number | undefined;
|
|
108
|
+
high_noise_sampler?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
109
|
+
high_noise_scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | undefined;
|
|
110
|
+
high_noise_cfg_scale?: number | undefined;
|
|
111
|
+
high_noise_flow_shift?: number | undefined;
|
|
112
|
+
moe_boundary?: number | undefined;
|
|
113
|
+
vace_strength?: number | undefined;
|
|
114
|
+
vae_tile_size?: string | number | undefined;
|
|
115
|
+
vae_tile_overlap?: number | undefined;
|
|
116
|
+
temporal_tiling?: boolean | undefined;
|
|
117
|
+
cache_mode?: "disabled" | "easycache" | "ucache" | "dbcache" | "taylorseer" | "cache-dit" | undefined;
|
|
118
|
+
cache_threshold?: number | undefined;
|
|
119
|
+
mode: "txt2vid";
|
|
120
|
+
strength?: never;
|
|
121
|
+
lora: string;
|
|
122
|
+
lora_strength?: number;
|
|
123
|
+
reference_attention_strength?: number;
|
|
124
|
+
reference_downscale_factor?: 1;
|
|
125
|
+
} | {
|
|
126
|
+
type: "videoStream";
|
|
127
|
+
requestId: string;
|
|
128
|
+
reference_images?: string[];
|
|
129
|
+
init_image?: string;
|
|
130
|
+
control_frames?: string[];
|
|
131
|
+
modelId: string;
|
|
132
|
+
seed?: number | undefined;
|
|
133
|
+
vae_tiling?: boolean | undefined;
|
|
134
|
+
prompt: string;
|
|
135
|
+
negative_prompt?: string | undefined;
|
|
136
|
+
width?: number | undefined;
|
|
137
|
+
height?: number | undefined;
|
|
138
|
+
steps?: number | undefined;
|
|
139
|
+
cfg_scale?: number | undefined;
|
|
140
|
+
sampling_method?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
141
|
+
scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | "ltx2" | undefined;
|
|
142
|
+
cache_preset?: string | undefined;
|
|
143
|
+
stg_scale?: number | undefined;
|
|
144
|
+
stg_block?: number | undefined;
|
|
145
|
+
video_frames?: number | undefined;
|
|
146
|
+
fps?: number | undefined;
|
|
147
|
+
flow_shift?: number | undefined;
|
|
148
|
+
high_noise_steps?: number | undefined;
|
|
149
|
+
high_noise_sampler?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
150
|
+
high_noise_scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | undefined;
|
|
151
|
+
high_noise_cfg_scale?: number | undefined;
|
|
152
|
+
high_noise_flow_shift?: number | undefined;
|
|
153
|
+
moe_boundary?: number | undefined;
|
|
154
|
+
vace_strength?: number | undefined;
|
|
155
|
+
vae_tile_size?: string | number | undefined;
|
|
156
|
+
vae_tile_overlap?: number | undefined;
|
|
157
|
+
temporal_tiling?: boolean | undefined;
|
|
158
|
+
cache_mode?: "disabled" | "easycache" | "ucache" | "dbcache" | "taylorseer" | "cache-dit" | undefined;
|
|
159
|
+
cache_threshold?: number | undefined;
|
|
160
|
+
lora?: never;
|
|
161
|
+
lora_strength?: never;
|
|
162
|
+
mode: "img2vid";
|
|
163
|
+
strength?: number;
|
|
164
|
+
reference_attention_strength?: never;
|
|
165
|
+
reference_downscale_factor?: never;
|
|
166
|
+
} | {
|
|
167
|
+
type: "videoStream";
|
|
168
|
+
requestId: string;
|
|
169
|
+
reference_images?: string[];
|
|
170
|
+
init_image?: string;
|
|
171
|
+
control_frames?: string[];
|
|
172
|
+
modelId: string;
|
|
173
|
+
seed?: number | undefined;
|
|
174
|
+
vae_tiling?: boolean | undefined;
|
|
175
|
+
prompt: string;
|
|
176
|
+
negative_prompt?: string | undefined;
|
|
177
|
+
width?: number | undefined;
|
|
178
|
+
height?: number | undefined;
|
|
179
|
+
steps?: number | undefined;
|
|
180
|
+
cfg_scale?: number | undefined;
|
|
181
|
+
sampling_method?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
182
|
+
scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | "ltx2" | undefined;
|
|
183
|
+
cache_preset?: string | undefined;
|
|
184
|
+
stg_scale?: number | undefined;
|
|
185
|
+
stg_block?: number | undefined;
|
|
186
|
+
video_frames?: number | undefined;
|
|
187
|
+
fps?: number | undefined;
|
|
188
|
+
flow_shift?: number | undefined;
|
|
189
|
+
high_noise_steps?: number | undefined;
|
|
190
|
+
high_noise_sampler?: "euler" | "euler_a" | "heun" | "dpm2" | "dpm++2m" | "dpm++2mv2" | "dpm++2s_a" | "lcm" | "ipndm" | "ipndm_v" | "ddim_trailing" | "tcd" | "res_multistep" | "res_2s" | undefined;
|
|
191
|
+
high_noise_scheduler?: "lcm" | "discrete" | "karras" | "exponential" | "ays" | "gits" | "sgm_uniform" | "simple" | "smoothstep" | "kl_optimal" | "bong_tangent" | undefined;
|
|
192
|
+
high_noise_cfg_scale?: number | undefined;
|
|
193
|
+
high_noise_flow_shift?: number | undefined;
|
|
194
|
+
moe_boundary?: number | undefined;
|
|
195
|
+
vace_strength?: number | undefined;
|
|
196
|
+
vae_tile_size?: string | number | undefined;
|
|
197
|
+
vae_tile_overlap?: number | undefined;
|
|
198
|
+
temporal_tiling?: boolean | undefined;
|
|
199
|
+
cache_mode?: "disabled" | "easycache" | "ucache" | "dbcache" | "taylorseer" | "cache-dit" | undefined;
|
|
200
|
+
cache_threshold?: number | undefined;
|
|
201
|
+
lora: string;
|
|
202
|
+
lora_strength?: number;
|
|
203
|
+
mode: "img2vid";
|
|
204
|
+
strength?: number;
|
|
205
|
+
reference_attention_strength?: never;
|
|
206
|
+
reference_downscale_factor?: never;
|
|
207
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { encodeBase64 } from '../utils/encoding.js';
|
|
2
|
+
export function createVideoStreamRequest(params, requestId) {
|
|
3
|
+
const { control_frames, init_image, reference_images, ...rest } = params;
|
|
4
|
+
return {
|
|
5
|
+
...rest,
|
|
6
|
+
...(control_frames !== undefined && {
|
|
7
|
+
control_frames: control_frames.map(encodeBase64)
|
|
8
|
+
}),
|
|
9
|
+
...(init_image !== undefined && {
|
|
10
|
+
init_image: encodeBase64(init_image)
|
|
11
|
+
}),
|
|
12
|
+
...(reference_images !== undefined && {
|
|
13
|
+
reference_images: reference_images.map(encodeBase64)
|
|
14
|
+
}),
|
|
15
|
+
type: 'videoStream',
|
|
16
|
+
requestId
|
|
17
|
+
};
|
|
18
|
+
}
|
package/dist/api/video.d.ts
CHANGED
|
@@ -21,8 +21,8 @@ export interface VideoResult {
|
|
|
21
21
|
* `modelConfig.clipVisionModelSrc` set to `clip_vision_h.safetensors`; LTX-2
|
|
22
22
|
* `img2vid` conditions on the first frame through its video VAE and needs no
|
|
23
23
|
* CLIP vision weights (the same LTX-2 model loaded for txt2vid also does
|
|
24
|
-
* img2vid). On React Native,
|
|
25
|
-
*
|
|
24
|
+
* img2vid). On React Native, the bundled video diffusion models are too large
|
|
25
|
+
* for typical mobile devices.
|
|
26
26
|
*
|
|
27
27
|
* @example Basic txt2vid generation
|
|
28
28
|
* ```typescript
|
|
@@ -76,6 +76,26 @@ export interface VideoResult {
|
|
|
76
76
|
* });
|
|
77
77
|
* ```
|
|
78
78
|
*
|
|
79
|
+
* @example LTX Ingredients reference conditioning
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const referenceSheet = fs.readFileSync("reference-sheet.png");
|
|
82
|
+
* const { outputs } = video({
|
|
83
|
+
* modelId,
|
|
84
|
+
* mode: "txt2vid",
|
|
85
|
+
* prompt: "Reference sheet: a red-haired explorer. Generated video: the explorer crosses a snowy ridge.",
|
|
86
|
+
* lora: "/absolute/path/to/ltx-2-ingredients.safetensors",
|
|
87
|
+
* lora_strength: 1.37,
|
|
88
|
+
* stg_scale: 1,
|
|
89
|
+
* stg_block: 29,
|
|
90
|
+
* reference_images: [referenceSheet],
|
|
91
|
+
* reference_attention_strength: 1,
|
|
92
|
+
* reference_downscale_factor: 1,
|
|
93
|
+
* video_frames: 217,
|
|
94
|
+
* scheduler: "ltx2",
|
|
95
|
+
* });
|
|
96
|
+
* const buffers = await outputs;
|
|
97
|
+
* ```
|
|
98
|
+
*
|
|
79
99
|
* @example Cancellation via requestId
|
|
80
100
|
* ```typescript
|
|
81
101
|
* const { requestId, outputs } = video({ modelId, mode: "txt2vid", prompt: "..." });
|
package/dist/api/video.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { videoStreamResponseSchema } from '../schemas/index.js';
|
|
2
|
+
import { createVideoStreamRequest } from './video-request.js';
|
|
2
3
|
import { stream as streamRpc } from '../dispatch.js';
|
|
3
4
|
import { generateRequestId } from '../runtime/request-id.js';
|
|
4
|
-
import { decodeBase64
|
|
5
|
+
import { decodeBase64 } from '../utils/encoding.js';
|
|
5
6
|
/**
|
|
6
7
|
* Generates a video using a loaded video diffusion model.
|
|
7
8
|
*
|
|
@@ -13,8 +14,8 @@ import { decodeBase64, encodeBase64 } from '../utils/encoding.js';
|
|
|
13
14
|
* `modelConfig.clipVisionModelSrc` set to `clip_vision_h.safetensors`; LTX-2
|
|
14
15
|
* `img2vid` conditions on the first frame through its video VAE and needs no
|
|
15
16
|
* CLIP vision weights (the same LTX-2 model loaded for txt2vid also does
|
|
16
|
-
* img2vid). On React Native,
|
|
17
|
-
*
|
|
17
|
+
* img2vid). On React Native, the bundled video diffusion models are too large
|
|
18
|
+
* for typical mobile devices.
|
|
18
19
|
*
|
|
19
20
|
* @example Basic txt2vid generation
|
|
20
21
|
* ```typescript
|
|
@@ -68,6 +69,26 @@ import { decodeBase64, encodeBase64 } from '../utils/encoding.js';
|
|
|
68
69
|
* });
|
|
69
70
|
* ```
|
|
70
71
|
*
|
|
72
|
+
* @example LTX Ingredients reference conditioning
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const referenceSheet = fs.readFileSync("reference-sheet.png");
|
|
75
|
+
* const { outputs } = video({
|
|
76
|
+
* modelId,
|
|
77
|
+
* mode: "txt2vid",
|
|
78
|
+
* prompt: "Reference sheet: a red-haired explorer. Generated video: the explorer crosses a snowy ridge.",
|
|
79
|
+
* lora: "/absolute/path/to/ltx-2-ingredients.safetensors",
|
|
80
|
+
* lora_strength: 1.37,
|
|
81
|
+
* stg_scale: 1,
|
|
82
|
+
* stg_block: 29,
|
|
83
|
+
* reference_images: [referenceSheet],
|
|
84
|
+
* reference_attention_strength: 1,
|
|
85
|
+
* reference_downscale_factor: 1,
|
|
86
|
+
* video_frames: 217,
|
|
87
|
+
* scheduler: "ltx2",
|
|
88
|
+
* });
|
|
89
|
+
* const buffers = await outputs;
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
71
92
|
* @example Cancellation via requestId
|
|
72
93
|
* ```typescript
|
|
73
94
|
* const { requestId, outputs } = video({ modelId, mode: "txt2vid", prompt: "..." });
|
|
@@ -77,18 +98,7 @@ import { decodeBase64, encodeBase64 } from '../utils/encoding.js';
|
|
|
77
98
|
*/
|
|
78
99
|
export function video(params) {
|
|
79
100
|
const requestId = generateRequestId();
|
|
80
|
-
const
|
|
81
|
-
const request = {
|
|
82
|
-
...rest,
|
|
83
|
-
...(control_frames !== undefined && {
|
|
84
|
-
control_frames: control_frames.map(encodeBase64)
|
|
85
|
-
}),
|
|
86
|
-
...(init_image !== undefined && {
|
|
87
|
-
init_image: encodeBase64(init_image)
|
|
88
|
-
}),
|
|
89
|
-
type: 'videoStream',
|
|
90
|
-
requestId
|
|
91
|
-
};
|
|
101
|
+
const request = createVideoStreamRequest(params, requestId);
|
|
92
102
|
let statsResolver = () => { };
|
|
93
103
|
let statsRejecter = () => { };
|
|
94
104
|
const statsPromise = new Promise((resolve, reject) => {
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Mirrors `preprocessImage` / `padState` / `DEFAULT_IMAGE_SIZE` from
|
|
5
5
|
* `@qvac/vla-ggml/addon.js`. Kept inlined (not re-exported from the addon)
|
|
6
|
-
* so preparing inputs never loads the addon's native binding
|
|
7
|
-
* without VLA prebuilds can still drive a remote VLA provider over delegation.
|
|
6
|
+
* so preparing inputs never loads the addon's native binding.
|
|
8
7
|
*
|
|
9
8
|
* This file is a verbatim port of the addon's JS implementation; keep them
|
|
10
9
|
* in sync so the produced tensors stay byte-identical regardless of where
|
package/dist/api/vla-helpers.js
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Mirrors `preprocessImage` / `padState` / `DEFAULT_IMAGE_SIZE` from
|
|
5
5
|
* `@qvac/vla-ggml/addon.js`. Kept inlined (not re-exported from the addon)
|
|
6
|
-
* so preparing inputs never loads the addon's native binding
|
|
7
|
-
* without VLA prebuilds can still drive a remote VLA provider over delegation.
|
|
6
|
+
* so preparing inputs never loads the addon's native binding.
|
|
8
7
|
*
|
|
9
8
|
* This file is a verbatim port of the addon's JS implementation; keep them
|
|
10
9
|
* in sync so the produced tensors stay byte-identical regardless of where
|
package/dist/api/vla.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { vlaHparamsResponseSchema, vlaRunResponseSchema, vlaSetEmbodimentResponseSchema } from '../schemas/index.js';
|
|
2
2
|
import { decodeBase64, encodeBase64 } from '../utils/encoding.js';
|
|
3
|
-
import { invokePlugin } from '
|
|
3
|
+
import { invokePlugin } from './invoke-plugin.js';
|
|
4
4
|
const VLA_RUN_HANDLER = 'vlaRun';
|
|
5
5
|
const VLA_HPARAMS_HANDLER = 'vlaHparams';
|
|
6
6
|
const VLA_SET_EMBODIMENT_HANDLER = 'vlaSetEmbodiment';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type WalkKey, type WalkKeysInput, type WorldSceneClientParams, type WorldSceneStats, type WorldSceneStreamRequest, type WorldStepClientParams, type WorldStepStats, type WorldStepStreamRequest } from '../schemas/sdcpp-config.js';
|
|
2
|
+
export type WorldStepStreamFactory = (request: WorldStepStreamRequest) => AsyncGenerator<unknown>;
|
|
3
|
+
export type WorldSceneStreamFactory = (request: WorldSceneStreamRequest) => AsyncGenerator<unknown>;
|
|
4
|
+
/** Mirrors `VideoProgressTick` / `DiffusionProgressTick`. */
|
|
5
|
+
export interface WorldStepProgressTick {
|
|
6
|
+
/** Blocks completed on this session, as the engine counts them. */
|
|
7
|
+
step: number;
|
|
8
|
+
/**
|
|
9
|
+
* Frames DELIVERED by the block that just finished — a final count, since the
|
|
10
|
+
* engine emits this after the frames rather than during. Named `totalSteps`
|
|
11
|
+
* only to keep the wire shape identical to `video` and `diffusion`.
|
|
12
|
+
*/
|
|
13
|
+
totalSteps: number;
|
|
14
|
+
elapsedMs: number;
|
|
15
|
+
}
|
|
16
|
+
export interface WorldStepResult {
|
|
17
|
+
requestId: string;
|
|
18
|
+
/** Frames of this block, yielded as the transport delivers them. */
|
|
19
|
+
frameStream: AsyncGenerator<Uint8Array>;
|
|
20
|
+
/**
|
|
21
|
+
* The engine's own tick for each completed block, forwarded verbatim — the
|
|
22
|
+
* same field shape `video` and `diffusion` expose.
|
|
23
|
+
*
|
|
24
|
+
* NOT mid-block liveness, and it cannot be. `WorldSessionModel.cpp` runs the
|
|
25
|
+
* block to completion, delivers every frame, and only then fires its progress
|
|
26
|
+
* callback: exactly one tick per block, after the frames. So this yields once
|
|
27
|
+
* per `worldStep`, at the end. Use it to report what a block did; a "still
|
|
28
|
+
* working" signal during the 1.8-7.5s a block takes needs an addon change.
|
|
29
|
+
*/
|
|
30
|
+
progressStream: AsyncGenerator<WorldStepProgressTick>;
|
|
31
|
+
/** Every frame of the block, once it completes. */
|
|
32
|
+
frames: Promise<Uint8Array[]>;
|
|
33
|
+
stats: Promise<WorldStepStats | undefined>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Completion of a scene creation. The world is live on the session either way —
|
|
37
|
+
* `stats` is what tells you it finished.
|
|
38
|
+
*/
|
|
39
|
+
export interface WorldSceneResult {
|
|
40
|
+
requestId: string;
|
|
41
|
+
stats: Promise<WorldSceneStats | undefined>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* What `worldCreateScene({ returnPack: true })` returns. `scene` exists only on
|
|
45
|
+
* this shape, so the bytes cannot be awaited on a request that never asked for
|
|
46
|
+
* them — the alternative, a `Promise<Uint8Array | undefined>` on one shared
|
|
47
|
+
* type, pushes that check to every caller and hides it from the compiler.
|
|
48
|
+
*
|
|
49
|
+
* Save the bytes to walk the world again: pass the file back as
|
|
50
|
+
* `modelConfig.sceneSrc` on a later `loadModel`. `sceneSrc` stays a path/URL —
|
|
51
|
+
* it is resolved on the load path with every other model source.
|
|
52
|
+
*/
|
|
53
|
+
export interface WorldSceneResultWithPack extends WorldSceneResult {
|
|
54
|
+
scene: Promise<Uint8Array>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Normalizes the three accepted key forms to the array the wire schema takes.
|
|
58
|
+
*
|
|
59
|
+
* A raw mask is accepted because the native session is ultimately driven by
|
|
60
|
+
* one, and a key-state object is accepted because that is what a keyboard
|
|
61
|
+
* handler naturally holds — neither should force the caller to convert.
|
|
62
|
+
*/
|
|
63
|
+
export declare function toWalkKeys(keys: WalkKeysInput | undefined): WalkKey[];
|
|
64
|
+
export declare function createWorldStepResult(params: WorldStepClientParams, streamFactory: WorldStepStreamFactory): WorldStepResult;
|
|
65
|
+
export declare function createWorldSceneResult(params: WorldSceneClientParams & {
|
|
66
|
+
returnPack: true;
|
|
67
|
+
}, streamFactory: WorldSceneStreamFactory): WorldSceneResultWithPack;
|
|
68
|
+
export declare function createWorldSceneResult(params: WorldSceneClientParams & {
|
|
69
|
+
returnPack?: false | undefined;
|
|
70
|
+
}, streamFactory: WorldSceneStreamFactory): WorldSceneResult;
|
|
71
|
+
export declare function createWorldSceneResult(params: WorldSceneClientParams, streamFactory: WorldSceneStreamFactory): WorldSceneResult | WorldSceneResultWithPack;
|