@qvac/inference 0.21.1 → 0.23.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 +89 -41
- package/README.md +44 -1
- package/dist/api/assess-model-fit.d.ts +4 -4
- package/dist/api/assess-model-fit.js +4 -4
- package/dist/api/audio-gen.d.ts +4 -1
- package/dist/api/audio-gen.js +5 -2
- package/dist/api/batch-completion.js +1 -1
- package/dist/api/completion-stream.d.ts +2 -1
- package/dist/api/completion-stream.js +4 -2
- package/dist/api/decide.d.ts +26 -0
- package/dist/api/decide.js +26 -0
- package/dist/api/diffusion.d.ts +18 -1
- package/dist/api/diffusion.js +18 -1
- package/dist/api/download-asset.js +1 -1
- package/dist/api/finetune.js +1 -1
- package/dist/api/get-model-info.d.ts +1 -1
- package/dist/api/index.d.ts +39 -37
- package/dist/api/index.js +38 -36
- package/dist/api/load-model.js +2 -2
- package/dist/api/logging-stream-registry.js +11 -7
- package/dist/api/logging-stream.d.ts +11 -1
- package/dist/api/logging-stream.js +11 -2
- package/dist/api/registry.d.ts +2 -1
- package/dist/api/registry.js +5 -4
- package/dist/api/rerank.d.ts +17 -0
- package/dist/api/rerank.js +36 -0
- package/dist/api/subscribe-logs.js +5 -3
- package/dist/api/text-to-speech.d.ts +1 -0
- package/dist/api/text-to-speech.js +15 -19
- package/dist/api/transcribe.js +5 -2
- package/dist/api/unload-model.js +1 -1
- package/dist/api/video-request.d.ts +5 -5
- package/dist/api/video.d.ts +5 -4
- package/dist/api/video.js +6 -5
- package/dist/api/vla.js +1 -1
- package/dist/api/world-result.js +1 -1
- package/dist/api/world.d.ts +1 -1
- package/dist/api/world.js +1 -1
- 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.d.ts +3 -2
- package/dist/dispatch.js +16 -4
- package/dist/errors/index.d.ts +9 -0
- package/dist/errors/index.js +18 -1
- package/dist/handlers/assess-model-fit.d.ts +5 -3
- package/dist/handlers/assess-model-fit.js +84 -32
- package/dist/handlers/cancelHandler.js +1 -1
- package/dist/handlers/completion-orchestrate.js +2 -2
- package/dist/handlers/download-asset.js +2 -2
- package/dist/handlers/finetune.js +1 -1
- package/dist/handlers/get-loaded-model-info.js +3 -5
- package/dist/handlers/get-model-info.js +1 -1
- package/dist/handlers/load-model/coreml-sidecars.d.ts +15 -0
- package/dist/handlers/load-model/coreml-sidecars.js +71 -8
- package/dist/handlers/load-model/download-manager.d.ts +1 -1
- package/dist/handlers/load-model/download-stats.d.ts +2 -2
- package/dist/handlers/load-model/download-stats.js +3 -3
- package/dist/handlers/load-model/handler.js +10 -7
- package/dist/handlers/load-model/http-verify.d.ts +1 -1
- package/dist/handlers/load-model/http.d.ts +1 -1
- package/dist/handlers/load-model/http.js +3 -3
- package/dist/handlers/load-model/hyperdrive.d.ts +1 -1
- package/dist/handlers/load-model/hyperdrive.js +2 -2
- 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 +5 -5
- package/dist/handlers/load-model/resolve-session.d.ts +1 -1
- package/dist/handlers/load-model/resolve-session.js +11 -3
- package/dist/handlers/load-model/resolve.d.ts +1 -1
- package/dist/handlers/load-model/resolve.js +5 -5
- package/dist/handlers/load-model/safe-fetch.js +5 -6
- package/dist/handlers/logging-stream.d.ts +2 -1
- package/dist/handlers/logging-stream.js +23 -7
- package/dist/handlers/registry.d.ts +3 -1
- package/dist/handlers/registry.js +7 -5
- package/dist/handlers/types.d.ts +7 -1
- package/dist/handlers/vector-index.js +2 -2
- 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/{resources/model-fit → model-fit}/assess.d.ts +18 -26
- package/dist/{resources/model-fit → model-fit}/assess.js +210 -274
- package/dist/{resources/model-fit/native-probe/classify-fit.d.ts → model-fit/classify.d.ts} +2 -2
- package/dist/{resources/model-fit/native-probe/classify-fit.js → model-fit/classify.js} +36 -5
- package/dist/{resources/model-fit/fit-stub/fetch-fit-stub.d.ts → model-fit/description/fetch.d.ts} +4 -2
- package/dist/{resources/model-fit/fit-stub/fetch-fit-stub.js → model-fit/description/fetch.js} +11 -6
- package/dist/{resources/model-fit/fit-stub/project-fit-from-load.d.ts → model-fit/description/project.d.ts} +3 -3
- package/dist/{resources/model-fit/fit-stub/project-fit-from-load.js → model-fit/description/project.js} +4 -2
- package/dist/{resources/model-fit/fit-stub/resolve-load-from-stubs.d.ts → model-fit/description/resolve-load.d.ts} +6 -4
- package/dist/{resources/model-fit/fit-stub/resolve-load-from-stubs.js → model-fit/description/resolve-load.js} +14 -6
- package/dist/model-fit/floor.d.ts +31 -0
- package/dist/{resources/model-fit → model-fit}/floor.js +13 -13
- package/dist/model-fit/kv-cache.d.ts +23 -0
- package/dist/model-fit/kv-cache.js +85 -0
- package/dist/{resources/model-fit/native-probe/advisory-fit.d.ts → model-fit/load-check.d.ts} +17 -14
- package/dist/{resources/model-fit/native-probe/advisory-fit.js → model-fit/load-check.js} +23 -64
- package/dist/model-fit/platform.d.ts +14 -0
- package/dist/model-fit/platform.js +26 -0
- package/dist/{resources/model-fit/native-probe/create-fit-request.d.ts → model-fit/request/create.d.ts} +5 -2
- package/dist/model-fit/request/create.js +61 -0
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/asr.d.ts +5 -1
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/asr.js +32 -1
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/audiogen.d.ts +1 -1
- package/dist/model-fit/request/engines/audiogen.js +63 -0
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/diffusion.d.ts +1 -1
- package/dist/model-fit/request/engines/diffusion.js +93 -0
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/llama.d.ts +2 -3
- package/dist/model-fit/request/engines/llama.js +44 -0
- package/dist/model-fit/request/engines/nmt.d.ts +8 -0
- package/dist/model-fit/request/engines/nmt.js +11 -0
- package/dist/model-fit/request/engines/ocr.d.ts +9 -0
- package/dist/model-fit/request/engines/ocr.js +13 -0
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/tts.d.ts +3 -1
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/tts.js +50 -4
- package/dist/{resources/model-fit/native-probe/engine-fit.d.ts → model-fit/run/engine.d.ts} +17 -4
- package/dist/{resources/model-fit/native-probe/engine-fit.js → model-fit/run/engine.js} +2 -2
- package/dist/model-fit/run/run.d.ts +43 -0
- package/dist/model-fit/run/run.js +204 -0
- package/dist/models/registry/index.d.ts +1 -1
- package/dist/models/registry/index.js +2 -2
- package/dist/models/registry/models.d.ts +1072 -815
- package/dist/models/registry/models.js +3704 -3405
- package/dist/models/registry/resource-profiles.d.ts +1 -2
- package/dist/models/registry/resource-profiles.js +406 -3
- package/dist/plugins/builtin/asr-ggml/config.d.ts +7 -1
- package/dist/plugins/builtin/asr-ggml/config.js +6 -0
- package/dist/plugins/builtin/asr-ggml/logging.d.ts +1 -1
- package/dist/plugins/builtin/audiogen-ggml/config.d.ts +1 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-edit-stream.js +29 -11
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-input.d.ts +27 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-input.js +23 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +7 -28
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-understand.js +2 -2
- package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +106 -13
- package/dist/plugins/builtin/audiogen-ggml/plugin.js +5 -4
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +20 -3
- 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/params.d.ts +18 -0
- package/dist/plugins/builtin/ggml-ocr/params.js +37 -0
- package/dist/plugins/builtin/ggml-ocr/plugin.d.ts +9 -0
- package/dist/plugins/builtin/ggml-ocr/plugin.js +17 -39
- package/dist/plugins/builtin/ggml-vla/plugin.d.ts +9 -2
- package/dist/plugins/builtin/ggml-vla/plugin.js +4 -4
- package/dist/plugins/builtin/index.d.ts +15 -12
- package/dist/plugins/builtin/index.js +15 -12
- package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +5 -7
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +2 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.js +6 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.d.ts +10 -7
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +141 -204
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.d.ts +36 -92
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.js +67 -216
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-state.d.ts +2 -49
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-state.js +2 -46
- package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +208 -19
- package/dist/plugins/builtin/llamacpp-completion/plugin.js +28 -20
- package/dist/plugins/builtin/llamacpp-completion/transform.js +5 -1
- package/dist/plugins/builtin/llamacpp-decision/helpers.d.ts +5 -0
- package/dist/plugins/builtin/llamacpp-decision/helpers.js +89 -0
- package/dist/plugins/builtin/llamacpp-decision/ops/decide.d.ts +91 -0
- package/dist/plugins/builtin/llamacpp-decision/ops/decide.js +129 -0
- package/dist/plugins/builtin/llamacpp-decision/plugin.d.ts +222 -0
- package/dist/plugins/builtin/llamacpp-decision/plugin.js +44 -0
- package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +9 -1
- package/dist/plugins/builtin/llamacpp-embedding/plugin.js +15 -5
- package/dist/plugins/builtin/llamacpp-embedding/transform.js +9 -0
- package/dist/plugins/builtin/llamacpp-rerank/helpers.d.ts +3 -0
- package/dist/plugins/builtin/llamacpp-rerank/helpers.js +16 -0
- package/dist/plugins/builtin/llamacpp-rerank/ops/rerank.d.ts +5 -0
- package/dist/plugins/builtin/llamacpp-rerank/ops/rerank.js +117 -0
- package/dist/plugins/builtin/llamacpp-rerank/plugin.d.ts +91 -0
- package/dist/plugins/builtin/llamacpp-rerank/plugin.js +45 -0
- package/dist/plugins/builtin/moss-transcribe/plugin.d.ts +143 -0
- package/dist/plugins/builtin/moss-transcribe/plugin.js +96 -0
- package/dist/plugins/builtin/nmtcpp-translation/load-files.d.ts +6 -0
- package/dist/plugins/builtin/nmtcpp-translation/load-files.js +70 -0
- package/dist/plugins/builtin/nmtcpp-translation/plugin.d.ts +17 -0
- package/dist/plugins/builtin/nmtcpp-translation/plugin.js +10 -74
- package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +25 -4
- package/dist/plugins/builtin/parakeet-transcription/plugin.js +20 -5
- package/dist/plugins/builtin/sdcpp-generation/ops/diffusion.d.ts +5 -2
- package/dist/plugins/builtin/sdcpp-generation/ops/diffusion.js +168 -52
- package/dist/plugins/builtin/sdcpp-generation/ops/video.d.ts +5 -2
- package/dist/plugins/builtin/sdcpp-generation/ops/video.js +28 -13
- package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +83 -1
- package/dist/plugins/builtin/sdcpp-generation/plugin.js +55 -52
- package/dist/plugins/builtin/sdcpp-generation/upscaler-config.d.ts +15 -0
- package/dist/plugins/builtin/sdcpp-generation/upscaler-config.js +19 -0
- package/dist/plugins/builtin/sdcpp-generation/world-config.d.ts +8 -0
- package/dist/plugins/builtin/sdcpp-generation/world-config.js +9 -0
- package/dist/plugins/builtin/tts-ggml/ops/moss-options.d.ts +22 -0
- package/dist/plugins/builtin/tts-ggml/ops/moss-options.js +79 -0
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.d.ts +1 -1
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.js +5 -2
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +19 -7
- package/dist/plugins/builtin/tts-ggml/plugin.d.ts +151 -1
- package/dist/plugins/builtin/tts-ggml/plugin.js +39 -2
- package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +28 -4
- package/dist/plugins/builtin/whispercpp-transcription/plugin.js +8 -4
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +2 -2
- package/dist/plugins/ops/kv-cache-utils.d.ts +5 -4
- package/dist/plugins/ops/kv-cache-utils.js +25 -33
- package/dist/plugins/ops/load-model.d.ts +8 -2
- package/dist/plugins/ops/load-model.js +33 -19
- package/dist/plugins/ops/transcribe.js +18 -2
- package/dist/plugins/ops/translate.js +3 -3
- package/dist/plugins/ops/unload-model.js +1 -1
- package/dist/plugins/turbovec-backend.js +5 -5
- 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/events.d.ts +1 -1
- package/dist/profiling/events.js +2 -2
- package/dist/profiling/exporters.d.ts +1 -1
- package/dist/profiling/exporters.js +3 -3
- package/dist/profiling/index.d.ts +13 -13
- package/dist/profiling/index.js +12 -12
- package/dist/profiling/operation-metrics.d.ts +1 -1
- package/dist/profiling/operation-metrics.js +2 -2
- package/dist/profiling/operation-wrappers.js +3 -3
- package/dist/profiling/profiler.js +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 +1 -1
- 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.js +1 -1
- package/dist/registry.js +3 -1
- package/dist/resources/collector.d.ts +1 -1
- package/dist/resources/collector.js +1 -1
- package/dist/resources/instance.d.ts +1 -1
- package/dist/resources/instance.js +1 -1
- package/dist/resources/native.d.ts +1 -1
- package/dist/resources/normalize.d.ts +1 -1
- package/dist/rpc/inventory.js +5 -7
- package/dist/runtime/env.d.ts +0 -2
- package/dist/runtime/env.js +2 -9
- package/dist/runtime/index.d.ts +5 -5
- package/dist/runtime/index.js +2 -2
- package/dist/runtime/lifecycle.js +7 -7
- package/dist/runtime/model-config-utils.js +9 -1
- package/dist/runtime/model-registry.d.ts +3 -1
- package/dist/runtime/model-registry.js +2 -1
- package/dist/runtime/registry-client.js +1 -1
- package/dist/runtime/request-context.d.ts +3 -3
- package/dist/runtime/request-context.js +22 -1
- package/dist/runtime/request-registry.d.ts +1 -1
- package/dist/runtime/request-registry.js +1 -1
- package/dist/runtime/state.d.ts +1 -1
- package/dist/runtime/state.js +7 -2
- package/dist/runtime/vector-index-backend.d.ts +2 -2
- package/dist/runtime/vector-index-registry.d.ts +5 -5
- package/dist/runtime/vector-index-registry.js +36 -13
- package/dist/schemas/assess-model-fit.d.ts +106 -43
- package/dist/schemas/assess-model-fit.js +69 -32
- package/dist/schemas/audio-gen.d.ts +199 -19
- package/dist/schemas/audio-gen.js +183 -51
- package/dist/schemas/batch-completion-stream.d.ts +210 -36
- package/dist/schemas/batch-completion-stream.js +3 -3
- package/dist/schemas/bci-config.d.ts +3 -0
- package/dist/schemas/bci-config.js +2 -2
- package/dist/schemas/bci.d.ts +24 -3
- package/dist/schemas/bci.js +2 -2
- package/dist/schemas/cancel.d.ts +10 -0
- package/dist/schemas/cancel.js +2 -0
- package/dist/schemas/common.d.ts +1465 -162
- package/dist/schemas/common.js +37 -31
- package/dist/schemas/completion-event.d.ts +8 -2
- package/dist/schemas/completion-event.js +4 -1
- package/dist/schemas/completion-stream.d.ts +243 -39
- package/dist/schemas/completion-stream.js +100 -29
- package/dist/schemas/config.d.ts +1326 -18
- package/dist/schemas/config.js +30 -8
- package/dist/schemas/decision.d.ts +610 -0
- package/dist/schemas/decision.js +219 -0
- package/dist/schemas/download-asset.d.ts +10 -4
- package/dist/schemas/download-asset.js +1 -1
- package/dist/schemas/engine-addon-map.d.ts +9 -1
- package/dist/schemas/engine-addon-map.js +26 -5
- package/dist/schemas/errors.d.ts +2 -0
- package/dist/schemas/errors.js +11 -1
- package/dist/schemas/index.d.ts +51 -48
- package/dist/schemas/index.js +50 -47
- package/dist/schemas/llamacpp-config.d.ts +222 -6
- package/dist/schemas/llamacpp-config.js +129 -7
- package/dist/schemas/load-model.d.ts +7960 -1492
- package/dist/schemas/load-model.js +122 -10
- package/dist/schemas/mcp-adapter.d.ts +1 -1
- package/dist/schemas/model-config-schemas.d.ts +428 -9
- package/dist/schemas/model-config-schemas.js +16 -11
- package/dist/schemas/model-fit-policy.d.ts +17 -0
- package/dist/schemas/model-fit-policy.js +17 -0
- package/dist/schemas/model-info.d.ts +20 -2
- package/dist/schemas/model-info.js +4 -3
- package/dist/schemas/model-resource-profile.d.ts +4 -4
- package/dist/schemas/model-resource-profile.js +2 -5
- package/dist/schemas/model-src-utils.d.ts +14 -2
- package/dist/schemas/model-src-utils.js +2 -2
- package/dist/schemas/model-types.d.ts +14 -1
- package/dist/schemas/model-types.js +4 -0
- package/dist/schemas/ocr.d.ts +76 -0
- package/dist/schemas/ocr.js +43 -1
- package/dist/schemas/plugin.d.ts +16 -4
- package/dist/schemas/plugin.js +12 -0
- package/dist/schemas/profiling.d.ts +4 -4
- package/dist/schemas/profiling.js +1 -1
- package/dist/schemas/rag.js +1 -1
- package/dist/schemas/registry.d.ts +34 -0
- package/dist/schemas/registry.js +5 -1
- package/dist/schemas/reload-config.d.ts +14 -2
- package/dist/schemas/reload-config.js +2 -2
- package/dist/schemas/rerank.d.ts +131 -0
- package/dist/schemas/rerank.js +102 -0
- package/dist/schemas/rpc-server.js +3 -3
- package/dist/schemas/sdcpp-config.d.ts +82 -0
- package/dist/schemas/sdcpp-config.js +41 -22
- package/dist/schemas/system-resources.d.ts +4 -4
- package/dist/schemas/text-to-speech.d.ts +463 -3
- package/dist/schemas/text-to-speech.js +129 -11
- package/dist/schemas/tools.d.ts +13 -4
- package/dist/schemas/tools.js +18 -6
- package/dist/schemas/transcription-config.d.ts +20 -0
- package/dist/schemas/transcription-config.js +54 -4
- package/dist/schemas/transcription.d.ts +47 -5
- package/dist/schemas/transcription.js +52 -5
- package/dist/schemas/translate.d.ts +2 -2
- package/dist/schemas/translate.js +1 -1
- package/dist/schemas/translation-config.d.ts +40 -10
- package/dist/schemas/translation-config.js +1 -1
- package/dist/schemas/vla.d.ts +9 -2
- package/dist/schemas/vla.js +9 -5
- package/dist/surface.d.ts +3 -2
- package/dist/surface.js +3 -2
- package/dist/utils/addon-responses.d.ts +3 -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/asr-events.d.ts +1 -0
- package/dist/utils/asr-events.js +2 -1
- package/dist/utils/audio/decoder.js +3 -1
- package/dist/utils/audio-input.js +1 -1
- package/dist/utils/cache/auto-history.d.ts +2 -1
- package/dist/utils/cache/auto-history.js +2 -2
- package/dist/utils/cache/paths.js +6 -6
- package/dist/utils/cache/types.d.ts +7 -0
- package/dist/utils/checksum.d.ts +2 -0
- package/dist/utils/checksum.js +41 -2
- package/dist/utils/completion-normalizer.js +1 -1
- package/dist/utils/gguf-architecture.d.ts +7 -0
- package/dist/utils/gguf-architecture.js +142 -0
- package/dist/utils/gguf-tensor-extractor.js +1 -1
- package/dist/utils/index.d.ts +13 -13
- package/dist/utils/index.js +13 -13
- package/dist/utils/mcp-adapter.d.ts +1 -1
- package/dist/utils/mcp-adapter.js +13 -9
- package/dist/utils/path-security.js +1 -1
- package/dist/utils/shard-utils.d.ts +5 -0
- package/dist/utils/shard-utils.js +19 -3
- package/dist/utils/tool-helpers.d.ts +1 -1
- package/dist/utils/tool-helpers.js +20 -52
- package/dist/utils/tool-integration.d.ts +1 -0
- package/dist/utils/tool-integration.js +3 -6
- package/dist/utils/tools/defer.d.ts +16 -26
- package/dist/utils/tools/defer.js +50 -41
- package/dist/utils/tools/dialect.d.ts +15 -4
- package/dist/utils/tools/dialect.js +34 -5
- package/dist/utils/tools/index.d.ts +3 -3
- package/dist/utils/tools/index.js +3 -3
- 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 +8 -5
- 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 +7 -4
- package/dist/utils/tools/shared.d.ts +3 -0
- package/dist/utils/tools/shared.js +62 -0
- package/dist/utils/transcribe-metadata.d.ts +8 -1
- package/dist/utils/transcribe-metadata.js +13 -3
- package/dist/utils/tts-stats.d.ts +2 -1
- package/dist/utils/until-aborted.d.ts +7 -0
- package/dist/utils/until-aborted.js +34 -0
- package/package.json +68 -51
- package/dist/resources/model-fit/calibration/darwin-arm64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/darwin-arm64.js +0 -36
- package/dist/resources/model-fit/calibration/darwin-x64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/darwin-x64.js +0 -38
- package/dist/resources/model-fit/calibration/fit.d.ts +0 -73
- package/dist/resources/model-fit/calibration/fit.js +0 -152
- package/dist/resources/model-fit/calibration/index.d.ts +0 -37
- package/dist/resources/model-fit/calibration/index.js +0 -75
- package/dist/resources/model-fit/calibration/linux-arm64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/linux-arm64.js +0 -38
- package/dist/resources/model-fit/calibration/linux-x64-vulkan.d.ts +0 -8
- package/dist/resources/model-fit/calibration/linux-x64-vulkan.js +0 -39
- package/dist/resources/model-fit/calibration/linux-x64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/linux-x64.js +0 -38
- package/dist/resources/model-fit/calibration/win32-x64-vulkan-shared.d.ts +0 -8
- package/dist/resources/model-fit/calibration/win32-x64-vulkan-shared.js +0 -39
- package/dist/resources/model-fit/calibration/win32-x64-vulkan.d.ts +0 -8
- package/dist/resources/model-fit/calibration/win32-x64-vulkan.js +0 -36
- package/dist/resources/model-fit/calibration/win32-x64.d.ts +0 -8
- package/dist/resources/model-fit/calibration/win32-x64.js +0 -38
- package/dist/resources/model-fit/estimators/llm.d.ts +0 -46
- package/dist/resources/model-fit/estimators/llm.js +0 -222
- package/dist/resources/model-fit/estimators/whisper.d.ts +0 -10
- package/dist/resources/model-fit/estimators/whisper.js +0 -76
- package/dist/resources/model-fit/floor.d.ts +0 -31
- package/dist/resources/model-fit/native-probe/child-engine-fit.d.ts +0 -2
- package/dist/resources/model-fit/native-probe/child-engine-fit.js +0 -41
- package/dist/resources/model-fit/native-probe/create-fit-request.js +0 -51
- package/dist/resources/model-fit/native-probe/engines/audiogen.js +0 -35
- package/dist/resources/model-fit/native-probe/engines/diffusion.js +0 -55
- package/dist/resources/model-fit/native-probe/engines/llama.js +0 -145
- package/dist/resources/model-fit/native-probe/fit-outcome.d.ts +0 -16
- package/dist/resources/model-fit/native-probe/fit-outcome.js +0 -1
- package/dist/resources/model-fit/native-probe/fit-process.d.ts +0 -27
- package/dist/resources/model-fit/native-probe/fit-process.js +0 -55
- package/dist/resources/model-fit/native-probe/fit-runner.d.ts +0 -1
- package/dist/resources/model-fit/native-probe/fit-runner.js +0 -58
- package/dist/resources/model-fit/native-probe/run-fit.d.ts +0 -24
- package/dist/resources/model-fit/native-probe/run-fit.js +0 -20
- package/dist/resources/model-fit/native-probe/run-in-process-fit.d.ts +0 -22
- package/dist/resources/model-fit/native-probe/run-in-process-fit.js +0 -108
- package/dist/resources/model-fit/native-probe/run-isolated-fit.d.ts +0 -63
- package/dist/resources/model-fit/native-probe/run-isolated-fit.js +0 -377
- package/dist/resources/model-fit/platform.d.ts +0 -9
- package/dist/resources/model-fit/platform.js +0 -28
- package/dist/resources/model-fit/types.d.ts +0 -120
- package/dist/resources/model-fit/types.js +0 -1
- /package/dist/{resources/model-fit/native-probe/engines → model-fit/request}/gpu.d.ts +0 -0
- /package/dist/{resources/model-fit/native-probe/engines → model-fit/request}/gpu.js +0 -0
|
@@ -5,12 +5,27 @@ type BundleSpec = {
|
|
|
5
5
|
targetSuffix: string;
|
|
6
6
|
};
|
|
7
7
|
export type CoremlSidecarSpec = {
|
|
8
|
+
source: string;
|
|
8
9
|
root: string;
|
|
9
10
|
modelStem: string;
|
|
10
11
|
bundles: readonly BundleSpec[];
|
|
12
|
+
withoutBundlesUse?: string;
|
|
11
13
|
};
|
|
12
14
|
type CompanionSet = NonNullable<RegistryItem['companionSet']>;
|
|
13
15
|
export declare function getCoremlSidecarSpec(registryPath: string, registrySource: string, platform: string | undefined): CoremlSidecarSpec | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* For the encoder-less GGUF of a Core ML distribution, the model constant to
|
|
18
|
+
* load instead where its bundles cannot be staged. The loader stages bundles
|
|
19
|
+
* on macOS and iOS alone, so anywhere else such a load is refused up front
|
|
20
|
+
* rather than failing inside the addon after the download.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getCoremlOnlyAlternative(registryPath: string, registrySource: string): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Why a `registry://` model source cannot load on `platform`, or `undefined`
|
|
25
|
+
* when it can. Only the encoder-less GGUF of a Core ML distribution is refused,
|
|
26
|
+
* and only off Apple platforms; every other source is the loader's business.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getRegistryModelPlatformRefusal(modelSrc: unknown, platform: string | undefined): string | undefined;
|
|
14
29
|
export declare function getCoremlSetKey(model: RegistryItem, spec: CoremlSidecarSpec): string;
|
|
15
30
|
export declare function readCachedCoremlCompanionSet(model: RegistryItem, platform: string | undefined, cacheDir?: string): Promise<CompanionSet | undefined>;
|
|
16
31
|
export declare function writeCachedCoremlCompanionSet(set: CompanionSet, cacheDir?: string): Promise<void>;
|
|
@@ -2,6 +2,7 @@ import { models } from '../../models/registry/models.js';
|
|
|
2
2
|
import { generateShortHash } from '../../utils/formatting.js';
|
|
3
3
|
import { getModelsCacheDir } from '../../utils/cache/paths.js';
|
|
4
4
|
import { validateAndJoinPath } from '../../utils/path-security.js';
|
|
5
|
+
import { modelInputToSrcSchema, registryUrlSchema } from '../../schemas/index.js';
|
|
5
6
|
import { promises as fsPromises } from 'bare-fs';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
// Apple Core ML sidecars for registry GGUFs. A native addon runs a stage on a
|
|
@@ -9,6 +10,8 @@ import { z } from 'zod';
|
|
|
9
10
|
// ggml otherwise, so on macOS and iOS the bundle is downloaded with its GGUF
|
|
10
11
|
// into one companion-set directory. The registry publishes a bundle as its
|
|
11
12
|
// individual component files, none of which is a model constant of its own.
|
|
13
|
+
// TranscribePsy's Core ML distribution goes further: its GGUF carries no
|
|
14
|
+
// encoder weights, so that GGUF only loads with its bundles beside it.
|
|
12
15
|
const COREML_COMPONENTS = [
|
|
13
16
|
'analytics/coremldata.bin',
|
|
14
17
|
'coremldata.bin',
|
|
@@ -21,6 +24,7 @@ const SIDECAR_FAMILIES = [
|
|
|
21
24
|
// The pinned ASR addon supports these encoder sidecars. The other bundles
|
|
22
25
|
// in the registry (CTC, Indic CTC, Nemotron, and TDT 1.1B) must not be
|
|
23
26
|
// downloaded until the addon can actually use them.
|
|
27
|
+
source: 's3',
|
|
24
28
|
root: 'qvac_models_compiled/ggml/parakeet/2026-09-28/',
|
|
25
29
|
pathPattern: /\/ggml\/parakeet\//,
|
|
26
30
|
stemPattern: /^(.+)\.(?:f16|q4_0|q8_0)\.gguf$/,
|
|
@@ -43,10 +47,27 @@ const SIDECAR_FAMILIES = [
|
|
|
43
47
|
]
|
|
44
48
|
}
|
|
45
49
|
},
|
|
50
|
+
{
|
|
51
|
+
// TranscribePsy's Core ML distribution is published on Hugging Face as an
|
|
52
|
+
// encoder-less GGUF with its encoder and decoder bundles beside it; the ASR
|
|
53
|
+
// addon runs both stages on the Neural Engine. The full GGUF
|
|
54
|
+
// (`transcribepsy-250m-eu-sub.gguf`) has no sidecar and runs on ggml.
|
|
55
|
+
source: 'hf',
|
|
56
|
+
pathPattern: /^qvac\/TranscribePsy-250M-EU-sub-coreml\/resolve\//,
|
|
57
|
+
stemPattern: /^(transcribepsy-250m-eu-sub-coreml)\.gguf$/,
|
|
58
|
+
bundlesByStem: {
|
|
59
|
+
'transcribepsy-250m-eu-sub-coreml': [
|
|
60
|
+
{ sourceName: 'transcribepsy-250m-eu-sub-coreml-encoder', targetSuffix: '-encoder' },
|
|
61
|
+
{ sourceName: 'transcribepsy-250m-eu-sub-coreml-decoder', targetSuffix: '-decoder' }
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
withoutBundlesUse: 'PARAKEET_TRANSCRIBEPSY_250M_Q8_0'
|
|
65
|
+
},
|
|
46
66
|
{
|
|
47
67
|
// The TTS addon runs the Audio8 codec's synthesis stack on this bundle when
|
|
48
68
|
// it sits beside the codec decoder GGUF. Every quantization tier shares the
|
|
49
69
|
// one bundle, which is why its name drops the tier.
|
|
70
|
+
source: 's3',
|
|
50
71
|
root: 'qvac_models_compiled/ggml/audio8/2026-09-30/',
|
|
51
72
|
pathPattern: /\/ggml\/audio-?8\//,
|
|
52
73
|
stemPattern: /^(.+)-(?:f16|f32|q8_0)\.gguf$/,
|
|
@@ -60,7 +81,7 @@ const checksumSchema = z.string().regex(/^[a-f0-9]{64}$/i);
|
|
|
60
81
|
const cachedFileSchema = z.object({
|
|
61
82
|
key: z.string(),
|
|
62
83
|
registryPath: z.string(),
|
|
63
|
-
registrySource: z.
|
|
84
|
+
registrySource: z.string(),
|
|
64
85
|
targetName: z.string(),
|
|
65
86
|
expectedSize: z.number().int().nonnegative(),
|
|
66
87
|
sha256Checksum: checksumSchema,
|
|
@@ -76,19 +97,60 @@ const cachedSetSchema = z.object({
|
|
|
76
97
|
files: z.array(cachedFileSchema)
|
|
77
98
|
});
|
|
78
99
|
export function getCoremlSidecarSpec(registryPath, registrySource, platform) {
|
|
79
|
-
if (
|
|
100
|
+
if (platform !== 'darwin' && platform !== 'ios')
|
|
80
101
|
return undefined;
|
|
81
102
|
const filename = registryPath.split('/').pop() || '';
|
|
82
103
|
for (const family of SIDECAR_FAMILIES) {
|
|
83
|
-
if (!family.pathPattern.test(registryPath))
|
|
104
|
+
if (family.source !== registrySource || !family.pathPattern.test(registryPath))
|
|
84
105
|
continue;
|
|
85
106
|
const modelStem = filename.match(family.stemPattern)?.[1];
|
|
86
107
|
const bundles = modelStem ? family.bundlesByStem[modelStem] : undefined;
|
|
87
|
-
if (modelStem && bundles)
|
|
88
|
-
return {
|
|
108
|
+
if (modelStem && bundles) {
|
|
109
|
+
return {
|
|
110
|
+
source: family.source,
|
|
111
|
+
root: family.root ?? registryPath.slice(0, registryPath.length - filename.length),
|
|
112
|
+
modelStem,
|
|
113
|
+
bundles,
|
|
114
|
+
...(family.withoutBundlesUse !== undefined && {
|
|
115
|
+
withoutBundlesUse: family.withoutBundlesUse
|
|
116
|
+
})
|
|
117
|
+
};
|
|
118
|
+
}
|
|
89
119
|
}
|
|
90
120
|
return undefined;
|
|
91
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* For the encoder-less GGUF of a Core ML distribution, the model constant to
|
|
124
|
+
* load instead where its bundles cannot be staged. The loader stages bundles
|
|
125
|
+
* on macOS and iOS alone, so anywhere else such a load is refused up front
|
|
126
|
+
* rather than failing inside the addon after the download.
|
|
127
|
+
*/
|
|
128
|
+
export function getCoremlOnlyAlternative(registryPath, registrySource) {
|
|
129
|
+
return getCoremlSidecarSpec(registryPath, registrySource, 'darwin')?.withoutBundlesUse;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Why a `registry://` model source cannot load on `platform`, or `undefined`
|
|
133
|
+
* when it can. Only the encoder-less GGUF of a Core ML distribution is refused,
|
|
134
|
+
* and only off Apple platforms; every other source is the loader's business.
|
|
135
|
+
*/
|
|
136
|
+
export function getRegistryModelPlatformRefusal(modelSrc, platform) {
|
|
137
|
+
if (platform === 'darwin' || platform === 'ios')
|
|
138
|
+
return undefined;
|
|
139
|
+
const src = modelInputToSrcSchema.safeParse(modelSrc);
|
|
140
|
+
if (!src.success || !src.data.startsWith('registry://'))
|
|
141
|
+
return undefined;
|
|
142
|
+
const url = registryUrlSchema.safeParse(src.data);
|
|
143
|
+
if (!url.success)
|
|
144
|
+
return undefined;
|
|
145
|
+
const { registryPath, registrySource } = url.data;
|
|
146
|
+
const alternative = getCoremlOnlyAlternative(registryPath, registrySource);
|
|
147
|
+
if (alternative === undefined)
|
|
148
|
+
return undefined;
|
|
149
|
+
const filename = registryPath.split('/').pop() || registryPath;
|
|
150
|
+
return (`${filename} is the encoder-less GGUF of a Core ML distribution: it loads on macOS and iOS, ` +
|
|
151
|
+
`where its Core ML encoder and decoder are staged beside it. On ${platform ?? 'this platform'}, ` +
|
|
152
|
+
`load ${alternative} instead.`);
|
|
153
|
+
}
|
|
92
154
|
export function getCoremlSetKey(model, spec) {
|
|
93
155
|
return generateShortHash(`${model.registrySource}:${model.registryPath}:coreml:${spec.root}`);
|
|
94
156
|
}
|
|
@@ -123,8 +185,9 @@ function isValidCachedSet(set, model, spec) {
|
|
|
123
185
|
new Set(set.files.map((file) => file.targetName)).size !== set.files.length) {
|
|
124
186
|
return false;
|
|
125
187
|
}
|
|
126
|
-
if (actual.some((file) => expected.get(file.targetName) !== file.registryPath))
|
|
188
|
+
if (actual.some((file) => file.registrySource !== spec.source || expected.get(file.targetName) !== file.registryPath)) {
|
|
127
189
|
return false;
|
|
190
|
+
}
|
|
128
191
|
for (const bundle of spec.bundles) {
|
|
129
192
|
const prefix = `${spec.modelStem}${bundle.targetSuffix}.mlmodelc/`;
|
|
130
193
|
const count = actual.filter((file) => file.targetName.startsWith(prefix)).length;
|
|
@@ -161,7 +224,7 @@ export function findCatalogCoremlCompanionSet(model, platform) {
|
|
|
161
224
|
for (const bundle of spec.bundles) {
|
|
162
225
|
const targetPrefix = `${spec.modelStem}${bundle.targetSuffix}.mlmodelc/`;
|
|
163
226
|
const registryPrefix = `${spec.root}${bundle.sourceName}.mlmodelc/`;
|
|
164
|
-
const entries = COREML_COMPONENTS.map((component) => models.find((entry) => entry.registrySource ===
|
|
227
|
+
const entries = COREML_COMPONENTS.map((component) => models.find((entry) => entry.registrySource === spec.source && entry.registryPath === registryPrefix + component));
|
|
165
228
|
if (entries.some((entry) => !entry))
|
|
166
229
|
continue;
|
|
167
230
|
for (let index = 0; index < entries.length; index++) {
|
|
@@ -243,7 +306,7 @@ export async function findCoremlCompanionSet(client, model, platform) {
|
|
|
243
306
|
});
|
|
244
307
|
const byPath = new Map();
|
|
245
308
|
for (const entry of registryEntries) {
|
|
246
|
-
if (entry.source ===
|
|
309
|
+
if (entry.source === spec.source && entry.path.startsWith(sourcePrefix)) {
|
|
247
310
|
byPath.set(entry.path, entry);
|
|
248
311
|
}
|
|
249
312
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModelProgressUpdate } from '../../schemas/index.js';
|
|
2
2
|
import { AbortController, type AbortSignal } from 'bare-abort-controller';
|
|
3
3
|
import type { DisposableScope } from '../../runtime/disposable-scope.js';
|
|
4
|
-
import type { DownloadHooks } from '
|
|
4
|
+
import type { DownloadHooks } from '../../handlers/load-model/types.js';
|
|
5
5
|
/**
|
|
6
6
|
* Per-subscriber binding to a registry-tracked request.
|
|
7
7
|
* `startOrJoinDownload` is request-aware: each caller (the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ModelProgressUpdate } from '../../schemas/index.js';
|
|
2
|
-
import type { DownloadStats, DownloadResult, DownloadHooks, DownloadSecurityOptions, ResolveResult } from '
|
|
3
|
-
import type { ExplicitRegistryMetadata } from '
|
|
2
|
+
import type { DownloadStats, DownloadResult, DownloadHooks, DownloadSecurityOptions, ResolveResult } from '../../handlers/load-model/types.js';
|
|
3
|
+
import type { ExplicitRegistryMetadata } from '../../handlers/load-model/registry-metadata.js';
|
|
4
4
|
export declare function downloadModelFromHttpWithStats(url: string, progressCallback?: (progress: ModelProgressUpdate) => void, downloadHooks?: DownloadHooks, security?: DownloadSecurityOptions): Promise<DownloadResult>;
|
|
5
5
|
export declare function downloadModelFromRegistryWithStats(registryPath: string, registrySource: string, progressCallback?: (progress: ModelProgressUpdate) => void, expectedChecksum?: string, downloadHooks?: DownloadHooks, explicitMetadata?: ExplicitRegistryMetadata): Promise<DownloadResult>;
|
|
6
6
|
export declare function downloadModelFromHyperdriveWithStats(hyperdriveKey: string, modelFileName: string, seed?: boolean, progressCallback?: (progress: ModelProgressUpdate) => void, downloadHooks?: DownloadHooks): Promise<DownloadResult>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { downloadModelFromHttp } from '
|
|
2
|
-
import { downloadModelFromRegistry } from '
|
|
3
|
-
import { downloadModelFromHyperdrive } from '
|
|
1
|
+
import { downloadModelFromHttp } from '../../handlers/load-model/http.js';
|
|
2
|
+
import { downloadModelFromRegistry } from '../../handlers/load-model/registry.js';
|
|
3
|
+
import { downloadModelFromHyperdrive } from '../../handlers/load-model/hyperdrive.js';
|
|
4
4
|
import { nowMs } from '../../profiling/index.js';
|
|
5
5
|
function createStatsCollector() {
|
|
6
6
|
return {
|
|
@@ -52,11 +52,11 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
52
52
|
});
|
|
53
53
|
import { normalizeModelType, PROFILING_KEY, OPERATION_EVENT_KEY } from '../../schemas/index.js';
|
|
54
54
|
import { loadModel } from '../../plugins/ops/load-model.js';
|
|
55
|
-
import { createResolveSession } from '
|
|
55
|
+
import { createResolveSession } from '../../handlers/load-model/resolve-session.js';
|
|
56
56
|
import { nowMs, generateProfileId } from '../../profiling/clock.js';
|
|
57
57
|
import { getModelEntry, updateModelConfig } from '../../runtime/model-registry.js';
|
|
58
58
|
import { generateShortHash, canonicalConfigString, transformConfigForReload } from '../../utils/index.js';
|
|
59
|
-
import { buildDownloadProfilingFields } from '
|
|
59
|
+
import { buildDownloadProfilingFields } from '../../handlers/load-model/types.js';
|
|
60
60
|
import { readBackendDiagnostics } from '../../profiling/backend-diagnostics.js';
|
|
61
61
|
import { ConfigReloadNotSupportedError, InferenceCancelledError, ModelTypeMismatchError, ModelNotFoundError, ModelLoadFailedError, PluginLoadConfigValidationFailedError, PluginNotFoundError } from '../../errors/index.js';
|
|
62
62
|
import { getEngineLogger } from '../../logging/index.js';
|
|
@@ -131,10 +131,10 @@ export async function handleLoadModel(request, progressCallback) {
|
|
|
131
131
|
}
|
|
132
132
|
// Phase boundary between download and load. The bare load path
|
|
133
133
|
// (`plugin.createModel(...)` / `model.load(false)`) does not accept
|
|
134
|
-
// an abort signal
|
|
135
|
-
//
|
|
136
|
-
//
|
|
137
|
-
// addon work.
|
|
134
|
+
// an abort signal, so cancel is honored at gates: here, if cancel
|
|
135
|
+
// arrived during download / resolveConfig, and inside `loadModel`
|
|
136
|
+
// after its fit check. Both surface `InferenceCancelledError`
|
|
137
|
+
// before sinking time into the addon work.
|
|
138
138
|
if (ctx.signal.aborted) {
|
|
139
139
|
throw new InferenceCancelledError(requestId);
|
|
140
140
|
}
|
|
@@ -167,7 +167,10 @@ export async function handleLoadModel(request, progressCallback) {
|
|
|
167
167
|
},
|
|
168
168
|
artifacts: Object.keys(pluginArtifacts).length > 0 ? pluginArtifacts : undefined,
|
|
169
169
|
modelName
|
|
170
|
-
},
|
|
170
|
+
}, {
|
|
171
|
+
...(profilingEnabled && { collectTiming: true }),
|
|
172
|
+
request: { signal: ctx.signal, requestId }
|
|
173
|
+
});
|
|
171
174
|
// Load phase soft-cancel limitation: `plugin.createModel(...)` and
|
|
172
175
|
// `model.load(false)` ran without a signal. A cancel that arrived
|
|
173
176
|
// during the load phase has just landed in the registry but the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DownloadHooks } from '
|
|
1
|
+
import type { DownloadHooks } from '../../handlers/load-model/types.js';
|
|
2
2
|
export declare function isHuggingFaceUrl(url: string): boolean;
|
|
3
3
|
/**
|
|
4
4
|
* Whether an HTTP download's transport must be secure (plaintext / HTTPS→HTTP
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ModelProgressUpdate } from '../../schemas/index.js';
|
|
2
|
-
import type { DownloadHooks, DownloadSecurityOptions } from '
|
|
2
|
+
import type { DownloadHooks, DownloadSecurityOptions } from '../../handlers/load-model/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* A mid-stream socket/body error, a connection failure (HTTP status 0, no
|
|
5
5
|
* response), or our own resume-triggered abort is recoverable by resuming from
|
|
@@ -3,11 +3,11 @@ import path from 'bare-path';
|
|
|
3
3
|
import { Readable } from 'bare-stream';
|
|
4
4
|
import { AbortController } from 'bare-abort-controller';
|
|
5
5
|
import { getModelsCacheDir, getShardedModelCacheDir, generateShortHash, detectShardedModel, parsePatternBasedShardUrl, extractTensorsFromShards, calculatePercentage, isArchiveUrl, sanitizePathComponent, extractAndValidateShardedArchive, validateShardedModelCache, checkAllShardsExist, generateShardFilenames, hasValidGGUFHeader } from '../../utils/index.js';
|
|
6
|
-
import { safeFetch } from '
|
|
7
|
-
import { shouldEnforceSecureTransport, verifyHttpModelFile } from '
|
|
6
|
+
import { safeFetch } from '../../handlers/load-model/safe-fetch.js';
|
|
7
|
+
import { shouldEnforceSecureTransport, verifyHttpModelFile } from '../../handlers/load-model/http-verify.js';
|
|
8
8
|
import { getConfig } from '../../runtime/state.js';
|
|
9
9
|
import { getLifecycleState, onResume } from '../../runtime/runtime-lifecycle.js';
|
|
10
|
-
import { createHttpDownloadKey, startOrJoinDownload, applyJoinedDownloadStats } from '
|
|
10
|
+
import { createHttpDownloadKey, startOrJoinDownload, applyJoinedDownloadStats } from '../../handlers/load-model/download-manager.js';
|
|
11
11
|
import { ChecksumUnavailableError, ChecksumValidationFailedError, DownloadCancelledError, HTTPError, InsecureModelSourceError, NoResponseBodyError, PartialDownloadOfflineError, ResponseBodyNotReadableError } from '../../errors/index.js';
|
|
12
12
|
import { getEngineLogger } from '../../logging/index.js';
|
|
13
13
|
const logger = getEngineLogger();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ModelProgressUpdate } from '../../schemas/index.js';
|
|
2
|
-
import type { DownloadHooks } from '
|
|
2
|
+
import type { DownloadHooks } from '../../handlers/load-model/types.js';
|
|
3
3
|
export declare function deleteCorestoreDirectory(corestoreDir: string): Promise<void>;
|
|
4
4
|
export declare function downloadModelFromHyperdrive(hyperdriveKey: string, modelFileName: string, seed?: boolean, progressCallback?: (progress: ModelProgressUpdate) => void, hooks?: DownloadHooks, expectedChecksum?: string): Promise<string>;
|
|
@@ -6,7 +6,7 @@ import Hyperdrive from 'hyperdrive';
|
|
|
6
6
|
import { getQvacPath } from '../../utils/qvac-paths.js';
|
|
7
7
|
import { getModelsCacheDir, generateShortHash, detectShardedModel, getShardedModelCacheDir, getShardPath, checkShardCompleteness, measureChecksum, extractTensorsFromShards, calculatePercentage, joinWithinBase } from '../../utils/index.js';
|
|
8
8
|
import { getModelBySrc } from '../../models/registry/index.js';
|
|
9
|
-
import { createHyperdriveDownloadKey, startOrJoinDownload, applyJoinedDownloadStats } from '
|
|
9
|
+
import { createHyperdriveDownloadKey, startOrJoinDownload, applyJoinedDownloadStats } from '../../handlers/load-model/download-manager.js';
|
|
10
10
|
import { getConfig } from '../../runtime/state.js';
|
|
11
11
|
import { FileNotFoundError, ChecksumValidationFailedError, DownloadCancelledError, HyperdriveDownloadFailedError, ModelLoadFailedError, NoBlobFoundError } from '../../errors/index.js';
|
|
12
12
|
import { getEngineLogger } from '../../logging/index.js';
|
|
@@ -165,7 +165,7 @@ async function validateCachedFile(modelPath, modelFileName, expectedSize, expect
|
|
|
165
165
|
// Partial files are ignored - corestore state is the source of truth for resume
|
|
166
166
|
if (localSize === expectedSize) {
|
|
167
167
|
logger.info(`✅ Model cached with correct size: ${modelPath}`);
|
|
168
|
-
//
|
|
168
|
+
// Validate against the expected checksum, reusing the digest only for unchanged files
|
|
169
169
|
if (expectedChecksum && expectedChecksum.length === 64) {
|
|
170
170
|
const checksum = await measureChecksum(modelPath, hooks);
|
|
171
171
|
if (checksum !== expectedChecksum) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { handleLoadModel } from '
|
|
2
|
-
export { resolveModelPath } from '
|
|
1
|
+
export { handleLoadModel } from '../../handlers/load-model/handler.js';
|
|
2
|
+
export { resolveModelPath } from '../../handlers/load-model/resolve.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { handleLoadModel } from '
|
|
2
|
-
export { resolveModelPath } from '
|
|
1
|
+
export { handleLoadModel } from '../../handlers/load-model/handler.js';
|
|
2
|
+
export { resolveModelPath } from '../../handlers/load-model/resolve.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModelProgressUpdate } from '../../schemas/index.js';
|
|
2
2
|
import type { RegistryItem } from '../../models/registry/index.js';
|
|
3
3
|
import type { AbortSignal } from 'bare-abort-controller';
|
|
4
|
-
import type { DownloadHooks } from '
|
|
4
|
+
import type { DownloadHooks } from '../../handlers/load-model/types.js';
|
|
5
5
|
type CompanionSetMetadata = NonNullable<RegistryItem['companionSet']>;
|
|
6
6
|
export interface DownloadCompanionSetOptions {
|
|
7
7
|
companionSet: CompanionSetMetadata;
|
|
@@ -2,7 +2,7 @@ import { promises as fsPromises } from 'bare-fs';
|
|
|
2
2
|
import { getModelsCacheDir, getCompanionSetPath, getCompanionSetCacheDir, getSingleFileCachePath, generateShortHash, calculatePercentage } from '../../utils/index.js';
|
|
3
3
|
import { measureChecksum } from '../../utils/checksum.js';
|
|
4
4
|
import { validateAndJoinPath } from '../../utils/path-security.js';
|
|
5
|
-
import { buildBlobBinding, downloadSingleFileFromRegistry, validateCachedFile } from '
|
|
5
|
+
import { buildBlobBinding, downloadSingleFileFromRegistry, validateCachedFile } from '../../handlers/load-model/registry-download-utils.js';
|
|
6
6
|
import { DownloadCancelledError, RegistryDownloadFailedError } from '../../errors/index.js';
|
|
7
7
|
import { getEngineLogger } from '../../logging/index.js';
|
|
8
8
|
const logger = getEngineLogger();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ModelProgressUpdate } from '../../schemas/index.js';
|
|
2
2
|
import type { QVACBlobBinding } from '@qvac/registry-client';
|
|
3
3
|
import type { AbortSignal } from 'bare-abort-controller';
|
|
4
|
-
import type { DownloadHooks } from '
|
|
5
|
-
export { DEFAULT_REGISTRY_STREAM_TIMEOUT_MS, buildRegistryClientOptions } from '
|
|
6
|
-
export type { RegistryClientDownloadOptions } from '
|
|
4
|
+
import type { DownloadHooks } from '../../handlers/load-model/types.js';
|
|
5
|
+
export { DEFAULT_REGISTRY_STREAM_TIMEOUT_MS, buildRegistryClientOptions } from '../../handlers/load-model/registry-client-options.js';
|
|
6
|
+
export type { RegistryClientDownloadOptions } from '../../handlers/load-model/registry-client-options.js';
|
|
7
7
|
export declare function buildBlobBinding(meta: {
|
|
8
8
|
blobCoreKey: string;
|
|
9
9
|
blobBlockOffset: number;
|
|
@@ -3,11 +3,11 @@ import path from 'bare-path';
|
|
|
3
3
|
import { measureChecksum, calculatePercentage } from '../../utils/index.js';
|
|
4
4
|
import { getRegistryClient } from '../../runtime/registry-client.js';
|
|
5
5
|
import { getConfig } from '../../runtime/state.js';
|
|
6
|
-
import { buildRegistryClientOptions } from '
|
|
6
|
+
import { buildRegistryClientOptions } from '../../handlers/load-model/registry-client-options.js';
|
|
7
7
|
import { ChecksumValidationFailedError, DownloadCancelledError } from '../../errors/index.js';
|
|
8
8
|
import { getEngineLogger } from '../../logging/index.js';
|
|
9
9
|
const logger = getEngineLogger();
|
|
10
|
-
export { DEFAULT_REGISTRY_STREAM_TIMEOUT_MS, buildRegistryClientOptions } from '
|
|
10
|
+
export { DEFAULT_REGISTRY_STREAM_TIMEOUT_MS, buildRegistryClientOptions } from '../../handlers/load-model/registry-client-options.js';
|
|
11
11
|
export function buildBlobBinding(meta) {
|
|
12
12
|
return {
|
|
13
13
|
coreKey: meta.blobCoreKey,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ModelProgressUpdate } from '../../schemas/index.js';
|
|
2
|
-
import type { DownloadHooks } from '
|
|
3
|
-
import { type ExplicitRegistryMetadata } from '
|
|
2
|
+
import type { DownloadHooks } from '../../handlers/load-model/types.js';
|
|
3
|
+
import { type ExplicitRegistryMetadata } from '../../handlers/load-model/registry-metadata.js';
|
|
4
4
|
export declare function downloadModelFromRegistry(registryPath: string, registrySource: string, progressCallback?: (progress: ModelProgressUpdate) => void, expectedChecksum?: string, hooks?: DownloadHooks, explicitMetadata?: ExplicitRegistryMetadata): Promise<string>;
|
|
@@ -4,13 +4,13 @@ import { getSingleFileCachePath } from '../../utils/cache/paths.js';
|
|
|
4
4
|
import { getModelByPath } from '../../models/registry/index.js';
|
|
5
5
|
import { getRegistryClient } from '../../runtime/registry-client.js';
|
|
6
6
|
import { getRuntimeContext } from '../../runtime/state.js';
|
|
7
|
-
import { createRegistryDownloadKey, startOrJoinDownload, applyJoinedDownloadStats } from '
|
|
8
|
-
import { buildBlobBinding, validateCachedFile, downloadSingleFileFromRegistry } from '
|
|
9
|
-
import { downloadCompanionSetFromRegistry } from '
|
|
10
|
-
import { findCoremlCompanionSet, findLocallyCachedCoremlCompanionSet, getCoremlSidecarSpec, writeCachedCoremlCompanionSet } from '
|
|
7
|
+
import { createRegistryDownloadKey, startOrJoinDownload, applyJoinedDownloadStats } from '../../handlers/load-model/download-manager.js';
|
|
8
|
+
import { buildBlobBinding, validateCachedFile, downloadSingleFileFromRegistry } from '../../handlers/load-model/registry-download-utils.js';
|
|
9
|
+
import { downloadCompanionSetFromRegistry } from '../../handlers/load-model/registry-companion-set.js';
|
|
10
|
+
import { findCoremlCompanionSet, findLocallyCachedCoremlCompanionSet, getCoremlSidecarSpec, writeCachedCoremlCompanionSet } from '../../handlers/load-model/coreml-sidecars.js';
|
|
11
11
|
import { DownloadCancelledError, ModelNotFoundError, RegistryDownloadFailedError } from '../../errors/index.js';
|
|
12
12
|
import { getEngineLogger } from '../../logging/index.js';
|
|
13
|
-
import { resolveRegistryDownloadMetadata } from '
|
|
13
|
+
import { resolveRegistryDownloadMetadata } from '../../handlers/load-model/registry-metadata.js';
|
|
14
14
|
const logger = getEngineLogger();
|
|
15
15
|
/**
|
|
16
16
|
* Find all shards for a model using path prefix query.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AbortSignal } from 'bare-abort-controller';
|
|
2
2
|
import type { ModelProgressUpdate, ResolveContext } from '../../schemas/index.js';
|
|
3
|
-
import type { DownloadRequestBinding, ResolveResult, DownloadSecurityOptions } from '
|
|
3
|
+
import type { DownloadRequestBinding, ResolveResult, DownloadSecurityOptions } from '../../handlers/load-model/types.js';
|
|
4
4
|
export interface ResolveSessionOptions {
|
|
5
5
|
progressCallback?: ((update: ModelProgressUpdate) => void) | undefined;
|
|
6
6
|
seed?: boolean | undefined;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { resolveModelPath, resolveModelPathWithStats } from '
|
|
2
|
-
import { cancelTransfer } from '
|
|
3
|
-
import { mergeDownloadStats } from '
|
|
1
|
+
import { resolveModelPath, resolveModelPathWithStats } from '../../handlers/load-model/resolve.js';
|
|
2
|
+
import { cancelTransfer } from '../../handlers/load-model/download-manager.js';
|
|
3
|
+
import { mergeDownloadStats } from '../../handlers/load-model/download-stats.js';
|
|
4
|
+
import { getRegistryModelPlatformRefusal } from '../../handlers/load-model/coreml-sidecars.js';
|
|
5
|
+
import { ModelLoadFailedError } from '../../errors/index.js';
|
|
4
6
|
import { getRuntimeContext } from '../../runtime/state.js';
|
|
5
7
|
export function createResolveSession(options) {
|
|
6
8
|
const { progressCallback, seed, profilingEnabled, signal, requestBinding, security } = options;
|
|
@@ -14,6 +16,12 @@ export function createResolveSession(options) {
|
|
|
14
16
|
...(requestBinding !== undefined && { requestBinding })
|
|
15
17
|
};
|
|
16
18
|
async function resolvePrimaryModelPath(modelSrc, fallbackSrc) {
|
|
19
|
+
// A GGUF that only runs with Core ML bundles beside it is refused before
|
|
20
|
+
// its download anywhere the loader cannot stage them. `downloadAsset` does
|
|
21
|
+
// not pass here, so fetching it for another machine still works.
|
|
22
|
+
const refusal = getRegistryModelPlatformRefusal(modelSrc, getRuntimeContext().platform);
|
|
23
|
+
if (refusal !== undefined)
|
|
24
|
+
throw new ModelLoadFailedError(refusal);
|
|
17
25
|
if (profilingEnabled) {
|
|
18
26
|
const result = await resolveModelPathWithStats(modelSrc, progressCallback, seed, signal, downloadHooks, fallbackSrc, security);
|
|
19
27
|
primaryResult = result;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ModelProgressUpdate } from '../../schemas/index.js';
|
|
2
|
-
import type { ResolveResult, DownloadHooks, DownloadSecurityOptions } from '
|
|
2
|
+
import type { ResolveResult, DownloadHooks, DownloadSecurityOptions } from '../../handlers/load-model/types.js';
|
|
3
3
|
import type { AbortSignal } from 'bare-abort-controller';
|
|
4
4
|
type ResolveMode = 'base' | 'stats';
|
|
5
5
|
export declare function resolveFallbackModel(fallbackSrc: string, expectedChecksum: string | undefined, progressCallback: ((progress: ModelProgressUpdate) => void) | undefined, mode: ResolveMode, signal: AbortSignal | undefined, hooks: DownloadHooks | undefined, security?: DownloadSecurityOptions): Promise<ResolveResult>;
|
|
@@ -3,11 +3,11 @@ import { hyperdriveUrlSchema, registryUrlSchema, SUPPORTED_ARCHIVE_EXTENSIONS, m
|
|
|
3
3
|
import { getModelsCacheDir, getShardedModelCacheDir, generateShortHash, extractAndValidateShardedArchive, measureChecksum } from '../../utils/index.js';
|
|
4
4
|
import { promises as fsPromises } from 'bare-fs';
|
|
5
5
|
import path from 'bare-path';
|
|
6
|
-
import { downloadModelFromHttp } from '
|
|
7
|
-
import { downloadModelFromHyperdrive } from '
|
|
8
|
-
import { downloadModelFromRegistry } from '
|
|
9
|
-
import { getExplicitRegistryMetadata } from '
|
|
10
|
-
import { downloadModelFromHttpWithStats, downloadModelFromHyperdriveWithStats, downloadModelFromRegistryWithStats } from '
|
|
6
|
+
import { downloadModelFromHttp } from '../../handlers/load-model/http.js';
|
|
7
|
+
import { downloadModelFromHyperdrive } from '../../handlers/load-model/hyperdrive.js';
|
|
8
|
+
import { downloadModelFromRegistry } from '../../handlers/load-model/registry.js';
|
|
9
|
+
import { getExplicitRegistryMetadata } from '../../handlers/load-model/registry-metadata.js';
|
|
10
|
+
import { downloadModelFromHttpWithStats, downloadModelFromHyperdriveWithStats, downloadModelFromRegistryWithStats } from '../../handlers/load-model/download-stats.js';
|
|
11
11
|
import { ChecksumValidationFailedError, DownloadCancelledError, InferenceCancelledError, ModelFileNotFoundError, ModelLoadFailedError, ModelNotFoundError, SeedingNotSupportedError } from '../../errors/index.js';
|
|
12
12
|
import { validateAndJoinPath } from '../../utils/path-security.js';
|
|
13
13
|
import { getEngineLogger } from '../../logging/index.js';
|
|
@@ -6,9 +6,6 @@ import { getEngineLogger } from '../../logging/index.js';
|
|
|
6
6
|
const logger = getEngineLogger();
|
|
7
7
|
const MAX_REDIRECTS = 20;
|
|
8
8
|
const REDIRECT_STATUSES = new Set([301, 302, 303, 307, 308]);
|
|
9
|
-
function protocolFor(url) {
|
|
10
|
-
return url.protocol === 'https:' ? https : http;
|
|
11
|
-
}
|
|
12
9
|
function assertSecureHop(url, previous) {
|
|
13
10
|
if (isSecureDownloadUrl(url))
|
|
14
11
|
return;
|
|
@@ -22,7 +19,6 @@ function assertSecureHop(url, previous) {
|
|
|
22
19
|
// connect can't leak.
|
|
23
20
|
function requestOnce(url, method, headers, timeoutMs, signal) {
|
|
24
21
|
return new Promise((resolve, reject) => {
|
|
25
|
-
const protocol = protocolFor(url);
|
|
26
22
|
let settled = false;
|
|
27
23
|
let timer;
|
|
28
24
|
const cleanup = () => {
|
|
@@ -45,7 +41,7 @@ function requestOnce(url, method, headers, timeoutMs, signal) {
|
|
|
45
41
|
reject(error);
|
|
46
42
|
};
|
|
47
43
|
const onAbort = () => fail(new DownloadCancelledError());
|
|
48
|
-
const
|
|
44
|
+
const onResponse = (res) => {
|
|
49
45
|
if (settled) {
|
|
50
46
|
res.destroy();
|
|
51
47
|
return;
|
|
@@ -53,7 +49,10 @@ function requestOnce(url, method, headers, timeoutMs, signal) {
|
|
|
53
49
|
settled = true;
|
|
54
50
|
cleanup();
|
|
55
51
|
resolve(res);
|
|
56
|
-
}
|
|
52
|
+
};
|
|
53
|
+
const req = url.protocol === 'https:'
|
|
54
|
+
? https.request(url, { method, headers }, (res) => onResponse(res))
|
|
55
|
+
: http.request(url, { method, headers }, onResponse);
|
|
57
56
|
req.on('error', (error) => fail(error));
|
|
58
57
|
if (signal) {
|
|
59
58
|
if (signal.aborted) {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { LoggingStreamRequest, LoggingStreamResponse } from '../schemas/index.js';
|
|
2
|
-
|
|
2
|
+
import type { StreamHandlerContext } from '../handlers/types.js';
|
|
3
|
+
export declare function handleLoggingStream(request: LoggingStreamRequest, context?: StreamHandlerContext): AsyncGenerator<LoggingStreamResponse>;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { registerLoggingStream, unregisterLoggingStream } from '../runtime/logging-stream-registry.js';
|
|
2
|
-
export async function* handleLoggingStream(request) {
|
|
2
|
+
export async function* handleLoggingStream(request, context = {}) {
|
|
3
3
|
const { id } = request;
|
|
4
|
+
const { signal } = context;
|
|
5
|
+
if (signal?.aborted)
|
|
6
|
+
return;
|
|
4
7
|
const logQueue = [];
|
|
5
8
|
let pendingResolve = null;
|
|
9
|
+
const wake = () => {
|
|
10
|
+
if (pendingResolve) {
|
|
11
|
+
const resolve = pendingResolve;
|
|
12
|
+
pendingResolve = null;
|
|
13
|
+
resolve();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
6
16
|
const streamHandler = (level, namespace, message, sourceId) => {
|
|
7
17
|
const logResponse = {
|
|
8
18
|
type: 'loggingStream',
|
|
@@ -15,25 +25,31 @@ export async function* handleLoggingStream(request) {
|
|
|
15
25
|
timestamp: Date.now()
|
|
16
26
|
};
|
|
17
27
|
logQueue.push(logResponse);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
wake();
|
|
29
|
+
};
|
|
30
|
+
// Release at once, even if nobody is reading; a quiet id would wait forever.
|
|
31
|
+
const onAbort = () => {
|
|
32
|
+
unregisterLoggingStream(id, streamHandler);
|
|
33
|
+
logQueue.length = 0;
|
|
34
|
+
wake();
|
|
23
35
|
};
|
|
24
36
|
registerLoggingStream(id, streamHandler);
|
|
37
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
25
38
|
try {
|
|
26
39
|
while (true) {
|
|
27
40
|
while (logQueue.length > 0) {
|
|
28
41
|
yield logQueue.shift();
|
|
29
42
|
}
|
|
30
|
-
//
|
|
43
|
+
// Aborted during a read: nothing to wake, so end here.
|
|
44
|
+
if (signal?.aborted)
|
|
45
|
+
return;
|
|
31
46
|
await new Promise((resolve) => {
|
|
32
47
|
pendingResolve = resolve;
|
|
33
48
|
});
|
|
34
49
|
}
|
|
35
50
|
}
|
|
36
51
|
finally {
|
|
52
|
+
signal?.removeEventListener('abort', onAbort);
|
|
37
53
|
unregisterLoggingStream(id, streamHandler);
|
|
38
54
|
}
|
|
39
55
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { ModelRegistryListResponse, ModelRegistrySearchRequest, ModelRegistrySearchResponse, ModelRegistryGetModelRequest, ModelRegistryGetModelResponse } from '../schemas/index.js';
|
|
1
|
+
import type { ModelRegistryListResponse, ModelRegistrySearchRequest, ModelRegistrySearchResponse, ModelRegistryGetModelRequest, ModelRegistryGetModelResponse, ModelRegistryEntry } from '../schemas/index.js';
|
|
2
|
+
import type { QVACModelEntry } from '@qvac/registry-client';
|
|
3
|
+
export declare function processRegistryModel(model: QVACModelEntry): ModelRegistryEntry | null;
|
|
2
4
|
export declare function handleModelRegistryList(): Promise<ModelRegistryListResponse>;
|
|
3
5
|
export declare function handleModelRegistrySearch(request: ModelRegistrySearchRequest): Promise<ModelRegistrySearchResponse>;
|
|
4
6
|
export declare function handleModelRegistryGetModel(request: ModelRegistryGetModelRequest): Promise<ModelRegistryGetModelResponse>;
|