@qvac/inference 0.18.1 → 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
package/dist/schemas/config.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { logLevelSchema } from '
|
|
3
|
-
import { ModelType } from '
|
|
4
|
-
import { llmConfigBaseSchema, embedConfigBaseSchema } from '
|
|
5
|
-
import { whisperConfigSchema, parakeetConfigSchema } from '
|
|
6
|
-
import { ocrConfigSchema } from '
|
|
7
|
-
import { sdcppConfigSchema } from '
|
|
8
|
-
import { vlaConfigSchema } from '
|
|
9
|
-
import { runtimeContextSchema } from '
|
|
2
|
+
import { logLevelSchema } from './logging-stream.js';
|
|
3
|
+
import { ModelType } from './model-types.js';
|
|
4
|
+
import { llmConfigBaseSchema, embedConfigBaseSchema } from './llamacpp-config.js';
|
|
5
|
+
import { whisperConfigSchema, parakeetConfigSchema } from './transcription-config.js';
|
|
6
|
+
import { ocrConfigSchema } from './ocr.js';
|
|
7
|
+
import { sdcppConfigSchema } from './sdcpp-config.js';
|
|
8
|
+
import { vlaConfigSchema } from './vla.js';
|
|
9
|
+
import { runtimeContextSchema } from './runtime-context.js';
|
|
10
10
|
// Alias keys for user convenience (maps to canonical types)
|
|
11
11
|
const AliasKeys = {
|
|
12
12
|
llm: 'llm',
|
|
@@ -104,6 +104,14 @@ export const qvacConfigSchema = z.object({
|
|
|
104
104
|
* Defaults to false; set to true to see logs on the console.
|
|
105
105
|
*/
|
|
106
106
|
loggerConsoleOutput: z.boolean().optional(),
|
|
107
|
+
/**
|
|
108
|
+
* Timeout in milliseconds for the worker RPC handshake performed when the SDK
|
|
109
|
+
* initializes. Raise this on slow storage or embedded hardware where the first
|
|
110
|
+
* worker start (native addon load) legitimately exceeds the default.
|
|
111
|
+
* The `QVAC_RPC_INIT_TIMEOUT_MS` environment variable takes precedence.
|
|
112
|
+
* Defaults to 30000 (30 seconds).
|
|
113
|
+
*/
|
|
114
|
+
rpcInitTimeoutMs: z.number().int().positive().optional(),
|
|
107
115
|
/**
|
|
108
116
|
* Maximum number of concurrent HTTP downloads for sharded models.
|
|
109
117
|
* Higher values may improve download speed but increase memory usage.
|
|
@@ -117,6 +125,31 @@ export const qvacConfigSchema = z.object({
|
|
|
117
125
|
* Defaults to 10000 (10 seconds).
|
|
118
126
|
*/
|
|
119
127
|
httpConnectionTimeoutMs: z.number().int().positive().optional(),
|
|
128
|
+
/**
|
|
129
|
+
* Require HTTP model downloads to be verified against a trusted checksum.
|
|
130
|
+
* Sources that expose one (currently Hugging Face, via the Hub's SHA-256)
|
|
131
|
+
* are always verified regardless of this flag, and a mismatch always fails.
|
|
132
|
+
* This flag only governs the unverifiable cases:
|
|
133
|
+
* - false (default): a source with no available checksum downloads with a
|
|
134
|
+
* warning (Hugging Face URLs that expose no SHA-256, and non-Hugging-Face
|
|
135
|
+
* URLs which have no checksum source).
|
|
136
|
+
* - true: a source that should be verifiable but exposes no usable checksum
|
|
137
|
+
* (e.g. a Hugging Face URL without a SHA-256) is rejected; a source with no
|
|
138
|
+
* checksum source at all still downloads, with a warning that no checksum
|
|
139
|
+
* source was available.
|
|
140
|
+
* Defaults to false.
|
|
141
|
+
*/
|
|
142
|
+
requireHttpChecksum: z.boolean().optional(),
|
|
143
|
+
/**
|
|
144
|
+
* Enforce secure transport for HTTP model downloads: reject plaintext http://
|
|
145
|
+
* and HTTPS->HTTP downgrade redirects (loopback exempt).
|
|
146
|
+
* - false (default): enforced only for Hugging Face sources, whose Hub SHA-256
|
|
147
|
+
* attestation a downgrade could sidestep. Bring-your-own HTTP on any host,
|
|
148
|
+
* plaintext included, is left as-is.
|
|
149
|
+
* - true: enforced for every HTTP source, so all downloads must use HTTPS.
|
|
150
|
+
* Defaults to false.
|
|
151
|
+
*/
|
|
152
|
+
requireSecureTransport: z.boolean().optional(),
|
|
120
153
|
/**
|
|
121
154
|
* Maximum number of retry attempts for registry (P2P) downloads on timeout.
|
|
122
155
|
* When a download times out due to a P2P connection stall, we
|
|
@@ -153,6 +186,15 @@ export const qvacConfigSchema = z.object({
|
|
|
153
186
|
* ```
|
|
154
187
|
*/
|
|
155
188
|
deviceDefaults: z.array(devicePatternSchema).optional(),
|
|
189
|
+
/**
|
|
190
|
+
* Create new RAG workspaces on the TurboVec index instead of HyperDB.
|
|
191
|
+
* The choice is per workspace and one-way: a workspace records its adapter
|
|
192
|
+
* on first open and keeps it regardless of later config changes. The only
|
|
193
|
+
* way to move an existing workspace back is `deleteWorkspace`, which
|
|
194
|
+
* deletes its data.
|
|
195
|
+
* Defaults to false.
|
|
196
|
+
*/
|
|
197
|
+
ragTurbovec: z.boolean().optional(),
|
|
156
198
|
/**
|
|
157
199
|
* Inert: we do not read this field. Plugins are registered
|
|
158
200
|
* in code with `registerPlugin` / `plugins([...])`, and there are no
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { AbortController } from 'bare-abort-controller';
|
|
3
|
-
import type { ModelProgressUpdate } from '
|
|
3
|
+
import type { ModelProgressUpdate } from './load-model.js';
|
|
4
4
|
export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
5
5
|
assetSrc: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
6
6
|
src: z.ZodString;
|
|
@@ -42,6 +42,8 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
42
42
|
}>, z.ZodLiteral<"vad">]>>;
|
|
43
43
|
}, z.core.$strip>]>;
|
|
44
44
|
seed: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
requireHttpChecksum: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
requireSecureTransport: z.ZodOptional<z.ZodBoolean>;
|
|
45
47
|
}, z.core.$strip>, z.ZodTransform<{
|
|
46
48
|
seed: boolean;
|
|
47
49
|
assetSrc: string | {
|
|
@@ -57,6 +59,8 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
57
59
|
sha256Checksum?: string | undefined;
|
|
58
60
|
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "ggml-ocr" | "sdcpp-generation" | "audiogen-ggml" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
|
|
59
61
|
};
|
|
62
|
+
requireHttpChecksum?: boolean | undefined;
|
|
63
|
+
requireSecureTransport?: boolean | undefined;
|
|
60
64
|
}, {
|
|
61
65
|
assetSrc: string | {
|
|
62
66
|
src: string;
|
|
@@ -72,6 +76,8 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
72
76
|
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "ggml-ocr" | "sdcpp-generation" | "audiogen-ggml" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
|
|
73
77
|
};
|
|
74
78
|
seed?: boolean | undefined;
|
|
79
|
+
requireHttpChecksum?: boolean | undefined;
|
|
80
|
+
requireSecureTransport?: boolean | undefined;
|
|
75
81
|
}>>;
|
|
76
82
|
export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
77
83
|
assetSrc: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
@@ -114,6 +120,8 @@ export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<
|
|
|
114
120
|
}>, z.ZodLiteral<"vad">]>>;
|
|
115
121
|
}, z.core.$strip>]>;
|
|
116
122
|
seed: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
requireHttpChecksum: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
+
requireSecureTransport: z.ZodOptional<z.ZodBoolean>;
|
|
117
125
|
onProgress: z.ZodOptional<z.ZodUnknown>;
|
|
118
126
|
withProgress: z.ZodOptional<z.ZodBoolean>;
|
|
119
127
|
requestId: z.ZodOptional<z.ZodString>;
|
|
@@ -123,6 +131,8 @@ export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<
|
|
|
123
131
|
withProgress: boolean;
|
|
124
132
|
seed: boolean;
|
|
125
133
|
requestId?: string;
|
|
134
|
+
requireHttpChecksum?: boolean;
|
|
135
|
+
requireSecureTransport?: boolean;
|
|
126
136
|
}, {
|
|
127
137
|
assetSrc: string | {
|
|
128
138
|
src: string;
|
|
@@ -138,6 +148,8 @@ export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<
|
|
|
138
148
|
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "ggml-ocr" | "sdcpp-generation" | "audiogen-ggml" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
|
|
139
149
|
};
|
|
140
150
|
seed?: boolean | undefined;
|
|
151
|
+
requireHttpChecksum?: boolean | undefined;
|
|
152
|
+
requireSecureTransport?: boolean | undefined;
|
|
141
153
|
onProgress?: unknown;
|
|
142
154
|
withProgress?: boolean | undefined;
|
|
143
155
|
requestId?: string | undefined;
|
|
@@ -147,18 +159,24 @@ export declare const downloadAssetRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
147
159
|
assetSrc: z.ZodString;
|
|
148
160
|
withProgress: z.ZodOptional<z.ZodBoolean>;
|
|
149
161
|
seed: z.ZodOptional<z.ZodBoolean>;
|
|
162
|
+
requireHttpChecksum: z.ZodOptional<z.ZodBoolean>;
|
|
163
|
+
requireSecureTransport: z.ZodOptional<z.ZodBoolean>;
|
|
150
164
|
requestId: z.ZodOptional<z.ZodString>;
|
|
151
165
|
}, z.core.$strip>, z.ZodTransform<{
|
|
152
166
|
seed: boolean;
|
|
153
167
|
type: "downloadAsset";
|
|
154
168
|
assetSrc: string;
|
|
155
169
|
withProgress?: boolean | undefined;
|
|
170
|
+
requireHttpChecksum?: boolean | undefined;
|
|
171
|
+
requireSecureTransport?: boolean | undefined;
|
|
156
172
|
requestId?: string | undefined;
|
|
157
173
|
}, {
|
|
158
174
|
type: "downloadAsset";
|
|
159
175
|
assetSrc: string;
|
|
160
176
|
withProgress?: boolean | undefined;
|
|
161
177
|
seed?: boolean | undefined;
|
|
178
|
+
requireHttpChecksum?: boolean | undefined;
|
|
179
|
+
requireSecureTransport?: boolean | undefined;
|
|
162
180
|
requestId?: string | undefined;
|
|
163
181
|
}>>;
|
|
164
182
|
export declare const downloadAssetResponseSchema: z.ZodObject<{
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { modelSrcInputSchema, modelInputToSrcSchema } from '
|
|
2
|
+
import { modelSrcInputSchema, modelInputToSrcSchema, MODEL_SOURCE_URI_HINT } from './model-src-utils.js';
|
|
3
|
+
const ASSET_SRC_DESCRIPTION = `The asset to download and cache: ${MODEL_SOURCE_URI_HINT}.`;
|
|
3
4
|
const downloadAssetOptionsBaseSchema = z.object({
|
|
4
|
-
assetSrc: modelSrcInputSchema,
|
|
5
|
-
seed: z.boolean().optional()
|
|
5
|
+
assetSrc: modelSrcInputSchema.describe(ASSET_SRC_DESCRIPTION),
|
|
6
|
+
seed: z.boolean().optional(),
|
|
7
|
+
requireHttpChecksum: z.boolean().optional(),
|
|
8
|
+
requireSecureTransport: z.boolean().optional()
|
|
6
9
|
});
|
|
7
10
|
export const downloadAssetOptionsSchema = downloadAssetOptionsBaseSchema.transform((data) => ({
|
|
8
11
|
...data,
|
|
@@ -23,14 +26,27 @@ export const downloadAssetOptionsToRequestSchema = downloadAssetOptionsBaseSchem
|
|
|
23
26
|
};
|
|
24
27
|
if (data.requestId !== undefined)
|
|
25
28
|
out.requestId = data.requestId;
|
|
29
|
+
if (data.requireHttpChecksum !== undefined)
|
|
30
|
+
out.requireHttpChecksum = data.requireHttpChecksum;
|
|
31
|
+
if (data.requireSecureTransport !== undefined) {
|
|
32
|
+
out.requireSecureTransport = data.requireSecureTransport;
|
|
33
|
+
}
|
|
26
34
|
return out;
|
|
27
35
|
});
|
|
28
36
|
export const downloadAssetRequestSchema = z
|
|
29
37
|
.object({
|
|
30
38
|
type: z.literal('downloadAsset'),
|
|
31
|
-
assetSrc: z.string(),
|
|
39
|
+
assetSrc: z.string().describe(ASSET_SRC_DESCRIPTION),
|
|
32
40
|
withProgress: z.boolean().optional(),
|
|
33
41
|
seed: z.boolean().optional(),
|
|
42
|
+
requireHttpChecksum: z
|
|
43
|
+
.boolean()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe('Reject a Hugging Face HTTP download that exposes no usable SHA-256 instead of downloading it unverified. Overrides the engine config for this call; defaults to the config value (false).'),
|
|
46
|
+
requireSecureTransport: z
|
|
47
|
+
.boolean()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('Reject plaintext http:// and HTTPS→HTTP downgrades for every HTTP source on this call (loopback exempt); when unset, only Hugging Face transport is hardened. Overrides the engine config for this call; defaults to the config value (false).'),
|
|
34
50
|
requestId: z
|
|
35
51
|
.string()
|
|
36
52
|
.min(1)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ModelRegistryEngine, type ModelRegistryEntryAddon } from '
|
|
1
|
+
import { type ModelRegistryEngine, type ModelRegistryEntryAddon } from './registry.js';
|
|
2
2
|
export declare const ENGINE_TO_ADDON: {
|
|
3
3
|
readonly "llamacpp-completion": "llm";
|
|
4
4
|
readonly "whispercpp-transcription": "whisper";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ModelType } from '
|
|
2
|
-
import { ADDON_AUDIOGEN, ADDON_BCI, ADDON_CLASSIFICATION, ADDON_DIFFUSION, ADDON_EMBEDDING, ADDON_LLM, ADDON_NMT, ADDON_OCR, ADDON_PARAKEET, ADDON_TTS, ADDON_VLA, ADDON_WHISPER } from '
|
|
3
|
-
import { modelRegistryEngineSchema } from '
|
|
1
|
+
import { ModelType } from './model-types.js';
|
|
2
|
+
import { ADDON_AUDIOGEN, ADDON_BCI, ADDON_CLASSIFICATION, ADDON_DIFFUSION, ADDON_EMBEDDING, ADDON_LLM, ADDON_NMT, ADDON_OCR, ADDON_PARAKEET, ADDON_TTS, ADDON_VLA, ADDON_WHISPER } from './plugin.js';
|
|
3
|
+
import { modelRegistryEngineSchema } from './registry.js';
|
|
4
4
|
// Canonical engine → addon mapping (exhaustive). `as const` preserves
|
|
5
5
|
// per-key literals so the addon can be derived from the engine at the type level.
|
|
6
6
|
export const ENGINE_TO_ADDON = {
|
package/dist/schemas/error.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
/**
|
|
3
|
-
* Serialized shape for errors that cross a response boundary —
|
|
4
|
-
*
|
|
3
|
+
* Serialized shape for errors that cross a response boundary — an RPC
|
|
4
|
+
* reply over `bare-rpc`, or a duplex stream.
|
|
5
5
|
* The fields are the union of (a) the `QvacErrorBase` serialisation
|
|
6
6
|
* (`name`, `code`, `message`, `stack`, `cause`, `timestamp`) and (b) the
|
|
7
7
|
* `typedFields` map carrying per-class structured data a receiver uses
|
package/dist/schemas/error.js
CHANGED
|
@@ -2,8 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
import { QvacErrorBase } from '@qvac/error';
|
|
3
3
|
import { formatZodError } from '../utils/zod-error.js';
|
|
4
4
|
/**
|
|
5
|
-
* Serialized shape for errors that cross a response boundary —
|
|
6
|
-
*
|
|
5
|
+
* Serialized shape for errors that cross a response boundary — an RPC
|
|
6
|
+
* reply over `bare-rpc`, or a duplex stream.
|
|
7
7
|
* The fields are the union of (a) the `QvacErrorBase` serialisation
|
|
8
8
|
* (`name`, `code`, `message`, `stack`, `cause`, `timestamp`) and (b) the
|
|
9
9
|
* `typedFields` map carrying per-class structured data a receiver uses
|
package/dist/schemas/errors.d.ts
CHANGED
|
@@ -9,8 +9,6 @@ export declare const ERROR_CODES: {
|
|
|
9
9
|
readonly MODEL_SRC_TYPE_MISMATCH: 50009;
|
|
10
10
|
readonly REQUEST_VALIDATION_FAILED: 50010;
|
|
11
11
|
readonly RPC_NO_HANDLER: 50200;
|
|
12
|
-
readonly PROVIDER_START_FAILED: 50400;
|
|
13
|
-
readonly PROVIDER_STOP_FAILED: 50401;
|
|
14
12
|
readonly CONFIG_FILE_INVALID: 50603;
|
|
15
13
|
readonly CONFIG_FILE_PARSE_FAILED: 50604;
|
|
16
14
|
readonly CONFIG_VALIDATION_FAILED: 50605;
|
|
@@ -19,7 +17,6 @@ export declare const ERROR_CODES: {
|
|
|
19
17
|
readonly MODEL_ALREADY_REGISTERED: 52001;
|
|
20
18
|
readonly MODEL_NOT_FOUND: 52002;
|
|
21
19
|
readonly MODEL_NOT_LOADED: 52003;
|
|
22
|
-
readonly MODEL_IS_DELEGATED: 52004;
|
|
23
20
|
readonly UNKNOWN_MODEL_TYPE: 52005;
|
|
24
21
|
readonly MODEL_LOAD_FAILED: 52200;
|
|
25
22
|
readonly MODEL_FILE_NOT_FOUND: 52201;
|
|
@@ -81,6 +78,8 @@ export declare const ERROR_CODES: {
|
|
|
81
78
|
readonly ARCHIVE_MISSING_SHARDS: 53013;
|
|
82
79
|
readonly PARTIAL_DOWNLOAD_OFFLINE: 53014;
|
|
83
80
|
readonly REGISTRY_DOWNLOAD_FAILED: 53015;
|
|
81
|
+
readonly INSECURE_MODEL_SOURCE: 53016;
|
|
82
|
+
readonly CHECKSUM_UNAVAILABLE: 53017;
|
|
84
83
|
readonly DELETE_CACHE_FAILED: 53200;
|
|
85
84
|
readonly INVALID_DELETE_CACHE_PARAMS: 53201;
|
|
86
85
|
readonly CACHE_DIR_NOT_ABSOLUTE: 53202;
|
|
@@ -93,9 +92,6 @@ export declare const ERROR_CODES: {
|
|
|
93
92
|
readonly AUDIO_PLAYER_FAILED: 53501;
|
|
94
93
|
readonly INVALID_AUDIO_CHUNK_TYPE: 53502;
|
|
95
94
|
readonly ASYNC_DISPOSE_UNAVAILABLE: 53503;
|
|
96
|
-
readonly DELEGATE_NO_FINAL_RESPONSE: 53700;
|
|
97
|
-
readonly DELEGATE_CONNECTION_FAILED: 53701;
|
|
98
|
-
readonly DELEGATE_PROVIDER_ERROR: 53702;
|
|
99
95
|
readonly RPC_NO_DATA_RECEIVED: 53703;
|
|
100
96
|
readonly RPC_UNKNOWN_REQUEST_TYPE: 53704;
|
|
101
97
|
readonly PLUGIN_NOT_FOUND: 53850;
|
package/dist/schemas/errors.js
CHANGED
|
@@ -13,9 +13,6 @@ export const ERROR_CODES = {
|
|
|
13
13
|
REQUEST_VALIDATION_FAILED: 50010,
|
|
14
14
|
// Dispatch (50,200-50,399)
|
|
15
15
|
RPC_NO_HANDLER: 50200,
|
|
16
|
-
// Provider / delegation, consumer side (50,400-50,599)
|
|
17
|
-
PROVIDER_START_FAILED: 50400,
|
|
18
|
-
PROVIDER_STOP_FAILED: 50401,
|
|
19
16
|
// Config file resolution (50,600-50,799)
|
|
20
17
|
CONFIG_FILE_INVALID: 50603,
|
|
21
18
|
CONFIG_FILE_PARSE_FAILED: 50604,
|
|
@@ -27,7 +24,6 @@ export const ERROR_CODES = {
|
|
|
27
24
|
MODEL_ALREADY_REGISTERED: 52001,
|
|
28
25
|
MODEL_NOT_FOUND: 52002,
|
|
29
26
|
MODEL_NOT_LOADED: 52003,
|
|
30
|
-
MODEL_IS_DELEGATED: 52004,
|
|
31
27
|
UNKNOWN_MODEL_TYPE: 52005,
|
|
32
28
|
// Model loading (52,200-52,399)
|
|
33
29
|
MODEL_LOAD_FAILED: 52200,
|
|
@@ -93,6 +89,8 @@ export const ERROR_CODES = {
|
|
|
93
89
|
ARCHIVE_MISSING_SHARDS: 53013,
|
|
94
90
|
PARTIAL_DOWNLOAD_OFFLINE: 53014,
|
|
95
91
|
REGISTRY_DOWNLOAD_FAILED: 53015,
|
|
92
|
+
INSECURE_MODEL_SOURCE: 53016,
|
|
93
|
+
CHECKSUM_UNAVAILABLE: 53017,
|
|
96
94
|
// Cache operations (53,200-53,349)
|
|
97
95
|
DELETE_CACHE_FAILED: 53200,
|
|
98
96
|
INVALID_DELETE_CACHE_PARAMS: 53201,
|
|
@@ -109,10 +107,7 @@ export const ERROR_CODES = {
|
|
|
109
107
|
AUDIO_PLAYER_FAILED: 53501,
|
|
110
108
|
INVALID_AUDIO_CHUNK_TYPE: 53502,
|
|
111
109
|
ASYNC_DISPOSE_UNAVAILABLE: 53503,
|
|
112
|
-
//
|
|
113
|
-
DELEGATE_NO_FINAL_RESPONSE: 53700,
|
|
114
|
-
DELEGATE_CONNECTION_FAILED: 53701,
|
|
115
|
-
DELEGATE_PROVIDER_ERROR: 53702,
|
|
110
|
+
// RPC transport (53,700-53,849)
|
|
116
111
|
RPC_NO_DATA_RECEIVED: 53703,
|
|
117
112
|
RPC_UNKNOWN_REQUEST_TYPE: 53704,
|
|
118
113
|
// Plugin errors (53,850-53,899)
|
|
@@ -170,15 +165,6 @@ const errorDefinitions = {
|
|
|
170
165
|
name: 'RPC_NO_HANDLER',
|
|
171
166
|
message: (requestType) => `No handler function registered for request type: ${requestType}`
|
|
172
167
|
},
|
|
173
|
-
// Provider / delegation, consumer side
|
|
174
|
-
[ERROR_CODES.PROVIDER_START_FAILED]: {
|
|
175
|
-
name: 'PROVIDER_START_FAILED',
|
|
176
|
-
message: (details) => `Failed to start provider${details ? `: ${details}` : ''}`
|
|
177
|
-
},
|
|
178
|
-
[ERROR_CODES.PROVIDER_STOP_FAILED]: {
|
|
179
|
-
name: 'PROVIDER_STOP_FAILED',
|
|
180
|
-
message: (details) => `Failed to stop provider${details ? `: ${details}` : ''}`
|
|
181
|
-
},
|
|
182
168
|
// Config file resolution
|
|
183
169
|
[ERROR_CODES.CONFIG_FILE_INVALID]: {
|
|
184
170
|
name: 'CONFIG_FILE_INVALID',
|
|
@@ -214,10 +200,6 @@ const errorDefinitions = {
|
|
|
214
200
|
name: 'MODEL_NOT_LOADED',
|
|
215
201
|
message: (modelId) => `Model with ID "${modelId}" is not loaded`
|
|
216
202
|
},
|
|
217
|
-
[ERROR_CODES.MODEL_IS_DELEGATED]: {
|
|
218
|
-
name: 'MODEL_IS_DELEGATED',
|
|
219
|
-
message: (modelId) => `Model "${modelId}" is a delegated model and cannot be accessed directly`
|
|
220
|
-
},
|
|
221
203
|
[ERROR_CODES.UNKNOWN_MODEL_TYPE]: {
|
|
222
204
|
name: 'UNKNOWN_MODEL_TYPE',
|
|
223
205
|
message: (modelType) => `Unknown model type: ${modelType}. Register the plugin for "${modelType}" in code with \`registerPlugin\` / \`plugins([...])\` before this call.`
|
|
@@ -354,13 +336,24 @@ const errorDefinitions = {
|
|
|
354
336
|
},
|
|
355
337
|
[ERROR_CODES.CONTEXT_OVERFLOW]: {
|
|
356
338
|
name: 'CONTEXT_OVERFLOW',
|
|
357
|
-
message: (promptTokens, ctxSize, modelId) => {
|
|
358
|
-
const prompt = promptTokens ? `${promptTokens} prompt tokens` : 'prompt';
|
|
359
|
-
const ctx = ctxSize
|
|
360
|
-
? ` exceeds the ${ctxSize}-token context window`
|
|
361
|
-
: " exceeds the model's context window";
|
|
339
|
+
message: (promptTokens, ctxSize, modelId, cachedTokens, requiredTokens) => {
|
|
362
340
|
const model = modelId ? ` for model "${modelId}"` : '';
|
|
363
|
-
|
|
341
|
+
// Ambiguous totals can be KV cells, and the guards trigger at equality —
|
|
342
|
+
// unit-neutral wording, phrased as leaving no room rather than exceeding.
|
|
343
|
+
const capacity = ctxSize
|
|
344
|
+
? `the effective context capacity (${ctxSize} units)`
|
|
345
|
+
: "the model's context capacity";
|
|
346
|
+
if (requiredTokens && cachedTokens) {
|
|
347
|
+
return `Conversation uses ${requiredTokens} context units (${cachedTokens} already cached) and leaves no room to generate within ${capacity}${model}. Start a new conversation or raise ctx_size.`;
|
|
348
|
+
}
|
|
349
|
+
if (requiredTokens) {
|
|
350
|
+
return `Request uses ${requiredTokens} context units and leaves no room to generate within ${capacity}${model}. Reduce the prompt size, start a new conversation, or raise ctx_size.`;
|
|
351
|
+
}
|
|
352
|
+
const window = ctxSize ? `the ${ctxSize}-token context window` : "the model's context window";
|
|
353
|
+
// The prompt-only branch below is reachable only through the public
|
|
354
|
+
// constructors — the parser always pairs promptTokens with requiredTokens.
|
|
355
|
+
const prompt = promptTokens ? `${promptTokens} prompt tokens` : 'prompt';
|
|
356
|
+
return `${prompt} exceeds ${window}${model}. Reduce the prompt size or start a new conversation.`;
|
|
364
357
|
}
|
|
365
358
|
},
|
|
366
359
|
[ERROR_CODES.INVALID_AUDIO_INPUT]: {
|
|
@@ -461,6 +454,15 @@ const errorDefinitions = {
|
|
|
461
454
|
name: 'REGISTRY_DOWNLOAD_FAILED',
|
|
462
455
|
message: (details) => `Registry download failed: ${details}`
|
|
463
456
|
},
|
|
457
|
+
[ERROR_CODES.INSECURE_MODEL_SOURCE]: {
|
|
458
|
+
name: 'INSECURE_MODEL_SOURCE',
|
|
459
|
+
message: (url, reason) => `Refusing insecure model download from ${url}: ${reason}`
|
|
460
|
+
},
|
|
461
|
+
[ERROR_CODES.CHECKSUM_UNAVAILABLE]: {
|
|
462
|
+
name: 'CHECKSUM_UNAVAILABLE',
|
|
463
|
+
message: (url) => `Model download from ${url} could not be verified against a trusted checksum ` +
|
|
464
|
+
`and requireHttpChecksum is enabled`
|
|
465
|
+
},
|
|
464
466
|
[ERROR_CODES.INVALID_SHARD_URL_PATTERN]: {
|
|
465
467
|
name: 'INVALID_SHARD_URL_PATTERN',
|
|
466
468
|
message: (url) => `URL does not contain a valid sharded model pattern: ${url}`
|
|
@@ -533,19 +535,7 @@ const errorDefinitions = {
|
|
|
533
535
|
name: 'ASYNC_DISPOSE_UNAVAILABLE',
|
|
534
536
|
message: 'Host runtime does not expose Symbol.asyncDispose; request-lifecycle primitives require ES2024 `using`/`asyncDispose` support. Verify your runtime (Bare ≥ 1.24) and any polyfill registration.'
|
|
535
537
|
},
|
|
536
|
-
//
|
|
537
|
-
[ERROR_CODES.DELEGATE_NO_FINAL_RESPONSE]: {
|
|
538
|
-
name: 'DELEGATE_NO_FINAL_RESPONSE',
|
|
539
|
-
message: 'No final response received from delegated provider'
|
|
540
|
-
},
|
|
541
|
-
[ERROR_CODES.DELEGATE_CONNECTION_FAILED]: {
|
|
542
|
-
name: 'DELEGATE_CONNECTION_FAILED',
|
|
543
|
-
message: (details) => `Failed to connect to delegated provider: ${details}`
|
|
544
|
-
},
|
|
545
|
-
[ERROR_CODES.DELEGATE_PROVIDER_ERROR]: {
|
|
546
|
-
name: 'DELEGATE_PROVIDER_ERROR',
|
|
547
|
-
message: (details, providerCode) => `Delegated provider error: ${details}` + (providerCode ? ` (code: ${providerCode})` : '')
|
|
548
|
-
},
|
|
538
|
+
// RPC transport
|
|
549
539
|
[ERROR_CODES.RPC_NO_DATA_RECEIVED]: {
|
|
550
540
|
name: 'RPC_NO_DATA_RECEIVED',
|
|
551
541
|
message: 'No data received from request'
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const heartbeatRequestSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"heartbeat">;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export declare const heartbeatResponseSchema: z.ZodObject<{
|
|
6
|
+
type: z.ZodLiteral<"heartbeat">;
|
|
7
|
+
number: z.ZodNumber;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type HeartbeatRequest = z.infer<typeof heartbeatRequestSchema>;
|
|
10
|
+
export type HeartbeatResponse = z.infer<typeof heartbeatResponseSchema>;
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export { toolSchema, toolCallSchema, toolCallErrorSchema, type Tool, type ToolCall, type ToolCallError, type ToolCallWithCall } from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
12
|
-
export * from '
|
|
13
|
-
export * from '
|
|
14
|
-
export * from '
|
|
15
|
-
export * from '
|
|
16
|
-
export * from '
|
|
17
|
-
export * from '
|
|
18
|
-
export * from '
|
|
19
|
-
export * from '
|
|
20
|
-
export * from '
|
|
21
|
-
export * from '
|
|
22
|
-
export * from '
|
|
23
|
-
export * from '
|
|
24
|
-
export * from '
|
|
25
|
-
export * from '
|
|
26
|
-
export * from '
|
|
27
|
-
export * from '
|
|
28
|
-
export * from '
|
|
29
|
-
export * from '
|
|
30
|
-
export * from '
|
|
31
|
-
export * from '
|
|
32
|
-
export * from '
|
|
33
|
-
export { ERROR_CODES, REGISTRY_ERROR_CODES } from '
|
|
1
|
+
export * from './model-file.js';
|
|
2
|
+
export * from './cancel.js';
|
|
3
|
+
export * from './batch-completion-stream.js';
|
|
4
|
+
export * from './completion-stream.js';
|
|
5
|
+
export * from './completion-event.js';
|
|
6
|
+
export { toolSchema, toolCallSchema, toolCallErrorSchema, type Tool, type ToolCall, type ToolCallError, type ToolCallWithCall } from './tools.js';
|
|
7
|
+
export * from './heartbeat.js';
|
|
8
|
+
export * from './model-ops.js';
|
|
9
|
+
export * from './download-asset.js';
|
|
10
|
+
export * from './embed.js';
|
|
11
|
+
export * from './finetune.js';
|
|
12
|
+
export * from './load-model.js';
|
|
13
|
+
export * from './reload-config.js';
|
|
14
|
+
export * from './logging-stream.js';
|
|
15
|
+
export * from './common.js';
|
|
16
|
+
export * from './transcription.js';
|
|
17
|
+
export * from './bci.js';
|
|
18
|
+
export * from './bci-config.js';
|
|
19
|
+
export * from './translate.js';
|
|
20
|
+
export * from './translation-config.js';
|
|
21
|
+
export * from './llamacpp-config.js';
|
|
22
|
+
export * from './transcription-config.js';
|
|
23
|
+
export * from './text-to-speech.js';
|
|
24
|
+
export * from './error.js';
|
|
25
|
+
export * from './rag.js';
|
|
26
|
+
export * from './ocr.js';
|
|
27
|
+
export * from './sdcpp-config.js';
|
|
28
|
+
export * from './vla.js';
|
|
29
|
+
export * from './classification.js';
|
|
30
|
+
export * from './audio-gen.js';
|
|
31
|
+
export * from './model-config-schemas.js';
|
|
32
|
+
export * from './lifecycle.js';
|
|
33
|
+
export { ERROR_CODES, REGISTRY_ERROR_CODES } from './errors.js';
|
|
34
34
|
export { ERR_CODES as RAG_ERROR_CODES } from '@qvac/rag/errors';
|
|
35
|
-
export { qvacConfigSchema, deviceMatchSchema, deviceConfigDefaultsSchema, devicePatternSchema, type QvacConfig, type DeviceMatch, type DeviceConfigDefaults, type DevicePattern } from '
|
|
36
|
-
export { PROFILING_KEY, PROFILING_TRAILER_KEY,
|
|
37
|
-
export { runtimeContextSchema, type RuntimeContext } from '
|
|
38
|
-
export * from '
|
|
39
|
-
export * from '
|
|
40
|
-
export * from '
|
|
41
|
-
export * from '
|
|
42
|
-
export { type McpClient, type McpClientInput } from '
|
|
43
|
-
export { PUBLIC_MODEL_TYPES as MODEL_TYPES, ModelType, type CanonicalModelType, type ModelTypeInput, normalizeModelType, isCanonicalModelType, isModelTypeAlias } from '
|
|
44
|
-
export * from '
|
|
45
|
-
export * from '
|
|
35
|
+
export { qvacConfigSchema, deviceMatchSchema, deviceConfigDefaultsSchema, devicePatternSchema, type QvacConfig, type DeviceMatch, type DeviceConfigDefaults, type DevicePattern } from './config.js';
|
|
36
|
+
export { PROFILING_KEY, PROFILING_TRAILER_KEY, OPERATION_EVENT_KEY, MODEL_EXECUTION_KEY, BACKEND_DIAGNOSTICS_KEY, profilerModeSchema, profilerGPUResourceGaugeSchema, profilerResourceGaugeSchema, serverBreakdownSchema, operationEventSchema, profilingRequestMetaSchema, profilingResponseMetaSchema, perCallProfilingSchema, type ProfilerMode, type ServerBreakdown, type OperationEvent, type ProfilingRequestMeta, type ProfilingResponseMeta, type PerCallProfiling, type ProfilerGPUResourceGauge, type ProfilerResourceGauge } from './profiling.js';
|
|
37
|
+
export { runtimeContextSchema, type RuntimeContext } from './runtime-context.js';
|
|
38
|
+
export * from './model-info.js';
|
|
39
|
+
export * from './system-resources.js';
|
|
40
|
+
export * from './model-src-utils.js';
|
|
41
|
+
export * from './json-schema.js';
|
|
42
|
+
export { type McpClient, type McpClientInput } from './mcp-adapter.js';
|
|
43
|
+
export { PUBLIC_MODEL_TYPES as MODEL_TYPES, ModelType, type CanonicalModelType, type ModelTypeInput, normalizeModelType, isCanonicalModelType, isModelTypeAlias } from './model-types.js';
|
|
44
|
+
export * from './plugin.js';
|
|
45
|
+
export * from './registry.js';
|
|
46
|
+
export * from './model-resource-profile.js';
|
|
47
|
+
export * from './assess-model-fit.js';
|
package/dist/schemas/index.js
CHANGED
|
@@ -1,45 +1,47 @@
|
|
|
1
1
|
// Re-export all schemas and types
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export { toolSchema, toolCallSchema, toolCallErrorSchema } from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
12
|
-
export * from '
|
|
13
|
-
export * from '
|
|
14
|
-
export * from '
|
|
15
|
-
export * from '
|
|
16
|
-
export * from '
|
|
17
|
-
export * from '
|
|
18
|
-
export * from '
|
|
19
|
-
export * from '
|
|
20
|
-
export * from '
|
|
21
|
-
export * from '
|
|
22
|
-
export * from '
|
|
23
|
-
export * from '
|
|
24
|
-
export * from '
|
|
25
|
-
export * from '
|
|
26
|
-
export * from '
|
|
27
|
-
export * from '
|
|
28
|
-
export * from '
|
|
29
|
-
export * from '
|
|
30
|
-
export * from '
|
|
31
|
-
export * from '
|
|
32
|
-
export * from '
|
|
33
|
-
export * from '
|
|
34
|
-
export { ERROR_CODES, REGISTRY_ERROR_CODES } from '
|
|
2
|
+
export * from './model-file.js';
|
|
3
|
+
export * from './cancel.js';
|
|
4
|
+
export * from './batch-completion-stream.js';
|
|
5
|
+
export * from './completion-stream.js';
|
|
6
|
+
export * from './completion-event.js';
|
|
7
|
+
export { toolSchema, toolCallSchema, toolCallErrorSchema } from './tools.js';
|
|
8
|
+
export * from './heartbeat.js';
|
|
9
|
+
export * from './model-ops.js';
|
|
10
|
+
export * from './download-asset.js';
|
|
11
|
+
export * from './embed.js';
|
|
12
|
+
export * from './finetune.js';
|
|
13
|
+
export * from './load-model.js';
|
|
14
|
+
export * from './reload-config.js';
|
|
15
|
+
export * from './logging-stream.js';
|
|
16
|
+
export * from './common.js';
|
|
17
|
+
export * from './transcription.js';
|
|
18
|
+
export * from './bci.js';
|
|
19
|
+
export * from './bci-config.js';
|
|
20
|
+
export * from './translate.js';
|
|
21
|
+
export * from './translation-config.js';
|
|
22
|
+
export * from './llamacpp-config.js';
|
|
23
|
+
export * from './transcription-config.js';
|
|
24
|
+
export * from './text-to-speech.js';
|
|
25
|
+
export * from './error.js';
|
|
26
|
+
export * from './rag.js';
|
|
27
|
+
export * from './ocr.js';
|
|
28
|
+
export * from './sdcpp-config.js';
|
|
29
|
+
export * from './vla.js';
|
|
30
|
+
export * from './classification.js';
|
|
31
|
+
export * from './audio-gen.js';
|
|
32
|
+
export * from './model-config-schemas.js';
|
|
33
|
+
export * from './lifecycle.js';
|
|
34
|
+
export { ERROR_CODES, REGISTRY_ERROR_CODES } from './errors.js';
|
|
35
35
|
export { ERR_CODES as RAG_ERROR_CODES } from '@qvac/rag/errors';
|
|
36
|
-
export { qvacConfigSchema, deviceMatchSchema, deviceConfigDefaultsSchema, devicePatternSchema } from '
|
|
37
|
-
export { PROFILING_KEY, PROFILING_TRAILER_KEY,
|
|
38
|
-
export { runtimeContextSchema } from '
|
|
39
|
-
export * from '
|
|
40
|
-
export * from '
|
|
41
|
-
export * from '
|
|
42
|
-
export * from '
|
|
43
|
-
export { PUBLIC_MODEL_TYPES as MODEL_TYPES, ModelType, normalizeModelType, isCanonicalModelType, isModelTypeAlias } from '
|
|
44
|
-
export * from '
|
|
45
|
-
export * from '
|
|
36
|
+
export { qvacConfigSchema, deviceMatchSchema, deviceConfigDefaultsSchema, devicePatternSchema } from './config.js';
|
|
37
|
+
export { PROFILING_KEY, PROFILING_TRAILER_KEY, OPERATION_EVENT_KEY, MODEL_EXECUTION_KEY, BACKEND_DIAGNOSTICS_KEY, profilerModeSchema, profilerGPUResourceGaugeSchema, profilerResourceGaugeSchema, serverBreakdownSchema, operationEventSchema, profilingRequestMetaSchema, profilingResponseMetaSchema, perCallProfilingSchema } from './profiling.js';
|
|
38
|
+
export { runtimeContextSchema } from './runtime-context.js';
|
|
39
|
+
export * from './model-info.js';
|
|
40
|
+
export * from './system-resources.js';
|
|
41
|
+
export * from './model-src-utils.js';
|
|
42
|
+
export * from './json-schema.js';
|
|
43
|
+
export { PUBLIC_MODEL_TYPES as MODEL_TYPES, ModelType, normalizeModelType, isCanonicalModelType, isModelTypeAlias } from './model-types.js';
|
|
44
|
+
export * from './plugin.js';
|
|
45
|
+
export * from './registry.js';
|
|
46
|
+
export * from './model-resource-profile.js';
|
|
47
|
+
export * from './assess-model-fit.js';
|