@qvac/inference 0.18.2 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +69 -36
- package/README.md +1 -5
- package/dist/api/assess-model-fit.d.ts +16 -0
- package/dist/api/assess-model-fit.js +27 -0
- package/dist/api/audio-gen.d.ts +4 -4
- package/dist/api/audio-gen.js +17 -6
- package/dist/api/completion-stream.d.ts +1 -1
- package/dist/api/completion-stream.js +1 -1
- package/dist/api/delete-cache.d.ts +7 -1
- package/dist/api/delete-cache.js +11 -1
- package/dist/api/download-asset.d.ts +1 -1
- package/dist/api/download-asset.js +2 -2
- package/dist/api/finetune.js +1 -1
- package/dist/api/get-loaded-model-info.d.ts +6 -10
- package/dist/api/get-loaded-model-info.js +6 -10
- package/dist/api/heartbeat.d.ts +5 -22
- package/dist/api/heartbeat.js +6 -23
- package/dist/api/index.d.ts +36 -35
- package/dist/api/index.js +35 -35
- package/dist/api/load-model.d.ts +5 -1
- package/dist/api/load-model.js +3 -5
- package/dist/api/logging-stream-registry.js +1 -1
- package/dist/api/resume.d.ts +0 -3
- package/dist/api/resume.js +0 -3
- package/dist/api/subscribe-logs.js +1 -1
- package/dist/api/suspend.d.ts +0 -4
- package/dist/api/suspend.js +0 -4
- package/dist/api/translate.d.ts +3 -1
- package/dist/api/translate.js +16 -8
- package/dist/api/unload-model.js +3 -5
- package/dist/api/video-request.d.ts +207 -0
- package/dist/api/video-request.js +18 -0
- package/dist/api/video.d.ts +22 -2
- package/dist/api/video.js +25 -15
- package/dist/api/vla-helpers.d.ts +1 -2
- package/dist/api/vla-helpers.js +1 -2
- package/dist/api/vla.js +1 -1
- package/dist/api/world-result.d.ts +71 -0
- package/dist/api/world-result.js +293 -0
- package/dist/api/world.d.ts +143 -0
- package/dist/api/world.js +71 -0
- package/dist/config/resolve-config.d.ts +1 -1
- package/dist/config/resolve-config.js +1 -1
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/index.js +2 -2
- package/dist/dispatch.js +15 -28
- package/dist/errors/index.d.ts +35 -31
- package/dist/errors/index.js +66 -56
- package/dist/handlers/assess-model-fit.d.ts +10 -0
- package/dist/handlers/assess-model-fit.js +75 -0
- package/dist/handlers/cancelHandler.js +1 -1
- package/dist/handlers/completion-orchestrate.js +1 -1
- package/dist/handlers/delete-cache.js +3 -0
- package/dist/handlers/download-asset.js +6 -5
- package/dist/handlers/finetune.js +1 -1
- package/dist/handlers/get-loaded-model-info.js +0 -12
- package/dist/handlers/get-model-info.js +1 -1
- package/dist/handlers/get-system-resources.js +8 -0
- package/dist/handlers/load-model/download-manager.d.ts +1 -1
- package/dist/handlers/load-model/download-stats.d.ts +3 -3
- package/dist/handlers/load-model/download-stats.js +5 -5
- package/dist/handlers/load-model/handler.js +6 -8
- package/dist/handlers/load-model/http-verify.d.ts +20 -0
- package/dist/handlers/load-model/http-verify.js +54 -0
- package/dist/handlers/load-model/http.d.ts +12 -2
- package/dist/handlers/load-model/http.js +119 -230
- package/dist/handlers/load-model/hyperdrive.d.ts +1 -1
- package/dist/handlers/load-model/hyperdrive.js +1 -1
- package/dist/handlers/load-model/index.d.ts +2 -2
- package/dist/handlers/load-model/index.js +2 -2
- package/dist/handlers/load-model/registry-companion-set.d.ts +1 -1
- package/dist/handlers/load-model/registry-companion-set.js +1 -1
- package/dist/handlers/load-model/registry-download-utils.d.ts +3 -3
- package/dist/handlers/load-model/registry-download-utils.js +2 -2
- package/dist/handlers/load-model/registry.d.ts +2 -2
- package/dist/handlers/load-model/registry.js +4 -4
- package/dist/handlers/load-model/resolve-session.d.ts +8 -1
- package/dist/handlers/load-model/resolve-session.js +12 -9
- package/dist/handlers/load-model/resolve.d.ts +4 -4
- package/dist/handlers/load-model/resolve.js +18 -16
- package/dist/handlers/load-model/safe-fetch.d.ts +44 -0
- package/dist/handlers/load-model/safe-fetch.js +143 -0
- package/dist/handlers/load-model/types.d.ts +9 -0
- package/dist/handlers/plugin-dispatch.js +1 -4
- package/dist/handlers/plugin-invoke.js +1 -4
- package/dist/handlers/types.d.ts +0 -2
- package/dist/handlers/unload-model.js +1 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/logging/addon.d.ts +1 -1
- package/dist/logging/addon.js +1 -1
- package/dist/logging/index.d.ts +5 -5
- package/dist/logging/index.js +4 -4
- package/dist/logging/logger.d.ts +1 -1
- package/dist/logging/logger.js +2 -2
- package/dist/models/registry/index.d.ts +1 -1
- package/dist/models/registry/index.js +2 -2
- package/dist/models/registry/models.d.ts +250 -0
- package/dist/models/registry/models.js +2071 -1806
- package/dist/models/registry/resource-profiles.d.ts +18 -0
- package/dist/models/registry/resource-profiles.js +4934 -0
- package/dist/plugins/builtin/audiogen-ggml/config.d.ts +14 -0
- package/dist/plugins/builtin/audiogen-ggml/config.js +23 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +47 -5
- package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +134 -4
- package/dist/plugins/builtin/audiogen-ggml/plugin.js +47 -28
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +1 -1
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +3 -3
- package/dist/plugins/builtin/ggml-classification/plugin.js +1 -1
- package/dist/plugins/builtin/ggml-ocr/plugin.js +2 -2
- package/dist/plugins/builtin/ggml-vla/plugin.d.ts +1 -1
- package/dist/plugins/builtin/ggml-vla/plugin.js +3 -3
- package/dist/plugins/builtin/index.d.ts +12 -12
- package/dist/plugins/builtin/index.js +12 -12
- package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +2 -2
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +1 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.js +3 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +37 -26
- package/dist/plugins/builtin/llamacpp-completion/ops/context-overflow.d.ts +12 -11
- package/dist/plugins/builtin/llamacpp-completion/ops/context-overflow.js +133 -41
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.d.ts +15 -4
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.js +79 -17
- package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +22 -8
- package/dist/plugins/builtin/llamacpp-completion/plugin.js +10 -13
- package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +4 -0
- package/dist/plugins/builtin/llamacpp-embedding/plugin.js +13 -2
- package/dist/plugins/builtin/nmtcpp-translation/plugin.js +2 -2
- package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +2 -2
- package/dist/plugins/builtin/parakeet-transcription/plugin.js +3 -3
- package/dist/plugins/builtin/sdcpp-generation/ops/upscale.js +1 -1
- package/dist/plugins/builtin/sdcpp-generation/ops/video.js +32 -2
- package/dist/plugins/builtin/sdcpp-generation/ops/world.d.ts +126 -0
- package/dist/plugins/builtin/sdcpp-generation/ops/world.js +820 -0
- package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +153 -4
- package/dist/plugins/builtin/sdcpp-generation/plugin.js +134 -13
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.js +1 -1
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +1 -1
- package/dist/plugins/builtin/tts-ggml/plugin.js +2 -2
- package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +2 -2
- package/dist/plugins/builtin/whispercpp-transcription/plugin.js +3 -3
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +2 -2
- package/dist/plugins/ops/kv-cache-utils.js +1 -1
- package/dist/plugins/ops/load-model.js +1 -1
- package/dist/plugins/ops/transcribe.js +2 -2
- package/dist/plugins/ops/translate.js +4 -12
- package/dist/plugins/ops/unload-model.js +19 -21
- package/dist/plugins/registry.d.ts +1 -0
- package/dist/plugins/registry.js +12 -0
- package/dist/profiling/aggregator.d.ts +1 -1
- package/dist/profiling/aggregator.js +1 -1
- package/dist/profiling/controller.d.ts +1 -1
- package/dist/profiling/controller.js +2 -2
- package/dist/profiling/envelope.d.ts +0 -1
- package/dist/profiling/envelope.js +0 -10
- package/dist/profiling/events.d.ts +2 -3
- package/dist/profiling/events.js +2 -9
- package/dist/profiling/exporters.d.ts +1 -1
- package/dist/profiling/exporters.js +3 -3
- package/dist/profiling/index.d.ts +13 -14
- package/dist/profiling/index.js +12 -13
- package/dist/profiling/operation-metrics.d.ts +1 -1
- package/dist/profiling/operation-metrics.js +35 -2
- package/dist/profiling/operation-wrappers.js +12 -15
- package/dist/profiling/profiler.d.ts +1 -2
- package/dist/profiling/profiler.js +7 -26
- package/dist/profiling/types.d.ts +1 -1
- package/dist/rag/handler.js +1 -1
- package/dist/rag/handlers/close-workspace.js +1 -1
- package/dist/rag/handlers/delete-embeddings.js +1 -1
- package/dist/rag/handlers/delete-workspace.js +2 -6
- package/dist/rag/handlers/ingest.js +1 -1
- package/dist/rag/handlers/list-workspaces.d.ts +1 -1
- package/dist/rag/handlers/list-workspaces.js +1 -1
- package/dist/rag/handlers/reindex.js +1 -1
- package/dist/rag/handlers/save-embeddings.js +1 -1
- package/dist/rag/handlers/search.js +1 -1
- package/dist/rag/index.d.ts +11 -11
- package/dist/rag/index.js +11 -11
- package/dist/rag/rag-workspace-manager.d.ts +4 -2
- package/dist/rag/rag-workspace-manager.js +268 -15
- package/dist/registry.js +8 -58
- package/dist/resources/collector.d.ts +3 -1
- package/dist/resources/collector.js +91 -9
- package/dist/resources/instance.d.ts +1 -1
- package/dist/resources/instance.js +1 -1
- package/dist/resources/model-fit/assess.d.ts +36 -0
- package/dist/resources/model-fit/assess.js +679 -0
- package/dist/resources/model-fit/calibration/darwin-arm64.d.ts +8 -0
- package/dist/resources/model-fit/calibration/darwin-arm64.js +36 -0
- package/dist/resources/model-fit/calibration/darwin-x64.d.ts +8 -0
- package/dist/resources/model-fit/calibration/darwin-x64.js +38 -0
- package/dist/resources/model-fit/calibration/fit.d.ts +73 -0
- package/dist/resources/model-fit/calibration/fit.js +152 -0
- package/dist/resources/model-fit/calibration/index.d.ts +37 -0
- package/dist/resources/model-fit/calibration/index.js +75 -0
- package/dist/resources/model-fit/calibration/linux-arm64.d.ts +8 -0
- package/dist/resources/model-fit/calibration/linux-arm64.js +38 -0
- package/dist/resources/model-fit/calibration/linux-x64-vulkan.d.ts +8 -0
- package/dist/resources/model-fit/calibration/linux-x64-vulkan.js +39 -0
- package/dist/resources/model-fit/calibration/linux-x64.d.ts +8 -0
- package/dist/resources/model-fit/calibration/linux-x64.js +38 -0
- package/dist/resources/model-fit/calibration/win32-x64-vulkan-shared.d.ts +8 -0
- package/dist/resources/model-fit/calibration/win32-x64-vulkan-shared.js +39 -0
- package/dist/resources/model-fit/calibration/win32-x64-vulkan.d.ts +8 -0
- package/dist/resources/model-fit/calibration/win32-x64-vulkan.js +36 -0
- package/dist/resources/model-fit/calibration/win32-x64.d.ts +8 -0
- package/dist/resources/model-fit/calibration/win32-x64.js +38 -0
- package/dist/resources/model-fit/estimators/llm.d.ts +46 -0
- package/dist/resources/model-fit/estimators/llm.js +222 -0
- package/dist/resources/model-fit/estimators/whisper.d.ts +10 -0
- package/dist/resources/model-fit/estimators/whisper.js +77 -0
- package/dist/resources/model-fit/floor.d.ts +31 -0
- package/dist/resources/model-fit/floor.js +65 -0
- package/dist/resources/model-fit/types.d.ts +120 -0
- package/dist/resources/model-fit/types.js +1 -0
- package/dist/resources/native.d.ts +1 -1
- package/dist/resources/native.js +15 -0
- package/dist/resources/normalize.d.ts +1 -1
- package/dist/resources/types.d.ts +14 -0
- package/dist/runtime/index.d.ts +5 -5
- package/dist/runtime/index.js +2 -2
- package/dist/runtime/lifecycle.js +5 -7
- package/dist/runtime/model-registry.d.ts +0 -14
- package/dist/runtime/model-registry.js +17 -40
- package/dist/runtime/registry-client.js +1 -1
- package/dist/runtime/request-context.d.ts +3 -3
- package/dist/runtime/request-context.js +13 -1
- package/dist/runtime/request-registry.d.ts +1 -1
- package/dist/runtime/request-registry.js +4 -5
- package/dist/runtime/state.d.ts +1 -1
- package/dist/runtime/state.js +18 -3
- package/dist/schemas/assess-model-fit.d.ts +311 -0
- package/dist/schemas/assess-model-fit.js +182 -0
- package/dist/schemas/audio-gen.d.ts +437 -7
- package/dist/schemas/audio-gen.js +131 -19
- package/dist/schemas/batch-completion-stream.d.ts +5 -2
- package/dist/schemas/batch-completion-stream.js +3 -3
- package/dist/schemas/bci-config.js +73 -27
- package/dist/schemas/bci.d.ts +3 -3
- package/dist/schemas/bci.js +5 -5
- package/dist/schemas/cancel.d.ts +5 -0
- package/dist/schemas/cancel.js +1 -0
- package/dist/schemas/classification.js +13 -6
- package/dist/schemas/common.d.ts +695 -335
- package/dist/schemas/common.js +33 -31
- package/dist/schemas/completion-event.d.ts +5 -2
- package/dist/schemas/completion-event.js +2 -1
- package/dist/schemas/completion-stream.d.ts +3 -5
- package/dist/schemas/completion-stream.js +4 -8
- package/dist/schemas/config.d.ts +640 -18
- package/dist/schemas/config.js +50 -8
- package/dist/schemas/download-asset.d.ts +19 -1
- package/dist/schemas/download-asset.js +20 -4
- package/dist/schemas/engine-addon-map.d.ts +1 -1
- package/dist/schemas/engine-addon-map.js +3 -3
- package/dist/schemas/error.d.ts +2 -2
- package/dist/schemas/error.js +2 -2
- package/dist/schemas/errors.d.ts +2 -6
- package/dist/schemas/errors.js +30 -40
- package/dist/schemas/heartbeat.d.ts +10 -0
- package/dist/schemas/heartbeat.js +8 -0
- package/dist/schemas/index.d.ts +46 -44
- package/dist/schemas/index.js +45 -43
- package/dist/schemas/llamacpp-config.d.ts +32 -10
- package/dist/schemas/llamacpp-config.js +11 -8
- package/dist/schemas/load-model.d.ts +2902 -1857
- package/dist/schemas/load-model.js +52 -52
- package/dist/schemas/mcp-adapter.d.ts +1 -1
- package/dist/schemas/model-config-schemas.d.ts +2354 -0
- package/dist/schemas/model-config-schemas.js +46 -0
- package/dist/schemas/model-info.d.ts +10 -20
- package/dist/schemas/model-info.js +4 -25
- package/dist/schemas/model-ops.d.ts +3 -1
- package/dist/schemas/model-ops.js +7 -2
- package/dist/schemas/model-resource-profile.d.ts +109 -0
- package/dist/schemas/model-resource-profile.js +83 -0
- package/dist/schemas/model-src-utils.d.ts +1 -0
- package/dist/schemas/model-src-utils.js +33 -13
- package/dist/schemas/ocr.js +48 -13
- package/dist/schemas/path-validation.js +8 -2
- package/dist/schemas/plugin.d.ts +23 -10
- package/dist/schemas/plugin.js +11 -0
- package/dist/schemas/profiling.d.ts +138 -43
- package/dist/schemas/profiling.js +1 -22
- package/dist/schemas/rag.js +1 -1
- package/dist/schemas/registry.js +1 -1
- package/dist/schemas/reload-config.d.ts +0 -2
- package/dist/schemas/reload-config.js +2 -3
- package/dist/schemas/sdcpp-config.d.ts +344 -4
- package/dist/schemas/sdcpp-config.js +504 -17
- package/dist/schemas/system-resources.d.ts +138 -0
- package/dist/schemas/system-resources.js +3 -1
- package/dist/schemas/text-to-speech.js +183 -76
- package/dist/schemas/transcription-config.js +253 -85
- package/dist/schemas/transcription.d.ts +3 -3
- package/dist/schemas/translate.d.ts +2 -2
- package/dist/schemas/translate.js +1 -1
- package/dist/schemas/translation-config.js +53 -25
- package/dist/schemas/vla.d.ts +1 -1
- package/dist/selection.d.ts +1 -5
- package/dist/selection.js +2 -6
- package/dist/surface.d.ts +1 -1
- package/dist/utils/addon-responses.d.ts +1 -0
- package/dist/utils/aggregate-events.d.ts +1 -1
- package/dist/utils/aggregate-events.js +2 -2
- package/dist/utils/archive.js +2 -2
- package/dist/utils/audio-input.js +1 -1
- package/dist/utils/cache/auto-history.d.ts +1 -1
- package/dist/utils/cache/auto-history.js +1 -1
- package/dist/utils/cache/paths.js +5 -5
- package/dist/utils/completion-normalizer.js +1 -1
- package/dist/utils/gguf-tensor-extractor.js +1 -1
- package/dist/utils/image-dimensions.d.ts +26 -0
- package/dist/utils/image-dimensions.js +46 -0
- package/dist/utils/index.d.ts +13 -10
- package/dist/utils/index.js +13 -10
- package/dist/utils/mcp-adapter.d.ts +1 -1
- package/dist/utils/mcp-adapter.js +1 -1
- package/dist/utils/path-sanitize.d.ts +7 -0
- package/dist/utils/path-sanitize.js +36 -0
- package/dist/utils/path-security.d.ts +0 -7
- package/dist/utils/path-security.js +1 -36
- package/dist/utils/shard-utils.js +3 -3
- package/dist/utils/tool-integration.js +1 -1
- package/dist/utils/tools/dialect.js +1 -1
- package/dist/utils/tools/index.d.ts +2 -2
- package/dist/utils/tools/index.js +2 -2
- package/dist/utils/tools/parser.js +8 -8
- package/dist/utils/tools/parsers/dsml.d.ts +1 -1
- package/dist/utils/tools/parsers/dsml.js +1 -1
- package/dist/utils/tools/parsers/gemma4native.d.ts +1 -1
- package/dist/utils/tools/parsers/gemma4native.js +1 -1
- package/dist/utils/tools/parsers/harmony.d.ts +1 -1
- package/dist/utils/tools/parsers/harmony.js +1 -1
- package/dist/utils/tools/parsers/hermes.d.ts +1 -1
- package/dist/utils/tools/parsers/hermes.js +1 -1
- package/dist/utils/tools/parsers/json.d.ts +1 -1
- package/dist/utils/tools/parsers/json.js +1 -1
- package/dist/utils/tools/parsers/pythonic.d.ts +1 -1
- package/dist/utils/tools/parsers/pythonic.js +1 -1
- package/dist/utils/tools/parsers/qwen35.d.ts +1 -1
- package/dist/utils/tools/parsers/qwen35.js +3 -3
- package/dist/utils/url-security.d.ts +17 -0
- package/dist/utils/url-security.js +75 -0
- package/package.json +31 -26
- package/dist/api/provide.d.ts +0 -23
- package/dist/api/provide.js +0 -32
- package/dist/api/stop-provider.d.ts +0 -20
- package/dist/api/stop-provider.js +0 -30
- package/dist/p2p/cancel-delegated.d.ts +0 -3
- package/dist/p2p/cancel-delegated.js +0 -64
- package/dist/p2p/completion-stream-delegated.d.ts +0 -4
- package/dist/p2p/completion-stream-delegated.js +0 -51
- package/dist/p2p/delegate-client.d.ts +0 -9
- package/dist/p2p/delegate-client.js +0 -219
- package/dist/p2p/delegate-connect-diagnostics.d.ts +0 -8
- package/dist/p2p/delegate-connect-diagnostics.js +0 -38
- package/dist/p2p/delegate-transport.d.ts +0 -18
- package/dist/p2p/delegate-transport.js +0 -237
- package/dist/p2p/error-handlers.d.ts +0 -4
- package/dist/p2p/error-handlers.js +0 -31
- package/dist/p2p/handle-request.d.ts +0 -2
- package/dist/p2p/handle-request.js +0 -171
- package/dist/p2p/handler-utils.d.ts +0 -19
- package/dist/p2p/handler-utils.js +0 -180
- package/dist/p2p/heartbeat-delegated.d.ts +0 -3
- package/dist/p2p/heartbeat-delegated.js +0 -32
- package/dist/p2p/load-model-delegated.d.ts +0 -6
- package/dist/p2p/load-model-delegated.js +0 -132
- package/dist/p2p/progress-throttle.d.ts +0 -7
- package/dist/p2p/progress-throttle.js +0 -47
- package/dist/p2p/provideHandler/connection.d.ts +0 -2
- package/dist/p2p/provideHandler/connection.js +0 -38
- package/dist/p2p/provideHandler/handler.d.ts +0 -2
- package/dist/p2p/provideHandler/handler.js +0 -66
- package/dist/p2p/provideHandler/proxy.d.ts +0 -2
- package/dist/p2p/provideHandler/proxy.js +0 -24
- package/dist/p2p/provideHandler.d.ts +0 -1
- package/dist/p2p/provideHandler.js +0 -2
- package/dist/p2p/rpc-utils.d.ts +0 -4
- package/dist/p2p/rpc-utils.js +0 -8
- package/dist/p2p/stopProvideHandler.d.ts +0 -2
- package/dist/p2p/stopProvideHandler.js +0 -29
- package/dist/p2p/swarm.d.ts +0 -9
- package/dist/p2p/swarm.js +0 -103
- package/dist/p2p/transport-selector.d.ts +0 -2
- package/dist/p2p/transport-selector.js +0 -18
- package/dist/p2p/unload-model-delegated.d.ts +0 -2
- package/dist/p2p/unload-model-delegated.js +0 -31
- package/dist/profiling/delegation-profiler.d.ts +0 -31
- package/dist/profiling/delegation-profiler.js +0 -155
- package/dist/schemas/delegate.d.ts +0 -29
- package/dist/schemas/delegate.js +0 -40
- package/dist/schemas/provide.d.ts +0 -50
- package/dist/schemas/provide.js +0 -32
|
@@ -50,13 +50,27 @@ export interface GPUInfoContext {
|
|
|
50
50
|
sample(index: number): NativeGPUUsage;
|
|
51
51
|
destroy(): void;
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* The process's own memory position, as opposed to the system-wide view.
|
|
55
|
+
*
|
|
56
|
+
* @property usedBytes - The process's resident footprint (RSS).
|
|
57
|
+
* @property availableBytes - How much more this process may allocate before
|
|
58
|
+
* the OS intervenes. `undefined` where the platform states no such limit.
|
|
59
|
+
*/
|
|
60
|
+
export interface ProcessMemorySample {
|
|
61
|
+
usedBytes: number | undefined;
|
|
62
|
+
availableBytes: number | undefined;
|
|
63
|
+
}
|
|
53
64
|
export interface ResourceCollectorDependencies {
|
|
54
65
|
cpuArchitectures: readonly number[];
|
|
55
66
|
gpuTypes: readonly number[];
|
|
67
|
+
/** Runtime platform, used to grade what a GPU memory reading can mean. */
|
|
68
|
+
platform: string;
|
|
56
69
|
createCPUInfo(): CPUInfoContext | undefined;
|
|
57
70
|
createGPUInfo(): GPUInfoContext | undefined;
|
|
58
71
|
createGPUId(): string;
|
|
59
72
|
now(): number;
|
|
73
|
+
sampleProcessMemory(): ProcessMemorySample;
|
|
60
74
|
}
|
|
61
75
|
export interface SystemResourceCollector {
|
|
62
76
|
getCapabilities(): SystemResourceCapabilities;
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { createDisposableScope } from '
|
|
2
|
-
export type { DisposableScope } from '
|
|
3
|
-
export type { RequestContext, RequestKind, RequestState, RequestLogContext } from '
|
|
4
|
-
export { createRequestRegistry, getRequestRegistry, withRequestContext } from '
|
|
5
|
-
export type { BeginOpts, CancelByModelId, CancelByRequestId, CancelTarget, ConcurrencyPolicy, ManagedRequestContext, RequestOutcome, RequestRegistry } from '
|
|
1
|
+
export { createDisposableScope } from './disposable-scope.js';
|
|
2
|
+
export type { DisposableScope } from './disposable-scope.js';
|
|
3
|
+
export type { RequestContext, RequestKind, RequestState, RequestLogContext } from './request-context.js';
|
|
4
|
+
export { createRequestRegistry, getRequestRegistry, withRequestContext } from './request-context.js';
|
|
5
|
+
export type { BeginOpts, CancelByModelId, CancelByRequestId, CancelTarget, ConcurrencyPolicy, ManagedRequestContext, RequestOutcome, RequestRegistry } from './request-registry.js';
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createDisposableScope } from '
|
|
2
|
-
export { createRequestRegistry, getRequestRegistry, withRequestContext } from '
|
|
1
|
+
export { createDisposableScope } from './disposable-scope.js';
|
|
2
|
+
export { createRequestRegistry, getRequestRegistry, withRequestContext } from './request-context.js';
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { initEnv } from '../runtime/env.js';
|
|
1
|
+
import { initEnv } from './env.js';
|
|
3
2
|
import { closeAllRagInstances } from '../rag/index.js';
|
|
4
3
|
import { cleanupDownloads } from '../handlers/load-model/download-manager.js';
|
|
5
|
-
import { unloadAllModels } from '
|
|
6
|
-
import { closeRegistryClient } from '
|
|
7
|
-
import { clearAllLoggingStreams, startLogBuffering, stopLogBufferingWithTimeout } from '
|
|
4
|
+
import { unloadAllModels } from './model-registry.js';
|
|
5
|
+
import { closeRegistryClient } from './registry-client.js';
|
|
6
|
+
import { clearAllLoggingStreams, startLogBuffering, stopLogBufferingWithTimeout } from './logging-stream-registry.js';
|
|
8
7
|
import { clearAllAddonLoggers, getEngineLogger, LOG_ID, ALL_LOG_ID } from '../logging/index.js';
|
|
9
8
|
import { clearPlugins } from '../plugins/index.js';
|
|
10
|
-
import { acquireCacheLock, releaseCacheLock } from '
|
|
9
|
+
import { acquireCacheLock, releaseCacheLock } from './cache-lock.js';
|
|
11
10
|
import { nativeResourceCollectorDependencies } from '../resources/native.js';
|
|
12
11
|
import { destroyResourceCollector, initializeResourceCollector } from '../resources/instance.js';
|
|
13
12
|
// The host application owns the Bare runtime lifecycle: this module sets up the
|
|
@@ -59,7 +58,6 @@ async function runCleanup() {
|
|
|
59
58
|
destroyResourceCollector();
|
|
60
59
|
clearRegistries();
|
|
61
60
|
await Promise.allSettled([
|
|
62
|
-
destroySwarm(),
|
|
63
61
|
closeAllRagInstances(),
|
|
64
62
|
cleanupDownloads(),
|
|
65
63
|
unloadAllModels(),
|
|
@@ -19,11 +19,6 @@ export interface AnyModel {
|
|
|
19
19
|
reload?(config: unknown): Promise<void>;
|
|
20
20
|
addon?: AddonInterface;
|
|
21
21
|
}
|
|
22
|
-
interface DelegateOptions {
|
|
23
|
-
providerPublicKey: string;
|
|
24
|
-
timeout?: number | undefined;
|
|
25
|
-
healthCheckTimeout?: number | undefined;
|
|
26
|
-
}
|
|
27
22
|
interface LocalOptions {
|
|
28
23
|
model: AnyModel;
|
|
29
24
|
path: string;
|
|
@@ -34,11 +29,6 @@ interface LocalOptions {
|
|
|
34
29
|
}
|
|
35
30
|
export type ModelEntry = {
|
|
36
31
|
id: string;
|
|
37
|
-
isDelegated: true;
|
|
38
|
-
delegated: DelegateOptions;
|
|
39
|
-
} | {
|
|
40
|
-
id: string;
|
|
41
|
-
isDelegated: false;
|
|
42
32
|
local: LocalOptions;
|
|
43
33
|
};
|
|
44
34
|
export declare function registerModel(id: string, options: {
|
|
@@ -47,10 +37,6 @@ export declare function registerModel(id: string, options: {
|
|
|
47
37
|
config: unknown;
|
|
48
38
|
modelType: CanonicalModelType;
|
|
49
39
|
name?: string | undefined;
|
|
50
|
-
} | {
|
|
51
|
-
providerPublicKey: string;
|
|
52
|
-
timeout?: number;
|
|
53
|
-
healthCheckTimeout?: number;
|
|
54
40
|
}): void;
|
|
55
41
|
export declare function getModelEntry(id: string): ModelEntry | null;
|
|
56
42
|
export declare function getModel(id: string): AnyModel;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModelAlreadyRegisteredError, ModelNotFoundError
|
|
1
|
+
import { ModelAlreadyRegisteredError, ModelNotFoundError } from '../errors/index.js';
|
|
2
2
|
import { getEngineLogger } from '../logging/index.js';
|
|
3
3
|
const logger = getEngineLogger();
|
|
4
4
|
// Global registry state - using stateless functions to manage it
|
|
@@ -7,36 +7,19 @@ export function registerModel(id, options) {
|
|
|
7
7
|
if (modelRegistry.has(id)) {
|
|
8
8
|
throw new ModelAlreadyRegisteredError(id);
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
modelRegistry.set(id, {
|
|
26
|
-
id,
|
|
27
|
-
isDelegated: false,
|
|
28
|
-
local: {
|
|
29
|
-
model: options.model,
|
|
30
|
-
path: options.path,
|
|
31
|
-
loadedAt: new Date(),
|
|
32
|
-
config: options.config,
|
|
33
|
-
modelType: options.modelType,
|
|
34
|
-
name: options.name
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const nameStr = options.name ? ` (${options.name})` : '';
|
|
38
|
-
logger.info(`Local model registered: ${id}${nameStr} -> ${options.path}`);
|
|
39
|
-
}
|
|
10
|
+
modelRegistry.set(id, {
|
|
11
|
+
id,
|
|
12
|
+
local: {
|
|
13
|
+
model: options.model,
|
|
14
|
+
path: options.path,
|
|
15
|
+
loadedAt: new Date(),
|
|
16
|
+
config: options.config,
|
|
17
|
+
modelType: options.modelType,
|
|
18
|
+
name: options.name
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const nameStr = options.name ? ` (${options.name})` : '';
|
|
22
|
+
logger.info(`Local model registered: ${id}${nameStr} -> ${options.path}`);
|
|
40
23
|
}
|
|
41
24
|
export function getModelEntry(id) {
|
|
42
25
|
return modelRegistry.get(id) || null;
|
|
@@ -46,9 +29,6 @@ export function getModel(id) {
|
|
|
46
29
|
if (!entry) {
|
|
47
30
|
throw new ModelNotFoundError(id);
|
|
48
31
|
}
|
|
49
|
-
if (entry.isDelegated) {
|
|
50
|
-
throw new ModelIsDelegatedError(id);
|
|
51
|
-
}
|
|
52
32
|
return entry.local.model;
|
|
53
33
|
}
|
|
54
34
|
export function isModelLoaded(id) {
|
|
@@ -68,7 +48,7 @@ export function getAllModelIds() {
|
|
|
68
48
|
}
|
|
69
49
|
export function getModelInfo(id) {
|
|
70
50
|
const entry = modelRegistry.get(id);
|
|
71
|
-
if (!entry
|
|
51
|
+
if (!entry) {
|
|
72
52
|
return null;
|
|
73
53
|
}
|
|
74
54
|
const result = {
|
|
@@ -84,7 +64,7 @@ export function getModelInfo(id) {
|
|
|
84
64
|
}
|
|
85
65
|
export function getModelConfig(id) {
|
|
86
66
|
const entry = modelRegistry.get(id);
|
|
87
|
-
if (!entry
|
|
67
|
+
if (!entry) {
|
|
88
68
|
throw new ModelNotFoundError(id);
|
|
89
69
|
}
|
|
90
70
|
return entry.local.config;
|
|
@@ -94,9 +74,6 @@ export function updateModelConfig(id, config) {
|
|
|
94
74
|
if (!entry) {
|
|
95
75
|
throw new ModelNotFoundError(id);
|
|
96
76
|
}
|
|
97
|
-
if (entry.isDelegated) {
|
|
98
|
-
throw new ModelIsDelegatedError(id);
|
|
99
|
-
}
|
|
100
77
|
entry.local.config = config;
|
|
101
78
|
}
|
|
102
79
|
export function clearRegistry() {
|
|
@@ -114,7 +91,7 @@ export async function unloadAllModels() {
|
|
|
114
91
|
for (const modelId of modelIds) {
|
|
115
92
|
const entry = modelRegistry.get(modelId);
|
|
116
93
|
try {
|
|
117
|
-
if (entry
|
|
94
|
+
if (entry) {
|
|
118
95
|
if (entry.local.model.unload) {
|
|
119
96
|
await entry.local.model.unload();
|
|
120
97
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QVACRegistryClient } from '@qvac/registry-client';
|
|
2
2
|
import { getCacheDir } from '../utils/cache/paths.js';
|
|
3
|
-
import { registerSwarm, unregisterSwarm, registerCorestore, unregisterCorestore } from '
|
|
3
|
+
import { registerSwarm, unregisterSwarm, registerCorestore, unregisterCorestore } from './runtime-lifecycle.js';
|
|
4
4
|
import { getEngineLogger } from '../logging/index.js';
|
|
5
5
|
import { DEFAULT_REGISTRY_CORE_KEY } from '../constants/index.js';
|
|
6
6
|
const logger = getEngineLogger();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AbortSignal } from 'bare-abort-controller';
|
|
2
|
-
import type { DisposableScope } from '
|
|
3
|
-
import { createRequestRegistry as createRegistry, type RequestRegistry } from '
|
|
2
|
+
import type { DisposableScope } from './disposable-scope.js';
|
|
3
|
+
import { createRequestRegistry as createRegistry, type RequestRegistry } from './request-registry.js';
|
|
4
4
|
import type { Logger } from '../logging/types.js';
|
|
5
5
|
/**
|
|
6
6
|
* Coarse classification of a long-running request. Used by
|
|
@@ -11,7 +11,7 @@ import type { Logger } from '../logging/types.js';
|
|
|
11
11
|
* The set is intentionally open-coded — adding a new kind is a one-line
|
|
12
12
|
* change and the union surfaces in editor autocomplete at every call site.
|
|
13
13
|
*/
|
|
14
|
-
export type RequestKind = 'completion' | 'batchCompletion' | 'embeddings' | 'transcribe' | 'translate' | 'diffusion' | 'audiogen' | 'tts' | 'ocr' | 'vla' | 'finetune' | 'loadModel' | 'downloadAsset' | 'rag';
|
|
14
|
+
export type RequestKind = 'completion' | 'batchCompletion' | 'embeddings' | 'transcribe' | 'translate' | 'diffusion' | 'world' | 'audiogen' | 'tts' | 'ocr' | 'vla' | 'finetune' | 'loadModel' | 'downloadAsset' | 'rag';
|
|
15
15
|
/**
|
|
16
16
|
* Lifecycle states a request transitions through. A new context starts in
|
|
17
17
|
* `"running"`. `cancel(...)` flips it to `"cancelling"` and aborts the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRequestRegistry as createRegistry } from '
|
|
1
|
+
import { createRequestRegistry as createRegistry } from './request-registry.js';
|
|
2
2
|
/**
|
|
3
3
|
* Shared singleton. Every long-running request registers under this
|
|
4
4
|
* registry, so a `cancel({ requestId })` call can find its target without
|
|
@@ -65,6 +65,18 @@ function installDefaultPolicies(r) {
|
|
|
65
65
|
onOverflow: 'queue',
|
|
66
66
|
maxQueueDepthPerModel: 64
|
|
67
67
|
});
|
|
68
|
+
// An ABot-World session runs one job at a time: the addon rejects a second
|
|
69
|
+
// step while a block is still streaming, and scene creation shares the same
|
|
70
|
+
// lane. Reject rather than queue, unlike every other policy here, because a
|
|
71
|
+
// walk is driven by live key input and a backlog of stale keypresses is worse
|
|
72
|
+
// for the caller than a prompt refusal it can drop. Making the registry
|
|
73
|
+
// authoritative also means the refusal arrives as a typed SDK error rather
|
|
74
|
+
// than the addon's opaque busy string.
|
|
75
|
+
r.policy({
|
|
76
|
+
kind: 'world',
|
|
77
|
+
maxConcurrentPerModel: 1,
|
|
78
|
+
onOverflow: 'reject'
|
|
79
|
+
});
|
|
68
80
|
}
|
|
69
81
|
export function getRequestRegistry() {
|
|
70
82
|
if (!registry) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AbortSignal } from 'bare-abort-controller';
|
|
2
|
-
import type { RequestContext, RequestKind } from '
|
|
2
|
+
import type { RequestContext, RequestKind } from './request-context.js';
|
|
3
3
|
import type { Logger } from '../logging/types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Outcome the caller declares when terminating a request through
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbortController } from 'bare-abort-controller';
|
|
2
|
-
import { createDisposableScope } from '
|
|
2
|
+
import { createDisposableScope } from './disposable-scope.js';
|
|
3
3
|
import { RequestIdConflictError, RequestRejectedByPolicyError } from '../errors/index.js';
|
|
4
4
|
import { getEngineLogger } from '../logging/index.js';
|
|
5
5
|
/**
|
|
@@ -9,10 +9,9 @@ import { getEngineLogger } from '../logging/index.js';
|
|
|
9
9
|
* the matching operation's `begin(...)`: a `cancel` issued at the same
|
|
10
10
|
* time as the matching `completion(...)` either lands first (and we need
|
|
11
11
|
* to remember it long enough for `begin(...)` to follow) or lands second
|
|
12
|
-
* (and we never touch this set).
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* slack while still bounding worst-case retention.
|
|
12
|
+
* (and we never touch this set). The gap is tiny, so 30 seconds is overkill
|
|
13
|
+
* but gives slow networks / pause-the-debugger scenarios enough slack while
|
|
14
|
+
* still bounding worst-case retention.
|
|
16
15
|
*
|
|
17
16
|
* The size cap protects against a buggy or malicious caller firing a
|
|
18
17
|
* stream of cancels for ids that never get a `begin(...)` follow-up —
|
package/dist/runtime/state.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { QvacConfig, RuntimeContext, CanonicalModelType } from '../schemas/index.js';
|
|
2
|
-
export { CANONICAL_TO_ALIAS, MODEL_CONFIG_SCHEMAS, BUILTIN_DEVICE_PATTERNS, matchesPattern, findAllMatchingPatterns, getDefaultsFromPattern, resolveModelConfigWithContext } from '
|
|
2
|
+
export { CANONICAL_TO_ALIAS, MODEL_CONFIG_SCHEMAS, BUILTIN_DEVICE_PATTERNS, matchesPattern, findAllMatchingPatterns, getDefaultsFromPattern, resolveModelConfigWithContext } from './model-config-utils.js';
|
|
3
3
|
/**
|
|
4
4
|
* Sets the QVAC configuration. This can only be called ONCE during initialization.
|
|
5
5
|
* After the first call, the config becomes immutable and any subsequent calls will throw.
|
package/dist/runtime/state.js
CHANGED
|
@@ -3,8 +3,8 @@ import path from 'bare-path';
|
|
|
3
3
|
import { getQvacPath } from '../utils/qvac-paths.js';
|
|
4
4
|
import { CacheDirNotAbsoluteError, CacheDirNotWritableError, ConfigAlreadySetError } from '../errors/index.js';
|
|
5
5
|
import { getEngineLogger, setGlobalConsoleOutput, setGlobalLogLevel } from '../logging/index.js';
|
|
6
|
-
export { CANONICAL_TO_ALIAS, MODEL_CONFIG_SCHEMAS, BUILTIN_DEVICE_PATTERNS, matchesPattern, findAllMatchingPatterns, getDefaultsFromPattern, resolveModelConfigWithContext } from '
|
|
7
|
-
import { BUILTIN_DEVICE_PATTERNS, resolveModelConfigWithContext } from '
|
|
6
|
+
export { CANONICAL_TO_ALIAS, MODEL_CONFIG_SCHEMAS, BUILTIN_DEVICE_PATTERNS, matchesPattern, findAllMatchingPatterns, getDefaultsFromPattern, resolveModelConfigWithContext } from './model-config-utils.js';
|
|
7
|
+
import { BUILTIN_DEVICE_PATTERNS, resolveModelConfigWithContext } from './model-config-utils.js';
|
|
8
8
|
const logger = getEngineLogger();
|
|
9
9
|
// ============================================
|
|
10
10
|
// Global configuration
|
|
@@ -15,9 +15,12 @@ const configRegistry = {
|
|
|
15
15
|
loggerLevel: undefined,
|
|
16
16
|
loggerConsoleOutput: undefined,
|
|
17
17
|
httpDownloadConcurrency: undefined,
|
|
18
|
+
requireHttpChecksum: undefined,
|
|
19
|
+
requireSecureTransport: undefined,
|
|
18
20
|
registryDownloadMaxRetries: undefined,
|
|
19
21
|
registryStreamTimeoutMs: undefined,
|
|
20
|
-
deviceDefaults: undefined
|
|
22
|
+
deviceDefaults: undefined,
|
|
23
|
+
ragTurbovec: undefined
|
|
21
24
|
};
|
|
22
25
|
let configIsSet = false;
|
|
23
26
|
/**
|
|
@@ -68,6 +71,14 @@ export function setConfig(config) {
|
|
|
68
71
|
configRegistry.httpDownloadConcurrency = config.httpDownloadConcurrency;
|
|
69
72
|
logger.info(`HTTP download concurrency set to: ${config.httpDownloadConcurrency}`);
|
|
70
73
|
}
|
|
74
|
+
if (config.requireHttpChecksum !== undefined && config.requireHttpChecksum !== null) {
|
|
75
|
+
configRegistry.requireHttpChecksum = config.requireHttpChecksum;
|
|
76
|
+
logger.info(`Require HTTP checksum: ${config.requireHttpChecksum}`);
|
|
77
|
+
}
|
|
78
|
+
if (config.requireSecureTransport !== undefined && config.requireSecureTransport !== null) {
|
|
79
|
+
configRegistry.requireSecureTransport = config.requireSecureTransport;
|
|
80
|
+
logger.info(`Require secure transport: ${config.requireSecureTransport}`);
|
|
81
|
+
}
|
|
71
82
|
if (config.registryDownloadMaxRetries !== undefined &&
|
|
72
83
|
config.registryDownloadMaxRetries !== null) {
|
|
73
84
|
configRegistry.registryDownloadMaxRetries = config.registryDownloadMaxRetries;
|
|
@@ -81,6 +92,10 @@ export function setConfig(config) {
|
|
|
81
92
|
configRegistry.deviceDefaults = config.deviceDefaults;
|
|
82
93
|
logger.info(`✅ Device defaults configured: ${config.deviceDefaults.length} pattern(s)`);
|
|
83
94
|
}
|
|
95
|
+
if (config.ragTurbovec !== undefined && config.ragTurbovec !== null) {
|
|
96
|
+
configRegistry.ragTurbovec = config.ragTurbovec;
|
|
97
|
+
logger.info(`✅ New RAG workspaces will use ${config.ragTurbovec ? 'TurboVec' : 'HyperDB'} (ragTurbovec: ${config.ragTurbovec})`);
|
|
98
|
+
}
|
|
84
99
|
// Mark config as set - now it's immutable
|
|
85
100
|
configIsSet = true;
|
|
86
101
|
}
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Advisory outcome of a pre-download fit assessment.
|
|
4
|
+
*
|
|
5
|
+
* `unknown` is a first-class answer, not a failure: it is what the SDK returns
|
|
6
|
+
* whenever the evidence does not support a defensible claim either way.
|
|
7
|
+
*/
|
|
8
|
+
export declare const modelFitVerdictSchema: z.ZodEnum<{
|
|
9
|
+
unknown: "unknown";
|
|
10
|
+
"likely-fits": "likely-fits";
|
|
11
|
+
"likely-too-large": "likely-too-large";
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Normalized workload shapes. An engine's estimator declares which kinds it
|
|
15
|
+
* supports; anything else assesses as `unknown`.
|
|
16
|
+
*
|
|
17
|
+
* Phase 1 covers LLM context and an audio window. Further kinds (fixed-cost
|
|
18
|
+
* loads, text, image, video) are additive in later phases — a kind joins the
|
|
19
|
+
* union only once an estimator actually handles it.
|
|
20
|
+
*/
|
|
21
|
+
export declare const modelFitWorkloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
22
|
+
kind: z.ZodLiteral<"llm">;
|
|
23
|
+
contextTokens: z.ZodNumber;
|
|
24
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
25
|
+
kind: z.ZodLiteral<"audio">;
|
|
26
|
+
windowMs: z.ZodNumber;
|
|
27
|
+
streaming: z.ZodBoolean;
|
|
28
|
+
batch: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
}, z.core.$strip>], "kind">;
|
|
30
|
+
/**
|
|
31
|
+
* The part of a model constant an assessment reads. Pass a catalog constant
|
|
32
|
+
* directly — the extra fields are ignored.
|
|
33
|
+
*
|
|
34
|
+
* Only the checksum (the profile lookup key) and the name (the result label)
|
|
35
|
+
* are read; everything else — engine, byte totals, transformer facts — comes
|
|
36
|
+
* from the resolved resource profile, not from the caller.
|
|
37
|
+
*/
|
|
38
|
+
export declare const modelFitModelRefSchema: z.ZodObject<{
|
|
39
|
+
sha256Checksum: z.ZodString;
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
/**
|
|
43
|
+
* One model the caller is considering, with the workload it would run.
|
|
44
|
+
*
|
|
45
|
+
* @property model - A catalog model constant. The generated resource profile,
|
|
46
|
+
* looked up by checksum, supplies the byte totals and transformer facts.
|
|
47
|
+
* @property artifacts - Extra catalog constants a compound load needs (a VAD
|
|
48
|
+
* model, a pivot model). Their artifact bytes are added to this candidate.
|
|
49
|
+
*/
|
|
50
|
+
export declare const modelFitCandidateSchema: z.ZodObject<{
|
|
51
|
+
model: z.ZodObject<{
|
|
52
|
+
sha256Checksum: z.ZodString;
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
56
|
+
sha256Checksum: z.ZodString;
|
|
57
|
+
name: z.ZodString;
|
|
58
|
+
}, z.core.$strip>>>;
|
|
59
|
+
workload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
60
|
+
kind: z.ZodLiteral<"llm">;
|
|
61
|
+
contextTokens: z.ZodNumber;
|
|
62
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
63
|
+
kind: z.ZodLiteral<"audio">;
|
|
64
|
+
windowMs: z.ZodNumber;
|
|
65
|
+
streaming: z.ZodBoolean;
|
|
66
|
+
batch: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
}, z.core.$strip>], "kind">;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
/**
|
|
70
|
+
* How the caller intends to run the candidates. This is a **declared
|
|
71
|
+
* assumption** used for aggregation, not a scheduling instruction — the SDK
|
|
72
|
+
* neither enforces nor reserves anything.
|
|
73
|
+
*
|
|
74
|
+
* - `sequential`: every model stays resident, but only the largest single
|
|
75
|
+
* working-memory peak is counted.
|
|
76
|
+
* - `concurrent`: every model stays resident and every peak is counted.
|
|
77
|
+
*/
|
|
78
|
+
export declare const modelFitExecutionSchema: z.ZodEnum<{
|
|
79
|
+
sequential: "sequential";
|
|
80
|
+
concurrent: "concurrent";
|
|
81
|
+
}>;
|
|
82
|
+
export declare const assessModelFitInputSchema: z.ZodObject<{
|
|
83
|
+
models: z.ZodArray<z.ZodObject<{
|
|
84
|
+
model: z.ZodObject<{
|
|
85
|
+
sha256Checksum: z.ZodString;
|
|
86
|
+
name: z.ZodString;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
89
|
+
sha256Checksum: z.ZodString;
|
|
90
|
+
name: z.ZodString;
|
|
91
|
+
}, z.core.$strip>>>;
|
|
92
|
+
workload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
93
|
+
kind: z.ZodLiteral<"llm">;
|
|
94
|
+
contextTokens: z.ZodNumber;
|
|
95
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
96
|
+
kind: z.ZodLiteral<"audio">;
|
|
97
|
+
windowMs: z.ZodNumber;
|
|
98
|
+
streaming: z.ZodBoolean;
|
|
99
|
+
batch: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
}, z.core.$strip>], "kind">;
|
|
101
|
+
}, z.core.$strip>>;
|
|
102
|
+
execution: z.ZodDefault<z.ZodEnum<{
|
|
103
|
+
sequential: "sequential";
|
|
104
|
+
concurrent: "concurrent";
|
|
105
|
+
}>>;
|
|
106
|
+
policy: z.ZodDefault<z.ZodLiteral<"interactive-v1">>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
/**
|
|
109
|
+
* What evidence the budget was derived from.
|
|
110
|
+
*
|
|
111
|
+
* - `system-memory`: total system RAM minus current use. The desktop model,
|
|
112
|
+
* and Android's — the low-memory killer acts system-wide.
|
|
113
|
+
* - `process-memory`: this process's own ceiling. iOS jetsam terminates an app
|
|
114
|
+
* on its per-process footprint against a limit well below device RAM, so a
|
|
115
|
+
* system-wide budget there would defend verdicts the OS does not honor.
|
|
116
|
+
*/
|
|
117
|
+
export declare const modelFitBasisSchema: z.ZodEnum<{
|
|
118
|
+
"system-memory": "system-memory";
|
|
119
|
+
"process-memory": "process-memory";
|
|
120
|
+
"device-memory": "device-memory";
|
|
121
|
+
"device-budget": "device-budget";
|
|
122
|
+
}>;
|
|
123
|
+
/**
|
|
124
|
+
* What kind of evidence a verdict rests on.
|
|
125
|
+
*
|
|
126
|
+
* - `calibration`: a two-sided estimate from coefficients measured on this
|
|
127
|
+
* platform. The only evidence that can support `likely-fits`.
|
|
128
|
+
* - `computed-only`: a floor computed from catalog facts alone — artifact bytes,
|
|
129
|
+
* plus the KV cache for llama.cpp models. It omits every engine cost that
|
|
130
|
+
* only a real load can tell, so it can refuse a model but never confirm one.
|
|
131
|
+
* This is what an uncalibrated platform, including Android and iOS, reports.
|
|
132
|
+
*/
|
|
133
|
+
export declare const modelFitEvidenceSchema: z.ZodEnum<{
|
|
134
|
+
calibration: "calibration";
|
|
135
|
+
"computed-only": "computed-only";
|
|
136
|
+
}>;
|
|
137
|
+
export declare const modelFitBudgetSchema: z.ZodObject<{
|
|
138
|
+
totalBytes: z.ZodNumber;
|
|
139
|
+
usedBytes: z.ZodNumber;
|
|
140
|
+
availableBytes: z.ZodNumber;
|
|
141
|
+
reservedBytes: z.ZodNumber;
|
|
142
|
+
availableAfterReserveBytes: z.ZodNumber;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
export declare const modelFitModelResultSchema: z.ZodObject<{
|
|
145
|
+
name: z.ZodString;
|
|
146
|
+
verdict: z.ZodEnum<{
|
|
147
|
+
unknown: "unknown";
|
|
148
|
+
"likely-fits": "likely-fits";
|
|
149
|
+
"likely-too-large": "likely-too-large";
|
|
150
|
+
}>;
|
|
151
|
+
evidence: z.ZodOptional<z.ZodEnum<{
|
|
152
|
+
calibration: "calibration";
|
|
153
|
+
"computed-only": "computed-only";
|
|
154
|
+
}>>;
|
|
155
|
+
estimate: z.ZodOptional<z.ZodObject<{
|
|
156
|
+
lowerBoundBytes: z.ZodNumber;
|
|
157
|
+
upperBoundBytes: z.ZodNumber;
|
|
158
|
+
}, z.core.$strip>>;
|
|
159
|
+
floorBytes: z.ZodOptional<z.ZodNumber>;
|
|
160
|
+
estimatorVersion: z.ZodOptional<z.ZodString>;
|
|
161
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
export declare const assessModelFitResultSchema: z.ZodObject<{
|
|
164
|
+
verdict: z.ZodEnum<{
|
|
165
|
+
unknown: "unknown";
|
|
166
|
+
"likely-fits": "likely-fits";
|
|
167
|
+
"likely-too-large": "likely-too-large";
|
|
168
|
+
}>;
|
|
169
|
+
basis: z.ZodEnum<{
|
|
170
|
+
"system-memory": "system-memory";
|
|
171
|
+
"process-memory": "process-memory";
|
|
172
|
+
"device-memory": "device-memory";
|
|
173
|
+
"device-budget": "device-budget";
|
|
174
|
+
}>;
|
|
175
|
+
execution: z.ZodEnum<{
|
|
176
|
+
sequential: "sequential";
|
|
177
|
+
concurrent: "concurrent";
|
|
178
|
+
}>;
|
|
179
|
+
evidence: z.ZodOptional<z.ZodEnum<{
|
|
180
|
+
calibration: "calibration";
|
|
181
|
+
"computed-only": "computed-only";
|
|
182
|
+
}>>;
|
|
183
|
+
budget: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
totalBytes: z.ZodNumber;
|
|
185
|
+
usedBytes: z.ZodNumber;
|
|
186
|
+
availableBytes: z.ZodNumber;
|
|
187
|
+
reservedBytes: z.ZodNumber;
|
|
188
|
+
availableAfterReserveBytes: z.ZodNumber;
|
|
189
|
+
}, z.core.$strip>>;
|
|
190
|
+
estimate: z.ZodOptional<z.ZodObject<{
|
|
191
|
+
lowerBoundBytes: z.ZodNumber;
|
|
192
|
+
upperBoundBytes: z.ZodNumber;
|
|
193
|
+
}, z.core.$strip>>;
|
|
194
|
+
floorBytes: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
models: z.ZodArray<z.ZodObject<{
|
|
196
|
+
name: z.ZodString;
|
|
197
|
+
verdict: z.ZodEnum<{
|
|
198
|
+
unknown: "unknown";
|
|
199
|
+
"likely-fits": "likely-fits";
|
|
200
|
+
"likely-too-large": "likely-too-large";
|
|
201
|
+
}>;
|
|
202
|
+
evidence: z.ZodOptional<z.ZodEnum<{
|
|
203
|
+
calibration: "calibration";
|
|
204
|
+
"computed-only": "computed-only";
|
|
205
|
+
}>>;
|
|
206
|
+
estimate: z.ZodOptional<z.ZodObject<{
|
|
207
|
+
lowerBoundBytes: z.ZodNumber;
|
|
208
|
+
upperBoundBytes: z.ZodNumber;
|
|
209
|
+
}, z.core.$strip>>;
|
|
210
|
+
floorBytes: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
estimatorVersion: z.ZodOptional<z.ZodString>;
|
|
212
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
213
|
+
}, z.core.$strip>>;
|
|
214
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
215
|
+
assumptions: z.ZodArray<z.ZodString>;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
export declare const assessModelFitRequestSchema: z.ZodObject<{
|
|
218
|
+
models: z.ZodArray<z.ZodObject<{
|
|
219
|
+
model: z.ZodObject<{
|
|
220
|
+
sha256Checksum: z.ZodString;
|
|
221
|
+
name: z.ZodString;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
224
|
+
sha256Checksum: z.ZodString;
|
|
225
|
+
name: z.ZodString;
|
|
226
|
+
}, z.core.$strip>>>;
|
|
227
|
+
workload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
228
|
+
kind: z.ZodLiteral<"llm">;
|
|
229
|
+
contextTokens: z.ZodNumber;
|
|
230
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
231
|
+
kind: z.ZodLiteral<"audio">;
|
|
232
|
+
windowMs: z.ZodNumber;
|
|
233
|
+
streaming: z.ZodBoolean;
|
|
234
|
+
batch: z.ZodOptional<z.ZodNumber>;
|
|
235
|
+
}, z.core.$strip>], "kind">;
|
|
236
|
+
}, z.core.$strip>>;
|
|
237
|
+
execution: z.ZodDefault<z.ZodEnum<{
|
|
238
|
+
sequential: "sequential";
|
|
239
|
+
concurrent: "concurrent";
|
|
240
|
+
}>>;
|
|
241
|
+
policy: z.ZodDefault<z.ZodLiteral<"interactive-v1">>;
|
|
242
|
+
type: z.ZodLiteral<"assessModelFit">;
|
|
243
|
+
}, z.core.$strip>;
|
|
244
|
+
export declare const assessModelFitResponseSchema: z.ZodObject<{
|
|
245
|
+
verdict: z.ZodEnum<{
|
|
246
|
+
unknown: "unknown";
|
|
247
|
+
"likely-fits": "likely-fits";
|
|
248
|
+
"likely-too-large": "likely-too-large";
|
|
249
|
+
}>;
|
|
250
|
+
basis: z.ZodEnum<{
|
|
251
|
+
"system-memory": "system-memory";
|
|
252
|
+
"process-memory": "process-memory";
|
|
253
|
+
"device-memory": "device-memory";
|
|
254
|
+
"device-budget": "device-budget";
|
|
255
|
+
}>;
|
|
256
|
+
execution: z.ZodEnum<{
|
|
257
|
+
sequential: "sequential";
|
|
258
|
+
concurrent: "concurrent";
|
|
259
|
+
}>;
|
|
260
|
+
evidence: z.ZodOptional<z.ZodEnum<{
|
|
261
|
+
calibration: "calibration";
|
|
262
|
+
"computed-only": "computed-only";
|
|
263
|
+
}>>;
|
|
264
|
+
budget: z.ZodOptional<z.ZodObject<{
|
|
265
|
+
totalBytes: z.ZodNumber;
|
|
266
|
+
usedBytes: z.ZodNumber;
|
|
267
|
+
availableBytes: z.ZodNumber;
|
|
268
|
+
reservedBytes: z.ZodNumber;
|
|
269
|
+
availableAfterReserveBytes: z.ZodNumber;
|
|
270
|
+
}, z.core.$strip>>;
|
|
271
|
+
estimate: z.ZodOptional<z.ZodObject<{
|
|
272
|
+
lowerBoundBytes: z.ZodNumber;
|
|
273
|
+
upperBoundBytes: z.ZodNumber;
|
|
274
|
+
}, z.core.$strip>>;
|
|
275
|
+
floorBytes: z.ZodOptional<z.ZodNumber>;
|
|
276
|
+
models: z.ZodArray<z.ZodObject<{
|
|
277
|
+
name: z.ZodString;
|
|
278
|
+
verdict: z.ZodEnum<{
|
|
279
|
+
unknown: "unknown";
|
|
280
|
+
"likely-fits": "likely-fits";
|
|
281
|
+
"likely-too-large": "likely-too-large";
|
|
282
|
+
}>;
|
|
283
|
+
evidence: z.ZodOptional<z.ZodEnum<{
|
|
284
|
+
calibration: "calibration";
|
|
285
|
+
"computed-only": "computed-only";
|
|
286
|
+
}>>;
|
|
287
|
+
estimate: z.ZodOptional<z.ZodObject<{
|
|
288
|
+
lowerBoundBytes: z.ZodNumber;
|
|
289
|
+
upperBoundBytes: z.ZodNumber;
|
|
290
|
+
}, z.core.$strip>>;
|
|
291
|
+
floorBytes: z.ZodOptional<z.ZodNumber>;
|
|
292
|
+
estimatorVersion: z.ZodOptional<z.ZodString>;
|
|
293
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
294
|
+
}, z.core.$strip>>;
|
|
295
|
+
reasons: z.ZodArray<z.ZodString>;
|
|
296
|
+
assumptions: z.ZodArray<z.ZodString>;
|
|
297
|
+
type: z.ZodLiteral<"assessModelFit">;
|
|
298
|
+
}, z.core.$strip>;
|
|
299
|
+
export type ModelFitVerdict = z.infer<typeof modelFitVerdictSchema>;
|
|
300
|
+
export type ModelFitModelRef = z.infer<typeof modelFitModelRefSchema>;
|
|
301
|
+
export type ModelFitWorkload = z.infer<typeof modelFitWorkloadSchema>;
|
|
302
|
+
export type ModelFitCandidate = z.infer<typeof modelFitCandidateSchema>;
|
|
303
|
+
export type ModelFitExecution = z.infer<typeof modelFitExecutionSchema>;
|
|
304
|
+
export type ModelFitBasis = z.infer<typeof modelFitBasisSchema>;
|
|
305
|
+
export type ModelFitEvidence = z.infer<typeof modelFitEvidenceSchema>;
|
|
306
|
+
export type ModelFitBudget = z.infer<typeof modelFitBudgetSchema>;
|
|
307
|
+
export type ModelFitModelResult = z.infer<typeof modelFitModelResultSchema>;
|
|
308
|
+
export type AssessModelFitInput = z.input<typeof assessModelFitInputSchema>;
|
|
309
|
+
export type AssessModelFitResult = z.infer<typeof assessModelFitResultSchema>;
|
|
310
|
+
export type AssessModelFitRequest = z.infer<typeof assessModelFitRequestSchema>;
|
|
311
|
+
export type AssessModelFitResponse = z.infer<typeof assessModelFitResponseSchema>;
|