@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
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type RagWorkspaceInfo } from '
|
|
1
|
+
import { type RagWorkspaceInfo } from '../../rag/rag-workspace-manager.js';
|
|
2
2
|
export declare function listWorkspaces(): RagWorkspaceInfo[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRagDbAdapter, hasRagWorkspaceStorage } from '
|
|
1
|
+
import { getRagDbAdapter, hasRagWorkspaceStorage } from '../../rag/rag-workspace-manager.js';
|
|
2
2
|
import { ragReindexParamsSchema } from '../../schemas/index.js';
|
|
3
3
|
import { RAGHyperDBFailedError } from '../../errors/index.js';
|
|
4
4
|
export async function reindex(params, options) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRagDbAdapter } from '
|
|
1
|
+
import { getRagDbAdapter } from '../../rag/rag-workspace-manager.js';
|
|
2
2
|
import { ragSaveEmbeddingsParamsSchema } from '../../schemas/index.js';
|
|
3
3
|
export async function saveEmbeddings(params, options) {
|
|
4
4
|
const { documents, progressInterval, workspace } = ragSaveEmbeddingsParamsSchema.parse(params);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRagInstance, hasRagWorkspaceStorage } from '
|
|
1
|
+
import { getRagInstance, hasRagWorkspaceStorage } from '../../rag/rag-workspace-manager.js';
|
|
2
2
|
import { embed } from '../../plugins/ops/embed.js';
|
|
3
3
|
import { ragSearchParamsSchema } from '../../schemas/index.js';
|
|
4
4
|
export async function search(params) {
|
package/dist/rag/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { chunk } from '
|
|
2
|
-
export { ingest } from '
|
|
3
|
-
export { saveEmbeddings } from '
|
|
4
|
-
export { search } from '
|
|
5
|
-
export { deleteEmbeddings } from '
|
|
6
|
-
export { reindex } from '
|
|
7
|
-
export { listWorkspaces } from '
|
|
8
|
-
export { closeWorkspace } from '
|
|
9
|
-
export { deleteWorkspace } from '
|
|
10
|
-
export { closeAllRagInstances, DEFAULT_WORKSPACE, type RagWorkspaceInfo } from '
|
|
11
|
-
export { getActiveRagRequest, setActiveRagRequest, clearActiveRagRequest, getWorkspaceKey } from '
|
|
1
|
+
export { chunk } from '../rag/handlers/chunk.js';
|
|
2
|
+
export { ingest } from '../rag/handlers/ingest.js';
|
|
3
|
+
export { saveEmbeddings } from '../rag/handlers/save-embeddings.js';
|
|
4
|
+
export { search } from '../rag/handlers/search.js';
|
|
5
|
+
export { deleteEmbeddings } from '../rag/handlers/delete-embeddings.js';
|
|
6
|
+
export { reindex } from '../rag/handlers/reindex.js';
|
|
7
|
+
export { listWorkspaces } from '../rag/handlers/list-workspaces.js';
|
|
8
|
+
export { closeWorkspace } from '../rag/handlers/close-workspace.js';
|
|
9
|
+
export { deleteWorkspace } from '../rag/handlers/delete-workspace.js';
|
|
10
|
+
export { closeAllRagInstances, DEFAULT_WORKSPACE, type RagWorkspaceInfo } from '../rag/rag-workspace-manager.js';
|
|
11
|
+
export { getActiveRagRequest, setActiveRagRequest, clearActiveRagRequest, getWorkspaceKey } from '../rag/rag-operation-manager.js';
|
package/dist/rag/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { chunk } from '
|
|
2
|
-
export { ingest } from '
|
|
3
|
-
export { saveEmbeddings } from '
|
|
4
|
-
export { search } from '
|
|
5
|
-
export { deleteEmbeddings } from '
|
|
6
|
-
export { reindex } from '
|
|
7
|
-
export { listWorkspaces } from '
|
|
8
|
-
export { closeWorkspace } from '
|
|
9
|
-
export { deleteWorkspace } from '
|
|
10
|
-
export { closeAllRagInstances, DEFAULT_WORKSPACE } from '
|
|
11
|
-
export { getActiveRagRequest, setActiveRagRequest, clearActiveRagRequest, getWorkspaceKey } from '
|
|
1
|
+
export { chunk } from '../rag/handlers/chunk.js';
|
|
2
|
+
export { ingest } from '../rag/handlers/ingest.js';
|
|
3
|
+
export { saveEmbeddings } from '../rag/handlers/save-embeddings.js';
|
|
4
|
+
export { search } from '../rag/handlers/search.js';
|
|
5
|
+
export { deleteEmbeddings } from '../rag/handlers/delete-embeddings.js';
|
|
6
|
+
export { reindex } from '../rag/handlers/reindex.js';
|
|
7
|
+
export { listWorkspaces } from '../rag/handlers/list-workspaces.js';
|
|
8
|
+
export { closeWorkspace } from '../rag/handlers/close-workspace.js';
|
|
9
|
+
export { deleteWorkspace } from '../rag/handlers/delete-workspace.js';
|
|
10
|
+
export { closeAllRagInstances, DEFAULT_WORKSPACE } from '../rag/rag-workspace-manager.js';
|
|
11
|
+
export { getActiveRagRequest, setActiveRagRequest, clearActiveRagRequest, getWorkspaceKey } from '../rag/rag-operation-manager.js';
|
|
@@ -6,7 +6,7 @@ import { getConfig, getConfiguredCacheDir } from '../runtime/state.js';
|
|
|
6
6
|
import { PathTraversalError, RAGWorkspaceInUseError, RAGWorkspaceModelMismatchError, RAGWorkspaceNotOpenError } from '../errors/index.js';
|
|
7
7
|
import { validateAndJoinPath } from '../utils/path-security.js';
|
|
8
8
|
import { createStreamLogger, getEngineLogger, RAG_NAMESPACE } from '../logging/index.js';
|
|
9
|
-
import { cancelAllRagOperations } from '
|
|
9
|
+
import { cancelAllRagOperations } from '../rag/rag-operation-manager.js';
|
|
10
10
|
import { registerCorestore, unregisterCorestore } from '../runtime/runtime-lifecycle.js';
|
|
11
11
|
import { getTurboVecIndexProvider } from '../plugins/registry.js';
|
|
12
12
|
const logger = getEngineLogger();
|
package/dist/registry.js
CHANGED
|
@@ -56,6 +56,8 @@ export const registry = {
|
|
|
56
56
|
handler: handleUnloadModel
|
|
57
57
|
},
|
|
58
58
|
embed: { type: 'reply', pluginOp: true, handler: pluginReply('embed') },
|
|
59
|
+
decide: { type: 'reply', pluginOp: true, handler: pluginReply('decide') },
|
|
60
|
+
rerank: { type: 'reply', pluginOp: true, handler: pluginReply('rerank') },
|
|
59
61
|
cancel: {
|
|
60
62
|
type: 'reply',
|
|
61
63
|
handler: cancelHandler
|
|
@@ -107,7 +109,7 @@ export const registry = {
|
|
|
107
109
|
worldStepStream: { type: 'stream', pluginOp: true, handler: pluginStream('worldStepStream') },
|
|
108
110
|
worldSceneStream: { type: 'stream', pluginOp: true, handler: pluginStream('worldSceneStream') },
|
|
109
111
|
classify: { type: 'stream', pluginOp: true, handler: pluginStream('classify') },
|
|
110
|
-
loggingStream: { type: 'stream', handler: handleLoggingStream },
|
|
112
|
+
loggingStream: { type: 'stream', handler: handleLoggingStream, endsOnAbort: true },
|
|
111
113
|
pluginInvokeStream: { type: 'stream', handler: handlePluginInvokeStream },
|
|
112
114
|
// Duplex
|
|
113
115
|
transcribeStream: { type: 'duplex', pluginOp: true, handler: pluginDuplex('transcribeStream') },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResourceCollectorDependencies, ResourceMetric, ResourceProvenance } from '
|
|
1
|
+
import type { ResourceCollectorDependencies, ResourceMetric, ResourceProvenance } from '../resources/types.js';
|
|
2
2
|
export declare function createSystemResourceCollector(dependencies: ResourceCollectorDependencies): {
|
|
3
3
|
getCapabilities: () => {
|
|
4
4
|
cpu: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { failedMetric, normalizeBooleanMetric, normalizeEnumMetric, normalizeNonNegativeIntegerMetric, normalizeNonNegativeMetric, normalizePositiveIntegerMetric, normalizeStringMetric, normalizeUtilizationMetric, unavailableMetric, unverifiedMetric } from '
|
|
1
|
+
import { failedMetric, normalizeBooleanMetric, normalizeEnumMetric, normalizeNonNegativeIntegerMetric, normalizeNonNegativeMetric, normalizePositiveIntegerMetric, normalizeStringMetric, normalizeUtilizationMetric, unavailableMetric, unverifiedMetric } from '../resources/normalize.js';
|
|
2
2
|
const CPU_SOURCE = 'bare-cpu-info';
|
|
3
3
|
const GPU_SOURCE = 'bare-gpu-info';
|
|
4
4
|
const GPU_MEMORY_SCOPE_REASON = 'GPU memory scope is unverified';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResourceCollectorDependencies, SystemResourceCollector } from '
|
|
1
|
+
import type { ResourceCollectorDependencies, SystemResourceCollector } from '../resources/types.js';
|
|
2
2
|
export declare function initializeResourceCollector(dependencies: ResourceCollectorDependencies): SystemResourceCollector;
|
|
3
3
|
export declare function getResourceCollector(): SystemResourceCollector | undefined;
|
|
4
4
|
export declare function destroyResourceCollector(): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ResourceCollectorDependencies } from '
|
|
1
|
+
import type { ResourceCollectorDependencies } from '../resources/types.js';
|
|
2
2
|
export declare const nativeResourceCollectorDependencies: ResourceCollectorDependencies;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResourceMetric, ResourceProvenance } from '
|
|
1
|
+
import type { ResourceMetric, ResourceProvenance } from '../resources/types.js';
|
|
2
2
|
export declare function unavailableMetric<T>(reason?: string): ResourceMetric<T>;
|
|
3
3
|
export declare function unverifiedMetric<T>(reason?: string): ResourceMetric<T>;
|
|
4
4
|
export declare function failedMetric<T>(reason: string): ResourceMetric<T>;
|
package/dist/rpc/inventory.js
CHANGED
|
@@ -4,14 +4,12 @@ import { InferenceCancelledError } from '../errors/index.js';
|
|
|
4
4
|
import { getEngineLogger } from '../logging/index.js';
|
|
5
5
|
import { throwIfAborted } from './network.js';
|
|
6
6
|
// Fabric RPC_PROTO_*_VERSION:
|
|
7
|
-
// https://github.com/tetherto/qvac-fabric-llm.cpp/blob/
|
|
7
|
+
// https://github.com/tetherto/qvac-fabric-llm.cpp/blob/v11259.1.0/ggml/include/ggml-rpc.h
|
|
8
8
|
// Command IDs and HELLO layouts, rpc_cmd and rpc_msg_hello_*:
|
|
9
|
-
// https://github.com/tetherto/qvac-fabric-llm.cpp/blob/
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
{ major: 109, minor: 0 }
|
|
14
|
-
];
|
|
9
|
+
// https://github.com/tetherto/qvac-fabric-llm.cpp/blob/v11259.1.0/ggml/src/ggml-rpc/ggml-rpc.cpp
|
|
10
|
+
// Native inference needs matching protocol majors, so only servers on the bundled
|
|
11
|
+
// Fabric's protocol are listed. Patch versions are compatible.
|
|
12
|
+
const SUPPORTED_VERSIONS = [{ major: 112, minor: 0 }];
|
|
15
13
|
const SUPPORTED_VERSION_LABEL = SUPPORTED_VERSIONS.map(({ major, minor }) => `${major}.${minor}.x`).join(', ');
|
|
16
14
|
const HELLO = 14;
|
|
17
15
|
const HELLO_REQUEST_SIZE = 24;
|
package/dist/runtime/env.d.ts
CHANGED
|
@@ -7,12 +7,10 @@ export declare function initEnv(): void;
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function getEnv(): {
|
|
9
9
|
HOME_DIR: string;
|
|
10
|
-
QVAC_ADVISORY_MODEL_FIT?: string | undefined;
|
|
11
10
|
};
|
|
12
11
|
/**
|
|
13
12
|
* Get the validated env config. Must call initEnv() first.
|
|
14
13
|
*/
|
|
15
14
|
export declare function getValidatedEnv(): {
|
|
16
15
|
HOME_DIR: string;
|
|
17
|
-
QVAC_ADVISORY_MODEL_FIT?: string | undefined;
|
|
18
16
|
};
|
package/dist/runtime/env.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import env from 'bare-env';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const envSchema = z.object({
|
|
4
|
-
HOME_DIR: z.string()
|
|
5
|
-
/**
|
|
6
|
-
* Operator opt-out for the advisory llama.cpp fit check (on by default).
|
|
7
|
-
* Free-form rather than an enum so a typo cannot fail engine startup; only
|
|
8
|
-
* `0`/`false`/`off`/`no` disable it.
|
|
9
|
-
*/
|
|
10
|
-
QVAC_ADVISORY_MODEL_FIT: z.string().optional()
|
|
4
|
+
HOME_DIR: z.string()
|
|
11
5
|
});
|
|
12
6
|
let validatedEnv = null;
|
|
13
7
|
/**
|
|
@@ -18,8 +12,7 @@ export function initEnv() {
|
|
|
18
12
|
// Snap's HOME can be revision-scoped; SNAP_USER_COMMON is stable.
|
|
19
13
|
env['SNAP_USER_COMMON'] ?? env['HOME'] ?? env['USERPROFILE'] ?? '/tmp';
|
|
20
14
|
let envConfig = {
|
|
21
|
-
HOME_DIR: defaultHomeDir
|
|
22
|
-
QVAC_ADVISORY_MODEL_FIT: env['QVAC_ADVISORY_MODEL_FIT']
|
|
15
|
+
HOME_DIR: defaultHomeDir
|
|
23
16
|
};
|
|
24
17
|
const isBareKit = typeof globalThis.BareKit !== 'undefined';
|
|
25
18
|
if (isBareKit && Bare.argv[0]) {
|
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 '../runtime/disposable-scope.js';
|
|
2
|
+
export type { DisposableScope } from '../runtime/disposable-scope.js';
|
|
3
|
+
export type { RequestContext, RequestKind, RequestState, RequestLogContext } from '../runtime/request-context.js';
|
|
4
|
+
export { createRequestRegistry, getRequestRegistry, withRequestContext } from '../runtime/request-context.js';
|
|
5
|
+
export type { BeginOpts, CancelByModelId, CancelByRequestId, CancelTarget, ConcurrencyPolicy, ManagedRequestContext, RequestOutcome, RequestRegistry } from '../runtime/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 '../runtime/disposable-scope.js';
|
|
2
|
+
export { createRequestRegistry, getRequestRegistry, withRequestContext } from '../runtime/request-context.js';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { closeRpcResources } from '../handlers/rpc-server.js';
|
|
2
|
-
import { initEnv } from '
|
|
2
|
+
import { initEnv } from '../runtime/env.js';
|
|
3
3
|
import { closeAllRagInstances } from '../rag/index.js';
|
|
4
|
-
import { disposeAllVectorIndexes } from '
|
|
4
|
+
import { disposeAllVectorIndexes } from '../runtime/vector-index-registry.js';
|
|
5
5
|
import { cleanupDownloads } from '../handlers/load-model/download-manager.js';
|
|
6
|
-
import { unloadAllModels } from '
|
|
7
|
-
import { closeRegistryClient } from '
|
|
8
|
-
import { clearAllLoggingStreams, startLogBuffering, stopLogBufferingWithTimeout } from '
|
|
6
|
+
import { unloadAllModels } from '../runtime/model-registry.js';
|
|
7
|
+
import { closeRegistryClient } from '../runtime/registry-client.js';
|
|
8
|
+
import { clearAllLoggingStreams, startLogBuffering, stopLogBufferingWithTimeout } from '../runtime/logging-stream-registry.js';
|
|
9
9
|
import { clearAllAddonLoggers, getEngineLogger, LOG_ID, ALL_LOG_ID } from '../logging/index.js';
|
|
10
10
|
import { clearPlugins } from '../plugins/index.js';
|
|
11
|
-
import { acquireCacheLock, releaseCacheLock } from '
|
|
11
|
+
import { acquireCacheLock, releaseCacheLock } from '../runtime/cache-lock.js';
|
|
12
12
|
import { nativeResourceCollectorDependencies } from '../resources/native.js';
|
|
13
13
|
import { destroyResourceCollector, initializeResourceCollector } from '../resources/instance.js';
|
|
14
14
|
// The host application owns the Bare runtime lifecycle: this module sets up the
|
|
@@ -62,8 +62,8 @@ async function runCleanup() {
|
|
|
62
62
|
cleanupPromise = (async () => {
|
|
63
63
|
destroyResourceCollector();
|
|
64
64
|
clearRegistries();
|
|
65
|
-
disposeAllVectorIndexes();
|
|
66
65
|
await Promise.allSettled([
|
|
66
|
+
disposeAllVectorIndexes(),
|
|
67
67
|
closeAllRagInstances(),
|
|
68
68
|
cleanupDownloads(),
|
|
69
69
|
unloadAllModels(),
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { ModelType } from '../schemas/index.js';
|
|
2
2
|
import { llmConfigSchema, embedConfigSchema } from '../schemas/llamacpp-config.js';
|
|
3
|
-
import { whisperConfigSchema, parakeetRuntimeConfigSchema } from '../schemas/transcription-config.js';
|
|
3
|
+
import { whisperConfigSchema, parakeetRuntimeConfigSchema, mossTranscribeConfigSchema } from '../schemas/transcription-config.js';
|
|
4
4
|
import { bciConfigSchema } from '../schemas/bci-config.js';
|
|
5
5
|
import { ocrConfigSchema } from '../schemas/ocr.js';
|
|
6
6
|
import { sdcppConfigSchema } from '../schemas/sdcpp-config.js';
|
|
7
7
|
import { vlaConfigSchema } from '../schemas/vla.js';
|
|
8
|
+
import { decisionConfigSchema } from '../schemas/decision.js';
|
|
9
|
+
import { rerankConfigSchema } from '../schemas/rerank.js';
|
|
8
10
|
import { classificationConfigSchema } from '../schemas/classification.js';
|
|
9
11
|
import { audioGenConfigSchema } from '../schemas/audio-gen.js';
|
|
10
12
|
export const CANONICAL_TO_ALIAS = {
|
|
11
13
|
[ModelType.llamacppCompletion]: 'llm',
|
|
12
14
|
[ModelType.llamacppEmbedding]: 'embeddings',
|
|
15
|
+
[ModelType.llamacppDecision]: 'llamacpp-decision',
|
|
16
|
+
[ModelType.llamacppRerank]: 'llamacpp-rerank',
|
|
13
17
|
[ModelType.whispercppTranscription]: 'whisper',
|
|
14
18
|
[ModelType.bciWhispercppTranscription]: 'bci',
|
|
15
19
|
[ModelType.parakeetTranscription]: 'parakeet',
|
|
20
|
+
[ModelType.mossTranscribe]: 'moss-transcribe',
|
|
16
21
|
[ModelType.nmtcppTranslation]: 'nmt',
|
|
17
22
|
[ModelType.onnxTts]: 'tts',
|
|
18
23
|
[ModelType.ttsGgml]: 'tts',
|
|
@@ -25,9 +30,12 @@ export const CANONICAL_TO_ALIAS = {
|
|
|
25
30
|
export const MODEL_CONFIG_SCHEMAS = {
|
|
26
31
|
[ModelType.llamacppCompletion]: llmConfigSchema,
|
|
27
32
|
[ModelType.llamacppEmbedding]: embedConfigSchema,
|
|
33
|
+
[ModelType.llamacppDecision]: decisionConfigSchema,
|
|
34
|
+
[ModelType.llamacppRerank]: rerankConfigSchema,
|
|
28
35
|
[ModelType.whispercppTranscription]: whisperConfigSchema,
|
|
29
36
|
[ModelType.bciWhispercppTranscription]: bciConfigSchema,
|
|
30
37
|
[ModelType.parakeetTranscription]: parakeetRuntimeConfigSchema.passthrough(),
|
|
38
|
+
[ModelType.mossTranscribe]: mossTranscribeConfigSchema,
|
|
31
39
|
[ModelType.ggmlOcr]: ocrConfigSchema,
|
|
32
40
|
[ModelType.sdcppGeneration]: sdcppConfigSchema,
|
|
33
41
|
[ModelType.audiogenGgml]: audioGenConfigSchema,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CanonicalModelType, NativeProbeFit } from '../schemas/index.js';
|
|
1
|
+
import type { CanonicalModelType, NativeProbeFit, ToolDialect } from '../schemas/index.js';
|
|
2
2
|
interface AddonInterface {
|
|
3
3
|
cancel(jobId?: string): Promise<void>;
|
|
4
4
|
}
|
|
@@ -27,6 +27,7 @@ interface LocalOptions {
|
|
|
27
27
|
modelType: CanonicalModelType;
|
|
28
28
|
name?: string | undefined;
|
|
29
29
|
fitProbe?: NativeProbeFit | undefined;
|
|
30
|
+
toolDialect?: ToolDialect | undefined;
|
|
30
31
|
}
|
|
31
32
|
export type ModelEntry = {
|
|
32
33
|
id: string;
|
|
@@ -39,6 +40,7 @@ export declare function registerModel(id: string, options: {
|
|
|
39
40
|
modelType: CanonicalModelType;
|
|
40
41
|
name?: string | undefined;
|
|
41
42
|
fitProbe?: NativeProbeFit | undefined;
|
|
43
|
+
toolDialect?: ToolDialect | undefined;
|
|
42
44
|
}): void;
|
|
43
45
|
export declare function getModelEntry(id: string): ModelEntry | null;
|
|
44
46
|
export declare function getModel(id: string): AnyModel;
|
|
@@ -16,7 +16,8 @@ export function registerModel(id, options) {
|
|
|
16
16
|
config: options.config,
|
|
17
17
|
modelType: options.modelType,
|
|
18
18
|
name: options.name,
|
|
19
|
-
fitProbe: options.fitProbe
|
|
19
|
+
fitProbe: options.fitProbe,
|
|
20
|
+
toolDialect: options.toolDialect
|
|
20
21
|
}
|
|
21
22
|
});
|
|
22
23
|
const nameStr = options.name ? ` (${options.name})` : '';
|
|
@@ -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/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 '../runtime/disposable-scope.js';
|
|
3
|
+
import { createRequestRegistry as createRegistry, type RequestRegistry } from '../runtime/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' | 'world' | 'audiogen' | 'tts' | 'ocr' | 'vla' | 'finetune' | 'loadModel' | 'downloadAsset' | 'rag' | 'rpcServer' | 'rpcDiscovery';
|
|
14
|
+
export type RequestKind = 'completion' | 'batchCompletion' | 'embeddings' | 'decision' | 'rerank' | 'transcribe' | 'translate' | 'diffusion' | 'world' | 'audiogen' | 'tts' | 'ocr' | 'vla' | 'finetune' | 'loadModel' | 'downloadAsset' | 'rag' | 'rpcServer' | 'rpcDiscovery';
|
|
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 '../runtime/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
|
|
@@ -21,6 +21,21 @@ let registry = null;
|
|
|
21
21
|
// passes an infinite cap and never enters the lane, so it stays ungated.
|
|
22
22
|
const LLAMACPP_COMPLETION_SLOT_GROUP = 'llamacppCompletion';
|
|
23
23
|
function installDefaultPolicies(r) {
|
|
24
|
+
// Laya owns one active job per model. Wait in the registry so cancelling a
|
|
25
|
+
// queued request never reaches the addon or interrupts the active job.
|
|
26
|
+
r.policy({
|
|
27
|
+
kind: 'decision',
|
|
28
|
+
maxConcurrentPerModel: 1,
|
|
29
|
+
onOverflow: 'queue',
|
|
30
|
+
maxQueueDepthPerModel: 64
|
|
31
|
+
});
|
|
32
|
+
// The reranker likewise runs one job at a time per model.
|
|
33
|
+
r.policy({
|
|
34
|
+
kind: 'rerank',
|
|
35
|
+
maxConcurrentPerModel: 1,
|
|
36
|
+
onOverflow: 'queue',
|
|
37
|
+
maxQueueDepthPerModel: 64
|
|
38
|
+
});
|
|
24
39
|
// Cap is the model's `parallel`, passed per request by the handlers; the value
|
|
25
40
|
// here is only the fallback when a caller supplies none.
|
|
26
41
|
r.policy({
|
|
@@ -82,6 +97,12 @@ function installDefaultPolicies(r) {
|
|
|
82
97
|
onOverflow: 'queue',
|
|
83
98
|
maxQueueDepthPerModel: 256
|
|
84
99
|
});
|
|
100
|
+
// Diffusion has one native job per model and model-wide cancellation.
|
|
101
|
+
r.policy({
|
|
102
|
+
kind: 'diffusion',
|
|
103
|
+
maxConcurrentPerModel: 1,
|
|
104
|
+
onOverflow: 'reject'
|
|
105
|
+
});
|
|
85
106
|
// An ABot-World session runs one job at a time: the addon rejects a second
|
|
86
107
|
// step while a block is still streaming, and scene creation shares the same
|
|
87
108
|
// lane. Reject rather than queue, unlike every other policy here, because a
|
|
@@ -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 '../runtime/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 '../runtime/disposable-scope.js';
|
|
3
3
|
import { RequestIdConflictError, RequestRejectedByPolicyError } from '../errors/index.js';
|
|
4
4
|
import { getEngineLogger } from '../logging/index.js';
|
|
5
5
|
/**
|
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 '../runtime/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 '../runtime/model-config-utils.js';
|
|
7
|
+
import { BUILTIN_DEVICE_PATTERNS, resolveModelConfigWithContext } from '../runtime/model-config-utils.js';
|
|
8
8
|
const logger = getEngineLogger();
|
|
9
9
|
// ============================================
|
|
10
10
|
// Global configuration
|
|
@@ -17,6 +17,7 @@ const configRegistry = {
|
|
|
17
17
|
httpDownloadConcurrency: undefined,
|
|
18
18
|
requireHttpChecksum: undefined,
|
|
19
19
|
requireSecureTransport: undefined,
|
|
20
|
+
modelFitPolicy: undefined,
|
|
20
21
|
registryDownloadMaxRetries: undefined,
|
|
21
22
|
registryStreamTimeoutMs: undefined,
|
|
22
23
|
fitStubBudgetMs: undefined,
|
|
@@ -80,6 +81,10 @@ export function setConfig(config) {
|
|
|
80
81
|
configRegistry.requireSecureTransport = config.requireSecureTransport;
|
|
81
82
|
logger.info(`Require secure transport: ${config.requireSecureTransport}`);
|
|
82
83
|
}
|
|
84
|
+
if (config.modelFitPolicy !== undefined && config.modelFitPolicy !== null) {
|
|
85
|
+
configRegistry.modelFitPolicy = config.modelFitPolicy;
|
|
86
|
+
logger.info(`Model fit policy: ${config.modelFitPolicy}`);
|
|
87
|
+
}
|
|
83
88
|
if (config.registryDownloadMaxRetries !== undefined &&
|
|
84
89
|
config.registryDownloadMaxRetries !== null) {
|
|
85
90
|
configRegistry.registryDownloadMaxRetries = config.registryDownloadMaxRetries;
|
|
@@ -20,6 +20,6 @@ export interface OpenVectorIndex {
|
|
|
20
20
|
dispose(): void;
|
|
21
21
|
}
|
|
22
22
|
export interface VectorIndexBackend {
|
|
23
|
-
create(dim: number, storage: VectorIndexStorage): OpenVectorIndex
|
|
24
|
-
load(path: string): OpenVectorIndex
|
|
23
|
+
create(dim: number, storage: VectorIndexStorage): OpenVectorIndex | Promise<OpenVectorIndex>;
|
|
24
|
+
load(path: string): OpenVectorIndex | Promise<OpenVectorIndex>;
|
|
25
25
|
}
|
|
@@ -9,20 +9,20 @@ export declare function resolveVectorIndexPath(snapshotPath: string): string;
|
|
|
9
9
|
export declare function createVectorIndex(params: {
|
|
10
10
|
dim: number;
|
|
11
11
|
storage: VectorIndexStorage;
|
|
12
|
-
}): {
|
|
12
|
+
}): Promise<{
|
|
13
13
|
indexId: string;
|
|
14
14
|
dim: number;
|
|
15
15
|
storage: VectorIndexStorage;
|
|
16
16
|
length: number;
|
|
17
|
-
}
|
|
17
|
+
}>;
|
|
18
18
|
export declare function loadVectorIndex(params: {
|
|
19
19
|
path: string;
|
|
20
|
-
}): {
|
|
20
|
+
}): Promise<{
|
|
21
21
|
storage?: VectorIndexStorage;
|
|
22
22
|
indexId: string;
|
|
23
23
|
dim: number;
|
|
24
24
|
length: number;
|
|
25
|
-
}
|
|
25
|
+
}>;
|
|
26
26
|
export declare function addVectors(params: {
|
|
27
27
|
indexId: string;
|
|
28
28
|
ids: VectorIdWire[];
|
|
@@ -73,4 +73,4 @@ export declare function disposeVectorIndex(params: {
|
|
|
73
73
|
disposed: boolean;
|
|
74
74
|
};
|
|
75
75
|
export declare function getOpenVectorIndexCount(): number;
|
|
76
|
-
export declare function disposeAllVectorIndexes(): void
|
|
76
|
+
export declare function disposeAllVectorIndexes(): Promise<void>;
|
|
@@ -2,14 +2,15 @@ import { promises as fsPromises } from 'bare-fs';
|
|
|
2
2
|
import path from 'bare-path';
|
|
3
3
|
import { QvacErrorBase } from '@qvac/error';
|
|
4
4
|
import { getTurboVecBackend } from '../plugins/turbovec-backend.js';
|
|
5
|
-
import { getConfiguredCacheDir } from '
|
|
6
|
-
import { generateRandomRequestId } from '
|
|
5
|
+
import { getConfiguredCacheDir } from '../runtime/state.js';
|
|
6
|
+
import { generateRandomRequestId } from '../runtime/request-id.js';
|
|
7
7
|
import { getEngineLogger } from '../logging/index.js';
|
|
8
8
|
import { VectorIndexFailedError, VectorIndexInvalidVectorsError, VectorIndexNotFoundError, VectorIndexProviderUnavailableError } from '../errors/index.js';
|
|
9
9
|
// Worker-side bookkeeping for open indexes: ids, wire-to-native conversion,
|
|
10
10
|
// row validation, snapshot paths, and lifetime. Engine behaviour lives in
|
|
11
11
|
// the backend.
|
|
12
12
|
const indexes = new Map();
|
|
13
|
+
const pendingIndexes = new Set();
|
|
13
14
|
function requireBackend() {
|
|
14
15
|
const backend = getTurboVecBackend();
|
|
15
16
|
if (!backend)
|
|
@@ -31,10 +32,33 @@ function runBackend(action, describe) {
|
|
|
31
32
|
return action();
|
|
32
33
|
}
|
|
33
34
|
catch (error) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
failBackend(error, describe);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function failBackend(error, describe) {
|
|
39
|
+
if (error instanceof QvacErrorBase)
|
|
40
|
+
throw error;
|
|
41
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
42
|
+
throw new VectorIndexFailedError(describe ? describe(detail) : detail, error);
|
|
43
|
+
}
|
|
44
|
+
// Keep pending opens reachable by shutdown until their indexes are registered.
|
|
45
|
+
async function openVectorIndex(action) {
|
|
46
|
+
const opening = (async () => {
|
|
47
|
+
try {
|
|
48
|
+
return await action();
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
failBackend(error);
|
|
52
|
+
}
|
|
53
|
+
})();
|
|
54
|
+
pendingIndexes.add(opening);
|
|
55
|
+
try {
|
|
56
|
+
const index = await opening;
|
|
57
|
+
const indexId = track(index);
|
|
58
|
+
return { index, indexId };
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
pendingIndexes.delete(opening);
|
|
38
62
|
}
|
|
39
63
|
}
|
|
40
64
|
/**
|
|
@@ -66,16 +90,14 @@ function track(index) {
|
|
|
66
90
|
indexes.set(indexId, index);
|
|
67
91
|
return indexId;
|
|
68
92
|
}
|
|
69
|
-
export function createVectorIndex(params) {
|
|
93
|
+
export async function createVectorIndex(params) {
|
|
70
94
|
const backend = requireBackend();
|
|
71
|
-
const index =
|
|
72
|
-
const indexId = track(index);
|
|
95
|
+
const { index, indexId } = await openVectorIndex(() => backend.create(params.dim, params.storage));
|
|
73
96
|
return { indexId, dim: index.dim, storage: params.storage, length: index.length };
|
|
74
97
|
}
|
|
75
|
-
export function loadVectorIndex(params) {
|
|
98
|
+
export async function loadVectorIndex(params) {
|
|
76
99
|
const backend = requireBackend();
|
|
77
|
-
const index =
|
|
78
|
-
const indexId = track(index);
|
|
100
|
+
const { index, indexId } = await openVectorIndex(() => backend.load(resolveVectorIndexPath(params.path)));
|
|
79
101
|
return {
|
|
80
102
|
indexId,
|
|
81
103
|
dim: index.dim,
|
|
@@ -148,7 +170,8 @@ export function disposeVectorIndex(params) {
|
|
|
148
170
|
export function getOpenVectorIndexCount() {
|
|
149
171
|
return indexes.size;
|
|
150
172
|
}
|
|
151
|
-
export function disposeAllVectorIndexes() {
|
|
173
|
+
export async function disposeAllVectorIndexes() {
|
|
174
|
+
await Promise.allSettled(pendingIndexes);
|
|
152
175
|
for (const [indexId, index] of indexes) {
|
|
153
176
|
try {
|
|
154
177
|
index.dispose();
|