@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
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// Nested JSON stays inline in the wire contract. The refinement rejects values
|
|
3
|
+
// that JSON serialization would discard or change before reaching the model.
|
|
4
|
+
function isJson(value, ancestors = new Set()) {
|
|
5
|
+
if (value === null || typeof value === 'string' || typeof value === 'boolean')
|
|
6
|
+
return true;
|
|
7
|
+
if (typeof value === 'number')
|
|
8
|
+
return Number.isFinite(value);
|
|
9
|
+
if (typeof value !== 'object' || ancestors.has(value))
|
|
10
|
+
return false;
|
|
11
|
+
if (!Array.isArray(value) && Object.getPrototypeOf(value) !== Object.prototype)
|
|
12
|
+
return false;
|
|
13
|
+
ancestors.add(value);
|
|
14
|
+
const valid = Object.values(value).every((child) => isJson(child, ancestors));
|
|
15
|
+
ancestors.delete(value);
|
|
16
|
+
return valid;
|
|
17
|
+
}
|
|
18
|
+
export const decisionStateSchema = z.union([
|
|
19
|
+
z.string(),
|
|
20
|
+
z.number(),
|
|
21
|
+
z.boolean(),
|
|
22
|
+
z.record(z.string(), z.unknown()).refine(isJson, 'Expected JSON values'),
|
|
23
|
+
z.array(z.unknown()).refine(isJson, 'Expected JSON values')
|
|
24
|
+
]);
|
|
25
|
+
const questionBase = {
|
|
26
|
+
instructions: decisionStateSchema.refine((value) => value !== '', 'Instructions cannot be empty'),
|
|
27
|
+
optionOrder: z.array(z.number().int().nonnegative()).optional()
|
|
28
|
+
};
|
|
29
|
+
export const decisionQuestionSchema = z.discriminatedUnion('type', [
|
|
30
|
+
z
|
|
31
|
+
.object({
|
|
32
|
+
...questionBase,
|
|
33
|
+
type: z.literal('choice'),
|
|
34
|
+
criteria: z.union([
|
|
35
|
+
z.array(z.union([z.string(), z.number(), z.boolean()])),
|
|
36
|
+
z.record(z.string(), decisionStateSchema.nullable())
|
|
37
|
+
])
|
|
38
|
+
})
|
|
39
|
+
.strict(),
|
|
40
|
+
z
|
|
41
|
+
.object({
|
|
42
|
+
...questionBase,
|
|
43
|
+
type: z.literal('score'),
|
|
44
|
+
criteria: z.array(decisionStateSchema)
|
|
45
|
+
})
|
|
46
|
+
.strict(),
|
|
47
|
+
z
|
|
48
|
+
.object({
|
|
49
|
+
...questionBase,
|
|
50
|
+
type: z.literal('noul'),
|
|
51
|
+
criteria: z
|
|
52
|
+
.object({
|
|
53
|
+
true: decisionStateSchema.nullable().optional(),
|
|
54
|
+
false: decisionStateSchema.nullable().optional()
|
|
55
|
+
})
|
|
56
|
+
.strict()
|
|
57
|
+
.nullable()
|
|
58
|
+
.optional(),
|
|
59
|
+
labels: z.object({ false: z.string(), true: z.string() }).strict().optional()
|
|
60
|
+
})
|
|
61
|
+
.strict()
|
|
62
|
+
]);
|
|
63
|
+
const decisionFields = {
|
|
64
|
+
questions: z
|
|
65
|
+
.record(z.string(), decisionQuestionSchema)
|
|
66
|
+
.describe('Question ID to decision question.'),
|
|
67
|
+
maxLen: z
|
|
68
|
+
.number()
|
|
69
|
+
.int()
|
|
70
|
+
.positive()
|
|
71
|
+
.optional()
|
|
72
|
+
.describe('Token budget per sequence; unset uses the checkpoint budget.'),
|
|
73
|
+
headMaxLen: z
|
|
74
|
+
.number()
|
|
75
|
+
.int()
|
|
76
|
+
.positive()
|
|
77
|
+
.optional()
|
|
78
|
+
.describe('Token budget for each question and its options; unset uses the checkpoint budget.')
|
|
79
|
+
};
|
|
80
|
+
export const decisionSingleRequestSchema = z
|
|
81
|
+
.object({ ...decisionFields, state: decisionStateSchema })
|
|
82
|
+
.strict();
|
|
83
|
+
export const decisionBatchRequestSchema = z
|
|
84
|
+
.object({ ...decisionFields, states: z.array(decisionStateSchema) })
|
|
85
|
+
.strict();
|
|
86
|
+
export const decisionRequestSchema = z.union([
|
|
87
|
+
decisionSingleRequestSchema,
|
|
88
|
+
decisionBatchRequestSchema
|
|
89
|
+
]);
|
|
90
|
+
const envelope = { modelId: z.string().min(1) };
|
|
91
|
+
export const decideParamsSchema = z.union([
|
|
92
|
+
decisionSingleRequestSchema.extend(envelope),
|
|
93
|
+
decisionBatchRequestSchema.extend(envelope)
|
|
94
|
+
]);
|
|
95
|
+
const wireEnvelope = {
|
|
96
|
+
...envelope,
|
|
97
|
+
type: z.literal('decide'),
|
|
98
|
+
requestId: z.string().min(1).optional()
|
|
99
|
+
};
|
|
100
|
+
export const decideRequestSchema = z.union([
|
|
101
|
+
decisionSingleRequestSchema.extend(wireEnvelope).meta({ title: 'DecideSingleRequest' }),
|
|
102
|
+
decisionBatchRequestSchema.extend(wireEnvelope).meta({ title: 'DecideBatchRequest' })
|
|
103
|
+
]);
|
|
104
|
+
const answerBase = {
|
|
105
|
+
answerConfidence: z.number(),
|
|
106
|
+
confidence: z.number(),
|
|
107
|
+
action: z.object({
|
|
108
|
+
actProbability: z.number().describe('Currently unreliable; do not use to trigger actions.')
|
|
109
|
+
})
|
|
110
|
+
};
|
|
111
|
+
export const decisionAnswerSchema = z.discriminatedUnion('type', [
|
|
112
|
+
z.object({
|
|
113
|
+
...answerBase,
|
|
114
|
+
type: z.literal('choice'),
|
|
115
|
+
choice: z.union([z.string(), z.number(), z.boolean()]),
|
|
116
|
+
probabilities: z.record(z.string(), z.number())
|
|
117
|
+
}),
|
|
118
|
+
z.object({
|
|
119
|
+
...answerBase,
|
|
120
|
+
type: z.literal('score'),
|
|
121
|
+
score: z.number(),
|
|
122
|
+
legend: z.record(z.string(), z.string()),
|
|
123
|
+
probabilities: z.record(z.string(), z.number())
|
|
124
|
+
}),
|
|
125
|
+
z.object({ ...answerBase, type: z.literal('noul'), noul: z.number() })
|
|
126
|
+
]);
|
|
127
|
+
export const decisionResultSchema = z.object({
|
|
128
|
+
model: z.string(),
|
|
129
|
+
answers: z.record(z.string(), decisionAnswerSchema),
|
|
130
|
+
usage: z.object({
|
|
131
|
+
inputTokens: z.number(),
|
|
132
|
+
outputTokens: z.number(),
|
|
133
|
+
stateTokens: z.number(),
|
|
134
|
+
stateTokensDropped: z.number(),
|
|
135
|
+
truncated: z.boolean(),
|
|
136
|
+
truncatedQuestions: z.array(z.string()),
|
|
137
|
+
options: z
|
|
138
|
+
.record(z.string(), z.object({
|
|
139
|
+
total: z.number(),
|
|
140
|
+
distinct: z.number(),
|
|
141
|
+
tokensPerOption: z.number().nullable()
|
|
142
|
+
}))
|
|
143
|
+
.optional()
|
|
144
|
+
})
|
|
145
|
+
});
|
|
146
|
+
export const decisionResponseSchema = z.union([decisionResultSchema, z.array(decisionResultSchema)]);
|
|
147
|
+
export const decideResponseSchema = z.object({
|
|
148
|
+
type: z.literal('decide'),
|
|
149
|
+
result: decisionResponseSchema
|
|
150
|
+
});
|
|
151
|
+
export const decisionConfigBaseSchema = z
|
|
152
|
+
.object({
|
|
153
|
+
device: z.enum(['cpu', 'gpu']).optional().describe("Compute device. Default 'gpu'."),
|
|
154
|
+
gpu_layers: z
|
|
155
|
+
.number()
|
|
156
|
+
.int()
|
|
157
|
+
.optional()
|
|
158
|
+
.describe('Layers to offload. Unset lets the addon choose placement.'),
|
|
159
|
+
batch_size: z
|
|
160
|
+
.number()
|
|
161
|
+
.int()
|
|
162
|
+
.positive()
|
|
163
|
+
.optional()
|
|
164
|
+
.describe('Tokens per forward pass. Default 2048; each sequence must fit.'),
|
|
165
|
+
poll: z
|
|
166
|
+
.number()
|
|
167
|
+
.int()
|
|
168
|
+
.min(0)
|
|
169
|
+
.max(100)
|
|
170
|
+
.optional()
|
|
171
|
+
.describe('CPU polling level, from 0 to 100. If omitted, uses the default native behavior. Higher values may reduce wake latency but consume more CPU during GPU work.'),
|
|
172
|
+
pollBatch: z
|
|
173
|
+
.number()
|
|
174
|
+
.int()
|
|
175
|
+
.min(0)
|
|
176
|
+
.max(100)
|
|
177
|
+
.optional()
|
|
178
|
+
.describe('CPU polling level for batch processing, from 0 to 100. If omitted, uses the default native behavior.'),
|
|
179
|
+
threads: z
|
|
180
|
+
.number()
|
|
181
|
+
.int()
|
|
182
|
+
.optional()
|
|
183
|
+
.describe('CPU threads, at most the CPU count. Zero or below uses all logical CPUs.'),
|
|
184
|
+
'threads-batch': z
|
|
185
|
+
.number()
|
|
186
|
+
.int()
|
|
187
|
+
.optional()
|
|
188
|
+
.describe('Batch CPU threads. Unset uses threads; zero or below uses all logical CPUs.'),
|
|
189
|
+
flash_attn: z
|
|
190
|
+
.enum(['on', 'off', 'auto'])
|
|
191
|
+
.optional()
|
|
192
|
+
.describe('Flash attention mode. Default auto.'),
|
|
193
|
+
verbosity: z
|
|
194
|
+
.number()
|
|
195
|
+
.int()
|
|
196
|
+
.min(0)
|
|
197
|
+
.max(3)
|
|
198
|
+
.optional()
|
|
199
|
+
.describe('Native log level: 0 error, 1 warn, 2 info, 3 debug.'),
|
|
200
|
+
'main-gpu': z
|
|
201
|
+
.union([z.number().int().nonnegative(), z.enum(['integrated', 'dedicated'])])
|
|
202
|
+
.optional()
|
|
203
|
+
.describe('GPU index or device class.'),
|
|
204
|
+
'split-mode': z.enum(['none', 'layer']).optional().describe('Multi-GPU split mode.'),
|
|
205
|
+
'tensor-split': z.string().optional().describe('Per-GPU tensor split proportions.'),
|
|
206
|
+
openclCacheDir: z
|
|
207
|
+
.string()
|
|
208
|
+
.optional()
|
|
209
|
+
.describe('Writable OpenCL kernel cache directory, required on Android.')
|
|
210
|
+
})
|
|
211
|
+
.strict();
|
|
212
|
+
export const DECISION_CONFIG_DEFAULTS = {
|
|
213
|
+
device: 'gpu'
|
|
214
|
+
};
|
|
215
|
+
export const decisionConfigSchema = decisionConfigBaseSchema.transform((data) => ({
|
|
216
|
+
...DECISION_CONFIG_DEFAULTS,
|
|
217
|
+
...data,
|
|
218
|
+
device: data.device ?? DECISION_CONFIG_DEFAULTS.device
|
|
219
|
+
}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { AbortController } from 'bare-abort-controller';
|
|
3
|
-
import type { ModelProgressUpdate } from '
|
|
3
|
+
import type { ModelProgressUpdate } from '../schemas/load-model.js';
|
|
4
4
|
export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
5
5
|
assetSrc: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
6
6
|
src: z.ZodString;
|
|
@@ -24,10 +24,13 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
24
24
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
25
25
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
26
26
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
27
|
+
"llamacpp-decision": "llamacpp-decision";
|
|
28
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
27
29
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
28
30
|
"onnx-tts": "onnx-tts";
|
|
29
31
|
"tts-ggml": "tts-ggml";
|
|
30
32
|
"parakeet-transcription": "parakeet-transcription";
|
|
33
|
+
"moss-transcribe": "moss-transcribe";
|
|
31
34
|
"ggml-ocr": "ggml-ocr";
|
|
32
35
|
"sdcpp-generation": "sdcpp-generation";
|
|
33
36
|
"audiogen-ggml": "audiogen-ggml";
|
|
@@ -57,7 +60,7 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
57
60
|
engine?: string | undefined;
|
|
58
61
|
expectedSize?: number | undefined;
|
|
59
62
|
sha256Checksum?: string | undefined;
|
|
60
|
-
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "ggml-ocr" | "sdcpp-generation" | "audiogen-ggml" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
|
|
63
|
+
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "llamacpp-decision" | "llamacpp-rerank" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "moss-transcribe" | "ggml-ocr" | "sdcpp-generation" | "audiogen-ggml" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
|
|
61
64
|
};
|
|
62
65
|
requireHttpChecksum?: boolean | undefined;
|
|
63
66
|
requireSecureTransport?: boolean | undefined;
|
|
@@ -73,7 +76,7 @@ export declare const downloadAssetOptionsSchema: z.ZodPipe<z.ZodObject<{
|
|
|
73
76
|
engine?: string | undefined;
|
|
74
77
|
expectedSize?: number | undefined;
|
|
75
78
|
sha256Checksum?: string | undefined;
|
|
76
|
-
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "ggml-ocr" | "sdcpp-generation" | "audiogen-ggml" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
|
|
79
|
+
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "llamacpp-decision" | "llamacpp-rerank" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "moss-transcribe" | "ggml-ocr" | "sdcpp-generation" | "audiogen-ggml" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
|
|
77
80
|
};
|
|
78
81
|
seed?: boolean | undefined;
|
|
79
82
|
requireHttpChecksum?: boolean | undefined;
|
|
@@ -102,10 +105,13 @@ export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<
|
|
|
102
105
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
103
106
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
104
107
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
108
|
+
"llamacpp-decision": "llamacpp-decision";
|
|
109
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
105
110
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
106
111
|
"onnx-tts": "onnx-tts";
|
|
107
112
|
"tts-ggml": "tts-ggml";
|
|
108
113
|
"parakeet-transcription": "parakeet-transcription";
|
|
114
|
+
"moss-transcribe": "moss-transcribe";
|
|
109
115
|
"ggml-ocr": "ggml-ocr";
|
|
110
116
|
"sdcpp-generation": "sdcpp-generation";
|
|
111
117
|
"audiogen-ggml": "audiogen-ggml";
|
|
@@ -145,7 +151,7 @@ export declare const downloadAssetOptionsToRequestSchema: z.ZodPipe<z.ZodObject<
|
|
|
145
151
|
engine?: string | undefined;
|
|
146
152
|
expectedSize?: number | undefined;
|
|
147
153
|
sha256Checksum?: string | undefined;
|
|
148
|
-
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "ggml-ocr" | "sdcpp-generation" | "audiogen-ggml" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
|
|
154
|
+
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "llamacpp-decision" | "llamacpp-rerank" | "nmtcpp-translation" | "onnx-tts" | "tts-ggml" | "parakeet-transcription" | "moss-transcribe" | "ggml-ocr" | "sdcpp-generation" | "audiogen-ggml" | "ggml-vla" | "ggml-classification" | "llm" | "whisper" | "bci" | "nmt" | "parakeet" | "classification" | "vad" | undefined;
|
|
149
155
|
};
|
|
150
156
|
seed?: boolean | undefined;
|
|
151
157
|
requireHttpChecksum?: boolean | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { modelSrcInputSchema, modelInputToSrcSchema, MODEL_SOURCE_URI_HINT } from '
|
|
2
|
+
import { modelSrcInputSchema, modelInputToSrcSchema, MODEL_SOURCE_URI_HINT } from '../schemas/model-src-utils.js';
|
|
3
3
|
const ASSET_SRC_DESCRIPTION = `The asset to download and cache: ${MODEL_SOURCE_URI_HINT}.`;
|
|
4
4
|
const downloadAssetOptionsBaseSchema = z.object({
|
|
5
5
|
assetSrc: modelSrcInputSchema.describe(ASSET_SRC_DESCRIPTION),
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { type ModelRegistryEngine, type ModelRegistryEntryAddon } from '
|
|
1
|
+
import { type ModelRegistryEngine, type ModelRegistryEntryAddon } from '../schemas/registry.js';
|
|
2
2
|
export declare const ENGINE_TO_ADDON: {
|
|
3
3
|
readonly "llamacpp-completion": "llm";
|
|
4
4
|
readonly "whispercpp-transcription": "whisper";
|
|
5
5
|
readonly "bci-whispercpp-transcription": "bci";
|
|
6
6
|
readonly "llamacpp-embedding": "embeddings";
|
|
7
|
+
readonly "llamacpp-decision": "embeddings";
|
|
8
|
+
readonly "llamacpp-rerank": "embeddings";
|
|
7
9
|
readonly "nmtcpp-translation": "nmt";
|
|
8
10
|
readonly "onnx-tts": "tts";
|
|
9
11
|
readonly "tts-ggml": "tts";
|
|
10
12
|
readonly "ggml-ocr": "ocr";
|
|
11
13
|
readonly "parakeet-transcription": "parakeet";
|
|
14
|
+
readonly "moss-transcribe": "moss-transcribe";
|
|
12
15
|
readonly "sdcpp-generation": "diffusion";
|
|
13
16
|
readonly "audiogen-ggml": "audiogen";
|
|
14
17
|
readonly "ggml-vla": "vla";
|
|
@@ -16,5 +19,10 @@ export declare const ENGINE_TO_ADDON: {
|
|
|
16
19
|
readonly 'onnx-vad': "vad";
|
|
17
20
|
};
|
|
18
21
|
export declare const LEGACY_ENGINE_TO_CANONICAL: Record<string, ModelRegistryEngine>;
|
|
22
|
+
export declare const LEGACY_REGISTRY_ENGINE_RULES: Record<string, readonly {
|
|
23
|
+
tag: string;
|
|
24
|
+
engine: ModelRegistryEngine;
|
|
25
|
+
}[]>;
|
|
19
26
|
export declare function resolveCanonicalEngine(engine: string): ModelRegistryEngine | null;
|
|
27
|
+
export declare function resolveRegistryEngine(engine: string, tags?: readonly string[]): ModelRegistryEngine | null;
|
|
20
28
|
export declare function getAddonFromEngine(engine: ModelRegistryEngine): ModelRegistryEntryAddon;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ModelType } from '
|
|
2
|
-
import { ADDON_AUDIOGEN, ADDON_BCI, ADDON_CLASSIFICATION, ADDON_DIFFUSION, ADDON_EMBEDDING, ADDON_LLM, ADDON_NMT, ADDON_OCR, ADDON_PARAKEET, ADDON_TTS, ADDON_VLA, ADDON_WHISPER } from '
|
|
3
|
-
import { modelRegistryEngineSchema } from '
|
|
1
|
+
import { ModelType } from '../schemas/model-types.js';
|
|
2
|
+
import { ADDON_ASR, ADDON_AUDIOGEN, ADDON_BCI, ADDON_CLASSIFICATION, ADDON_DIFFUSION, ADDON_EMBEDDING, ADDON_LLM, ADDON_NMT, ADDON_OCR, ADDON_PARAKEET, ADDON_TTS, ADDON_VLA, ADDON_WHISPER } from '../schemas/plugin.js';
|
|
3
|
+
import { modelRegistryEngineSchema } from '../schemas/registry.js';
|
|
4
4
|
// Canonical engine → addon mapping (exhaustive). `as const` preserves
|
|
5
5
|
// per-key literals so the addon can be derived from the engine at the type level.
|
|
6
6
|
export const ENGINE_TO_ADDON = {
|
|
@@ -8,11 +8,14 @@ export const ENGINE_TO_ADDON = {
|
|
|
8
8
|
[ModelType.whispercppTranscription]: 'whisper',
|
|
9
9
|
[ModelType.bciWhispercppTranscription]: 'bci',
|
|
10
10
|
[ModelType.llamacppEmbedding]: 'embeddings',
|
|
11
|
+
[ModelType.llamacppDecision]: 'embeddings',
|
|
12
|
+
[ModelType.llamacppRerank]: 'embeddings',
|
|
11
13
|
[ModelType.nmtcppTranslation]: 'nmt',
|
|
12
14
|
[ModelType.onnxTts]: 'tts',
|
|
13
15
|
[ModelType.ttsGgml]: 'tts',
|
|
14
16
|
[ModelType.ggmlOcr]: 'ocr',
|
|
15
17
|
[ModelType.parakeetTranscription]: 'parakeet',
|
|
18
|
+
[ModelType.mossTranscribe]: 'moss-transcribe',
|
|
16
19
|
[ModelType.sdcppGeneration]: 'diffusion',
|
|
17
20
|
[ModelType.audiogenGgml]: 'audiogen',
|
|
18
21
|
[ModelType.ggmlVla]: 'vla',
|
|
@@ -57,6 +60,11 @@ export const LEGACY_ENGINE_TO_CANONICAL = {
|
|
|
57
60
|
[ADDON_CLASSIFICATION]: ModelType.ggmlClassification,
|
|
58
61
|
classification: ModelType.ggmlClassification
|
|
59
62
|
};
|
|
63
|
+
// Legacy shared package ids need metadata to identify their plugin. These rules
|
|
64
|
+
// are exported with the engine contract so submission validation uses the same data.
|
|
65
|
+
export const LEGACY_REGISTRY_ENGINE_RULES = {
|
|
66
|
+
[ADDON_ASR]: [{ tag: 'moss-transcribe', engine: ModelType.mossTranscribe }]
|
|
67
|
+
};
|
|
60
68
|
// Resolves any engine string (legacy or canonical) to a validated canonical engine.
|
|
61
69
|
// Returns null if the engine is not recognized.
|
|
62
70
|
export function resolveCanonicalEngine(engine) {
|
|
@@ -67,10 +75,23 @@ export function resolveCanonicalEngine(engine) {
|
|
|
67
75
|
return ModelType.ttsGgml;
|
|
68
76
|
return direct.data;
|
|
69
77
|
}
|
|
70
|
-
|
|
78
|
+
if (Object.hasOwn(LEGACY_ENGINE_TO_CANONICAL, engine)) {
|
|
79
|
+
return LEGACY_ENGINE_TO_CANONICAL[engine] ?? null;
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
// Canonical engine identity takes precedence over legacy tag hints. A shared
|
|
84
|
+
// legacy package without a unique matching rule stays unresolved.
|
|
85
|
+
export function resolveRegistryEngine(engine, tags = []) {
|
|
86
|
+
const canonical = resolveCanonicalEngine(engine);
|
|
71
87
|
if (canonical)
|
|
72
88
|
return canonical;
|
|
73
|
-
|
|
89
|
+
if (!Object.hasOwn(LEGACY_REGISTRY_ENGINE_RULES, engine))
|
|
90
|
+
return null;
|
|
91
|
+
const matches = new Set(LEGACY_REGISTRY_ENGINE_RULES[engine]
|
|
92
|
+
?.filter((rule) => tags.includes(rule.tag))
|
|
93
|
+
.map((rule) => rule.engine));
|
|
94
|
+
return matches.size === 1 ? (matches.values().next().value ?? null) : null;
|
|
74
95
|
}
|
|
75
96
|
// Returns the addon type for a validated canonical engine.
|
|
76
97
|
export function getAddonFromEngine(engine) {
|
package/dist/schemas/errors.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ export declare const ERROR_CODES: {
|
|
|
28
28
|
readonly TTS_REFERENCE_AUDIO_REQUIRED: 52209;
|
|
29
29
|
readonly LEGACY_PARAKEET_MODEL_DEPRECATED: 52210;
|
|
30
30
|
readonly LEGACY_TTS_MODEL_DEPRECATED: 52211;
|
|
31
|
+
readonly MODEL_FIT_REFUSED: 52212;
|
|
31
32
|
readonly RPC_SERVER_OPERATION_FAILED: 52423;
|
|
32
33
|
readonly MODEL_UNLOAD_FAILED: 52400;
|
|
33
34
|
readonly EMBED_FAILED: 52401;
|
|
@@ -111,6 +112,7 @@ export declare const ERROR_CODES: {
|
|
|
111
112
|
readonly PLUGIN_LOAD_CONFIG_VALIDATION_FAILED: 53859;
|
|
112
113
|
readonly PATH_TRAVERSAL: 53900;
|
|
113
114
|
readonly QVAC_MODEL_REGISTRY_QUERY_FAILED: 53950;
|
|
115
|
+
readonly QVAC_MODEL_REGISTRY_MODEL_NOT_FOUND: 53951;
|
|
114
116
|
};
|
|
115
117
|
declare const errorDefinitions: ErrorCodesMap;
|
|
116
118
|
export { errorDefinitions as ERROR_DEFINITIONS };
|
package/dist/schemas/errors.js
CHANGED
|
@@ -36,6 +36,7 @@ export const ERROR_CODES = {
|
|
|
36
36
|
TTS_REFERENCE_AUDIO_REQUIRED: 52209,
|
|
37
37
|
LEGACY_PARAKEET_MODEL_DEPRECATED: 52210,
|
|
38
38
|
LEGACY_TTS_MODEL_DEPRECATED: 52211,
|
|
39
|
+
MODEL_FIT_REFUSED: 52212,
|
|
39
40
|
// Model operations (52,400-52,799)
|
|
40
41
|
RPC_SERVER_OPERATION_FAILED: 52423,
|
|
41
42
|
MODEL_UNLOAD_FAILED: 52400,
|
|
@@ -130,7 +131,8 @@ export const ERROR_CODES = {
|
|
|
130
131
|
// Security (53,900-53,949)
|
|
131
132
|
PATH_TRAVERSAL: 53900,
|
|
132
133
|
// Model registry query (53,950-54,000)
|
|
133
|
-
QVAC_MODEL_REGISTRY_QUERY_FAILED: 53950
|
|
134
|
+
QVAC_MODEL_REGISTRY_QUERY_FAILED: 53950,
|
|
135
|
+
QVAC_MODEL_REGISTRY_MODEL_NOT_FOUND: 53951
|
|
134
136
|
};
|
|
135
137
|
const errorDefinitions = {
|
|
136
138
|
// Response / request validation
|
|
@@ -255,6 +257,10 @@ const errorDefinitions = {
|
|
|
255
257
|
name: 'LEGACY_TTS_MODEL_DEPRECATED',
|
|
256
258
|
message: (legacyFields) => `Legacy ONNX TTS modelConfig fields are no longer supported (${legacyFields ?? 'unknown fields'}). As of @qvac/tts-ggml the addon uses GGUF bundles: supply the primary GGUF via modelSrc, set language in modelConfig, and for Chatterbox add s3genModelSrc (e.g. loadModel({ modelSrc: TTS_T3_TURBO_EN_CHATTERBOX_Q8_0, modelType: "tts", modelConfig: { ttsEngine: "chatterbox", language: "en", s3genModelSrc: TTS_S3GEN_EN_CHATTERBOX } })). Supertonic multilingual mode is selected by the GGUF (e.g. TTS_MULTILINGUAL_SUPERTONIC2_Q8_0) plus language — not ttsSupertonicMultilingual.`
|
|
257
259
|
},
|
|
260
|
+
[ERROR_CODES.MODEL_FIT_REFUSED]: {
|
|
261
|
+
name: 'MODEL_FIT_REFUSED',
|
|
262
|
+
message: (modelType, reason, detail) => `${modelType}: the engine fitter projects this load will not fit (${reason})${detail ? `: ${detail}` : ''}`
|
|
263
|
+
},
|
|
258
264
|
// Model operations
|
|
259
265
|
[ERROR_CODES.MODEL_UNLOAD_FAILED]: {
|
|
260
266
|
name: 'MODEL_UNLOAD_FAILED',
|
|
@@ -624,6 +630,10 @@ const errorDefinitions = {
|
|
|
624
630
|
[ERROR_CODES.QVAC_MODEL_REGISTRY_QUERY_FAILED]: {
|
|
625
631
|
name: 'QVAC_MODEL_REGISTRY_QUERY_FAILED',
|
|
626
632
|
message: (details) => `QVAC model registry query failed${details ? `: ${details}` : ''}`
|
|
633
|
+
},
|
|
634
|
+
[ERROR_CODES.QVAC_MODEL_REGISTRY_MODEL_NOT_FOUND]: {
|
|
635
|
+
name: 'QVAC_MODEL_REGISTRY_MODEL_NOT_FOUND',
|
|
636
|
+
message: (registrySource, registryPath) => `QVAC model registry has no model at ${registrySource}/${registryPath}`
|
|
627
637
|
}
|
|
628
638
|
};
|
|
629
639
|
addCodes(errorDefinitions, { name: 'qvac-inference', version: '1.0.0' });
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,49 +1,52 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export { toolSchema, toolCallSchema, toolCallErrorSchema, type Tool, type ToolCall, type ToolCallError, type ToolCallWithCall } from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
12
|
-
export * from '
|
|
13
|
-
export * from '
|
|
14
|
-
export * from '
|
|
15
|
-
export * from '
|
|
16
|
-
export * from '
|
|
17
|
-
export * from '
|
|
18
|
-
export * from '
|
|
19
|
-
export * from '
|
|
20
|
-
export * from '
|
|
21
|
-
export * from '
|
|
22
|
-
export * from '
|
|
23
|
-
export * from '
|
|
24
|
-
export * from '
|
|
25
|
-
export * from '
|
|
26
|
-
export * from '
|
|
27
|
-
export * from '
|
|
28
|
-
export * from '
|
|
29
|
-
export * from '
|
|
30
|
-
export * from '
|
|
31
|
-
export * from '
|
|
32
|
-
export * from '
|
|
33
|
-
export * from '
|
|
34
|
-
export
|
|
1
|
+
export * from '../schemas/model-file.js';
|
|
2
|
+
export * from '../schemas/cancel.js';
|
|
3
|
+
export * from '../schemas/batch-completion-stream.js';
|
|
4
|
+
export * from '../schemas/completion-stream.js';
|
|
5
|
+
export * from '../schemas/completion-event.js';
|
|
6
|
+
export { toolSchema, toolCallSchema, toolCallErrorSchema, type Tool, type ToolCall, type ToolCallError, type ToolCallWithCall } from '../schemas/tools.js';
|
|
7
|
+
export * from '../schemas/heartbeat.js';
|
|
8
|
+
export * from '../schemas/model-ops.js';
|
|
9
|
+
export * from '../schemas/download-asset.js';
|
|
10
|
+
export * from '../schemas/embed.js';
|
|
11
|
+
export * from '../schemas/decision.js';
|
|
12
|
+
export * from '../schemas/rerank.js';
|
|
13
|
+
export * from '../schemas/finetune.js';
|
|
14
|
+
export * from '../schemas/load-model.js';
|
|
15
|
+
export * from '../schemas/reload-config.js';
|
|
16
|
+
export * from '../schemas/logging-stream.js';
|
|
17
|
+
export * from '../schemas/common.js';
|
|
18
|
+
export * from '../schemas/transcription.js';
|
|
19
|
+
export * from '../schemas/bci.js';
|
|
20
|
+
export * from '../schemas/bci-config.js';
|
|
21
|
+
export * from '../schemas/translate.js';
|
|
22
|
+
export * from '../schemas/translation-config.js';
|
|
23
|
+
export * from '../schemas/llamacpp-config.js';
|
|
24
|
+
export * from '../schemas/transcription-config.js';
|
|
25
|
+
export * from '../schemas/text-to-speech.js';
|
|
26
|
+
export * from '../schemas/error.js';
|
|
27
|
+
export * from '../schemas/rag.js';
|
|
28
|
+
export * from '../schemas/vector-index.js';
|
|
29
|
+
export * from '../schemas/ocr.js';
|
|
30
|
+
export * from '../schemas/sdcpp-config.js';
|
|
31
|
+
export * from '../schemas/vla.js';
|
|
32
|
+
export * from '../schemas/classification.js';
|
|
33
|
+
export * from '../schemas/audio-gen.js';
|
|
34
|
+
export * from '../schemas/model-config-schemas.js';
|
|
35
|
+
export * from '../schemas/lifecycle.js';
|
|
36
|
+
export { ERROR_CODES, REGISTRY_ERROR_CODES } from '../schemas/errors.js';
|
|
35
37
|
export { ERR_CODES as RAG_ERROR_CODES } from '@qvac/rag/errors';
|
|
36
|
-
export { qvacConfigSchema, deviceMatchSchema, deviceConfigDefaultsSchema, devicePatternSchema, type QvacConfig, type DeviceMatch, type DeviceConfigDefaults, type DevicePattern } from '
|
|
37
|
-
export { PROFILING_KEY, PROFILING_TRAILER_KEY, OPERATION_EVENT_KEY, MODEL_EXECUTION_KEY, BACKEND_DIAGNOSTICS_KEY, profilerModeSchema, profilerGPUResourceGaugeSchema, profilerResourceGaugeSchema, serverBreakdownSchema, operationEventSchema, profilingRequestMetaSchema, profilingResponseMetaSchema, perCallProfilingSchema, type ProfilerMode, type ServerBreakdown, type OperationEvent, type ProfilingRequestMeta, type ProfilingResponseMeta, type PerCallProfiling, type ProfilerGPUResourceGauge, type ProfilerResourceGauge } from '
|
|
38
|
-
export { runtimeContextSchema, type RuntimeContext } from '
|
|
39
|
-
export
|
|
40
|
-
export * from '
|
|
41
|
-
export * from '
|
|
42
|
-
export * from '
|
|
43
|
-
export
|
|
44
|
-
export {
|
|
45
|
-
export
|
|
46
|
-
export * from '
|
|
47
|
-
export * from '
|
|
48
|
-
export * from '
|
|
49
|
-
export * from '
|
|
38
|
+
export { qvacConfigSchema, deviceMatchSchema, deviceConfigDefaultsSchema, devicePatternSchema, type QvacConfig, type DeviceMatch, type DeviceConfigDefaults, type DevicePattern } from '../schemas/config.js';
|
|
39
|
+
export { PROFILING_KEY, PROFILING_TRAILER_KEY, OPERATION_EVENT_KEY, MODEL_EXECUTION_KEY, BACKEND_DIAGNOSTICS_KEY, profilerModeSchema, profilerGPUResourceGaugeSchema, profilerResourceGaugeSchema, serverBreakdownSchema, operationEventSchema, profilingRequestMetaSchema, profilingResponseMetaSchema, perCallProfilingSchema, type ProfilerMode, type ServerBreakdown, type OperationEvent, type ProfilingRequestMeta, type ProfilingResponseMeta, type PerCallProfiling, type ProfilerGPUResourceGauge, type ProfilerResourceGauge } from '../schemas/profiling.js';
|
|
40
|
+
export { runtimeContextSchema, type RuntimeContext } from '../schemas/runtime-context.js';
|
|
41
|
+
export { modelFitPolicySchema, DEFAULT_MODEL_FIT_POLICY, type ModelFitPolicy } from '../schemas/model-fit-policy.js';
|
|
42
|
+
export * from '../schemas/model-info.js';
|
|
43
|
+
export * from '../schemas/system-resources.js';
|
|
44
|
+
export * from '../schemas/model-src-utils.js';
|
|
45
|
+
export * from '../schemas/json-schema.js';
|
|
46
|
+
export { type McpClient, type McpClientInput } from '../schemas/mcp-adapter.js';
|
|
47
|
+
export { PUBLIC_MODEL_TYPES as MODEL_TYPES, ModelType, type CanonicalModelType, type ModelTypeInput, normalizeModelType, isCanonicalModelType, isModelTypeAlias } from '../schemas/model-types.js';
|
|
48
|
+
export * from '../schemas/plugin.js';
|
|
49
|
+
export * from '../schemas/registry.js';
|
|
50
|
+
export * from '../schemas/model-resource-profile.js';
|
|
51
|
+
export * from '../schemas/assess-model-fit.js';
|
|
52
|
+
export * from '../schemas/rpc-server.js';
|