@qvac/sdk 0.14.1 → 0.15.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 +27 -11
- package/README.md +34 -35
- package/dist/client/api/batch-completion.d.ts +15 -0
- package/dist/client/api/batch-completion.js +332 -0
- package/dist/client/api/bci-transcribe.d.ts +1 -1
- package/dist/client/api/bci-transcribe.js +31 -31
- package/dist/client/api/cancel.d.ts +1 -1
- package/dist/client/api/cancel.js +18 -18
- package/dist/client/api/classify.d.ts +1 -1
- package/dist/client/api/classify.js +9 -6
- package/dist/client/api/client-request-id.js +1 -1
- package/dist/client/api/completion-stream.d.ts +3 -3
- package/dist/client/api/completion-stream.js +18 -18
- package/dist/client/api/delete-cache.js +9 -9
- package/dist/client/api/diffusion.d.ts +1 -1
- package/dist/client/api/diffusion.js +17 -11
- package/dist/client/api/download-asset.d.ts +1 -1
- package/dist/client/api/download-asset.js +11 -11
- package/dist/client/api/embed.d.ts +1 -1
- package/dist/client/api/embed.js +10 -10
- package/dist/client/api/finetune.d.ts +1 -1
- package/dist/client/api/finetune.js +25 -27
- package/dist/client/api/get-loaded-model-info.d.ts +2 -2
- package/dist/client/api/get-loaded-model-info.js +8 -8
- package/dist/client/api/get-model-info.d.ts +1 -1
- package/dist/client/api/get-model-info.js +7 -7
- package/dist/client/api/heartbeat.d.ts +2 -2
- package/dist/client/api/heartbeat.js +7 -7
- package/dist/client/api/index.d.ts +33 -32
- package/dist/client/api/index.js +33 -32
- package/dist/client/api/invoke-plugin.d.ts +1 -1
- package/dist/client/api/invoke-plugin.js +10 -10
- package/dist/client/api/load-model.d.ts +1 -1
- package/dist/client/api/load-model.js +32 -32
- package/dist/client/api/logging-stream.d.ts +1 -1
- package/dist/client/api/logging-stream.js +6 -6
- package/dist/client/api/ocr.d.ts +1 -1
- package/dist/client/api/ocr.js +11 -11
- package/dist/client/api/provide.d.ts +1 -1
- package/dist/client/api/provide.js +7 -7
- package/dist/client/api/rag.d.ts +1 -1
- package/dist/client/api/rag.js +65 -66
- package/dist/client/api/registry.d.ts +1 -1
- package/dist/client/api/registry.js +8 -8
- package/dist/client/api/resume.js +5 -5
- package/dist/client/api/state.d.ts +1 -1
- package/dist/client/api/state.js +5 -5
- package/dist/client/api/stop-provider.js +6 -6
- package/dist/client/api/subscribe-logs.d.ts +1 -1
- package/dist/client/api/subscribe-logs.js +3 -3
- package/dist/client/api/suspend.js +5 -5
- package/dist/client/api/text-to-speech.d.ts +1 -1
- package/dist/client/api/text-to-speech.js +37 -39
- package/dist/client/api/transcribe.d.ts +2 -2
- package/dist/client/api/transcribe.js +44 -45
- package/dist/client/api/translate.d.ts +1 -1
- package/dist/client/api/translate.js +14 -14
- package/dist/client/api/unload-model.d.ts +1 -1
- package/dist/client/api/unload-model.js +11 -11
- package/dist/client/api/upscale.d.ts +1 -1
- package/dist/client/api/upscale.js +9 -9
- package/dist/client/api/video.d.ts +1 -1
- package/dist/client/api/video.js +16 -14
- package/dist/client/api/vla-helpers.d.ts +2 -2
- package/dist/client/api/vla-helpers.js +6 -11
- package/dist/client/api/vla.d.ts +1 -1
- package/dist/client/api/vla.js +13 -13
- package/dist/client/config-loader/config-utils.d.ts +1 -1
- package/dist/client/config-loader/config-utils.js +3 -3
- package/dist/client/config-loader/resolve-config.bare.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.bare.js +11 -11
- package/dist/client/config-loader/resolve-config.expo.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.expo.js +6 -6
- package/dist/client/config-loader/resolve-config.node.d.ts +1 -1
- package/dist/client/config-loader/resolve-config.node.js +27 -27
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/init-hooks.d.ts +1 -1
- package/dist/client/init-hooks.js +12 -12
- package/dist/client/logging-stream-registry.d.ts +1 -1
- package/dist/client/logging-stream-registry.js +6 -6
- package/dist/client/parse-input.d.ts +1 -1
- package/dist/client/parse-input.js +3 -3
- package/dist/client/plugins-factory.d.ts +2 -2
- package/dist/client/plugins-factory.js +2 -2
- package/dist/client/rpc/bare-client.d.ts +2 -1
- package/dist/client/rpc/bare-client.js +37 -39
- package/dist/client/rpc/ensure-worker-ready.js +4 -4
- package/dist/client/rpc/expo-device-info.d.ts +1 -1
- package/dist/client/rpc/expo-device-info.js +11 -11
- package/dist/client/rpc/expo-rpc-client.d.ts +2 -1
- package/dist/client/rpc/expo-rpc-client.js +38 -47
- package/dist/client/rpc/node-rpc-client.d.ts +2 -1
- package/dist/client/rpc/node-rpc-client.js +103 -75
- package/dist/client/rpc/profiling/index.d.ts +1 -1
- package/dist/client/rpc/profiling/index.js +1 -1
- package/dist/client/rpc/profiling/profiler.d.ts +2 -2
- package/dist/client/rpc/profiling/profiler.js +31 -34
- package/dist/client/rpc/rpc-client.d.ts +2 -2
- package/dist/client/rpc/rpc-client.js +113 -72
- package/dist/client/rpc/rpc-error.d.ts +1 -1
- package/dist/client/rpc/rpc-error.js +14 -14
- package/dist/commands/bundle/bare-pack.d.ts +1 -1
- package/dist/commands/bundle/bare-pack.js +20 -20
- package/dist/commands/bundle/constants.js +21 -21
- package/dist/commands/bundle/entry-gen.js +4 -4
- package/dist/commands/bundle/index.js +45 -47
- package/dist/commands/bundle/manifest.d.ts +1 -1
- package/dist/commands/bundle/manifest.js +44 -46
- package/dist/commands/bundle/plugins.d.ts +2 -2
- package/dist/commands/bundle/plugins.js +7 -7
- package/dist/commands/bundle/resolve-sdk-import.js +6 -13
- package/dist/commands/index.d.ts +4 -4
- package/dist/commands/index.js +2 -2
- package/dist/commands/verify/abi.d.ts +9 -9
- package/dist/commands/verify/abi.js +31 -31
- package/dist/commands/verify/addon-source.d.ts +1 -1
- package/dist/commands/verify/addon-source.js +13 -14
- package/dist/commands/verify/bundle-source.d.ts +1 -1
- package/dist/commands/verify/bundle-source.js +7 -7
- package/dist/commands/verify/index.d.ts +3 -3
- package/dist/commands/verify/index.js +18 -17
- package/dist/commands/verify/node-modules-source.d.ts +1 -1
- package/dist/commands/verify/node-modules-source.js +11 -11
- package/dist/commands/verify/prebuilds.d.ts +3 -3
- package/dist/commands/verify/prebuilds.js +8 -8
- package/dist/constants/audio.d.ts +1 -1
- package/dist/constants/audio.js +1 -1
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/index.js +2 -2
- package/dist/constants/registry.js +1 -1
- package/dist/examples/audio/mic-input.d.ts +1 -1
- package/dist/examples/audio/mic-input.js +31 -31
- package/dist/examples/batch-completion.d.ts +38 -0
- package/dist/examples/batch-completion.js +100 -0
- package/dist/examples/bci/bci-filesystem-streaming.js +20 -20
- package/dist/examples/bci/bci-filesystem.js +17 -17
- package/dist/examples/cache-management.js +32 -32
- package/dist/examples/cancel-by-request-id.js +11 -11
- package/dist/examples/classification/classify-image.js +5 -5
- package/dist/examples/completion-events.js +16 -18
- package/dist/examples/completion-stop-reason.js +13 -13
- package/dist/examples/concurrent-completion-collision.js +20 -20
- package/dist/examples/config/blind-relay/blind-relay.config.js +4 -4
- package/dist/examples/config/default/default.config.js +2 -2
- package/dist/examples/config/plugins/plugins.config.js +2 -2
- package/dist/examples/config-reload.js +14 -14
- package/dist/examples/default-config-usage.js +10 -13
- package/dist/examples/delegated-inference/composite.js +23 -23
- package/dist/examples/delegated-inference/consumer-profiled.js +19 -19
- package/dist/examples/delegated-inference/consumer.js +11 -11
- package/dist/examples/delegated-inference/provider.js +24 -24
- package/dist/examples/diffusion-esrgan-upscale.js +19 -19
- package/dist/examples/diffusion-flux2-klein-img2img.js +17 -17
- package/dist/examples/diffusion-flux2-klein.js +14 -14
- package/dist/examples/diffusion-img2img.js +13 -13
- package/dist/examples/diffusion-img2vid.js +22 -23
- package/dist/examples/diffusion-simple.js +7 -7
- package/dist/examples/diffusion-txt2img.js +13 -14
- package/dist/examples/diffusion-txt2vid.js +18 -18
- package/dist/examples/download-with-blind-relays.js +7 -8
- package/dist/examples/download-with-cancel.js +9 -9
- package/dist/examples/embed-multi-gpu.js +9 -9
- package/dist/examples/embed-p2p.js +24 -24
- package/dist/examples/finetune/llamacpp-finetune.js +21 -21
- package/dist/examples/kv-cache-cleanup.js +34 -34
- package/dist/examples/kv-cache-custom-key.js +30 -30
- package/dist/examples/kv-cache-example.js +18 -20
- package/dist/examples/llamacpp-cache.js +33 -33
- package/dist/examples/llamacpp-dynamic-tools.js +38 -38
- package/dist/examples/llamacpp-filesystem.js +13 -15
- package/dist/examples/llamacpp-http.js +12 -14
- package/dist/examples/llamacpp-multi-gpu.js +12 -12
- package/dist/examples/llamacpp-multimodal.js +16 -16
- package/dist/examples/llamacpp-p2p.js +11 -11
- package/dist/examples/llamacpp-sharded.js +12 -12
- package/dist/examples/llamacpp-structured-output.js +37 -37
- package/dist/examples/logging-file-transport.js +19 -21
- package/dist/examples/logging-global.js +8 -8
- package/dist/examples/logging-streaming.js +16 -18
- package/dist/examples/mcp-websearch.js +44 -44
- package/dist/examples/multi-model-demo.js +33 -33
- package/dist/examples/ocr-fasttext.js +17 -17
- package/dist/examples/parallel-download.js +11 -13
- package/dist/examples/plugins.js +43 -43
- package/dist/examples/profiling/basic.js +34 -36
- package/dist/examples/profiling/per-call.js +16 -16
- package/dist/examples/quickstart.bare.js +4 -6
- package/dist/examples/quickstart.js +7 -7
- package/dist/examples/rag/rag-chromadb.js +26 -26
- package/dist/examples/rag/rag-hyperdb/cancellation.js +19 -20
- package/dist/examples/rag/rag-hyperdb/ingest.js +19 -19
- package/dist/examples/rag/rag-hyperdb/pipeline.js +26 -26
- package/dist/examples/rag/rag-hyperdb/workspaces.js +46 -46
- package/dist/examples/rag/rag-lancedb.js +29 -32
- package/dist/examples/rag/rag-sqlite.js +25 -25
- package/dist/examples/registry-query.js +15 -15
- package/dist/examples/seed-p2p.js +8 -8
- package/dist/examples/suspend-resume.js +20 -20
- package/dist/examples/tools/llamacpp-native-tools.js +25 -25
- package/dist/examples/tools/llamacpp-tools-gemma4.js +14 -14
- package/dist/examples/tools/llamacpp-tools-harmony-multiturn.js +15 -15
- package/dist/examples/tools/llamacpp-tools-pythonic.js +15 -15
- package/dist/examples/tools/llamacpp-tools-qwen35.js +14 -14
- package/dist/examples/tools/shared.d.ts +2 -2
- package/dist/examples/tools/shared.js +17 -17
- package/dist/examples/transcription/parakeet-ctc-filesystem.js +12 -12
- package/dist/examples/transcription/parakeet-microphone-record.js +19 -19
- package/dist/examples/transcription/parakeet-microphone-stream.js +23 -23
- package/dist/examples/transcription/parakeet-sortformer-streaming.js +18 -28
- package/dist/examples/transcription/parakeet-sortformer.js +21 -21
- package/dist/examples/transcription/parakeet-tdt-filesystem.js +13 -13
- package/dist/examples/transcription/whispercpp-filesystem-streaming.js +34 -34
- package/dist/examples/transcription/whispercpp-filesystem.js +19 -19
- package/dist/examples/transcription/whispercpp-microphone-conversation.js +27 -27
- package/dist/examples/transcription/whispercpp-microphone-record.js +21 -21
- package/dist/examples/transcription/whispercpp-prompt.js +18 -18
- package/dist/examples/translation/translation-bergamot-batch.js +17 -17
- package/dist/examples/translation/translation-bergamot-pivot.js +16 -16
- package/dist/examples/translation/translation-bergamot.js +11 -11
- package/dist/examples/translation/translation-indic.js +10 -10
- package/dist/examples/translation/translation-llm-afriquegemma.js +10 -10
- package/dist/examples/translation/translation-llm-context.js +10 -10
- package/dist/examples/translation/translation-llm.js +13 -13
- package/dist/examples/translation/translation-stream.js +11 -11
- package/dist/examples/tts/chatterbox-enhanced.d.ts +2 -0
- package/dist/examples/tts/chatterbox-enhanced.js +55 -0
- package/dist/examples/tts/chatterbox-multilingual.d.ts +2 -0
- package/dist/examples/tts/chatterbox-multilingual.js +54 -0
- package/dist/examples/tts/chatterbox.js +18 -18
- package/dist/examples/tts/llm-to-tts-streaming.js +30 -30
- package/dist/examples/tts/supertonic-enhanced.d.ts +2 -0
- package/dist/examples/tts/supertonic-enhanced.js +57 -0
- package/dist/examples/tts/supertonic-multilingual.js +19 -19
- package/dist/examples/tts/supertonic.js +18 -18
- package/dist/examples/tts/utils.js +24 -32
- package/dist/examples/vla-pi05.js +14 -14
- package/dist/examples/vla-smolvla.js +14 -14
- package/dist/examples/voice-assistant/voice-assistant.js +46 -46
- package/dist/expo/plugins/find-in-ancestor-node-modules.js +3 -3
- package/dist/expo/plugins/get-project-root.d.ts +2 -2
- package/dist/expo/plugins/get-project-root.js +1 -1
- package/dist/expo/plugins/index.d.ts +11 -11
- package/dist/expo/plugins/index.js +10 -10
- package/dist/expo/plugins/resolve-sdk-package-dir.js +7 -11
- package/dist/expo/plugins/withAndroidArchitecture.d.ts +1 -1
- package/dist/expo/plugins/withAndroidArchitecture.js +12 -12
- package/dist/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
- package/dist/expo/plugins/withAndroidNdkVersion.js +9 -9
- package/dist/expo/plugins/withDeviceInfo.d.ts +1 -1
- package/dist/expo/plugins/withDeviceInfo.js +13 -13
- package/dist/expo/plugins/withMobileBundle.d.ts +1 -1
- package/dist/expo/plugins/withMobileBundle.js +34 -42
- package/dist/expo/plugins/withOpenCL.d.ts +1 -1
- package/dist/expo/plugins/withOpenCL.js +14 -16
- package/dist/expo/plugins/withQvacSDK.d.ts +1 -1
- package/dist/expo/plugins/withQvacSDK.js +12 -12
- package/dist/index.d.ts +16 -16
- package/dist/index.js +16 -17
- package/dist/logging/addon.d.ts +1 -1
- package/dist/logging/addon.js +13 -13
- package/dist/logging/base-logger.d.ts +2 -2
- package/dist/logging/base-logger.js +6 -6
- package/dist/logging/client-logger.d.ts +1 -1
- package/dist/logging/client-logger.js +3 -3
- package/dist/logging/index.d.ts +9 -9
- package/dist/logging/index.js +8 -8
- package/dist/logging/logger.d.ts +1 -1
- package/dist/logging/logger.js +4 -4
- package/dist/logging/namespaces.d.ts +1 -1
- package/dist/logging/namespaces.js +5 -5
- package/dist/logging/registry.d.ts +2 -2
- package/dist/logging/registry.js +3 -3
- package/dist/logging/server-logger.d.ts +1 -1
- package/dist/logging/server-logger.js +2 -2
- package/dist/logging/stream-logger.d.ts +1 -1
- package/dist/logging/stream-logger.js +4 -4
- package/dist/logging/transport.d.ts +1 -1
- package/dist/logging/types.d.ts +1 -1
- package/dist/logging/utils.d.ts +2 -2
- package/dist/logging/utils.js +40 -41
- package/dist/models/registry/index.d.ts +1 -1
- package/dist/models/registry/index.js +5 -5
- package/dist/models/registry/models.d.ts +429 -122
- package/dist/models/registry/models.js +13693 -13369
- package/dist/models/update-models/codegen.d.ts +1 -1
- package/dist/models/update-models/codegen.js +8 -8
- package/dist/models/update-models/companions.d.ts +6 -1
- package/dist/models/update-models/companions.js +104 -39
- package/dist/models/update-models/history.d.ts +1 -1
- package/dist/models/update-models/history.js +11 -11
- package/dist/models/update-models/index.js +32 -34
- package/dist/models/update-models/naming.d.ts +2 -2
- package/dist/models/update-models/naming.js +177 -186
- package/dist/models/update-models/processing.d.ts +2 -2
- package/dist/models/update-models/processing.js +17 -19
- package/dist/models/update-models/registry.d.ts +2 -2
- package/dist/models/update-models/registry.js +9 -9
- package/dist/models/update-models/shards.d.ts +1 -1
- package/dist/models/update-models/shards.js +3 -3
- package/dist/models/update-models/types.d.ts +1 -1
- package/dist/models/update-models/utils.js +5 -5
- package/dist/pear/pre.js +84 -84
- package/dist/profiling/aggregator.d.ts +1 -1
- package/dist/profiling/aggregator.js +6 -6
- package/dist/profiling/clock.d.ts +1 -1
- package/dist/profiling/clock.js +10 -10
- package/dist/profiling/controller.d.ts +2 -2
- package/dist/profiling/controller.js +11 -12
- package/dist/profiling/envelope.d.ts +1 -1
- package/dist/profiling/envelope.js +4 -6
- package/dist/profiling/events.d.ts +2 -2
- package/dist/profiling/events.js +8 -10
- package/dist/profiling/exporters.d.ts +1 -1
- package/dist/profiling/exporters.js +81 -79
- package/dist/profiling/index.d.ts +8 -8
- package/dist/profiling/index.js +7 -7
- package/dist/profiling/model-execution.js +2 -1
- package/dist/profiling/ring-buffer.js +2 -2
- package/dist/profiling/types.d.ts +3 -3
- package/dist/schemas/archive.d.ts +1 -1
- package/dist/schemas/archive.js +8 -14
- package/dist/schemas/batch-completion-stream.d.ts +463 -0
- package/dist/schemas/batch-completion-stream.js +124 -0
- package/dist/schemas/bci-config.d.ts +1 -1
- package/dist/schemas/bci-config.js +7 -7
- package/dist/schemas/bci.d.ts +3 -3
- package/dist/schemas/bci.js +25 -31
- package/dist/schemas/cancel.d.ts +6 -1
- package/dist/schemas/cancel.js +33 -34
- package/dist/schemas/classification.d.ts +1 -1
- package/dist/schemas/classification.js +7 -7
- package/dist/schemas/common.d.ts +194 -25
- package/dist/schemas/common.js +40 -37
- package/dist/schemas/completion-event.d.ts +11 -8
- package/dist/schemas/completion-event.js +27 -26
- package/dist/schemas/completion-stream.d.ts +4 -3
- package/dist/schemas/completion-stream.js +51 -67
- package/dist/schemas/delegate.d.ts +1 -1
- package/dist/schemas/delegate.js +7 -7
- package/dist/schemas/delete-cache.d.ts +1 -1
- package/dist/schemas/delete-cache.js +8 -8
- package/dist/schemas/download-asset.d.ts +2 -2
- package/dist/schemas/download-asset.js +21 -21
- package/dist/schemas/embed.d.ts +3 -3
- package/dist/schemas/embed.js +16 -27
- package/dist/schemas/engine-addon-map.d.ts +2 -2
- package/dist/schemas/engine-addon-map.js +24 -24
- package/dist/schemas/error.d.ts +1 -1
- package/dist/schemas/error.js +12 -13
- package/dist/schemas/finetune.d.ts +1 -1
- package/dist/schemas/finetune.js +35 -41
- package/dist/schemas/get-loaded-model-info.d.ts +1 -1
- package/dist/schemas/get-loaded-model-info.js +10 -10
- package/dist/schemas/get-model-info.d.ts +1 -1
- package/dist/schemas/get-model-info.js +48 -91
- package/dist/schemas/heartbeat.d.ts +1 -1
- package/dist/schemas/heartbeat.js +6 -6
- package/dist/schemas/index.d.ts +52 -51
- package/dist/schemas/index.js +52 -51
- package/dist/schemas/json-schema.d.ts +1 -1
- package/dist/schemas/llamacpp-config.d.ts +33 -25
- package/dist/schemas/llamacpp-config.js +43 -30
- package/dist/schemas/load-model.d.ts +160 -128
- package/dist/schemas/load-model.js +120 -126
- package/dist/schemas/logging-stream.d.ts +1 -1
- package/dist/schemas/logging-stream.js +6 -12
- package/dist/schemas/mcp-adapter.d.ts +1 -1
- package/dist/schemas/model-src-utils.d.ts +1 -1
- package/dist/schemas/model-src-utils.js +13 -13
- package/dist/schemas/model-types.d.ts +1 -1
- package/dist/schemas/model-types.js +27 -27
- package/dist/schemas/ocr.d.ts +1 -1
- package/dist/schemas/ocr.js +18 -18
- package/dist/schemas/path-validation.d.ts +1 -1
- package/dist/schemas/path-validation.js +4 -4
- package/dist/schemas/plugin.d.ts +9 -10
- package/dist/schemas/plugin.js +47 -47
- package/dist/schemas/profiling.d.ts +1 -1
- package/dist/schemas/profiling.js +16 -16
- package/dist/schemas/provide.d.ts +1 -1
- package/dist/schemas/provide.js +8 -8
- package/dist/schemas/rag.d.ts +3 -3
- package/dist/schemas/rag.js +65 -70
- package/dist/schemas/registry.d.ts +1 -1
- package/dist/schemas/registry.js +44 -66
- package/dist/schemas/reload-config.d.ts +1 -1
- package/dist/schemas/reload-config.js +14 -18
- package/dist/schemas/resume.d.ts +1 -1
- package/dist/schemas/resume.js +3 -3
- package/dist/schemas/runtime-context.d.ts +1 -1
- package/dist/schemas/runtime-context.js +4 -4
- package/dist/schemas/sdcpp-config.d.ts +9 -9
- package/dist/schemas/sdcpp-config.js +298 -300
- package/dist/schemas/sdk-config.d.ts +55 -43
- package/dist/schemas/sdk-config.js +25 -29
- package/dist/schemas/sdk-errors-client.d.ts +1 -1
- package/dist/schemas/sdk-errors-client.js +80 -80
- package/dist/schemas/sdk-errors-registry.js +1 -1
- package/dist/schemas/sdk-errors-server.d.ts +1 -1
- package/dist/schemas/sdk-errors-server.js +200 -199
- package/dist/schemas/shard.d.ts +1 -1
- package/dist/schemas/shard.js +4 -4
- package/dist/schemas/state.d.ts +1 -1
- package/dist/schemas/state.js +5 -10
- package/dist/schemas/stop-provide.d.ts +1 -1
- package/dist/schemas/stop-provide.js +4 -4
- package/dist/schemas/suspend.d.ts +1 -1
- package/dist/schemas/suspend.js +3 -3
- package/dist/schemas/text-to-speech.d.ts +455 -3
- package/dist/schemas/text-to-speech.js +146 -110
- package/dist/schemas/tools.d.ts +1 -1
- package/dist/schemas/tools.js +17 -24
- package/dist/schemas/transcription-config.d.ts +1 -1
- package/dist/schemas/transcription-config.js +18 -18
- package/dist/schemas/transcription.d.ts +5 -5
- package/dist/schemas/transcription.js +31 -33
- package/dist/schemas/translate.d.ts +3 -3
- package/dist/schemas/translate.js +38 -67
- package/dist/schemas/translation-config.d.ts +1 -1
- package/dist/schemas/translation-config.js +116 -123
- package/dist/schemas/unload-model.d.ts +1 -1
- package/dist/schemas/unload-model.js +6 -6
- package/dist/schemas/vla.d.ts +1 -1
- package/dist/schemas/vla.js +30 -30
- package/dist/scripts/run-security-tests.js +9 -10
- package/dist/scripts/run-unit-tests.js +11 -12
- package/dist/server/bare/delegate-connect-diagnostics.js +13 -19
- package/dist/server/bare/delegate-rpc-client.d.ts +2 -2
- package/dist/server/bare/delegate-rpc-client.js +32 -34
- package/dist/server/bare/hyperswarm.d.ts +3 -3
- package/dist/server/bare/hyperswarm.js +14 -14
- package/dist/server/bare/ops/bci-transcribe.d.ts +1 -1
- package/dist/server/bare/ops/bci-transcribe.js +44 -44
- package/dist/server/bare/ops/cancel.d.ts +2 -2
- package/dist/server/bare/ops/cancel.js +6 -6
- package/dist/server/bare/ops/embed.d.ts +1 -1
- package/dist/server/bare/ops/embed.js +26 -16
- package/dist/server/bare/ops/kv-cache-utils.d.ts +1 -1
- package/dist/server/bare/ops/kv-cache-utils.js +17 -19
- package/dist/server/bare/ops/load-model.d.ts +2 -2
- package/dist/server/bare/ops/load-model.js +14 -18
- package/dist/server/bare/ops/transcribe.d.ts +3 -3
- package/dist/server/bare/ops/transcribe.js +62 -62
- package/dist/server/bare/ops/translate.d.ts +1 -1
- package/dist/server/bare/ops/translate.js +39 -30
- package/dist/server/bare/ops/unload-model.d.ts +1 -1
- package/dist/server/bare/ops/unload-model.js +12 -12
- package/dist/server/bare/plugins/bci-whispercpp-transcription/args.d.ts +2 -2
- package/dist/server/bare/plugins/bci-whispercpp-transcription/args.js +3 -3
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.d.ts +2 -2
- package/dist/server/bare/plugins/bci-whispercpp-transcription/plugin.js +33 -33
- package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.d.ts +1 -1
- package/dist/server/bare/plugins/bci-whispercpp-transcription/resolve-config.js +1 -1
- package/dist/server/bare/plugins/ggml-classification/ops/classify.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-classification/ops/classify.js +8 -8
- package/dist/server/bare/plugins/ggml-classification/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-classification/plugin.js +14 -14
- package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-ocr/ops/ocr-stream.js +27 -26
- package/dist/server/bare/plugins/ggml-ocr/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-ocr/plugin.js +38 -38
- package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-vla/ops/vla-hparams.js +3 -3
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-vla/ops/vla-run.js +23 -23
- package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/ggml-vla/plugin.js +15 -15
- package/dist/server/bare/plugins/index.d.ts +11 -11
- package/dist/server/bare/plugins/index.js +11 -11
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.d.ts +23 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.js +30 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.d.ts +32 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.js +99 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.d.ts +1 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +8 -8
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +3 -2
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +4 -1
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +22 -4
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +55 -59
- package/dist/server/bare/plugins/llamacpp-completion/ops/context-overflow.js +5 -5
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.d.ts +2 -2
- package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +34 -34
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +7 -7
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +19 -23
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +4 -6
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +186 -17
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +235 -70
- package/dist/server/bare/plugins/llamacpp-completion/transform.d.ts +1 -1
- package/dist/server/bare/plugins/llamacpp-completion/transform.js +15 -15
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.d.ts +3 -3
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +27 -29
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +38 -39
- package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.d.ts +1 -1
- package/dist/server/bare/plugins/nmtcpp-translation/resolve-vocab.js +19 -22
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +36 -36
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.d.ts +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +15 -17
- package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.d.ts +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/upscale.js +11 -11
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.d.ts +1 -1
- package/dist/server/bare/plugins/sdcpp-generation/ops/video.js +42 -44
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +4 -4
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +69 -63
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.d.ts +2 -2
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech-stream.js +19 -21
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.d.ts +2 -2
- package/dist/server/bare/plugins/tts-ggml/ops/text-to-speech.js +22 -24
- package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +3 -2
- package/dist/server/bare/plugins/tts-ggml/plugin.js +95 -49
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +52 -52
- package/dist/server/bare/rag-hyperdb/handlers/chunk.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/chunk.js +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/close-workspace.js +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/delete-embeddings.js +4 -4
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/delete-workspace.js +3 -3
- package/dist/server/bare/rag-hyperdb/handlers/ingest.d.ts +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/ingest.js +4 -4
- package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/list-workspaces.js +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/reindex.d.ts +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/reindex.js +5 -5
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.d.ts +2 -2
- package/dist/server/bare/rag-hyperdb/handlers/save-embeddings.js +3 -3
- package/dist/server/bare/rag-hyperdb/handlers/search.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/handlers/search.js +3 -3
- package/dist/server/bare/rag-hyperdb/index.d.ts +11 -11
- package/dist/server/bare/rag-hyperdb/index.js +11 -11
- package/dist/server/bare/rag-hyperdb/rag-operation-manager.js +3 -3
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.d.ts +1 -1
- package/dist/server/bare/rag-hyperdb/rag-workspace-manager.js +20 -20
- package/dist/server/bare/registry/config-registry.d.ts +1 -1
- package/dist/server/bare/registry/config-registry.js +13 -16
- package/dist/server/bare/registry/logging-stream-registry.d.ts +1 -1
- package/dist/server/bare/registry/logging-stream-registry.js +2 -2
- package/dist/server/bare/registry/model-config-registry.d.ts +2 -2
- package/dist/server/bare/registry/model-config-registry.js +6 -6
- package/dist/server/bare/registry/model-config-utils.d.ts +2 -2
- package/dist/server/bare/registry/model-config-utils.js +35 -35
- package/dist/server/bare/registry/model-registry.d.ts +3 -3
- package/dist/server/bare/registry/model-registry.js +11 -11
- package/dist/server/bare/registry/registry-client.d.ts +1 -1
- package/dist/server/bare/registry/registry-client.js +18 -18
- package/dist/server/bare/registry/runtime-context-registry.d.ts +1 -1
- package/dist/server/bare/registry/runtime-context-registry.js +3 -3
- package/dist/server/bare/runtime/disposable-scope.js +3 -3
- package/dist/server/bare/runtime/index.d.ts +7 -7
- package/dist/server/bare/runtime/index.js +3 -3
- package/dist/server/bare/runtime/request-context.d.ts +4 -4
- package/dist/server/bare/runtime/request-id.js +1 -1
- package/dist/server/bare/runtime/request-registry-singleton.d.ts +1 -1
- package/dist/server/bare/runtime/request-registry-singleton.js +23 -4
- package/dist/server/bare/runtime/request-registry.d.ts +27 -12
- package/dist/server/bare/runtime/request-registry.js +39 -34
- package/dist/server/bare/runtime/with-request-context.d.ts +1 -1
- package/dist/server/bare/runtime/with-request-context.js +11 -11
- package/dist/server/bare/runtime-lifecycle.d.ts +1 -1
- package/dist/server/bare/runtime-lifecycle.js +27 -31
- package/dist/server/bare/types/addon-responses.d.ts +5 -4
- package/dist/server/bare/utils/audio-input.d.ts +2 -2
- package/dist/server/bare/utils/audio-input.js +7 -7
- package/dist/server/bare/utils/transcribe-metadata.d.ts +1 -1
- package/dist/server/bare/utils/transcribe-metadata.js +4 -4
- package/dist/server/bare/utils/tts-stats.d.ts +1 -1
- package/dist/server/bare/utils/tts-stats.js +3 -3
- package/dist/server/env.js +8 -8
- package/dist/server/error-handlers.d.ts +3 -3
- package/dist/server/error-handlers.js +11 -11
- package/dist/server/plugins/index.d.ts +1 -1
- package/dist/server/plugins/index.js +1 -1
- package/dist/server/plugins/registry.d.ts +1 -1
- package/dist/server/plugins/registry.js +12 -14
- package/dist/server/rpc/create-server.d.ts +1 -1
- package/dist/server/rpc/create-server.js +11 -12
- package/dist/server/rpc/delegate-transport.d.ts +3 -3
- package/dist/server/rpc/delegate-transport.js +43 -44
- package/dist/server/rpc/handle-request.d.ts +1 -1
- package/dist/server/rpc/handle-request.js +28 -30
- package/dist/server/rpc/handler-registry.d.ts +1 -1
- package/dist/server/rpc/handler-registry.js +97 -92
- package/dist/server/rpc/handler-selection.d.ts +3 -3
- package/dist/server/rpc/handler-selection.js +3 -3
- package/dist/server/rpc/handler-utils.d.ts +7 -7
- package/dist/server/rpc/handler-utils.js +32 -35
- package/dist/server/rpc/handlers/batch-completion-stream.d.ts +78 -0
- package/dist/server/rpc/handlers/batch-completion-stream.js +4 -0
- package/dist/server/rpc/handlers/bci-transcribe-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/bci-transcribe-stream.js +2 -2
- package/dist/server/rpc/handlers/bci-transcribe.d.ts +1 -1
- package/dist/server/rpc/handlers/bci-transcribe.js +2 -2
- package/dist/server/rpc/handlers/cancel-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/cancel-delegated.js +13 -13
- package/dist/server/rpc/handlers/cancelHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/cancelHandler.js +11 -11
- package/dist/server/rpc/handlers/classify.d.ts +1 -1
- package/dist/server/rpc/handlers/classify.js +2 -2
- package/dist/server/rpc/handlers/completion-stream-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/completion-stream-delegated.js +14 -14
- package/dist/server/rpc/handlers/completion-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/completion-stream.js +2 -2
- package/dist/server/rpc/handlers/delete-cache.d.ts +1 -1
- package/dist/server/rpc/handlers/delete-cache.js +10 -10
- package/dist/server/rpc/handlers/diffusion-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/diffusion-stream.js +2 -2
- package/dist/server/rpc/handlers/download-asset.d.ts +1 -1
- package/dist/server/rpc/handlers/download-asset.js +20 -20
- package/dist/server/rpc/handlers/embed.d.ts +1 -1
- package/dist/server/rpc/handlers/embed.js +2 -2
- package/dist/server/rpc/handlers/finetune.d.ts +1 -1
- package/dist/server/rpc/handlers/finetune.js +8 -6
- package/dist/server/rpc/handlers/get-loaded-model-info.d.ts +1 -1
- package/dist/server/rpc/handlers/get-loaded-model-info.js +9 -9
- package/dist/server/rpc/handlers/get-model-info.d.ts +1 -1
- package/dist/server/rpc/handlers/get-model-info.js +20 -20
- package/dist/server/rpc/handlers/heartbeat-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/heartbeat-delegated.js +7 -7
- package/dist/server/rpc/handlers/heartbeat.d.ts +1 -1
- package/dist/server/rpc/handlers/heartbeat.js +1 -1
- package/dist/server/rpc/handlers/index.d.ts +33 -31
- package/dist/server/rpc/handlers/index.js +34 -32
- package/dist/server/rpc/handlers/load-model/download-manager.d.ts +4 -4
- package/dist/server/rpc/handlers/load-model/download-manager.js +19 -17
- package/dist/server/rpc/handlers/load-model/download-stats.d.ts +4 -3
- package/dist/server/rpc/handlers/load-model/download-stats.js +9 -11
- package/dist/server/rpc/handlers/load-model/handler.d.ts +1 -1
- package/dist/server/rpc/handlers/load-model/handler.js +42 -43
- package/dist/server/rpc/handlers/load-model/http.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/http.js +100 -107
- package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +72 -74
- package/dist/server/rpc/handlers/load-model/index.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/index.js +2 -2
- package/dist/server/rpc/handlers/load-model/registry-client-options.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/registry-client-options.js +2 -3
- package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +5 -5
- package/dist/server/rpc/handlers/load-model/registry-companion-set.js +19 -21
- package/dist/server/rpc/handlers/load-model/registry-download-utils.d.ts +6 -6
- package/dist/server/rpc/handlers/load-model/registry-download-utils.js +16 -18
- package/dist/server/rpc/handlers/load-model/registry-metadata.d.ts +11 -0
- package/dist/server/rpc/handlers/load-model/registry-metadata.js +23 -0
- package/dist/server/rpc/handlers/load-model/registry.d.ts +4 -3
- package/dist/server/rpc/handlers/load-model/registry.js +50 -56
- package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/resolve-session.js +7 -7
- package/dist/server/rpc/handlers/load-model/resolve.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/resolve.js +36 -35
- package/dist/server/rpc/handlers/load-model/types.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/types.js +7 -7
- package/dist/server/rpc/handlers/load-model-delegated.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model-delegated.js +31 -30
- package/dist/server/rpc/handlers/logging-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/logging-stream.js +3 -3
- package/dist/server/rpc/handlers/ocr-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/ocr-stream.js +2 -2
- package/dist/server/rpc/handlers/plugin-dispatch.js +9 -9
- package/dist/server/rpc/handlers/plugin-invoke.d.ts +1 -1
- package/dist/server/rpc/handlers/plugin-invoke.js +16 -16
- package/dist/server/rpc/handlers/provideHandler/connection.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler/connection.js +16 -16
- package/dist/server/rpc/handlers/provideHandler/handler.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler/handler.js +18 -18
- package/dist/server/rpc/handlers/provideHandler/proxy.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler/proxy.js +11 -11
- package/dist/server/rpc/handlers/provideHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/provideHandler.js +1 -1
- package/dist/server/rpc/handlers/rag.d.ts +1 -1
- package/dist/server/rpc/handlers/rag.js +50 -50
- package/dist/server/rpc/handlers/registry.d.ts +1 -1
- package/dist/server/rpc/handlers/registry.js +34 -36
- package/dist/server/rpc/handlers/resume.d.ts +1 -1
- package/dist/server/rpc/handlers/resume.js +3 -3
- package/dist/server/rpc/handlers/state.d.ts +1 -1
- package/dist/server/rpc/handlers/state.js +3 -3
- package/dist/server/rpc/handlers/stopProvideHandler.d.ts +1 -1
- package/dist/server/rpc/handlers/stopProvideHandler.js +7 -7
- package/dist/server/rpc/handlers/suspend.d.ts +1 -1
- package/dist/server/rpc/handlers/suspend.js +3 -3
- package/dist/server/rpc/handlers/text-to-speech-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/text-to-speech-stream.js +2 -2
- package/dist/server/rpc/handlers/text-to-speech.d.ts +1 -1
- package/dist/server/rpc/handlers/text-to-speech.js +2 -2
- package/dist/server/rpc/handlers/transcribe-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/transcribe-stream.js +2 -2
- package/dist/server/rpc/handlers/transcribe.d.ts +1 -1
- package/dist/server/rpc/handlers/transcribe.js +2 -2
- package/dist/server/rpc/handlers/translate.d.ts +1 -1
- package/dist/server/rpc/handlers/translate.js +2 -2
- package/dist/server/rpc/handlers/unload-model-delegated.d.ts +1 -1
- package/dist/server/rpc/handlers/unload-model-delegated.js +10 -10
- package/dist/server/rpc/handlers/unload-model.d.ts +1 -1
- package/dist/server/rpc/handlers/unload-model.js +10 -10
- package/dist/server/rpc/handlers/upscale-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/upscale-stream.js +2 -2
- package/dist/server/rpc/handlers/video-stream.d.ts +1 -1
- package/dist/server/rpc/handlers/video-stream.js +2 -2
- package/dist/server/rpc/index.d.ts +2 -2
- package/dist/server/rpc/index.js +2 -2
- package/dist/server/rpc/profiling/context.d.ts +1 -1
- package/dist/server/rpc/profiling/context.js +9 -10
- package/dist/server/rpc/profiling/delegation-profiler.d.ts +2 -2
- package/dist/server/rpc/profiling/delegation-profiler.js +23 -24
- package/dist/server/rpc/profiling/index.d.ts +4 -4
- package/dist/server/rpc/profiling/index.js +4 -4
- package/dist/server/rpc/profiling/operation-metrics.d.ts +2 -2
- package/dist/server/rpc/profiling/operation-metrics.js +102 -102
- package/dist/server/rpc/profiling/operation-wrappers.d.ts +1 -1
- package/dist/server/rpc/profiling/operation-wrappers.js +16 -14
- package/dist/server/rpc/profiling/profiler.d.ts +2 -2
- package/dist/server/rpc/profiling/profiler.js +9 -13
- package/dist/server/rpc/rpc-utils.js +1 -4
- package/dist/server/rpc/transport-selector.d.ts +1 -1
- package/dist/server/rpc/transport-selector.js +4 -4
- package/dist/server/utils/archive.js +27 -29
- package/dist/server/utils/audio/decoder.d.ts +2 -2
- package/dist/server/utils/audio/decoder.js +11 -11
- package/dist/server/utils/cache/auto-history.d.ts +1 -1
- package/dist/server/utils/cache/auto-history.js +5 -5
- package/dist/server/utils/cache/paths.d.ts +2 -2
- package/dist/server/utils/cache/paths.js +14 -14
- package/dist/server/utils/checksum.d.ts +1 -1
- package/dist/server/utils/checksum.js +10 -12
- package/dist/server/utils/clear-storage.d.ts +1 -1
- package/dist/server/utils/clear-storage.js +8 -11
- package/dist/server/utils/completion-normalizer.d.ts +1 -1
- package/dist/server/utils/completion-normalizer.js +106 -113
- package/dist/server/utils/config-transform.d.ts +1 -1
- package/dist/server/utils/config-transform.js +2 -2
- package/dist/server/utils/expand-gguf-shards.js +4 -4
- package/dist/server/utils/formatting.js +6 -12
- package/dist/server/utils/gguf-tensor-extractor.js +17 -21
- package/dist/server/utils/index.d.ts +11 -11
- package/dist/server/utils/index.js +11 -11
- package/dist/server/utils/multi-gpu-mobile.js +1 -1
- package/dist/server/utils/path-security.d.ts +1 -1
- package/dist/server/utils/path-security.js +6 -6
- package/dist/server/utils/qvac-paths.js +3 -3
- package/dist/server/utils/response-format.d.ts +1 -1
- package/dist/server/utils/response-format.js +4 -4
- package/dist/server/utils/shard-utils.d.ts +1 -1
- package/dist/server/utils/shard-utils.js +14 -16
- package/dist/server/utils/tool-integration.d.ts +1 -1
- package/dist/server/utils/tool-integration.js +5 -9
- package/dist/server/utils/tools/dialect.d.ts +1 -1
- package/dist/server/utils/tools/dialect.js +7 -7
- package/dist/server/utils/tools/index.d.ts +2 -2
- package/dist/server/utils/tools/index.js +2 -2
- package/dist/server/utils/tools/parser.d.ts +1 -1
- package/dist/server/utils/tools/parser.js +14 -14
- package/dist/server/utils/tools/parsers/gemma4native.d.ts +2 -2
- package/dist/server/utils/tools/parsers/gemma4native.js +13 -8
- package/dist/server/utils/tools/parsers/harmony.d.ts +2 -2
- package/dist/server/utils/tools/parsers/harmony.js +9 -11
- package/dist/server/utils/tools/parsers/hermes.d.ts +2 -2
- package/dist/server/utils/tools/parsers/hermes.js +16 -16
- package/dist/server/utils/tools/parsers/json.d.ts +2 -2
- package/dist/server/utils/tools/parsers/json.js +14 -14
- package/dist/server/utils/tools/parsers/pythonic.d.ts +2 -2
- package/dist/server/utils/tools/parsers/pythonic.js +43 -43
- package/dist/server/utils/tools/parsers/qwen35.d.ts +2 -2
- package/dist/server/utils/tools/parsers/qwen35.js +20 -20
- package/dist/server/utils/tools/shared.d.ts +1 -1
- package/dist/server/utils/tools/shared.js +10 -12
- package/dist/server/utils/worker-lock.js +10 -10
- package/dist/server/worker-core.d.ts +1 -1
- package/dist/server/worker-core.js +44 -43
- package/dist/server/worker.js +9 -9
- package/dist/utils/aggregate-events.d.ts +2 -2
- package/dist/utils/aggregate-events.js +17 -19
- package/dist/utils/cache-normalize.js +1 -4
- package/dist/utils/encoding.js +1 -1
- package/dist/utils/errors-base.d.ts +1 -1
- package/dist/utils/errors-base.js +1 -1
- package/dist/utils/errors-client.d.ts +1 -1
- package/dist/utils/errors-client.js +5 -5
- package/dist/utils/errors-server.d.ts +3 -3
- package/dist/utils/errors-server.js +19 -18
- package/dist/utils/load-model-validation.js +3 -3
- package/dist/utils/mcp-adapter.d.ts +4 -4
- package/dist/utils/mcp-adapter.js +31 -38
- package/dist/utils/path-sanitize.js +14 -17
- package/dist/utils/tool-helpers.d.ts +2 -2
- package/dist/utils/tool-helpers.js +25 -26
- package/dist/utils/withTimeout.d.ts +7 -0
- package/dist/utils/withTimeout.js +11 -1
- package/dist/utils/zod-error.d.ts +1 -1
- package/dist/utils/zod-error.js +1 -1
- package/electron-forge/index.cjs +274 -317
- package/expo/plugins/patches/android-link.mjs +25 -30
- package/expo/plugins/patches/ios-link.mjs +25 -30
- package/package.json +17 -16
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EsrganUpscaler } from
|
|
2
|
-
import { getModel, getModelEntry
|
|
3
|
-
import { ModelOperationNotSupportedError } from
|
|
4
|
-
import { ModelType } from
|
|
1
|
+
import { EsrganUpscaler } from '@qvac/diffusion-cpp';
|
|
2
|
+
import { getModel, getModelEntry } from '../../../registry/model-registry.js';
|
|
3
|
+
import { ModelOperationNotSupportedError } from '../../../../../utils/errors-server.js';
|
|
4
|
+
import { ModelType } from '../../../../../schemas/index.js';
|
|
5
5
|
// The diffusion plugin instantiates `EsrganUpscaler` when the model is loaded
|
|
6
6
|
// with `modelConfig.mode === "upscale"` and `ImgStableDiffusion` otherwise. The
|
|
7
7
|
// latter has no `.upscale()` method, so we refuse the call upfront with a
|
|
@@ -12,11 +12,11 @@ function asUpscalerModel(model, modelId) {
|
|
|
12
12
|
}
|
|
13
13
|
const entry = getModelEntry(modelId);
|
|
14
14
|
const modelType = entry && !entry.isDelegated ? entry.local.modelType : ModelType.sdcppGeneration;
|
|
15
|
-
throw new ModelOperationNotSupportedError(modelId, modelType,
|
|
15
|
+
throw new ModelOperationNotSupportedError(modelId, modelType, 'upscale', ['diffusion'], []);
|
|
16
16
|
}
|
|
17
17
|
export async function* upscale(request) {
|
|
18
18
|
const model = asUpscalerModel(getModel(request.modelId), request.modelId);
|
|
19
|
-
const response = await model.upscale(Buffer.from(request.image,
|
|
19
|
+
const response = await model.upscale(Buffer.from(request.image, 'base64'), request.repeats === undefined ? undefined : { repeats: request.repeats });
|
|
20
20
|
// The addon emits exactly one final PNG regardless of `repeats`, so
|
|
21
21
|
// this loop typically iterates once. `outputIndex` is still emitted for
|
|
22
22
|
// wire parity with diffusionStream and to leave headroom for future
|
|
@@ -25,16 +25,16 @@ export async function* upscale(request) {
|
|
|
25
25
|
for await (const chunk of response.iterate()) {
|
|
26
26
|
if (chunk instanceof Uint8Array) {
|
|
27
27
|
yield {
|
|
28
|
-
type:
|
|
29
|
-
data: Buffer.from(chunk).toString(
|
|
30
|
-
outputIndex: outputIndex
|
|
28
|
+
type: 'upscaleStream',
|
|
29
|
+
data: Buffer.from(chunk).toString('base64'),
|
|
30
|
+
outputIndex: outputIndex++
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
const responseWithStats = response;
|
|
35
35
|
yield {
|
|
36
|
-
type:
|
|
36
|
+
type: 'upscaleStream',
|
|
37
37
|
done: true,
|
|
38
|
-
stats: responseWithStats.stats ?? undefined
|
|
38
|
+
stats: responseWithStats.stats ?? undefined
|
|
39
39
|
};
|
|
40
40
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { VideoRequest, VideoStreamResponse } from
|
|
1
|
+
import type { VideoRequest, VideoStreamResponse } from '../../../../../schemas/sdcpp-config';
|
|
2
2
|
export declare function video(request: VideoRequest): AsyncGenerator<VideoStreamResponse>;
|
|
3
3
|
//# sourceMappingURL=video.d.ts.map
|
|
@@ -50,13 +50,13 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
50
50
|
var e = new Error(message);
|
|
51
51
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
52
|
});
|
|
53
|
-
import { VideoStableDiffusion } from
|
|
54
|
-
import { getServerLogger } from
|
|
55
|
-
import { getModel, getModelEntry
|
|
56
|
-
import { getRequestRegistry, withRequestContext } from
|
|
57
|
-
import { generateServerRequestId } from
|
|
58
|
-
import { ModelOperationNotSupportedError } from
|
|
59
|
-
import { ModelType } from
|
|
53
|
+
import { VideoStableDiffusion } from '@qvac/diffusion-cpp';
|
|
54
|
+
import { getServerLogger } from '../../../../../logging/index.js';
|
|
55
|
+
import { getModel, getModelEntry } from '../../../registry/model-registry.js';
|
|
56
|
+
import { getRequestRegistry, withRequestContext } from '../../../runtime/index.js';
|
|
57
|
+
import { generateServerRequestId } from '../../../runtime/request-id.js';
|
|
58
|
+
import { ModelOperationNotSupportedError } from '../../../../../utils/errors-server.js';
|
|
59
|
+
import { ModelType } from '../../../../../schemas/index.js';
|
|
60
60
|
// The diffusion plugin instantiates `VideoStableDiffusion` when the model is
|
|
61
61
|
// loaded with `modelConfig.mode === "video"` and `ImgStableDiffusion` (or
|
|
62
62
|
// `EsrganUpscaler`) otherwise. Those have no video `run()` shape, so we refuse
|
|
@@ -67,18 +67,16 @@ function asVideoModel(model, modelId) {
|
|
|
67
67
|
return model;
|
|
68
68
|
}
|
|
69
69
|
const entry = getModelEntry(modelId);
|
|
70
|
-
const modelType = entry && !entry.isDelegated
|
|
71
|
-
|
|
72
|
-
: ModelType.sdcppGeneration;
|
|
73
|
-
throw new ModelOperationNotSupportedError(modelId, modelType, "video", ["diffusion"], []);
|
|
70
|
+
const modelType = entry && !entry.isDelegated ? entry.local.modelType : ModelType.sdcppGeneration;
|
|
71
|
+
throw new ModelOperationNotSupportedError(modelId, modelType, 'video', ['diffusion'], []);
|
|
74
72
|
}
|
|
75
73
|
export async function* video(request) {
|
|
76
74
|
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
77
75
|
try {
|
|
78
76
|
const ctx = __addDisposableResource(env_1, await getRequestRegistry().begin({
|
|
79
77
|
requestId: request.requestId ?? generateServerRequestId(),
|
|
80
|
-
kind:
|
|
81
|
-
modelId: request.modelId
|
|
78
|
+
kind: 'diffusion',
|
|
79
|
+
modelId: request.modelId
|
|
82
80
|
}), true);
|
|
83
81
|
const requestLogger = withRequestContext(getServerLogger(), ctx);
|
|
84
82
|
const model = asVideoModel(getModel(request.modelId), request.modelId);
|
|
@@ -87,76 +85,76 @@ export async function* video(request) {
|
|
|
87
85
|
requestLogger.warn(`[cancel] model.cancel() rejected during abort for modelId=${request.modelId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
88
86
|
});
|
|
89
87
|
};
|
|
90
|
-
ctx.signal.addEventListener(
|
|
88
|
+
ctx.signal.addEventListener('abort', onAbort, { once: true });
|
|
91
89
|
if (ctx.signal.aborted)
|
|
92
90
|
onAbort();
|
|
93
91
|
ctx.scope.defer(() => {
|
|
94
|
-
ctx.signal.removeEventListener(
|
|
92
|
+
ctx.signal.removeEventListener('abort', onAbort);
|
|
95
93
|
});
|
|
96
94
|
const response = await model.run({
|
|
97
95
|
mode: request.mode,
|
|
98
96
|
prompt: request.prompt,
|
|
99
97
|
...(request.negative_prompt !== undefined && {
|
|
100
|
-
negative_prompt: request.negative_prompt
|
|
98
|
+
negative_prompt: request.negative_prompt
|
|
101
99
|
}),
|
|
102
100
|
...(request.width !== undefined && { width: request.width }),
|
|
103
101
|
...(request.height !== undefined && { height: request.height }),
|
|
104
102
|
...(request.video_frames !== undefined && {
|
|
105
|
-
video_frames: request.video_frames
|
|
103
|
+
video_frames: request.video_frames
|
|
106
104
|
}),
|
|
107
105
|
...(request.fps !== undefined && { fps: request.fps }),
|
|
108
106
|
...(request.seed !== undefined && { seed: request.seed }),
|
|
109
107
|
...(request.steps !== undefined && { steps: request.steps }),
|
|
110
108
|
...(request.sampling_method !== undefined && {
|
|
111
|
-
sampling_method: request.sampling_method
|
|
109
|
+
sampling_method: request.sampling_method
|
|
112
110
|
}),
|
|
113
111
|
...(request.scheduler !== undefined && { scheduler: request.scheduler }),
|
|
114
112
|
...(request.cfg_scale !== undefined && { cfg_scale: request.cfg_scale }),
|
|
115
113
|
...(request.flow_shift !== undefined && { flow_shift: request.flow_shift }),
|
|
116
114
|
...(request.high_noise_steps !== undefined && {
|
|
117
|
-
high_noise_steps: request.high_noise_steps
|
|
115
|
+
high_noise_steps: request.high_noise_steps
|
|
118
116
|
}),
|
|
119
117
|
...(request.high_noise_sampler !== undefined && {
|
|
120
|
-
high_noise_sampler: request.high_noise_sampler
|
|
118
|
+
high_noise_sampler: request.high_noise_sampler
|
|
121
119
|
}),
|
|
122
120
|
...(request.high_noise_scheduler !== undefined && {
|
|
123
|
-
high_noise_scheduler: request.high_noise_scheduler
|
|
121
|
+
high_noise_scheduler: request.high_noise_scheduler
|
|
124
122
|
}),
|
|
125
123
|
...(request.high_noise_cfg_scale !== undefined && {
|
|
126
|
-
high_noise_cfg_scale: request.high_noise_cfg_scale
|
|
124
|
+
high_noise_cfg_scale: request.high_noise_cfg_scale
|
|
127
125
|
}),
|
|
128
126
|
...(request.high_noise_flow_shift !== undefined && {
|
|
129
|
-
high_noise_flow_shift: request.high_noise_flow_shift
|
|
127
|
+
high_noise_flow_shift: request.high_noise_flow_shift
|
|
130
128
|
}),
|
|
131
129
|
...(request.moe_boundary !== undefined && {
|
|
132
|
-
moe_boundary: request.moe_boundary
|
|
130
|
+
moe_boundary: request.moe_boundary
|
|
133
131
|
}),
|
|
134
132
|
...(request.vace_strength !== undefined && {
|
|
135
|
-
vace_strength: request.vace_strength
|
|
133
|
+
vace_strength: request.vace_strength
|
|
136
134
|
}),
|
|
137
135
|
...(request.init_image !== undefined && {
|
|
138
|
-
init_image: Buffer.from(request.init_image,
|
|
136
|
+
init_image: Buffer.from(request.init_image, 'base64')
|
|
139
137
|
}),
|
|
140
138
|
...(request.strength !== undefined && {
|
|
141
|
-
strength: request.strength
|
|
139
|
+
strength: request.strength
|
|
142
140
|
}),
|
|
143
141
|
...(request.control_frames !== undefined && {
|
|
144
|
-
control_frames: request.control_frames.map((b64) => Buffer.from(b64,
|
|
142
|
+
control_frames: request.control_frames.map((b64) => Buffer.from(b64, 'base64'))
|
|
145
143
|
}),
|
|
146
144
|
...(request.vae_tiling !== undefined && { vae_tiling: request.vae_tiling }),
|
|
147
145
|
...(request.vae_tile_size !== undefined && {
|
|
148
|
-
vae_tile_size: request.vae_tile_size
|
|
146
|
+
vae_tile_size: request.vae_tile_size
|
|
149
147
|
}),
|
|
150
148
|
...(request.vae_tile_overlap !== undefined && {
|
|
151
|
-
vae_tile_overlap: request.vae_tile_overlap
|
|
149
|
+
vae_tile_overlap: request.vae_tile_overlap
|
|
152
150
|
}),
|
|
153
151
|
...(request.cache_mode !== undefined && { cache_mode: request.cache_mode }),
|
|
154
152
|
...(request.cache_preset !== undefined && {
|
|
155
|
-
cache_preset: request.cache_preset
|
|
153
|
+
cache_preset: request.cache_preset
|
|
156
154
|
}),
|
|
157
155
|
...(request.cache_threshold !== undefined && {
|
|
158
|
-
cache_threshold: request.cache_threshold
|
|
159
|
-
})
|
|
156
|
+
cache_threshold: request.cache_threshold
|
|
157
|
+
})
|
|
160
158
|
});
|
|
161
159
|
let outputIndex = 0;
|
|
162
160
|
for await (const chunk of response.iterate()) {
|
|
@@ -164,20 +162,20 @@ export async function* video(request) {
|
|
|
164
162
|
break;
|
|
165
163
|
if (chunk instanceof Uint8Array) {
|
|
166
164
|
yield {
|
|
167
|
-
type:
|
|
168
|
-
data: Buffer.from(chunk).toString(
|
|
169
|
-
outputIndex: outputIndex
|
|
165
|
+
type: 'videoStream',
|
|
166
|
+
data: Buffer.from(chunk).toString('base64'),
|
|
167
|
+
outputIndex: outputIndex++
|
|
170
168
|
};
|
|
171
169
|
}
|
|
172
|
-
else if (typeof chunk ===
|
|
170
|
+
else if (typeof chunk === 'string') {
|
|
173
171
|
try {
|
|
174
172
|
const tick = JSON.parse(chunk);
|
|
175
|
-
if (
|
|
173
|
+
if ('step' in tick) {
|
|
176
174
|
yield {
|
|
177
|
-
type:
|
|
178
|
-
step: tick[
|
|
179
|
-
totalSteps: tick[
|
|
180
|
-
elapsedMs: tick[
|
|
175
|
+
type: 'videoStream',
|
|
176
|
+
step: tick['step'],
|
|
177
|
+
totalSteps: tick['total'],
|
|
178
|
+
elapsedMs: tick['elapsed_ms']
|
|
181
179
|
};
|
|
182
180
|
}
|
|
183
181
|
}
|
|
@@ -188,9 +186,9 @@ export async function* video(request) {
|
|
|
188
186
|
}
|
|
189
187
|
const responseWithStats = response;
|
|
190
188
|
yield {
|
|
191
|
-
type:
|
|
189
|
+
type: 'videoStream',
|
|
192
190
|
done: true,
|
|
193
|
-
stats: responseWithStats.stats ?? undefined
|
|
191
|
+
stats: responseWithStats.stats ?? undefined
|
|
194
192
|
};
|
|
195
193
|
}
|
|
196
194
|
catch (e_1) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type CreateModelParams, type PluginModelResult, type ResolveContext, type ResolveResult, type SdcppConfig } from
|
|
2
|
-
type DiffusionArtifactKey =
|
|
1
|
+
import { type CreateModelParams, type PluginModelResult, type ResolveContext, type ResolveResult, type SdcppConfig } from '../../../../schemas/index';
|
|
2
|
+
type DiffusionArtifactKey = 'clipLModelPath' | 'clipGModelPath' | 'clipVisionModelPath' | 't5XxlModelPath' | 'llmModelPath' | 'vaeModelPath' | 'highNoiseDiffusionModelPath' | 'esrganModelPath';
|
|
3
3
|
/**
|
|
4
4
|
* Stable-diffusion.cpp plugin for image diffusion, upscaling, and Wan video.
|
|
5
5
|
*
|
|
@@ -20,8 +20,8 @@ export declare const diffusionPlugin: {
|
|
|
20
20
|
}>>;
|
|
21
21
|
threads: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
22
22
|
device: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
23
|
-
cpu: "cpu";
|
|
24
23
|
gpu: "gpu";
|
|
24
|
+
cpu: "cpu";
|
|
25
25
|
}>>;
|
|
26
26
|
prediction: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
27
27
|
auto: "auto";
|
|
@@ -593,8 +593,8 @@ export declare const diffusionPlugin: {
|
|
|
593
593
|
height: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
594
594
|
repeats: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
595
595
|
backendDevice: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
596
|
-
cpu: "cpu";
|
|
597
596
|
gpu: "gpu";
|
|
597
|
+
cpu: "cpu";
|
|
598
598
|
}>>;
|
|
599
599
|
}, import("zod/v4/core").$strip>>;
|
|
600
600
|
}, import("zod/v4/core").$strip>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import ImgStableDiffusion, { EsrganUpscaler, VideoStableDiffusion
|
|
2
|
-
import addonLogging from
|
|
3
|
-
import { definePlugin, defineHandler, sdcppConfigSchema, diffusionRequestSchema, diffusionStreamResponseSchema, videoRequestSchema, videoStreamResponseSchema, upscaleRequestSchema, upscaleStreamResponseSchema, ModelType, ADDON_DIFFUSION
|
|
4
|
-
import { createStreamLogger, registerAddonLogger } from
|
|
5
|
-
import { ModelLoadFailedError } from
|
|
6
|
-
import { diffusion } from
|
|
7
|
-
import { video } from
|
|
8
|
-
import { upscale } from
|
|
1
|
+
import ImgStableDiffusion, { EsrganUpscaler, VideoStableDiffusion } from '@qvac/diffusion-cpp';
|
|
2
|
+
import addonLogging from '@qvac/diffusion-cpp/addonLogging.js';
|
|
3
|
+
import { definePlugin, defineHandler, sdcppConfigSchema, diffusionRequestSchema, diffusionStreamResponseSchema, videoRequestSchema, videoStreamResponseSchema, upscaleRequestSchema, upscaleStreamResponseSchema, ModelType, ADDON_DIFFUSION } from '../../../../schemas/index.js';
|
|
4
|
+
import { createStreamLogger, registerAddonLogger } from '../../../../logging/index.js';
|
|
5
|
+
import { ModelLoadFailedError } from '../../../../utils/errors-server.js';
|
|
6
|
+
import { diffusion } from './ops/diffusion.js';
|
|
7
|
+
import { video } from './ops/video.js';
|
|
8
|
+
import { upscale } from './ops/upscale.js';
|
|
9
9
|
// Single source of truth for `SdcppConfig.upscaler.*` → addon-config key
|
|
10
10
|
// mapping. Used by both the diffusion-mode (post-generation upscaler) and the
|
|
11
11
|
// standalone-upscale-mode branches; keeping the mapping in one place avoids
|
|
@@ -15,17 +15,17 @@ function flattenUpscalerKeys(upscaler) {
|
|
|
15
15
|
return {};
|
|
16
16
|
return {
|
|
17
17
|
...(upscaler.tile_size !== undefined && {
|
|
18
|
-
upscaler_tile_size: upscaler.tile_size
|
|
18
|
+
upscaler_tile_size: upscaler.tile_size
|
|
19
19
|
}),
|
|
20
20
|
...(upscaler.direct !== undefined && {
|
|
21
|
-
upscaler_direct: upscaler.direct
|
|
21
|
+
upscaler_direct: upscaler.direct
|
|
22
22
|
}),
|
|
23
23
|
...(upscaler.offload_params_to_cpu !== undefined && {
|
|
24
|
-
upscaler_offload_params_to_cpu: upscaler.offload_params_to_cpu
|
|
24
|
+
upscaler_offload_params_to_cpu: upscaler.offload_params_to_cpu
|
|
25
25
|
}),
|
|
26
26
|
...(upscaler.threads !== undefined && {
|
|
27
|
-
upscaler_threads: upscaler.threads
|
|
28
|
-
})
|
|
27
|
+
upscaler_threads: upscaler.threads
|
|
28
|
+
})
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
// `mode: "upscale"` builds an EsrganUpscaler directly (not via SdCtx), so the
|
|
@@ -35,7 +35,7 @@ function toEsrganAddonConfig(config) {
|
|
|
35
35
|
return {
|
|
36
36
|
...flattenUpscalerKeys(config.upscaler),
|
|
37
37
|
...(config.device !== undefined && { device: config.device }),
|
|
38
|
-
...(config.verbosity !== undefined && { verbosity: config.verbosity })
|
|
38
|
+
...(config.verbosity !== undefined && { verbosity: config.verbosity })
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
@@ -48,34 +48,40 @@ function toEsrganAddonConfig(config) {
|
|
|
48
48
|
*/
|
|
49
49
|
export const diffusionPlugin = definePlugin({
|
|
50
50
|
modelType: ModelType.sdcppGeneration,
|
|
51
|
-
displayName:
|
|
51
|
+
displayName: 'Image Generation & Upscaling (stable-diffusion.cpp)',
|
|
52
52
|
addonPackage: ADDON_DIFFUSION,
|
|
53
53
|
loadConfigSchema: sdcppConfigSchema,
|
|
54
54
|
async resolveConfig(cfg, ctx) {
|
|
55
55
|
// Standalone-upscaler mode never references auxiliary models: the primary
|
|
56
56
|
// modelSrc IS the ESRGAN file. Skip resolution to avoid downloading
|
|
57
57
|
// unused encoders/VAEs and to keep load fast.
|
|
58
|
-
if (cfg.mode ===
|
|
58
|
+
if (cfg.mode === 'upscale') {
|
|
59
59
|
return { config: cfg };
|
|
60
60
|
}
|
|
61
61
|
const { clipLModelSrc, clipGModelSrc, clipVisionModelSrc, t5XxlModelSrc, llmModelSrc, vaeModelSrc, highNoiseDiffusionModelSrc, upscaler, ...rest } = cfg;
|
|
62
62
|
// Video jobs do not apply ESRGAN so we drop the whole `upscaler` object.
|
|
63
|
-
const effectiveUpscaler = cfg.mode ===
|
|
63
|
+
const effectiveUpscaler = cfg.mode === 'video' ? undefined : upscaler;
|
|
64
64
|
const { model_src: esrganModelSrc, ...upscalerRuntime } = effectiveUpscaler ?? {};
|
|
65
65
|
const runtimeConfig = {
|
|
66
66
|
...rest,
|
|
67
|
-
...(effectiveUpscaler && { upscaler: upscalerRuntime })
|
|
67
|
+
...(effectiveUpscaler && { upscaler: upscalerRuntime })
|
|
68
68
|
};
|
|
69
69
|
const sources = {
|
|
70
|
-
clipLModelSrc,
|
|
71
|
-
|
|
70
|
+
clipLModelSrc,
|
|
71
|
+
clipGModelSrc,
|
|
72
|
+
clipVisionModelSrc,
|
|
73
|
+
t5XxlModelSrc,
|
|
74
|
+
llmModelSrc,
|
|
75
|
+
vaeModelSrc,
|
|
76
|
+
highNoiseDiffusionModelSrc,
|
|
77
|
+
esrganModelSrc
|
|
72
78
|
};
|
|
73
79
|
const hasSources = Object.values(sources).some(Boolean);
|
|
74
80
|
if (!hasSources) {
|
|
75
81
|
return { config: runtimeConfig };
|
|
76
82
|
}
|
|
77
83
|
const resolve = ctx.resolveModelPath;
|
|
78
|
-
const [clipLModelPath, clipGModelPath, clipVisionModelPath, t5XxlModelPath, llmModelPath, vaeModelPath, highNoiseDiffusionModelPath, esrganModelPath
|
|
84
|
+
const [clipLModelPath, clipGModelPath, clipVisionModelPath, t5XxlModelPath, llmModelPath, vaeModelPath, highNoiseDiffusionModelPath, esrganModelPath] = await Promise.all([
|
|
79
85
|
clipLModelSrc ? resolve(clipLModelSrc) : undefined,
|
|
80
86
|
clipGModelSrc ? resolve(clipGModelSrc) : undefined,
|
|
81
87
|
clipVisionModelSrc ? resolve(clipVisionModelSrc) : undefined,
|
|
@@ -83,7 +89,7 @@ export const diffusionPlugin = definePlugin({
|
|
|
83
89
|
llmModelSrc ? resolve(llmModelSrc) : undefined,
|
|
84
90
|
vaeModelSrc ? resolve(vaeModelSrc) : undefined,
|
|
85
91
|
highNoiseDiffusionModelSrc ? resolve(highNoiseDiffusionModelSrc) : undefined,
|
|
86
|
-
esrganModelSrc ? resolve(esrganModelSrc) : undefined
|
|
92
|
+
esrganModelSrc ? resolve(esrganModelSrc) : undefined
|
|
87
93
|
]);
|
|
88
94
|
return {
|
|
89
95
|
config: runtimeConfig,
|
|
@@ -95,8 +101,8 @@ export const diffusionPlugin = definePlugin({
|
|
|
95
101
|
...(llmModelPath && { llmModelPath }),
|
|
96
102
|
...(vaeModelPath && { vaeModelPath }),
|
|
97
103
|
...(highNoiseDiffusionModelPath && { highNoiseDiffusionModelPath }),
|
|
98
|
-
...(esrganModelPath && { esrganModelPath })
|
|
99
|
-
}
|
|
104
|
+
...(esrganModelPath && { esrganModelPath })
|
|
105
|
+
}
|
|
100
106
|
};
|
|
101
107
|
},
|
|
102
108
|
createModel(params) {
|
|
@@ -107,45 +113,45 @@ export const diffusionPlugin = definePlugin({
|
|
|
107
113
|
// the main diffusion checkpoint. Reject early with a clear error
|
|
108
114
|
// instead of letting the native addon fail mid-load. Done before any
|
|
109
115
|
// logger / native side-effects so callers can recover cleanly.
|
|
110
|
-
if (config.mode ===
|
|
116
|
+
if (config.mode === 'diffusion' &&
|
|
111
117
|
config.upscaler !== undefined &&
|
|
112
|
-
!artifacts?.[
|
|
113
|
-
throw new ModelLoadFailedError(
|
|
114
|
-
|
|
118
|
+
!artifacts?.['esrganModelPath']) {
|
|
119
|
+
throw new ModelLoadFailedError('modelConfig.upscaler.model_src is required when modelConfig.upscaler ' +
|
|
120
|
+
'is set in diffusion mode. Provide the ESRGAN model, omit the ' +
|
|
115
121
|
"upscaler block, or switch to modelConfig.mode = 'upscale' to load " +
|
|
116
|
-
|
|
122
|
+
'a standalone upscaler.');
|
|
117
123
|
}
|
|
118
124
|
const logger = createStreamLogger(modelId, ModelType.sdcppGeneration);
|
|
119
125
|
registerAddonLogger(modelId, ModelType.sdcppGeneration, logger);
|
|
120
|
-
if (config.mode ===
|
|
126
|
+
if (config.mode === 'upscale') {
|
|
121
127
|
const model = new EsrganUpscaler({
|
|
122
128
|
files: { esrgan: modelPath },
|
|
123
129
|
config: toEsrganAddonConfig(config),
|
|
124
130
|
logger,
|
|
125
|
-
opts: { stats: true }
|
|
131
|
+
opts: { stats: true }
|
|
126
132
|
});
|
|
127
133
|
return { model };
|
|
128
134
|
}
|
|
129
|
-
if (config.mode ===
|
|
130
|
-
if (!artifacts?.[
|
|
131
|
-
throw new ModelLoadFailedError(
|
|
132
|
-
|
|
135
|
+
if (config.mode === 'video') {
|
|
136
|
+
if (!artifacts?.['t5XxlModelPath']) {
|
|
137
|
+
throw new ModelLoadFailedError('modelConfig.t5XxlModelSrc is required in video mode. ' +
|
|
138
|
+
'Provide the Wan text encoder model before loading the video pipeline.');
|
|
133
139
|
}
|
|
134
|
-
if (!artifacts?.[
|
|
135
|
-
throw new ModelLoadFailedError(
|
|
136
|
-
|
|
140
|
+
if (!artifacts?.['vaeModelPath']) {
|
|
141
|
+
throw new ModelLoadFailedError('modelConfig.vaeModelSrc is required in video mode. ' +
|
|
142
|
+
'Provide the Wan VAE model before loading the video pipeline.');
|
|
137
143
|
}
|
|
138
144
|
const files = {
|
|
139
145
|
model: modelPath,
|
|
140
|
-
t5Xxl: artifacts[
|
|
141
|
-
vae: artifacts[
|
|
142
|
-
...(artifacts?.[
|
|
143
|
-
highNoiseDiffusionModel: artifacts[
|
|
146
|
+
t5Xxl: artifacts['t5XxlModelPath'],
|
|
147
|
+
vae: artifacts['vaeModelPath'],
|
|
148
|
+
...(artifacts?.['highNoiseDiffusionModelPath'] && {
|
|
149
|
+
highNoiseDiffusionModel: artifacts['highNoiseDiffusionModelPath']
|
|
144
150
|
}),
|
|
145
|
-
...(artifacts?.[
|
|
146
|
-
clipVision: artifacts[
|
|
151
|
+
...(artifacts?.['clipVisionModelPath'] && {
|
|
152
|
+
clipVision: artifacts['clipVisionModelPath']
|
|
147
153
|
}),
|
|
148
|
-
...(artifacts?.[
|
|
154
|
+
...(artifacts?.['esrganModelPath'] && { esrgan: artifacts['esrganModelPath'] })
|
|
149
155
|
};
|
|
150
156
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
151
157
|
const { clipLModelSrc, clipGModelSrc, clipVisionModelSrc, t5XxlModelSrc, llmModelSrc, vaeModelSrc, highNoiseDiffusionModelSrc, upscaler, mode, ...rest } = config;
|
|
@@ -154,18 +160,18 @@ export const diffusionPlugin = definePlugin({
|
|
|
154
160
|
files,
|
|
155
161
|
config: rest,
|
|
156
162
|
logger,
|
|
157
|
-
opts: { stats: true }
|
|
163
|
+
opts: { stats: true }
|
|
158
164
|
});
|
|
159
165
|
return { model };
|
|
160
166
|
}
|
|
161
167
|
const files = {
|
|
162
168
|
model: modelPath,
|
|
163
|
-
...(artifacts?.[
|
|
164
|
-
...(artifacts?.[
|
|
165
|
-
...(artifacts?.[
|
|
166
|
-
...(artifacts?.[
|
|
167
|
-
...(artifacts?.[
|
|
168
|
-
...(artifacts?.[
|
|
169
|
+
...(artifacts?.['clipLModelPath'] && { clipL: artifacts['clipLModelPath'] }),
|
|
170
|
+
...(artifacts?.['clipGModelPath'] && { clipG: artifacts['clipGModelPath'] }),
|
|
171
|
+
...(artifacts?.['t5XxlModelPath'] && { t5Xxl: artifacts['t5XxlModelPath'] }),
|
|
172
|
+
...(artifacts?.['llmModelPath'] && { llm: artifacts['llmModelPath'] }),
|
|
173
|
+
...(artifacts?.['vaeModelPath'] && { vae: artifacts['vaeModelPath'] }),
|
|
174
|
+
...(artifacts?.['esrganModelPath'] && { esrgan: artifacts['esrganModelPath'] })
|
|
169
175
|
};
|
|
170
176
|
// `mode` is consumed by this plugin to select the model class above; the
|
|
171
177
|
// stable-diffusion.cpp native config does not understand it. Strip it
|
|
@@ -174,13 +180,13 @@ export const diffusionPlugin = definePlugin({
|
|
|
174
180
|
const { upscaler, mode, ...rest } = config;
|
|
175
181
|
const addonConfig = {
|
|
176
182
|
...rest,
|
|
177
|
-
...flattenUpscalerKeys(upscaler)
|
|
183
|
+
...flattenUpscalerKeys(upscaler)
|
|
178
184
|
};
|
|
179
185
|
const model = new ImgStableDiffusion({
|
|
180
186
|
files,
|
|
181
187
|
config: addonConfig,
|
|
182
188
|
logger,
|
|
183
|
-
opts: { stats: true }
|
|
189
|
+
opts: { stats: true }
|
|
184
190
|
});
|
|
185
191
|
return { model };
|
|
186
192
|
},
|
|
@@ -191,15 +197,15 @@ export const diffusionPlugin = definePlugin({
|
|
|
191
197
|
streaming: true,
|
|
192
198
|
// sdcpp diffusion exposes a model-wide hard cancel — compute
|
|
193
199
|
// is interrupted on the currently-running generation.
|
|
194
|
-
cancel: { scope:
|
|
195
|
-
handler: diffusion
|
|
200
|
+
cancel: { scope: 'model', hard: true },
|
|
201
|
+
handler: diffusion
|
|
196
202
|
}),
|
|
197
203
|
videoStream: defineHandler({
|
|
198
204
|
requestSchema: videoRequestSchema,
|
|
199
205
|
responseSchema: videoStreamResponseSchema,
|
|
200
206
|
streaming: true,
|
|
201
|
-
cancel: { scope:
|
|
202
|
-
handler: video
|
|
207
|
+
cancel: { scope: 'model', hard: true },
|
|
208
|
+
handler: video
|
|
203
209
|
}),
|
|
204
210
|
upscaleStream: defineHandler({
|
|
205
211
|
requestSchema: upscaleRequestSchema,
|
|
@@ -207,12 +213,12 @@ export const diffusionPlugin = definePlugin({
|
|
|
207
213
|
streaming: true,
|
|
208
214
|
// sdcpp upscale path has no cancel surface today — SDK falls
|
|
209
215
|
// back to soft-cancel.
|
|
210
|
-
cancel: { scope:
|
|
211
|
-
handler: upscale
|
|
212
|
-
})
|
|
216
|
+
cancel: { scope: 'none' },
|
|
217
|
+
handler: upscale
|
|
218
|
+
})
|
|
213
219
|
},
|
|
214
220
|
logging: {
|
|
215
221
|
module: addonLogging,
|
|
216
|
-
namespace: ModelType.sdcppGeneration
|
|
217
|
-
}
|
|
222
|
+
namespace: ModelType.sdcppGeneration
|
|
223
|
+
}
|
|
218
224
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type TextToSpeechStreamRequest, type TtsStats } from
|
|
2
|
-
import { type TtsOpYield } from
|
|
1
|
+
import { type TextToSpeechStreamRequest, type TtsStats } from '../../../../../schemas/index';
|
|
2
|
+
import { type TtsOpYield } from '../../../utils/tts-stats';
|
|
3
3
|
export declare function textToSpeechStream(params: TextToSpeechStreamRequest, inputStream: AsyncIterable<Buffer>): AsyncGenerator<TtsOpYield, {
|
|
4
4
|
modelExecutionMs: number;
|
|
5
5
|
stats?: TtsStats;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { getModel } from
|
|
2
|
-
import { textToSpeechStreamRequestSchema
|
|
3
|
-
import { nowMs } from
|
|
4
|
-
import { buildStreamResult, hasDefinedValues } from
|
|
5
|
-
import { TextToSpeechStreamFailedError } from
|
|
6
|
-
import { collectTtsStats
|
|
1
|
+
import { getModel } from '../../../registry/model-registry.js';
|
|
2
|
+
import { textToSpeechStreamRequestSchema } from '../../../../../schemas/index.js';
|
|
3
|
+
import { nowMs } from '../../../../../profiling/index.js';
|
|
4
|
+
import { buildStreamResult, hasDefinedValues } from '../../../../../profiling/model-execution.js';
|
|
5
|
+
import { TextToSpeechStreamFailedError } from '../../../../../utils/errors-server.js';
|
|
6
|
+
import { collectTtsStats } from '../../../utils/tts-stats.js';
|
|
7
7
|
function hasRunStreaming(model) {
|
|
8
|
-
return (typeof model ===
|
|
8
|
+
return (typeof model === 'object' &&
|
|
9
9
|
model !== null &&
|
|
10
|
-
|
|
11
|
-
typeof model.runStreaming ===
|
|
10
|
+
'runStreaming' in model &&
|
|
11
|
+
typeof model.runStreaming === 'function');
|
|
12
12
|
}
|
|
13
13
|
function findLastCompleteUtf8End(buf) {
|
|
14
14
|
const len = buf.length;
|
|
@@ -38,18 +38,16 @@ async function* buffersToUtf8Fragments(inputStream) {
|
|
|
38
38
|
const combined = pending.length === 0 ? buf : Buffer.concat([pending, buf]);
|
|
39
39
|
const completeEnd = findLastCompleteUtf8End(combined);
|
|
40
40
|
if (completeEnd > 0) {
|
|
41
|
-
const s = combined.subarray(0, completeEnd).toString(
|
|
41
|
+
const s = combined.subarray(0, completeEnd).toString('utf8');
|
|
42
42
|
if (s.length > 0) {
|
|
43
43
|
yield s;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
pending =
|
|
47
|
-
completeEnd < combined.length
|
|
48
|
-
? Buffer.from(combined.subarray(completeEnd))
|
|
49
|
-
: Buffer.alloc(0);
|
|
47
|
+
completeEnd < combined.length ? Buffer.from(combined.subarray(completeEnd)) : Buffer.alloc(0);
|
|
50
48
|
}
|
|
51
49
|
if (pending.length > 0) {
|
|
52
|
-
const s = pending.toString(
|
|
50
|
+
const s = pending.toString('utf8');
|
|
53
51
|
if (s.length > 0) {
|
|
54
52
|
yield s;
|
|
55
53
|
}
|
|
@@ -58,16 +56,16 @@ async function* buffersToUtf8Fragments(inputStream) {
|
|
|
58
56
|
function buildRunStreamingOptions(request) {
|
|
59
57
|
const o = {};
|
|
60
58
|
if (request.accumulateSentences !== undefined) {
|
|
61
|
-
o[
|
|
59
|
+
o['accumulateSentences'] = request.accumulateSentences;
|
|
62
60
|
}
|
|
63
61
|
if (request.sentenceDelimiterPreset !== undefined) {
|
|
64
|
-
o[
|
|
62
|
+
o['sentenceDelimiterPreset'] = request.sentenceDelimiterPreset;
|
|
65
63
|
}
|
|
66
64
|
if (request.maxBufferScalars !== undefined) {
|
|
67
|
-
o[
|
|
65
|
+
o['maxBufferScalars'] = request.maxBufferScalars;
|
|
68
66
|
}
|
|
69
67
|
if (request.flushAfterMs !== undefined) {
|
|
70
|
-
o[
|
|
68
|
+
o['flushAfterMs'] = request.flushAfterMs;
|
|
71
69
|
}
|
|
72
70
|
return o;
|
|
73
71
|
}
|
|
@@ -76,7 +74,7 @@ export async function* textToSpeechStream(params, inputStream) {
|
|
|
76
74
|
const model = getModel(request.modelId);
|
|
77
75
|
const modelStart = nowMs();
|
|
78
76
|
if (!hasRunStreaming(model)) {
|
|
79
|
-
throw new TextToSpeechStreamFailedError(
|
|
77
|
+
throw new TextToSpeechStreamFailedError('textToSpeechStream requires a TTS model with runStreaming');
|
|
80
78
|
}
|
|
81
79
|
const textSource = buffersToUtf8Fragments(inputStream);
|
|
82
80
|
const streamOpts = buildRunStreamingOptions(request);
|
|
@@ -92,9 +90,9 @@ export async function* textToSpeechStream(params, inputStream) {
|
|
|
92
90
|
yield {
|
|
93
91
|
buffer: buf,
|
|
94
92
|
...(data.chunkIndex !== undefined ? { chunkIndex: data.chunkIndex } : {}),
|
|
95
|
-
...(typeof data.sentenceChunk ===
|
|
93
|
+
...(typeof data.sentenceChunk === 'string' && data.sentenceChunk.length > 0
|
|
96
94
|
? { sentenceChunk: data.sentenceChunk }
|
|
97
|
-
: {})
|
|
95
|
+
: {})
|
|
98
96
|
};
|
|
99
97
|
}
|
|
100
98
|
const modelExecutionMs = nowMs() - modelStart;
|