@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,4 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const transcriptionFitWorkloadSchema: z.ZodObject<{
|
|
3
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
4
|
+
hotwords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
5
|
+
maxNewTokens: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
audioSeconds: z.ZodNumber;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export type TranscriptionFitWorkload = z.infer<typeof transcriptionFitWorkloadSchema>;
|
|
2
9
|
/**
|
|
3
10
|
* Advisory outcome of a pre-download fit assessment.
|
|
4
11
|
*
|
|
@@ -19,7 +26,7 @@ export type ModelFitWorkload = {
|
|
|
19
26
|
contextTokens?: number;
|
|
20
27
|
} | {
|
|
21
28
|
kind: 'audio';
|
|
22
|
-
windowMs
|
|
29
|
+
windowMs?: number;
|
|
23
30
|
streaming: boolean;
|
|
24
31
|
};
|
|
25
32
|
/**
|
|
@@ -59,6 +66,16 @@ export declare const modelFitExecutionSchema: z.ZodEnum<{
|
|
|
59
66
|
sequential: "sequential";
|
|
60
67
|
concurrent: "concurrent";
|
|
61
68
|
}>;
|
|
69
|
+
/** Fit-only workload used to estimate MOSS text-to-speech memory requirements. */
|
|
70
|
+
export declare const ttsFitWorkloadSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
71
|
+
promptRows: z.ZodNumber;
|
|
72
|
+
referenceSamples: z.ZodNumber;
|
|
73
|
+
streaming: z.ZodBoolean;
|
|
74
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
75
|
+
prompt: z.ZodString;
|
|
76
|
+
seconds: z.ZodNumber;
|
|
77
|
+
}, z.core.$strict>]>;
|
|
78
|
+
export type TtsFitWorkload = z.infer<typeof ttsFitWorkloadSchema>;
|
|
62
79
|
/**
|
|
63
80
|
* A load to assess, in `loadModel`'s own parameters. The engine's plugin
|
|
64
81
|
* resolves it, so the config and the artifact keys the fitter reads are the
|
|
@@ -68,6 +85,12 @@ export declare const modelFitExecutionSchema: z.ZodEnum<{
|
|
|
68
85
|
* artifact, or to the file itself where it is already on disk.
|
|
69
86
|
*/
|
|
70
87
|
export declare const modelFitCandidateSchema: z.ZodObject<{
|
|
88
|
+
transcriptionWorkload: z.ZodOptional<z.ZodObject<{
|
|
89
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
90
|
+
hotwords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
91
|
+
maxNewTokens: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
audioSeconds: z.ZodNumber;
|
|
93
|
+
}, z.core.$strict>>;
|
|
71
94
|
modelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
72
95
|
src: z.ZodString;
|
|
73
96
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -90,10 +113,13 @@ export declare const modelFitCandidateSchema: z.ZodObject<{
|
|
|
90
113
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
91
114
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
92
115
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
116
|
+
"llamacpp-decision": "llamacpp-decision";
|
|
117
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
93
118
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
94
119
|
"onnx-tts": "onnx-tts";
|
|
95
120
|
"tts-ggml": "tts-ggml";
|
|
96
121
|
"parakeet-transcription": "parakeet-transcription";
|
|
122
|
+
"moss-transcribe": "moss-transcribe";
|
|
97
123
|
"ggml-ocr": "ggml-ocr";
|
|
98
124
|
"sdcpp-generation": "sdcpp-generation";
|
|
99
125
|
"audiogen-ggml": "audiogen-ggml";
|
|
@@ -118,10 +144,13 @@ export declare const modelFitCandidateSchema: z.ZodObject<{
|
|
|
118
144
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
119
145
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
120
146
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
147
|
+
"llamacpp-decision": "llamacpp-decision";
|
|
148
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
121
149
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
122
150
|
"onnx-tts": "onnx-tts";
|
|
123
151
|
"tts-ggml": "tts-ggml";
|
|
124
152
|
"parakeet-transcription": "parakeet-transcription";
|
|
153
|
+
"moss-transcribe": "moss-transcribe";
|
|
125
154
|
"ggml-ocr": "ggml-ocr";
|
|
126
155
|
"sdcpp-generation": "sdcpp-generation";
|
|
127
156
|
"audiogen-ggml": "audiogen-ggml";
|
|
@@ -134,10 +163,24 @@ export declare const modelFitCandidateSchema: z.ZodObject<{
|
|
|
134
163
|
parakeet: "parakeet";
|
|
135
164
|
classification: "classification";
|
|
136
165
|
}>>;
|
|
166
|
+
ttsWorkload: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
167
|
+
promptRows: z.ZodNumber;
|
|
168
|
+
referenceSamples: z.ZodNumber;
|
|
169
|
+
streaming: z.ZodBoolean;
|
|
170
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
171
|
+
prompt: z.ZodString;
|
|
172
|
+
seconds: z.ZodNumber;
|
|
173
|
+
}, z.core.$strict>]>>;
|
|
137
174
|
modelConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
138
175
|
}, z.core.$strip>;
|
|
139
176
|
export declare const assessModelFitInputSchema: z.ZodObject<{
|
|
140
177
|
models: z.ZodArray<z.ZodObject<{
|
|
178
|
+
transcriptionWorkload: z.ZodOptional<z.ZodObject<{
|
|
179
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
180
|
+
hotwords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
181
|
+
maxNewTokens: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
audioSeconds: z.ZodNumber;
|
|
183
|
+
}, z.core.$strict>>;
|
|
141
184
|
modelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
142
185
|
src: z.ZodString;
|
|
143
186
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -160,10 +203,13 @@ export declare const assessModelFitInputSchema: z.ZodObject<{
|
|
|
160
203
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
161
204
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
162
205
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
206
|
+
"llamacpp-decision": "llamacpp-decision";
|
|
207
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
163
208
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
164
209
|
"onnx-tts": "onnx-tts";
|
|
165
210
|
"tts-ggml": "tts-ggml";
|
|
166
211
|
"parakeet-transcription": "parakeet-transcription";
|
|
212
|
+
"moss-transcribe": "moss-transcribe";
|
|
167
213
|
"ggml-ocr": "ggml-ocr";
|
|
168
214
|
"sdcpp-generation": "sdcpp-generation";
|
|
169
215
|
"audiogen-ggml": "audiogen-ggml";
|
|
@@ -188,10 +234,13 @@ export declare const assessModelFitInputSchema: z.ZodObject<{
|
|
|
188
234
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
189
235
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
190
236
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
237
|
+
"llamacpp-decision": "llamacpp-decision";
|
|
238
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
191
239
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
192
240
|
"onnx-tts": "onnx-tts";
|
|
193
241
|
"tts-ggml": "tts-ggml";
|
|
194
242
|
"parakeet-transcription": "parakeet-transcription";
|
|
243
|
+
"moss-transcribe": "moss-transcribe";
|
|
195
244
|
"ggml-ocr": "ggml-ocr";
|
|
196
245
|
"sdcpp-generation": "sdcpp-generation";
|
|
197
246
|
"audiogen-ggml": "audiogen-ggml";
|
|
@@ -204,6 +253,14 @@ export declare const assessModelFitInputSchema: z.ZodObject<{
|
|
|
204
253
|
parakeet: "parakeet";
|
|
205
254
|
classification: "classification";
|
|
206
255
|
}>>;
|
|
256
|
+
ttsWorkload: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
257
|
+
promptRows: z.ZodNumber;
|
|
258
|
+
referenceSamples: z.ZodNumber;
|
|
259
|
+
streaming: z.ZodBoolean;
|
|
260
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
261
|
+
prompt: z.ZodString;
|
|
262
|
+
seconds: z.ZodNumber;
|
|
263
|
+
}, z.core.$strict>]>>;
|
|
207
264
|
modelConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
208
265
|
}, z.core.$strip>>;
|
|
209
266
|
execution: z.ZodDefault<z.ZodEnum<{
|
|
@@ -230,18 +287,14 @@ export declare const modelFitBasisSchema: z.ZodEnum<{
|
|
|
230
287
|
/**
|
|
231
288
|
* What kind of evidence a verdict rests on.
|
|
232
289
|
*
|
|
233
|
-
* - `
|
|
234
|
-
*
|
|
290
|
+
* - `native-fit`: the engine's own fitter, run against the model or the
|
|
291
|
+
* registry's weightless description of it. It is the answer the loader would
|
|
292
|
+
* give on this machine, and the only evidence that can confirm a fit.
|
|
235
293
|
* - `computed-only`: a floor computed from catalog facts alone — artifact bytes,
|
|
236
294
|
* plus the KV cache for llama.cpp models. It omits every engine cost that
|
|
237
295
|
* only a real load can tell, so it can refuse a model but never confirm one.
|
|
238
|
-
* This is what an uncalibrated platform, including Android and iOS, reports.
|
|
239
|
-
* - `native-fit`: the engine's own fitter, run against the registry's weightless
|
|
240
|
-
* description of the artifact. It is the answer the loader would give on this
|
|
241
|
-
* machine, not a model of it, so it outranks `calibration` where both exist.
|
|
242
296
|
*/
|
|
243
297
|
export declare const modelFitEvidenceSchema: z.ZodEnum<{
|
|
244
|
-
calibration: "calibration";
|
|
245
298
|
"computed-only": "computed-only";
|
|
246
299
|
"native-fit": "native-fit";
|
|
247
300
|
}>;
|
|
@@ -260,14 +313,9 @@ export declare const modelFitModelResultSchema: z.ZodObject<{
|
|
|
260
313
|
"likely-too-large": "likely-too-large";
|
|
261
314
|
}>;
|
|
262
315
|
evidence: z.ZodOptional<z.ZodEnum<{
|
|
263
|
-
calibration: "calibration";
|
|
264
316
|
"computed-only": "computed-only";
|
|
265
317
|
"native-fit": "native-fit";
|
|
266
318
|
}>>;
|
|
267
|
-
estimate: z.ZodOptional<z.ZodObject<{
|
|
268
|
-
lowerBoundBytes: z.ZodNumber;
|
|
269
|
-
upperBoundBytes: z.ZodNumber;
|
|
270
|
-
}, z.core.$strip>>;
|
|
271
319
|
floorBytes: z.ZodOptional<z.ZodNumber>;
|
|
272
320
|
estimatorVersion: z.ZodOptional<z.ZodString>;
|
|
273
321
|
device: z.ZodOptional<z.ZodString>;
|
|
@@ -290,7 +338,6 @@ export declare const assessModelFitResultSchema: z.ZodObject<{
|
|
|
290
338
|
concurrent: "concurrent";
|
|
291
339
|
}>;
|
|
292
340
|
evidence: z.ZodOptional<z.ZodEnum<{
|
|
293
|
-
calibration: "calibration";
|
|
294
341
|
"computed-only": "computed-only";
|
|
295
342
|
"native-fit": "native-fit";
|
|
296
343
|
}>>;
|
|
@@ -301,10 +348,6 @@ export declare const assessModelFitResultSchema: z.ZodObject<{
|
|
|
301
348
|
reservedBytes: z.ZodNumber;
|
|
302
349
|
availableAfterReserveBytes: z.ZodNumber;
|
|
303
350
|
}, z.core.$strip>>;
|
|
304
|
-
estimate: z.ZodOptional<z.ZodObject<{
|
|
305
|
-
lowerBoundBytes: z.ZodNumber;
|
|
306
|
-
upperBoundBytes: z.ZodNumber;
|
|
307
|
-
}, z.core.$strip>>;
|
|
308
351
|
floorBytes: z.ZodOptional<z.ZodNumber>;
|
|
309
352
|
models: z.ZodArray<z.ZodObject<{
|
|
310
353
|
name: z.ZodString;
|
|
@@ -314,14 +357,9 @@ export declare const assessModelFitResultSchema: z.ZodObject<{
|
|
|
314
357
|
"likely-too-large": "likely-too-large";
|
|
315
358
|
}>;
|
|
316
359
|
evidence: z.ZodOptional<z.ZodEnum<{
|
|
317
|
-
calibration: "calibration";
|
|
318
360
|
"computed-only": "computed-only";
|
|
319
361
|
"native-fit": "native-fit";
|
|
320
362
|
}>>;
|
|
321
|
-
estimate: z.ZodOptional<z.ZodObject<{
|
|
322
|
-
lowerBoundBytes: z.ZodNumber;
|
|
323
|
-
upperBoundBytes: z.ZodNumber;
|
|
324
|
-
}, z.core.$strip>>;
|
|
325
363
|
floorBytes: z.ZodOptional<z.ZodNumber>;
|
|
326
364
|
estimatorVersion: z.ZodOptional<z.ZodString>;
|
|
327
365
|
device: z.ZodOptional<z.ZodString>;
|
|
@@ -331,19 +369,18 @@ export declare const assessModelFitResultSchema: z.ZodObject<{
|
|
|
331
369
|
assumptions: z.ZodArray<z.ZodString>;
|
|
332
370
|
}, z.core.$strip>;
|
|
333
371
|
/**
|
|
334
|
-
* The other fit question
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
372
|
+
* The other fit question: `assessModelFit` above answers "should I download
|
|
373
|
+
* this?" about a set of models against a memory budget, while the native probe
|
|
374
|
+
* answers "will the load I am about to run fit?" by handing one model file and
|
|
375
|
+
* the resolved settings to the fitter of the engine that would run it. Two
|
|
376
|
+
* scopes, so two verdict vocabularies:
|
|
339
377
|
*
|
|
340
|
-
* - `likely-fits` / `likely-too-large` hedge because
|
|
378
|
+
* - `likely-fits` / `likely-too-large` hedge because the set is judged against a
|
|
379
|
+
* sampled budget that the rest of the machine moves.
|
|
341
380
|
* - `fit` / `does-not-fit` do not, because the probe measured this build of this
|
|
342
381
|
* file against this device.
|
|
343
382
|
*
|
|
344
|
-
*
|
|
345
|
-
* it saw the artifact and the resolved load settings. `assessModelFit` is the
|
|
346
|
-
* answer available before the bytes are on disk. Neither denies a load today.
|
|
383
|
+
* Neither denies a load.
|
|
347
384
|
*/
|
|
348
385
|
export declare const nativeProbeVerdictSchema: z.ZodEnum<{
|
|
349
386
|
unknown: "unknown";
|
|
@@ -364,7 +401,7 @@ export declare const nativeProbePlanSchema: z.ZodObject<{
|
|
|
364
401
|
* the engine separates them, and are absent together where it reports only a
|
|
365
402
|
* total. They are summed across devices, as `deviceBytes` is, so a load spread
|
|
366
403
|
* over more than one device is described by its totals and `deviceName` names
|
|
367
|
-
* the first.
|
|
404
|
+
* the first non-CPU row.
|
|
368
405
|
*
|
|
369
406
|
* `deviceFreeBytes` is the backend's own gauge. A device sharing the host pool,
|
|
370
407
|
* as Apple silicon and Adreno/Mali do, reports what it could address rather
|
|
@@ -379,6 +416,14 @@ export declare const nativeProbeProjectionSchema: z.ZodObject<{
|
|
|
379
416
|
computeBytes: z.ZodOptional<z.ZodNumber>;
|
|
380
417
|
deviceFreeBytes: z.ZodOptional<z.ZodNumber>;
|
|
381
418
|
deviceTotalBytes: z.ZodOptional<z.ZodNumber>;
|
|
419
|
+
devices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
420
|
+
name: z.ZodString;
|
|
421
|
+
totalBytes: z.ZodNumber;
|
|
422
|
+
freeBytes: z.ZodNumber;
|
|
423
|
+
weightsBytes: z.ZodNumber;
|
|
424
|
+
contextBytes: z.ZodNumber;
|
|
425
|
+
computeBytes: z.ZodNumber;
|
|
426
|
+
}, z.core.$strip>>>;
|
|
382
427
|
report: z.ZodOptional<z.ZodString>;
|
|
383
428
|
}, z.core.$strip>;
|
|
384
429
|
export declare const nativeProbeFitSchema: z.ZodObject<{
|
|
@@ -406,11 +451,25 @@ export declare const nativeProbeFitSchema: z.ZodObject<{
|
|
|
406
451
|
computeBytes: z.ZodOptional<z.ZodNumber>;
|
|
407
452
|
deviceFreeBytes: z.ZodOptional<z.ZodNumber>;
|
|
408
453
|
deviceTotalBytes: z.ZodOptional<z.ZodNumber>;
|
|
454
|
+
devices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
455
|
+
name: z.ZodString;
|
|
456
|
+
totalBytes: z.ZodNumber;
|
|
457
|
+
freeBytes: z.ZodNumber;
|
|
458
|
+
weightsBytes: z.ZodNumber;
|
|
459
|
+
contextBytes: z.ZodNumber;
|
|
460
|
+
computeBytes: z.ZodNumber;
|
|
461
|
+
}, z.core.$strip>>>;
|
|
409
462
|
report: z.ZodOptional<z.ZodString>;
|
|
410
463
|
}, z.core.$strip>>;
|
|
411
464
|
}, z.core.$strip>;
|
|
412
465
|
export declare const assessModelFitRequestSchema: z.ZodObject<{
|
|
413
466
|
models: z.ZodArray<z.ZodObject<{
|
|
467
|
+
transcriptionWorkload: z.ZodOptional<z.ZodObject<{
|
|
468
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
469
|
+
hotwords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
470
|
+
maxNewTokens: z.ZodOptional<z.ZodNumber>;
|
|
471
|
+
audioSeconds: z.ZodNumber;
|
|
472
|
+
}, z.core.$strict>>;
|
|
414
473
|
modelSrc: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
415
474
|
src: z.ZodString;
|
|
416
475
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -433,10 +492,13 @@ export declare const assessModelFitRequestSchema: z.ZodObject<{
|
|
|
433
492
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
434
493
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
435
494
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
495
|
+
"llamacpp-decision": "llamacpp-decision";
|
|
496
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
436
497
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
437
498
|
"onnx-tts": "onnx-tts";
|
|
438
499
|
"tts-ggml": "tts-ggml";
|
|
439
500
|
"parakeet-transcription": "parakeet-transcription";
|
|
501
|
+
"moss-transcribe": "moss-transcribe";
|
|
440
502
|
"ggml-ocr": "ggml-ocr";
|
|
441
503
|
"sdcpp-generation": "sdcpp-generation";
|
|
442
504
|
"audiogen-ggml": "audiogen-ggml";
|
|
@@ -461,10 +523,13 @@ export declare const assessModelFitRequestSchema: z.ZodObject<{
|
|
|
461
523
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
462
524
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
463
525
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
526
|
+
"llamacpp-decision": "llamacpp-decision";
|
|
527
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
464
528
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
465
529
|
"onnx-tts": "onnx-tts";
|
|
466
530
|
"tts-ggml": "tts-ggml";
|
|
467
531
|
"parakeet-transcription": "parakeet-transcription";
|
|
532
|
+
"moss-transcribe": "moss-transcribe";
|
|
468
533
|
"ggml-ocr": "ggml-ocr";
|
|
469
534
|
"sdcpp-generation": "sdcpp-generation";
|
|
470
535
|
"audiogen-ggml": "audiogen-ggml";
|
|
@@ -477,6 +542,14 @@ export declare const assessModelFitRequestSchema: z.ZodObject<{
|
|
|
477
542
|
parakeet: "parakeet";
|
|
478
543
|
classification: "classification";
|
|
479
544
|
}>>;
|
|
545
|
+
ttsWorkload: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
546
|
+
promptRows: z.ZodNumber;
|
|
547
|
+
referenceSamples: z.ZodNumber;
|
|
548
|
+
streaming: z.ZodBoolean;
|
|
549
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
550
|
+
prompt: z.ZodString;
|
|
551
|
+
seconds: z.ZodNumber;
|
|
552
|
+
}, z.core.$strict>]>>;
|
|
480
553
|
modelConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
481
554
|
}, z.core.$strip>>;
|
|
482
555
|
execution: z.ZodDefault<z.ZodEnum<{
|
|
@@ -503,7 +576,6 @@ export declare const assessModelFitResponseSchema: z.ZodObject<{
|
|
|
503
576
|
concurrent: "concurrent";
|
|
504
577
|
}>;
|
|
505
578
|
evidence: z.ZodOptional<z.ZodEnum<{
|
|
506
|
-
calibration: "calibration";
|
|
507
579
|
"computed-only": "computed-only";
|
|
508
580
|
"native-fit": "native-fit";
|
|
509
581
|
}>>;
|
|
@@ -514,10 +586,6 @@ export declare const assessModelFitResponseSchema: z.ZodObject<{
|
|
|
514
586
|
reservedBytes: z.ZodNumber;
|
|
515
587
|
availableAfterReserveBytes: z.ZodNumber;
|
|
516
588
|
}, z.core.$strip>>;
|
|
517
|
-
estimate: z.ZodOptional<z.ZodObject<{
|
|
518
|
-
lowerBoundBytes: z.ZodNumber;
|
|
519
|
-
upperBoundBytes: z.ZodNumber;
|
|
520
|
-
}, z.core.$strip>>;
|
|
521
589
|
floorBytes: z.ZodOptional<z.ZodNumber>;
|
|
522
590
|
models: z.ZodArray<z.ZodObject<{
|
|
523
591
|
name: z.ZodString;
|
|
@@ -527,14 +595,9 @@ export declare const assessModelFitResponseSchema: z.ZodObject<{
|
|
|
527
595
|
"likely-too-large": "likely-too-large";
|
|
528
596
|
}>;
|
|
529
597
|
evidence: z.ZodOptional<z.ZodEnum<{
|
|
530
|
-
calibration: "calibration";
|
|
531
598
|
"computed-only": "computed-only";
|
|
532
599
|
"native-fit": "native-fit";
|
|
533
600
|
}>>;
|
|
534
|
-
estimate: z.ZodOptional<z.ZodObject<{
|
|
535
|
-
lowerBoundBytes: z.ZodNumber;
|
|
536
|
-
upperBoundBytes: z.ZodNumber;
|
|
537
|
-
}, z.core.$strip>>;
|
|
538
601
|
floorBytes: z.ZodOptional<z.ZodNumber>;
|
|
539
602
|
estimatorVersion: z.ZodOptional<z.ZodString>;
|
|
540
603
|
device: z.ZodOptional<z.ZodString>;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { modelRegistryEntrySchema } from '
|
|
3
|
-
import { modelSrcInputSchema } from '
|
|
4
|
-
import { modelTypeInputSchema } from '
|
|
2
|
+
import { modelRegistryEntrySchema } from '../schemas/registry.js';
|
|
3
|
+
import { modelSrcInputSchema } from '../schemas/model-src-utils.js';
|
|
4
|
+
import { modelTypeInputSchema } from '../schemas/model-types.js';
|
|
5
|
+
import { transcribeParamsSchema } from '../schemas/transcription.js';
|
|
6
|
+
export const transcriptionFitWorkloadSchema = transcribeParamsSchema
|
|
7
|
+
.pick({ prompt: true, hotwords: true, maxNewTokens: true })
|
|
8
|
+
.extend({ audioSeconds: z.number().positive().describe('Longest whole recording to project.') })
|
|
9
|
+
.strict()
|
|
10
|
+
.refine((value) => value.prompt === undefined || !value.hotwords?.length, {
|
|
11
|
+
message: 'MOSS prompt cannot be combined with hotwords'
|
|
12
|
+
});
|
|
5
13
|
/**
|
|
6
14
|
* Advisory outcome of a pre-download fit assessment.
|
|
7
15
|
*
|
|
@@ -26,7 +34,7 @@ export const modelFitModelRefSchema = modelRegistryEntrySchema
|
|
|
26
34
|
registryPath: z
|
|
27
35
|
.string()
|
|
28
36
|
.optional()
|
|
29
|
-
.describe('Registry coordinates. Present on a catalog constant; without them no fit stub can be resolved and the assessment falls back to
|
|
37
|
+
.describe('Registry coordinates. Present on a catalog constant; without them no fit stub can be resolved and the assessment falls back to the computed floor.'),
|
|
30
38
|
registrySource: z
|
|
31
39
|
.string()
|
|
32
40
|
.optional()
|
|
@@ -42,6 +50,32 @@ export const modelFitModelRefSchema = modelRegistryEntrySchema
|
|
|
42
50
|
* - `concurrent`: every model stays resident and every peak is counted.
|
|
43
51
|
*/
|
|
44
52
|
export const modelFitExecutionSchema = z.enum(['sequential', 'concurrent']);
|
|
53
|
+
/** Fit-only workload used to estimate MOSS text-to-speech memory requirements. */
|
|
54
|
+
export const ttsFitWorkloadSchema = z.union([
|
|
55
|
+
z
|
|
56
|
+
.strictObject({
|
|
57
|
+
promptRows: z
|
|
58
|
+
.number()
|
|
59
|
+
.int()
|
|
60
|
+
.positive()
|
|
61
|
+
.max(2147483647)
|
|
62
|
+
.describe('Complete native prompt rows, including dialogue and references.'),
|
|
63
|
+
referenceSamples: z
|
|
64
|
+
.number()
|
|
65
|
+
.int()
|
|
66
|
+
.nonnegative()
|
|
67
|
+
.max(2147483647)
|
|
68
|
+
.describe('Total mono reference audio samples.'),
|
|
69
|
+
streaming: z.boolean().describe('Whether the MOSS workload uses native streaming.')
|
|
70
|
+
})
|
|
71
|
+
.meta({ title: 'MossTtsFitWorkload' }),
|
|
72
|
+
z
|
|
73
|
+
.strictObject({
|
|
74
|
+
prompt: z.string().min(1).describe('Sound-effect description.'),
|
|
75
|
+
seconds: z.number().positive().max(30).describe('Sound-effect duration in seconds, up to 30.')
|
|
76
|
+
})
|
|
77
|
+
.meta({ title: 'MossSoundEffectFitWorkload' })
|
|
78
|
+
]);
|
|
45
79
|
/**
|
|
46
80
|
* A load to assess, in `loadModel`'s own parameters. The engine's plugin
|
|
47
81
|
* resolves it, so the config and the artifact keys the fitter reads are the
|
|
@@ -51,12 +85,18 @@ export const modelFitExecutionSchema = z.enum(['sequential', 'concurrent']);
|
|
|
51
85
|
* artifact, or to the file itself where it is already on disk.
|
|
52
86
|
*/
|
|
53
87
|
export const modelFitCandidateSchema = z.object({
|
|
88
|
+
transcriptionWorkload: transcriptionFitWorkloadSchema
|
|
89
|
+
.optional()
|
|
90
|
+
.describe('MOSS fit-only workload. Required for a native MOSS projection; does not configure loading.'),
|
|
54
91
|
modelSrc: modelSrcInputSchema
|
|
55
92
|
.optional()
|
|
56
93
|
.describe('The model to assess, as `loadModel` takes it. Optional for the loads `loadModel` also takes without one, where every source is a config field.'),
|
|
57
94
|
modelType: modelTypeInputSchema
|
|
58
95
|
.optional()
|
|
59
96
|
.describe('Engine that would run the load. Inferred from `modelSrc` when omitted, as `loadModel` infers it; required only where the source does not name one.'),
|
|
97
|
+
ttsWorkload: ttsFitWorkloadSchema
|
|
98
|
+
.optional()
|
|
99
|
+
.describe('Fit-only MOSS-TTS/TTSD or MOSS-SoundEffect workload; never passed to model loading.'),
|
|
60
100
|
modelConfig: z
|
|
61
101
|
.record(z.string(), z.unknown())
|
|
62
102
|
.optional()
|
|
@@ -75,10 +115,6 @@ export const assessModelFitInputSchema = z.object({
|
|
|
75
115
|
.default('interactive-v1')
|
|
76
116
|
.describe('Headroom policy. `interactive-v1` withholds 20% of the memory available right now, capped at 2 GiB on desktop and 1 GiB on mobile.')
|
|
77
117
|
});
|
|
78
|
-
const byteRangeSchema = z.object({
|
|
79
|
-
lowerBoundBytes: z.number(),
|
|
80
|
-
upperBoundBytes: z.number()
|
|
81
|
-
});
|
|
82
118
|
/**
|
|
83
119
|
* What evidence the budget was derived from.
|
|
84
120
|
*
|
|
@@ -97,17 +133,14 @@ export const modelFitBasisSchema = z.enum([
|
|
|
97
133
|
/**
|
|
98
134
|
* What kind of evidence a verdict rests on.
|
|
99
135
|
*
|
|
100
|
-
* - `
|
|
101
|
-
*
|
|
136
|
+
* - `native-fit`: the engine's own fitter, run against the model or the
|
|
137
|
+
* registry's weightless description of it. It is the answer the loader would
|
|
138
|
+
* give on this machine, and the only evidence that can confirm a fit.
|
|
102
139
|
* - `computed-only`: a floor computed from catalog facts alone — artifact bytes,
|
|
103
140
|
* plus the KV cache for llama.cpp models. It omits every engine cost that
|
|
104
141
|
* only a real load can tell, so it can refuse a model but never confirm one.
|
|
105
|
-
* This is what an uncalibrated platform, including Android and iOS, reports.
|
|
106
|
-
* - `native-fit`: the engine's own fitter, run against the registry's weightless
|
|
107
|
-
* description of the artifact. It is the answer the loader would give on this
|
|
108
|
-
* machine, not a model of it, so it outranks `calibration` where both exist.
|
|
109
142
|
*/
|
|
110
|
-
export const modelFitEvidenceSchema = z.enum(['
|
|
143
|
+
export const modelFitEvidenceSchema = z.enum(['computed-only', 'native-fit']);
|
|
111
144
|
export const modelFitBudgetSchema = z.object({
|
|
112
145
|
totalBytes: z
|
|
113
146
|
.number()
|
|
@@ -129,9 +162,6 @@ export const modelFitModelResultSchema = z.object({
|
|
|
129
162
|
evidence: modelFitEvidenceSchema
|
|
130
163
|
.optional()
|
|
131
164
|
.describe('What the verdict rests on. Absent when nothing could be computed for this model, e.g. no catalog profile.'),
|
|
132
|
-
estimate: byteRangeSchema
|
|
133
|
-
.optional()
|
|
134
|
-
.describe('Two-sided bound from calibrated coefficients. Absent under computed-only evidence, or when this model assessed as `unknown` for want of any evidence.'),
|
|
135
165
|
floorBytes: z
|
|
136
166
|
.number()
|
|
137
167
|
.optional()
|
|
@@ -152,11 +182,8 @@ export const assessModelFitResultSchema = z.object({
|
|
|
152
182
|
execution: modelFitExecutionSchema.describe('The declared execution mode this result assumed.'),
|
|
153
183
|
evidence: modelFitEvidenceSchema
|
|
154
184
|
.optional()
|
|
155
|
-
.describe('The weakest evidence among the candidates: `computed-only` as soon as one model has only a floor, since the combined verdict can then never be `likely-fits`. Absent whenever any candidate could not be assessed at all, so an `unknown` that carries `evidence` is a near-miss or
|
|
185
|
+
.describe('The weakest evidence among the candidates: `computed-only` as soon as one model has only a floor, since the combined verdict can then never be `likely-fits`. Absent whenever any candidate could not be assessed at all, so an `unknown` that carries `evidence` is a near-miss or a floor, never a missing model.'),
|
|
156
186
|
budget: modelFitBudgetSchema.optional().describe('Absent when memory evidence was unusable.'),
|
|
157
|
-
estimate: byteRangeSchema
|
|
158
|
-
.optional()
|
|
159
|
-
.describe('Combined two-sided bound. Absent when the combined verdict is `unknown` for want of evidence, and under computed-only evidence, which has no upper bound.'),
|
|
160
187
|
floorBytes: z
|
|
161
188
|
.number()
|
|
162
189
|
.optional()
|
|
@@ -169,19 +196,18 @@ export const assessModelFitResultSchema = z.object({
|
|
|
169
196
|
});
|
|
170
197
|
// ============== Native probe (pre-load) ==============
|
|
171
198
|
/**
|
|
172
|
-
* The other fit question
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
199
|
+
* The other fit question: `assessModelFit` above answers "should I download
|
|
200
|
+
* this?" about a set of models against a memory budget, while the native probe
|
|
201
|
+
* answers "will the load I am about to run fit?" by handing one model file and
|
|
202
|
+
* the resolved settings to the fitter of the engine that would run it. Two
|
|
203
|
+
* scopes, so two verdict vocabularies:
|
|
177
204
|
*
|
|
178
|
-
* - `likely-fits` / `likely-too-large` hedge because
|
|
205
|
+
* - `likely-fits` / `likely-too-large` hedge because the set is judged against a
|
|
206
|
+
* sampled budget that the rest of the machine moves.
|
|
179
207
|
* - `fit` / `does-not-fit` do not, because the probe measured this build of this
|
|
180
208
|
* file against this device.
|
|
181
209
|
*
|
|
182
|
-
*
|
|
183
|
-
* it saw the artifact and the resolved load settings. `assessModelFit` is the
|
|
184
|
-
* answer available before the bytes are on disk. Neither denies a load today.
|
|
210
|
+
* Neither denies a load.
|
|
185
211
|
*/
|
|
186
212
|
export const nativeProbeVerdictSchema = z.enum(['fit', 'does-not-fit', 'unknown']);
|
|
187
213
|
export const nativeProbePlanSchema = z.object({
|
|
@@ -198,7 +224,7 @@ export const nativeProbePlanSchema = z.object({
|
|
|
198
224
|
* the engine separates them, and are absent together where it reports only a
|
|
199
225
|
* total. They are summed across devices, as `deviceBytes` is, so a load spread
|
|
200
226
|
* over more than one device is described by its totals and `deviceName` names
|
|
201
|
-
* the first.
|
|
227
|
+
* the first non-CPU row.
|
|
202
228
|
*
|
|
203
229
|
* `deviceFreeBytes` is the backend's own gauge. A device sharing the host pool,
|
|
204
230
|
* as Apple silicon and Adreno/Mali do, reports what it could address rather
|
|
@@ -222,6 +248,17 @@ export const nativeProbeProjectionSchema = z.object({
|
|
|
222
248
|
.describe('Compute buffers and graph arenas, within `deviceBytes`.'),
|
|
223
249
|
deviceFreeBytes: z.number().optional().describe('Device memory free when the probe ran.'),
|
|
224
250
|
deviceTotalBytes: z.number().optional().describe('Device memory installed.'),
|
|
251
|
+
devices: z
|
|
252
|
+
.array(z.object({
|
|
253
|
+
name: z.string().describe('Device name as the engine registered it.'),
|
|
254
|
+
totalBytes: z.number().describe('Device memory installed.'),
|
|
255
|
+
freeBytes: z.number().describe('Device memory free when the probe ran.'),
|
|
256
|
+
weightsBytes: z.number().describe('Model weights placed on this device.'),
|
|
257
|
+
contextBytes: z.number().describe('Context and KV cache placed on this device.'),
|
|
258
|
+
computeBytes: z.number().describe('Compute buffers placed on this device.')
|
|
259
|
+
}))
|
|
260
|
+
.optional()
|
|
261
|
+
.describe('One row per device the load was placed on, including the CPU backend, host excluded — `hostBytes` carries that. The flattened totals sum these rows, and `deviceName` names the first non-CPU row.'),
|
|
225
262
|
report: z
|
|
226
263
|
.string()
|
|
227
264
|
.optional()
|