@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,10 +1,10 @@
|
|
|
1
1
|
import ASRGgml from '@qvac/asr-ggml';
|
|
2
2
|
import { definePlugin, defineHandler, defineDuplexHandler, transcribeRequestSchema, transcribeResponseSchema, transcribeStreamRequestSchema, transcribeStreamResponseSchema, ModelType, whisperConfigSchema, ADDON_ASR } from '../../../schemas/index.js';
|
|
3
|
-
import { transcribe, transcribeStream } from '
|
|
3
|
+
import { transcribe, transcribeStream } from '../../../plugins/ops/transcribe.js';
|
|
4
4
|
import { attachModelExecutionMs } from '../../../profiling/model-execution.js';
|
|
5
5
|
import { attachBackendDiagnostics } from '../../../profiling/backend-diagnostics.js';
|
|
6
|
-
import { buildWhisperEngineConfig } from '
|
|
7
|
-
import { createAsrModelLogger } from '
|
|
6
|
+
import { buildWhisperEngineConfig } from '../../../plugins/builtin/asr-ggml/config.js';
|
|
7
|
+
import { createAsrModelLogger } from '../../../plugins/builtin/asr-ggml/logging.js';
|
|
8
8
|
function createWhisperModel(modelId, modelPath, whisperConfig, vadModelPath) {
|
|
9
9
|
const logger = createAsrModelLogger(modelId, ModelType.whispercppTranscription);
|
|
10
10
|
const model = new ASRGgml({
|
|
@@ -55,12 +55,16 @@ export const whisperPlugin = definePlugin({
|
|
|
55
55
|
modelId: request.modelId,
|
|
56
56
|
audioChunk: request.audioChunk,
|
|
57
57
|
prompt: request.prompt,
|
|
58
|
+
hotwords: request.hotwords,
|
|
59
|
+
maxNewTokens: request.maxNewTokens,
|
|
58
60
|
metadata: true
|
|
59
61
|
}, request.requestId)
|
|
60
62
|
: transcribe({
|
|
61
63
|
modelId: request.modelId,
|
|
62
64
|
audioChunk: request.audioChunk,
|
|
63
|
-
prompt: request.prompt
|
|
65
|
+
prompt: request.prompt,
|
|
66
|
+
hotwords: request.hotwords,
|
|
67
|
+
maxNewTokens: request.maxNewTokens
|
|
64
68
|
}, request.requestId);
|
|
65
69
|
try {
|
|
66
70
|
let result = await stream.next();
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as hostApi from '../api/index.js';
|
|
2
2
|
import type { QvacPlugin } from '../schemas/plugin.js';
|
|
3
|
-
export { registerPlugin, registerPlugins, ensureAddonLoggerReady, getPlugin, getPluginHandler, getTurboVecIndexProvider, hasPlugin, getAllPlugins, clearPlugins, unregisterPlugin } from '
|
|
3
|
+
export { registerPlugin, registerPlugins, ensureAddonLoggerReady, getPlugin, getPluginHandler, getTurboVecIndexProvider, hasPlugin, getAllPlugins, clearPlugins, unregisterPlugin } from '../plugins/registry.js';
|
|
4
4
|
/**
|
|
5
5
|
* Register a set of plugins and return the host API bound to them. The
|
|
6
6
|
* ergonomic entry point for assembling an explicit plugin subset — we ship
|
package/dist/plugins/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { registerPlugins } from '
|
|
1
|
+
import { registerPlugins } from '../plugins/registry.js';
|
|
2
2
|
import * as hostApi from '../api/index.js';
|
|
3
|
-
export { registerPlugin, registerPlugins, ensureAddonLoggerReady, getPlugin, getPluginHandler, getTurboVecIndexProvider, hasPlugin, getAllPlugins, clearPlugins, unregisterPlugin } from '
|
|
3
|
+
export { registerPlugin, registerPlugins, ensureAddonLoggerReady, getPlugin, getPluginHandler, getTurboVecIndexProvider, hasPlugin, getAllPlugins, clearPlugins, unregisterPlugin } from '../plugins/registry.js';
|
|
4
4
|
/**
|
|
5
5
|
* Register a set of plugins and return the host API bound to them. The
|
|
6
6
|
* ergonomic entry point for assembling an explicit plugin subset — we ship
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { type CacheMessage } from '../../utils/index.js';
|
|
2
|
+
import type { Tool } from '../../schemas/tools.js';
|
|
2
3
|
export declare function extractSystemPrompt(messages: CacheMessage[]): string | null;
|
|
3
|
-
export declare function generateConfigHash(systemPrompt: string | null
|
|
4
|
-
export declare function generateCacheKey(messages: CacheMessage[]): string;
|
|
4
|
+
export declare function generateConfigHash(systemPrompt: string | null): string;
|
|
5
|
+
export declare function generateCacheKey(messages: CacheMessage[], tools?: readonly Tool[]): string;
|
|
5
6
|
export declare function getCacheFilePath(modelId: string, configHash: string, cacheKey: string): Promise<string>;
|
|
6
|
-
export declare function findMatchingCache(modelId: string, configHash: string, currentHistory: CacheMessage[]): Promise<{
|
|
7
|
+
export declare function findMatchingCache(modelId: string, configHash: string, currentHistory: CacheMessage[], tools?: readonly Tool[]): Promise<{
|
|
7
8
|
cacheKey: string;
|
|
8
9
|
cachePath: string;
|
|
9
10
|
} | null>;
|
|
10
|
-
export declare function getCurrentCacheInfo(modelId: string, configHash: string, currentHistory: CacheMessage[]): Promise<{
|
|
11
|
+
export declare function getCurrentCacheInfo(modelId: string, configHash: string, currentHistory: CacheMessage[], tools?: readonly Tool[]): Promise<{
|
|
11
12
|
cacheKey: string;
|
|
12
13
|
cachePath: string;
|
|
13
14
|
}>;
|
|
@@ -5,43 +5,33 @@ import { getAutoCacheLookupHistory, getKVCacheDir, validateAndJoinPath } from '.
|
|
|
5
5
|
import { getEngineLogger } from '../../logging/index.js';
|
|
6
6
|
import { PathTraversalError } from '../../errors/index.js';
|
|
7
7
|
import { Buffer } from 'bare-buffer';
|
|
8
|
-
import { markAutoCacheKey } from '
|
|
8
|
+
import { markAutoCacheKey } from '../../plugins/ops/kv-cache-retention.js';
|
|
9
9
|
const logger = getEngineLogger();
|
|
10
|
-
// In-memory KV-cache state lives in `KvCacheSession
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
// in-memory state.
|
|
10
|
+
// In-memory KV-cache state lives in `KvCacheSession`, its single mutation
|
|
11
|
+
// point. This module keeps only the pure path / hash utilities that don't
|
|
12
|
+
// touch in-memory state.
|
|
14
13
|
export function extractSystemPrompt(messages) {
|
|
15
14
|
const systemMessage = messages.find((msg) => msg.role === 'system');
|
|
16
15
|
return systemMessage ? systemMessage.content : null;
|
|
17
16
|
}
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
// that is the order sent to the model.
|
|
25
|
-
function canonicalizeHashInput(value) {
|
|
26
|
-
if (Array.isArray(value))
|
|
27
|
-
return value.map(canonicalizeHashInput);
|
|
28
|
-
if (typeof value !== 'object' || value === null)
|
|
29
|
-
return value;
|
|
30
|
-
const canonical = {};
|
|
31
|
-
for (const key of Object.keys(value).sort()) {
|
|
32
|
-
canonical[key] = canonicalizeHashInput(value[key]);
|
|
33
|
-
}
|
|
34
|
-
return canonical;
|
|
35
|
-
}
|
|
36
|
-
export function generateConfigHash(systemPrompt, tools) {
|
|
17
|
+
// Names the cache file by system prompt only. Tools stay out on purpose: the
|
|
18
|
+
// addon compares the rendered prompt against the tokens the file holds, so a
|
|
19
|
+
// changed tool set on the same key must reach the same file to be trimmed there.
|
|
20
|
+
// The empty `tools` keeps the path earlier releases gave a tool-less cache, so
|
|
21
|
+
// an upgrade overwrites those files instead of orphaning them.
|
|
22
|
+
export function generateConfigHash(systemPrompt) {
|
|
37
23
|
const hash = crypto.createHash('sha-256');
|
|
38
|
-
|
|
39
|
-
hash.update(Buffer.from(canonicalConfig, 'utf8'));
|
|
24
|
+
hash.update(Buffer.from(JSON.stringify({ systemPrompt, tools: [] }), 'utf8'));
|
|
40
25
|
return hash.digest('hex').substring(0, 16);
|
|
41
26
|
}
|
|
42
|
-
export function generateCacheKey(messages) {
|
|
27
|
+
export function generateCacheKey(messages, tools) {
|
|
43
28
|
const hash = crypto.createHash('sha-256');
|
|
44
|
-
|
|
29
|
+
// Before the first assistant reply, the rendered tools are part of the
|
|
30
|
+
// reusable prefix. Keep those primes isolated; established conversations
|
|
31
|
+
// retain history-only keys so the addon can trim a changed tool block.
|
|
32
|
+
const historyString = JSON.stringify(tools?.length && !messages.some((message) => message.role === 'assistant')
|
|
33
|
+
? { messages, tools }
|
|
34
|
+
: messages);
|
|
45
35
|
const historyBuffer = Buffer.from(historyString, 'utf8');
|
|
46
36
|
hash.update(historyBuffer);
|
|
47
37
|
const hashString = hash.digest('hex');
|
|
@@ -65,12 +55,14 @@ export async function getCacheFilePath(modelId, configHash, cacheKey) {
|
|
|
65
55
|
return cachePath;
|
|
66
56
|
}
|
|
67
57
|
// Used for auto-generated cache key
|
|
68
|
-
export async function findMatchingCache(modelId, configHash, currentHistory) {
|
|
69
|
-
if (currentHistory.length
|
|
58
|
+
export async function findMatchingCache(modelId, configHash, currentHistory, tools) {
|
|
59
|
+
if (currentHistory.length === 0) {
|
|
70
60
|
return null;
|
|
71
61
|
}
|
|
72
62
|
const previousHistory = getAutoCacheLookupHistory(currentHistory);
|
|
73
|
-
|
|
63
|
+
if (previousHistory.length === 0 && !tools?.length)
|
|
64
|
+
return null;
|
|
65
|
+
const cacheKey = generateCacheKey(previousHistory, tools);
|
|
74
66
|
const cachePath = resolveCacheFilePath(modelId, configHash, cacheKey);
|
|
75
67
|
try {
|
|
76
68
|
await fsPromises.access(cachePath);
|
|
@@ -81,8 +73,8 @@ export async function findMatchingCache(modelId, configHash, currentHistory) {
|
|
|
81
73
|
return null;
|
|
82
74
|
}
|
|
83
75
|
}
|
|
84
|
-
export async function getCurrentCacheInfo(modelId, configHash, currentHistory) {
|
|
85
|
-
const cacheKey = generateCacheKey(currentHistory);
|
|
76
|
+
export async function getCurrentCacheInfo(modelId, configHash, currentHistory, tools) {
|
|
77
|
+
const cacheKey = generateCacheKey(currentHistory, tools);
|
|
86
78
|
await markAutoCacheKey(cacheKey);
|
|
87
79
|
const cachePath = await getCacheFilePath(modelId, configHash, cacheKey);
|
|
88
80
|
return { cacheKey, cachePath };
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import type { AbortSignal } from 'bare-abort-controller';
|
|
1
2
|
import { type LoadModelServerParams } from '../../schemas/index.js';
|
|
2
3
|
import type { LoadTimingStats } from '../../profiling/types.js';
|
|
3
4
|
export interface LoadModelResult {
|
|
4
5
|
timing?: LoadTimingStats;
|
|
5
6
|
}
|
|
6
|
-
export
|
|
7
|
+
export interface LoadModelOptions {
|
|
7
8
|
collectTiming?: boolean;
|
|
8
|
-
|
|
9
|
+
request?: {
|
|
10
|
+
signal: AbortSignal;
|
|
11
|
+
requestId: string;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare function loadModel(params: LoadModelServerParams, options?: LoadModelOptions): Promise<LoadModelResult>;
|
|
@@ -4,16 +4,19 @@ import { forwardBackendDiagnostics } from '../../profiling/backend-diagnostics.j
|
|
|
4
4
|
import { isModelLoaded, registerModel } from '../../runtime/model-registry.js';
|
|
5
5
|
import { startLogBuffering, stopLogBufferingWithTimeout } from '../../runtime/logging-stream-registry.js';
|
|
6
6
|
import { detectShardedModel, generateShardFilenames, validateShardedModelCache } from '../../utils/index.js';
|
|
7
|
-
import { PluginNotFoundError, ModelFileNotFoundError, ModelFileNotFoundInDirError, ModelFileLocateFailedError } from '../../errors/index.js';
|
|
8
|
-
import { ensureAddonLoggerReady, getPlugin } from '
|
|
9
|
-
import { runAdvisoryFitCheck } from '../../
|
|
7
|
+
import { PluginNotFoundError, ModelFileNotFoundError, ModelFileNotFoundInDirError, ModelFileLocateFailedError, ModelFitRefusedError, InferenceCancelledError } from '../../errors/index.js';
|
|
8
|
+
import { ensureAddonLoggerReady, getPlugin } from '../../plugins/index.js';
|
|
9
|
+
import { runAdvisoryFitCheck } from '../../model-fit/load-check.js';
|
|
10
|
+
import { refusesLoad, resolveModelFitPolicy, runsProbe } from '../../schemas/model-fit-policy.js';
|
|
11
|
+
import { getConfig } from '../../runtime/state.js';
|
|
12
|
+
import { resolveToolDialect } from '../../utils/tools/dialect.js';
|
|
10
13
|
import { promises as fsPromises } from 'bare-fs';
|
|
11
14
|
import path from 'bare-path';
|
|
12
15
|
import { getEngineLogger } from '../../logging/index.js';
|
|
13
16
|
const logger = getEngineLogger();
|
|
14
17
|
export async function loadModel(params, options) {
|
|
15
18
|
const { modelId, modelPath, options: modelOptions, artifacts, modelName } = loadModelServerParamsSchema.parse(params);
|
|
16
|
-
const { modelConfig, modelType: rawModelType } = modelOptions;
|
|
19
|
+
const { modelConfig, modelType: rawModelType, modelFitPolicy } = modelOptions;
|
|
17
20
|
// Normalize modelType to canonical form (handles aliases and custom types)
|
|
18
21
|
const modelType = normalizeModelType(rawModelType);
|
|
19
22
|
// Check if model is already loaded
|
|
@@ -53,20 +56,27 @@ export async function loadModel(params, options) {
|
|
|
53
56
|
throw new ModelFileLocateFailedError(modelType, modelPath, error);
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
59
|
+
// Runs after config resolution and path validation so it sees the same state
|
|
60
|
+
// the real load uses, and before `createModel()` so it never competes with
|
|
61
|
+
// the native load for device memory.
|
|
62
|
+
const fitPolicy = resolveModelFitPolicy(modelFitPolicy, getConfig().modelFitPolicy);
|
|
63
|
+
const request = options?.request;
|
|
64
|
+
const fitProbe = runsProbe(fitPolicy)
|
|
65
|
+
? await runAdvisoryFitCheck({
|
|
66
|
+
modelId,
|
|
67
|
+
modelType: modelType,
|
|
68
|
+
modelPath,
|
|
69
|
+
modelConfig,
|
|
70
|
+
artifacts,
|
|
71
|
+
isShardedModel
|
|
72
|
+
}, request !== undefined ? { signal: request.signal } : {})
|
|
73
|
+
: undefined;
|
|
74
|
+
if (request?.signal.aborted === true) {
|
|
75
|
+
throw new InferenceCancelledError(request.requestId);
|
|
76
|
+
}
|
|
77
|
+
if (refusesLoad(fitPolicy, fitProbe?.verdict)) {
|
|
78
|
+
throw new ModelFitRefusedError(modelType, fitProbe.reason, fitProbe.message);
|
|
79
|
+
}
|
|
70
80
|
// Load the addon's logger before the addon itself runs. Plugins that defer
|
|
71
81
|
// their logging module do so to keep registration free of native loads, so
|
|
72
82
|
// this is the first point their addon is genuinely required.
|
|
@@ -85,13 +95,17 @@ export async function loadModel(params, options) {
|
|
|
85
95
|
await result.model.load(false);
|
|
86
96
|
const modelInitializationTimeMs = options?.collectTiming ? nowMs() - initStart : undefined;
|
|
87
97
|
logger.info(`${modelType} model ${modelId} loaded`);
|
|
98
|
+
const toolDialect = 'completionStream' in plugin.handlers
|
|
99
|
+
? await resolveToolDialect(modelName, modelPath)
|
|
100
|
+
: undefined;
|
|
88
101
|
registerModel(modelId, {
|
|
89
102
|
model: result.model,
|
|
90
103
|
path: modelPath,
|
|
91
104
|
config: modelConfig,
|
|
92
105
|
modelType: modelType,
|
|
93
106
|
name: modelName,
|
|
94
|
-
fitProbe
|
|
107
|
+
fitProbe,
|
|
108
|
+
toolDialect
|
|
95
109
|
});
|
|
96
110
|
const loadResult = modelInitializationTimeMs !== undefined ? { timing: { modelInitializationTimeMs } } : {};
|
|
97
111
|
return forwardBackendDiagnostics(loadResult, result);
|
|
@@ -62,7 +62,7 @@ import { assertMetadataSupported, toTranscribeSegment } from '../../utils/transc
|
|
|
62
62
|
import { getRequestRegistry, withRequestContext } from '../../runtime/index.js';
|
|
63
63
|
import { generateRandomRequestId } from '../../runtime/request-id.js';
|
|
64
64
|
import { isEndOfTurnEvent, isVadEvent, toEndOfTurnEvent, toVadStateEvent } from '../../utils/asr-events.js';
|
|
65
|
-
import { buildWhisperReloadConfig } from '
|
|
65
|
+
import { buildWhisperReloadConfig } from '../../plugins/builtin/asr-ggml/config.js';
|
|
66
66
|
export { assertMetadataSupported, toTranscribeSegment };
|
|
67
67
|
function hasRunStreaming(model) {
|
|
68
68
|
return 'runStreaming' in model && typeof model.runStreaming === 'function';
|
|
@@ -191,6 +191,15 @@ export async function* transcribe(params, requestId) {
|
|
|
191
191
|
}), true);
|
|
192
192
|
const requestLogger = withRequestContext(getEngineLogger(), ctx);
|
|
193
193
|
const engineType = getEngineModelType(modelId);
|
|
194
|
+
const hasMossOptions = params.hotwords !== undefined || params.maxNewTokens !== undefined;
|
|
195
|
+
if (engineType !== ModelType.mossTranscribe && hasMossOptions) {
|
|
196
|
+
throw new TranscriptionFailedError('hotwords and maxNewTokens require a MOSS-Transcribe-Diarize model');
|
|
197
|
+
}
|
|
198
|
+
if (engineType === ModelType.mossTranscribe &&
|
|
199
|
+
params.prompt !== undefined &&
|
|
200
|
+
params.hotwords?.length) {
|
|
201
|
+
throw new TranscriptionFailedError('MOSS prompt cannot be combined with hotwords');
|
|
202
|
+
}
|
|
194
203
|
assertMetadataSupported(modelId, engineType, metadata);
|
|
195
204
|
const silenceMarker = SILENCE_MARKERS[engineType] ?? '';
|
|
196
205
|
const audioFormat = getAudioFormat(modelId, engineType);
|
|
@@ -224,7 +233,14 @@ export async function* transcribe(params, requestId) {
|
|
|
224
233
|
});
|
|
225
234
|
const audioStream = await createAudioStream(params.audioChunk, audioFormat);
|
|
226
235
|
const modelStart = nowMs();
|
|
227
|
-
const
|
|
236
|
+
const runOptions = engineType === ModelType.mossTranscribe
|
|
237
|
+
? {
|
|
238
|
+
...(params.prompt !== undefined && { prompt: params.prompt }),
|
|
239
|
+
...(params.hotwords !== undefined && { hotwords: params.hotwords }),
|
|
240
|
+
...(params.maxNewTokens !== undefined && { maxNewTokens: params.maxNewTokens })
|
|
241
|
+
}
|
|
242
|
+
: undefined;
|
|
243
|
+
const response = (await model.run(audioStream, runOptions));
|
|
228
244
|
for await (const output of response.iterate()) {
|
|
229
245
|
if (ctx.signal.aborted)
|
|
230
246
|
break;
|
|
@@ -55,14 +55,14 @@ import { translateServerParamsSchema, normalizeModelType, ModelType, AFRICAN_LAN
|
|
|
55
55
|
import { getLangName, detectOne } from '@qvac/langdetect-text';
|
|
56
56
|
import { nowMs } from '../../profiling/index.js';
|
|
57
57
|
import { buildStreamResult } from '../../profiling/model-execution.js';
|
|
58
|
-
import { buildNmtTranslationStats, markNmtCountersStale } from '
|
|
58
|
+
import { buildNmtTranslationStats, markNmtCountersStale } from '../../plugins/ops/translate-stats.js';
|
|
59
59
|
import { ModelNotFoundError, ModelTypeMismatchError, TranslationFailedError } from '../../errors/index.js';
|
|
60
60
|
import { getRequestRegistry, withRequestContext } from '../../runtime/index.js';
|
|
61
|
-
import { isAddonContextOverflowError } from '
|
|
61
|
+
import { isAddonContextOverflowError } from '../../plugins/builtin/llamacpp-completion/ops/context-overflow.js';
|
|
62
62
|
import { generateRandomRequestId } from '../../runtime/request-id.js';
|
|
63
63
|
import { getModelParallel } from '../../utils/config-transform.js';
|
|
64
64
|
import { getEngineLogger } from '../../logging/index.js';
|
|
65
|
-
import { isTranslatePsyModel, buildTranslatePsyMessages, TRANSLATEPSY_GENERATION_PARAMS } from '
|
|
65
|
+
import { isTranslatePsyModel, buildTranslatePsyMessages, TRANSLATEPSY_GENERATION_PARAMS } from '../../plugins/ops/translatepsy-utils.js';
|
|
66
66
|
const AFRICAN_LANGUAGE_ALIASES = new Map([
|
|
67
67
|
['af', 'afr_Latn'],
|
|
68
68
|
['sw', 'swh_Latn'],
|
|
@@ -3,7 +3,7 @@ import path from 'bare-path';
|
|
|
3
3
|
import { unregisterModel } from '../../runtime/model-registry.js';
|
|
4
4
|
import { getRequestRegistry } from '../../runtime/index.js';
|
|
5
5
|
import { unregisterAllLoggingStreams } from '../../runtime/logging-stream-registry.js';
|
|
6
|
-
import { clearFinetuneRuntimeState } from '
|
|
6
|
+
import { clearFinetuneRuntimeState } from '../../plugins/builtin/llamacpp-completion/ops/finetune.js';
|
|
7
7
|
import { unregisterAddonLogger, getEngineLogger } from '../../logging/index.js';
|
|
8
8
|
import { unloadModelParamsSchema } from '../../schemas/index.js';
|
|
9
9
|
import { ModelNotLoadedError } from '../../errors/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getTurboVecIndexProvider } from '
|
|
1
|
+
import { getTurboVecIndexProvider } from '../plugins/registry.js';
|
|
2
2
|
import { VECTOR_ID_RESERVED, VectorIndexStorage } from '../schemas/index.js';
|
|
3
3
|
// The native index pads short result rows with UINT64_MAX.
|
|
4
4
|
const PADDING_ID = BigInt(VECTOR_ID_RESERVED);
|
|
@@ -88,11 +88,11 @@ export function getTurboVecBackend() {
|
|
|
88
88
|
if (!provider)
|
|
89
89
|
return undefined;
|
|
90
90
|
return {
|
|
91
|
-
create(dim, storage) {
|
|
92
|
-
return openIndex(provider.create({ dim, storage }), storage);
|
|
91
|
+
async create(dim, storage) {
|
|
92
|
+
return openIndex(await provider.create({ dim, storage }), storage);
|
|
93
93
|
},
|
|
94
|
-
load(path) {
|
|
95
|
-
const index = provider.load(path);
|
|
94
|
+
async load(path) {
|
|
95
|
+
const index = await provider.load(path);
|
|
96
96
|
return openIndex(index, storageFromBitWidth(index.bitWidth));
|
|
97
97
|
}
|
|
98
98
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Accumulates profiling statistics and maintains a bounded buffer of recent events.
|
|
3
3
|
* Uses a ring buffer for O(1) event insertion.
|
|
4
4
|
*/
|
|
5
|
-
import type { ProfilingEvent, AggregatedStats } from '
|
|
5
|
+
import type { ProfilingEvent, AggregatedStats } from '../profiling/types.js';
|
|
6
6
|
export declare function createAggregator(maxRecentEvents?: number): void;
|
|
7
7
|
export declare function recordEvent(event: ProfilingEvent, storeInBuffer?: boolean): void;
|
|
8
8
|
export declare function getAggregates(): Record<string, AggregatedStats>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Uses a ring buffer for O(1) event insertion.
|
|
4
4
|
*/
|
|
5
5
|
import { getGlobalSingleton } from '../utils/global-singleton.js';
|
|
6
|
-
import { createRingBuffer, ringBufferPush, ringBufferToArray, ringBufferClear, ringBufferResize, ringBufferDroppedCount } from '
|
|
6
|
+
import { createRingBuffer, ringBufferPush, ringBufferToArray, ringBufferClear, ringBufferResize, ringBufferDroppedCount } from '../profiling/ring-buffer.js';
|
|
7
7
|
const DEFAULT_MAX_RECENT_EVENTS = 1000;
|
|
8
8
|
const AGGREGATOR_STATE_KEY = Symbol.for('@qvac/inference:profiler-aggregator-state');
|
|
9
9
|
function getAggregatorState() {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* 3. Disabled default
|
|
8
8
|
*/
|
|
9
9
|
import type { ProfilerMode, PerCallProfiling } from '../schemas/index.js';
|
|
10
|
-
import type { ProfilerRuntimeOptions, ProfilingEvent, AggregatedStats } from '
|
|
10
|
+
import type { ProfilerRuntimeOptions, ProfilingEvent, AggregatedStats } from '../profiling/types.js';
|
|
11
11
|
export interface ResolvedProfilerConfig {
|
|
12
12
|
enabled: boolean;
|
|
13
13
|
mode: ProfilerMode;
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* 3. Disabled default
|
|
8
8
|
*/
|
|
9
9
|
import { getGlobalSingleton } from '../utils/global-singleton.js';
|
|
10
|
-
import { createAggregator, recordEvent as aggregatorRecord, getAggregates as aggregatorGetAggregates, getRecentEvents as aggregatorGetRecentEvents, clearAggregator, setMaxRecentEvents } from '
|
|
11
|
-
import { nowMs, generateProfileId } from '
|
|
10
|
+
import { createAggregator, recordEvent as aggregatorRecord, getAggregates as aggregatorGetAggregates, getRecentEvents as aggregatorGetRecentEvents, clearAggregator, setMaxRecentEvents } from '../profiling/aggregator.js';
|
|
11
|
+
import { nowMs, generateProfileId } from '../profiling/clock.js';
|
|
12
12
|
const DEFAULT_CONFIG = {
|
|
13
13
|
enabled: false,
|
|
14
14
|
mode: 'summary',
|
package/dist/profiling/events.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { nowMs } from '
|
|
2
|
-
import { record } from '
|
|
1
|
+
import { nowMs } from '../profiling/clock.js';
|
|
2
|
+
import { record } from '../profiling/controller.js';
|
|
3
3
|
export function recordPhase(base, phase, ms, extra) {
|
|
4
4
|
if (ms === undefined)
|
|
5
5
|
return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* JSON, table, and summary export utilities for profiling data.
|
|
3
3
|
*/
|
|
4
|
-
import type { ProfilerExport } from '
|
|
4
|
+
import type { ProfilerExport } from '../profiling/types.js';
|
|
5
5
|
export declare function exportJSON(options?: {
|
|
6
6
|
includeRecentEvents?: boolean;
|
|
7
7
|
}): ProfilerExport;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* JSON, table, and summary export utilities for profiling data.
|
|
3
3
|
*/
|
|
4
|
-
import { getEffectiveConfig, getAggregates, getRecentEvents } from '
|
|
5
|
-
import { getDroppedCount, getEventCount } from '
|
|
6
|
-
import { nowMs } from '
|
|
4
|
+
import { getEffectiveConfig, getAggregates, getRecentEvents } from '../profiling/controller.js';
|
|
5
|
+
import { getDroppedCount, getEventCount } from '../profiling/aggregator.js';
|
|
6
|
+
import { nowMs } from '../profiling/clock.js';
|
|
7
7
|
export function exportJSON(options) {
|
|
8
8
|
const config = getEffectiveConfig();
|
|
9
9
|
const includeRecent = options?.includeRecentEvents ?? true;
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* profiler.disable();
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
import * as controller from '
|
|
15
|
-
import type { ProfilerRuntimeOptions, ProfilingEvent, ProfilerExport, AggregatedStats } from '
|
|
14
|
+
import * as controller from '../profiling/controller.js';
|
|
15
|
+
import type { ProfilerRuntimeOptions, ProfilingEvent, ProfilerExport, AggregatedStats } from '../profiling/types.js';
|
|
16
16
|
export declare const profiler: {
|
|
17
17
|
/**
|
|
18
18
|
* Enables profiling and resets all previously aggregated data.
|
|
@@ -76,15 +76,15 @@ export declare const profiler: {
|
|
|
76
76
|
*/
|
|
77
77
|
clear: () => void;
|
|
78
78
|
};
|
|
79
|
-
export type { ProfilerRuntimeOptions, ProfilingEvent, ProfilerExport, AggregatedStats, ProfilingEventKind } from '
|
|
79
|
+
export type { ProfilerRuntimeOptions, ProfilingEvent, ProfilerExport, AggregatedStats, ProfilingEventKind } from '../profiling/types.js';
|
|
80
80
|
export type { ProfilerMode, ProfilerGPUResourceGauge, ProfilerResourceGauge } from '../schemas/index.js';
|
|
81
|
-
export { nowMs } from '
|
|
82
|
-
export { attachBackendDiagnostics } from '
|
|
83
|
-
export { enable, disable, record, shouldProfile, shouldIncludeServerBreakdown, shouldIncludeResourceGauges, generateId, isEnabled, getAggregates, getRecentEvents, getEffectiveConfig, onRecord, type ResolvedProfilerConfig } from '
|
|
84
|
-
export { recordEvent, clearAggregator } from '
|
|
85
|
-
export { exportJSON, exportTable, exportSummary } from '
|
|
86
|
-
export { createProfilingMeta, createProfilingDisabledMeta, injectProfilingMetaIntoObject, extractProfilingMeta, stripProfilingMeta } from '
|
|
87
|
-
export { recordPhase, recordFailure, recordServerBreakdownPhases, type BaseTimings, type BaseEvent } from '
|
|
88
|
-
export { createServerProfiler, type ServerProfiler } from '
|
|
89
|
-
export { profileReplyHandler, profileStreamHandler } from '
|
|
90
|
-
export { registerOperationMetrics, buildOperationEvent, type OperationMetricsConfig } from '
|
|
81
|
+
export { nowMs } from '../profiling/clock.js';
|
|
82
|
+
export { attachBackendDiagnostics } from '../profiling/backend-diagnostics.js';
|
|
83
|
+
export { enable, disable, record, shouldProfile, shouldIncludeServerBreakdown, shouldIncludeResourceGauges, generateId, isEnabled, getAggregates, getRecentEvents, getEffectiveConfig, onRecord, type ResolvedProfilerConfig } from '../profiling/controller.js';
|
|
84
|
+
export { recordEvent, clearAggregator } from '../profiling/aggregator.js';
|
|
85
|
+
export { exportJSON, exportTable, exportSummary } from '../profiling/exporters.js';
|
|
86
|
+
export { createProfilingMeta, createProfilingDisabledMeta, injectProfilingMetaIntoObject, extractProfilingMeta, stripProfilingMeta } from '../profiling/envelope.js';
|
|
87
|
+
export { recordPhase, recordFailure, recordServerBreakdownPhases, type BaseTimings, type BaseEvent } from '../profiling/events.js';
|
|
88
|
+
export { createServerProfiler, type ServerProfiler } from '../profiling/profiler.js';
|
|
89
|
+
export { profileReplyHandler, profileStreamHandler } from '../profiling/operation-wrappers.js';
|
|
90
|
+
export { registerOperationMetrics, buildOperationEvent, type OperationMetricsConfig } from '../profiling/operation-metrics.js';
|
package/dist/profiling/index.js
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* profiler.disable();
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
import * as controller from '
|
|
15
|
-
import * as exporters from '
|
|
14
|
+
import * as controller from '../profiling/controller.js';
|
|
15
|
+
import * as exporters from '../profiling/exporters.js';
|
|
16
16
|
export const profiler = {
|
|
17
17
|
/**
|
|
18
18
|
* Enables profiling and resets all previously aggregated data.
|
|
@@ -74,13 +74,13 @@ export const profiler = {
|
|
|
74
74
|
*/
|
|
75
75
|
clear: () => controller.clear()
|
|
76
76
|
};
|
|
77
|
-
export { nowMs } from '
|
|
78
|
-
export { attachBackendDiagnostics } from '
|
|
79
|
-
export { enable, disable, record, shouldProfile, shouldIncludeServerBreakdown, shouldIncludeResourceGauges, generateId, isEnabled, getAggregates, getRecentEvents, getEffectiveConfig, onRecord } from '
|
|
80
|
-
export { recordEvent, clearAggregator } from '
|
|
81
|
-
export { exportJSON, exportTable, exportSummary } from '
|
|
82
|
-
export { createProfilingMeta, createProfilingDisabledMeta, injectProfilingMetaIntoObject, extractProfilingMeta, stripProfilingMeta } from '
|
|
83
|
-
export { recordPhase, recordFailure, recordServerBreakdownPhases } from '
|
|
84
|
-
export { createServerProfiler } from '
|
|
85
|
-
export { profileReplyHandler, profileStreamHandler } from '
|
|
86
|
-
export { registerOperationMetrics, buildOperationEvent } from '
|
|
77
|
+
export { nowMs } from '../profiling/clock.js';
|
|
78
|
+
export { attachBackendDiagnostics } from '../profiling/backend-diagnostics.js';
|
|
79
|
+
export { enable, disable, record, shouldProfile, shouldIncludeServerBreakdown, shouldIncludeResourceGauges, generateId, isEnabled, getAggregates, getRecentEvents, getEffectiveConfig, onRecord } from '../profiling/controller.js';
|
|
80
|
+
export { recordEvent, clearAggregator } from '../profiling/aggregator.js';
|
|
81
|
+
export { exportJSON, exportTable, exportSummary } from '../profiling/exporters.js';
|
|
82
|
+
export { createProfilingMeta, createProfilingDisabledMeta, injectProfilingMetaIntoObject, extractProfilingMeta, stripProfilingMeta } from '../profiling/envelope.js';
|
|
83
|
+
export { recordPhase, recordFailure, recordServerBreakdownPhases } from '../profiling/events.js';
|
|
84
|
+
export { createServerProfiler } from '../profiling/profiler.js';
|
|
85
|
+
export { profileReplyHandler, profileStreamHandler } from '../profiling/operation-wrappers.js';
|
|
86
|
+
export { registerOperationMetrics, buildOperationEvent } from '../profiling/operation-metrics.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Declarative extraction of operation-level metrics from request/response data.
|
|
3
3
|
* Used by operation wrappers to capture handler-specific profiling events.
|
|
4
4
|
*/
|
|
5
|
-
import type { ProfilingEvent, ProfilingEventKind } from '
|
|
5
|
+
import type { ProfilingEvent, ProfilingEventKind } from '../profiling/types.js';
|
|
6
6
|
import type { DownloadStats } from '../handlers/load-model/types.js';
|
|
7
7
|
export type MetricExtractor<T> = (data: T) => Record<string, number> | undefined;
|
|
8
8
|
export type TagExtractor<T> = (data: T) => Record<string, string> | undefined;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Declarative extraction of operation-level metrics from request/response data.
|
|
3
3
|
* Used by operation wrappers to capture handler-specific profiling events.
|
|
4
4
|
*/
|
|
5
|
-
import { readModelExecutionMs } from '
|
|
6
|
-
import { readBackendDiagnostics } from '
|
|
5
|
+
import { readModelExecutionMs } from '../profiling/model-execution.js';
|
|
6
|
+
import { readBackendDiagnostics } from '../profiling/backend-diagnostics.js';
|
|
7
7
|
const metricsRegistry = new Map();
|
|
8
8
|
function extractDownloadStatsGauges(stats, gauges) {
|
|
9
9
|
if (stats?.downloadTimeMs !== undefined) {
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Used to wrap dispatch/invoke functions with timing capture.
|
|
4
4
|
*/
|
|
5
5
|
import { PROFILING_KEY, OPERATION_EVENT_KEY } from '../schemas/index.js';
|
|
6
|
-
import { nowMs, generateProfileId } from '
|
|
7
|
-
import { record, shouldIncludeResourceGauges, shouldProfile } from '
|
|
6
|
+
import { nowMs, generateProfileId } from '../profiling/clock.js';
|
|
7
|
+
import { record, shouldIncludeResourceGauges, shouldProfile } from '../profiling/controller.js';
|
|
8
8
|
import { getResourceCollector } from '../resources/instance.js';
|
|
9
|
-
import { buildOperationEvent } from '
|
|
9
|
+
import { buildOperationEvent } from '../profiling/operation-metrics.js';
|
|
10
10
|
function isTerminalChunk(value) {
|
|
11
11
|
return typeof value === 'object' && value !== null && 'done' in value && value.done === true;
|
|
12
12
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { responseSchema, PROFILING_KEY, OPERATION_EVENT_KEY, PROFILING_TRAILER_KEY } from '../schemas/index.js';
|
|
2
|
-
import { nowMs } from '
|
|
2
|
+
import { nowMs } from '../profiling/clock.js';
|
|
3
3
|
export function createProfilingContext(meta) {
|
|
4
4
|
return { meta, requestStart: nowMs() };
|
|
5
5
|
}
|
package/dist/rag/handler.js
CHANGED
|
@@ -50,7 +50,7 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
50
50
|
var e = new Error(message);
|
|
51
51
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
52
|
});
|
|
53
|
-
import { chunk, ingest, reindex, saveEmbeddings, search, deleteEmbeddings, listWorkspaces, closeWorkspace, deleteWorkspace, DEFAULT_WORKSPACE, getActiveRagRequest, setActiveRagRequest, clearActiveRagRequest } from '
|
|
53
|
+
import { chunk, ingest, reindex, saveEmbeddings, search, deleteEmbeddings, listWorkspaces, closeWorkspace, deleteWorkspace, DEFAULT_WORKSPACE, getActiveRagRequest, setActiveRagRequest, clearActiveRagRequest } from '../rag/index.js';
|
|
54
54
|
import { getRequestRegistry, withRequestContext } from '../runtime/index.js';
|
|
55
55
|
import { generateRandomRequestId } from '../runtime/request-id.js';
|
|
56
56
|
import { getEngineLogger } from '../logging/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { closeRagInstance, deleteWorkspace, DEFAULT_WORKSPACE } from '
|
|
1
|
+
import { closeRagInstance, deleteWorkspace, DEFAULT_WORKSPACE } from '../../rag/rag-workspace-manager.js';
|
|
2
2
|
import { ragCloseWorkspaceParamsSchema } from '../../schemas/index.js';
|
|
3
3
|
export async function closeWorkspace(params) {
|
|
4
4
|
const { workspace, deleteOnClose } = ragCloseWorkspaceParamsSchema.parse(params);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRagDbAdapter, hasRagWorkspaceStorage } from '
|
|
1
|
+
import { getRagDbAdapter, hasRagWorkspaceStorage } from '../../rag/rag-workspace-manager.js';
|
|
2
2
|
import { ragDeleteEmbeddingsParamsSchema } from '../../schemas/index.js';
|
|
3
3
|
import { RAGDeleteFailedError } from '../../errors/index.js';
|
|
4
4
|
export async function deleteEmbeddings(params) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { deleteWorkspace as deleteWorkspaceFromManager } from '
|
|
1
|
+
import { deleteWorkspace as deleteWorkspaceFromManager } from '../../rag/rag-workspace-manager.js';
|
|
2
2
|
import { ragDeleteWorkspaceParamsSchema } from '../../schemas/index.js';
|
|
3
3
|
import { RAGWorkspaceNotFoundError } from '../../errors/index.js';
|
|
4
4
|
export async function deleteWorkspace(params) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getRagInstance } from '
|
|
1
|
+
import { getRagInstance } from '../../rag/rag-workspace-manager.js';
|
|
2
2
|
import { embed } from '../../plugins/ops/embed.js';
|
|
3
3
|
import { ragIngestParamsSchema } from '../../schemas/index.js';
|
|
4
4
|
export async function ingest(params, options) {
|