@qvac/inference 0.22.0 → 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 +59 -40
- package/README.md +1 -1
- package/dist/api/audio-gen.js +1 -1
- package/dist/api/completion-stream.d.ts +2 -1
- package/dist/api/completion-stream.js +3 -1
- package/dist/api/decide.js +1 -1
- 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/index.d.ts +39 -38
- package/dist/api/index.js +38 -37
- 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/unload-model.js +1 -1
- package/dist/api/video.js +1 -1
- 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 +6 -0
- package/dist/errors/index.js +13 -1
- package/dist/handlers/assess-model-fit.d.ts +1 -1
- package/dist/handlers/assess-model-fit.js +4 -4
- 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 +2 -3
- 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/logging-stream.d.ts +2 -1
- package/dist/handlers/logging-stream.js +23 -7
- package/dist/handlers/registry.js +4 -2
- 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 +3 -3
- package/dist/logging/utils.js +1 -1
- package/dist/{resources/model-fit → model-fit}/assess.d.ts +4 -4
- package/dist/{resources/model-fit → model-fit}/assess.js +3 -3
- 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} +4 -4
- package/dist/{resources/model-fit/fit-stub/fetch-fit-stub.d.ts → model-fit/description/fetch.d.ts} +1 -1
- package/dist/{resources/model-fit/fit-stub/fetch-fit-stub.js → model-fit/description/fetch.js} +5 -5
- 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} +2 -2
- package/dist/{resources/model-fit/fit-stub/resolve-load-from-stubs.d.ts → model-fit/description/resolve-load.d.ts} +3 -3
- package/dist/{resources/model-fit/fit-stub/resolve-load-from-stubs.js → model-fit/description/resolve-load.js} +6 -6
- package/dist/{resources/model-fit → model-fit}/floor.d.ts +2 -2
- package/dist/{resources/model-fit → model-fit}/floor.js +1 -1
- package/dist/{resources/model-fit → model-fit}/kv-cache.d.ts +1 -1
- package/dist/{resources/model-fit/native-probe/advisory-fit.d.ts → model-fit/load-check.d.ts} +8 -10
- package/dist/{resources/model-fit/native-probe/advisory-fit.js → model-fit/load-check.js} +14 -40
- package/dist/{resources/model-fit/types.d.ts → model-fit/platform.d.ts} +8 -0
- package/dist/{resources/model-fit/native-probe/create-fit-request.d.ts → model-fit/request/create.d.ts} +3 -3
- package/dist/{resources/model-fit/native-probe/create-fit-request.js → model-fit/request/create.js} +8 -8
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/asr.d.ts +2 -2
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/asr.js +9 -1
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/audiogen.d.ts +1 -1
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/audiogen.js +1 -1
- 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 -2
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/llama.js +13 -10
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/nmt.d.ts +1 -1
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/nmt.js +1 -1
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/ocr.d.ts +1 -1
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/ocr.js +1 -1
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/tts.d.ts +2 -2
- package/dist/{resources/model-fit/native-probe → model-fit/request}/engines/tts.js +1 -1
- package/dist/{resources/model-fit/native-probe/engine-fit.d.ts → model-fit/run/engine.d.ts} +3 -4
- package/dist/{resources/model-fit/native-probe/engine-fit.js → model-fit/run/engine.js} +1 -1
- 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 +510 -0
- package/dist/models/registry/models.js +2946 -2410
- package/dist/models/registry/resource-profiles.js +203 -1
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-edit-stream.js +2 -2
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +2 -2
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-understand.js +2 -2
- package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +60 -54
- package/dist/plugins/builtin/audiogen-ggml/plugin.js +4 -4
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +26 -25
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +4 -4
- package/dist/plugins/builtin/ggml-classification/plugin.d.ts +4 -4
- package/dist/plugins/builtin/ggml-classification/plugin.js +1 -1
- package/dist/plugins/builtin/ggml-ocr/plugin.d.ts +11 -10
- package/dist/plugins/builtin/ggml-ocr/plugin.js +4 -4
- package/dist/plugins/builtin/ggml-vla/plugin.d.ts +12 -12
- package/dist/plugins/builtin/ggml-vla/plugin.js +3 -3
- package/dist/plugins/builtin/index.d.ts +15 -14
- package/dist/plugins/builtin/index.js +15 -14
- 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 +1 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +36 -19
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.d.ts +5 -3
- package/dist/plugins/builtin/llamacpp-completion/ops/kv-cache-session.js +9 -7
- package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +169 -78
- package/dist/plugins/builtin/llamacpp-completion/plugin.js +26 -17
- package/dist/plugins/builtin/llamacpp-completion/transform.js +4 -0
- package/dist/plugins/builtin/llamacpp-decision/helpers.d.ts +0 -1
- package/dist/plugins/builtin/llamacpp-decision/helpers.js +7 -15
- package/dist/plugins/builtin/llamacpp-decision/ops/decide.js +1 -1
- package/dist/plugins/builtin/llamacpp-decision/plugin.d.ts +39 -33
- package/dist/plugins/builtin/llamacpp-decision/plugin.js +4 -3
- package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +7 -6
- package/dist/plugins/builtin/llamacpp-embedding/plugin.js +16 -6
- package/dist/plugins/builtin/llamacpp-embedding/transform.js +6 -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 +16 -16
- package/dist/plugins/builtin/moss-transcribe/plugin.js +4 -4
- package/dist/plugins/builtin/nmtcpp-translation/plugin.d.ts +18 -13
- package/dist/plugins/builtin/nmtcpp-translation/plugin.js +4 -4
- package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +29 -29
- package/dist/plugins/builtin/parakeet-transcription/plugin.js +4 -4
- 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 +19 -8
- package/dist/plugins/builtin/sdcpp-generation/ops/world.d.ts +2 -2
- package/dist/plugins/builtin/sdcpp-generation/ops/world.js +1 -1
- package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +90 -34
- package/dist/plugins/builtin/sdcpp-generation/plugin.js +45 -45
- 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/text-to-speech-stream.d.ts +1 -1
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.js +2 -2
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +2 -2
- package/dist/plugins/builtin/tts-ggml/plugin.d.ts +47 -32
- package/dist/plugins/builtin/tts-ggml/plugin.js +3 -3
- package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +34 -33
- package/dist/plugins/builtin/whispercpp-transcription/plugin.js +4 -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 +4 -3
- package/dist/plugins/ops/kv-cache-utils.js +15 -8
- package/dist/plugins/ops/load-model.d.ts +8 -2
- package/dist/plugins/ops/load-model.js +14 -5
- package/dist/plugins/ops/transcribe.js +1 -1
- 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 +2 -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 +3 -3
- 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 +3 -0
- 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 +14 -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 +2 -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 +6 -0
- package/dist/schemas/assess-model-fit.js +4 -4
- package/dist/schemas/audio-gen.d.ts +13 -1
- package/dist/schemas/audio-gen.js +3 -3
- package/dist/schemas/batch-completion-stream.d.ts +8 -2
- package/dist/schemas/batch-completion-stream.js +3 -3
- package/dist/schemas/bci-config.d.ts +1 -0
- package/dist/schemas/bci-config.js +2 -2
- package/dist/schemas/bci.d.ts +1 -1
- package/dist/schemas/bci.js +2 -2
- package/dist/schemas/cancel.d.ts +5 -0
- package/dist/schemas/cancel.js +1 -0
- package/dist/schemas/common.d.ts +478 -100
- package/dist/schemas/common.js +35 -32
- package/dist/schemas/completion-event.d.ts +8 -2
- package/dist/schemas/completion-event.js +4 -1
- package/dist/schemas/completion-stream.d.ts +11 -2
- package/dist/schemas/completion-stream.js +37 -10
- package/dist/schemas/config.d.ts +849 -6
- package/dist/schemas/config.js +12 -10
- package/dist/schemas/decision.d.ts +8 -0
- package/dist/schemas/decision.js +14 -0
- package/dist/schemas/download-asset.d.ts +6 -4
- package/dist/schemas/download-asset.js +1 -1
- package/dist/schemas/engine-addon-map.d.ts +2 -1
- package/dist/schemas/engine-addon-map.js +4 -3
- package/dist/schemas/errors.d.ts +1 -0
- package/dist/schemas/errors.js +6 -1
- package/dist/schemas/index.d.ts +51 -50
- package/dist/schemas/index.js +50 -49
- package/dist/schemas/llamacpp-config.d.ts +182 -6
- package/dist/schemas/llamacpp-config.js +102 -7
- package/dist/schemas/load-model.d.ts +3176 -646
- package/dist/schemas/load-model.js +34 -1
- package/dist/schemas/mcp-adapter.d.ts +1 -1
- package/dist/schemas/model-config-schemas.d.ts +195 -1
- package/dist/schemas/model-config-schemas.js +14 -12
- package/dist/schemas/model-fit-policy.d.ts +1 -1
- package/dist/schemas/model-info.js +2 -2
- package/dist/schemas/model-resource-profile.d.ts +1 -0
- package/dist/schemas/model-resource-profile.js +1 -1
- package/dist/schemas/model-src-utils.d.ts +6 -2
- package/dist/schemas/model-src-utils.js +2 -2
- package/dist/schemas/model-types.d.ts +5 -1
- package/dist/schemas/model-types.js +1 -0
- package/dist/schemas/ocr.d.ts +2 -0
- package/dist/schemas/ocr.js +1 -1
- package/dist/schemas/plugin.d.ts +9 -3
- package/dist/schemas/plugin.js +6 -0
- package/dist/schemas/profiling.js +1 -1
- package/dist/schemas/rag.js +1 -1
- package/dist/schemas/registry.d.ts +8 -0
- package/dist/schemas/registry.js +2 -1
- package/dist/schemas/reload-config.d.ts +6 -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/sdcpp-config.d.ts +56 -0
- package/dist/schemas/sdcpp-config.js +33 -15
- package/dist/schemas/text-to-speech.d.ts +61 -0
- package/dist/schemas/transcription-config.d.ts +5 -0
- package/dist/schemas/transcription-config.js +16 -1
- package/dist/schemas/transcription.d.ts +1 -1
- package/dist/schemas/transcription.js +1 -1
- package/dist/schemas/translate.d.ts +2 -2
- package/dist/schemas/translate.js +1 -1
- package/dist/schemas/translation-config.d.ts +20 -10
- package/dist/schemas/translation-config.js +1 -1
- package/dist/surface.d.ts +2 -1
- package/dist/surface.js +2 -1
- package/dist/utils/addon-responses.d.ts +2 -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/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/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 +1 -1
- 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-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 +1 -1
- 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 +1 -1
- package/dist/utils/tts-stats.d.ts +1 -1
- package/dist/utils/until-aborted.d.ts +7 -0
- package/dist/utils/until-aborted.js +34 -0
- package/package.json +53 -45
- 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 -49
- package/dist/resources/model-fit/native-probe/engines/diffusion.js +0 -65
- 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 -24
- package/dist/resources/model-fit/native-probe/run-in-process-fit.js +0 -123
- 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/types.js +0 -1
- /package/dist/{resources/model-fit → model-fit}/kv-cache.js +0 -0
- /package/dist/{resources/model-fit → model-fit}/platform.js +0 -0
- /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
|
@@ -155,6 +155,7 @@ export declare const nmtConfigBaseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
155
155
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
156
156
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
157
157
|
"llamacpp-decision": "llamacpp-decision";
|
|
158
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
158
159
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
159
160
|
"onnx-tts": "onnx-tts";
|
|
160
161
|
"tts-ggml": "tts-ggml";
|
|
@@ -196,6 +197,7 @@ export declare const nmtConfigBaseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
196
197
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
197
198
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
198
199
|
"llamacpp-decision": "llamacpp-decision";
|
|
200
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
199
201
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
200
202
|
"onnx-tts": "onnx-tts";
|
|
201
203
|
"tts-ggml": "tts-ggml";
|
|
@@ -250,6 +252,7 @@ export declare const nmtConfigBaseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
250
252
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
251
253
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
252
254
|
"llamacpp-decision": "llamacpp-decision";
|
|
255
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
253
256
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
254
257
|
"onnx-tts": "onnx-tts";
|
|
255
258
|
"tts-ggml": "tts-ggml";
|
|
@@ -291,6 +294,7 @@ export declare const nmtConfigBaseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
291
294
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
292
295
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
293
296
|
"llamacpp-decision": "llamacpp-decision";
|
|
297
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
294
298
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
295
299
|
"onnx-tts": "onnx-tts";
|
|
296
300
|
"tts-ggml": "tts-ggml";
|
|
@@ -332,6 +336,7 @@ export declare const nmtConfigBaseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
332
336
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
333
337
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
334
338
|
"llamacpp-decision": "llamacpp-decision";
|
|
339
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
335
340
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
336
341
|
"onnx-tts": "onnx-tts";
|
|
337
342
|
"tts-ggml": "tts-ggml";
|
|
@@ -570,6 +575,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
570
575
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
571
576
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
572
577
|
"llamacpp-decision": "llamacpp-decision";
|
|
578
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
573
579
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
574
580
|
"onnx-tts": "onnx-tts";
|
|
575
581
|
"tts-ggml": "tts-ggml";
|
|
@@ -611,6 +617,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
611
617
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
612
618
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
613
619
|
"llamacpp-decision": "llamacpp-decision";
|
|
620
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
614
621
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
615
622
|
"onnx-tts": "onnx-tts";
|
|
616
623
|
"tts-ggml": "tts-ggml";
|
|
@@ -665,6 +672,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
665
672
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
666
673
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
667
674
|
"llamacpp-decision": "llamacpp-decision";
|
|
675
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
668
676
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
669
677
|
"onnx-tts": "onnx-tts";
|
|
670
678
|
"tts-ggml": "tts-ggml";
|
|
@@ -706,6 +714,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
706
714
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
707
715
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
708
716
|
"llamacpp-decision": "llamacpp-decision";
|
|
717
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
709
718
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
710
719
|
"onnx-tts": "onnx-tts";
|
|
711
720
|
"tts-ggml": "tts-ggml";
|
|
@@ -747,6 +756,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
747
756
|
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
748
757
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
749
758
|
"llamacpp-decision": "llamacpp-decision";
|
|
759
|
+
"llamacpp-rerank": "llamacpp-rerank";
|
|
750
760
|
"nmtcpp-translation": "nmtcpp-translation";
|
|
751
761
|
"onnx-tts": "onnx-tts";
|
|
752
762
|
"tts-ggml": "tts-ggml";
|
|
@@ -860,7 +870,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
860
870
|
engine?: string | undefined;
|
|
861
871
|
expectedSize?: number | undefined;
|
|
862
872
|
sha256Checksum?: string | undefined;
|
|
863
|
-
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "llamacpp-decision" | "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;
|
|
873
|
+
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;
|
|
864
874
|
} | undefined;
|
|
865
875
|
dstVocabSrc?: string | {
|
|
866
876
|
src: string;
|
|
@@ -873,7 +883,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
873
883
|
engine?: string | undefined;
|
|
874
884
|
expectedSize?: number | undefined;
|
|
875
885
|
sha256Checksum?: string | undefined;
|
|
876
|
-
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "llamacpp-decision" | "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;
|
|
886
|
+
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;
|
|
877
887
|
} | undefined;
|
|
878
888
|
normalize?: number | undefined;
|
|
879
889
|
pivotModel?: {
|
|
@@ -888,7 +898,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
888
898
|
engine?: string | undefined;
|
|
889
899
|
expectedSize?: number | undefined;
|
|
890
900
|
sha256Checksum?: string | undefined;
|
|
891
|
-
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "llamacpp-decision" | "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;
|
|
901
|
+
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;
|
|
892
902
|
};
|
|
893
903
|
mode?: "full" | undefined;
|
|
894
904
|
beamsize?: number | undefined;
|
|
@@ -910,7 +920,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
910
920
|
engine?: string | undefined;
|
|
911
921
|
expectedSize?: number | undefined;
|
|
912
922
|
sha256Checksum?: string | undefined;
|
|
913
|
-
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "llamacpp-decision" | "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;
|
|
923
|
+
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;
|
|
914
924
|
} | undefined;
|
|
915
925
|
dstVocabSrc?: string | {
|
|
916
926
|
src: string;
|
|
@@ -923,7 +933,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
923
933
|
engine?: string | undefined;
|
|
924
934
|
expectedSize?: number | undefined;
|
|
925
935
|
sha256Checksum?: string | undefined;
|
|
926
|
-
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "llamacpp-decision" | "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;
|
|
936
|
+
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;
|
|
927
937
|
} | undefined;
|
|
928
938
|
normalize?: number | undefined;
|
|
929
939
|
} | undefined;
|
|
@@ -964,7 +974,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
964
974
|
engine?: string | undefined;
|
|
965
975
|
expectedSize?: number | undefined;
|
|
966
976
|
sha256Checksum?: string | undefined;
|
|
967
|
-
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "llamacpp-decision" | "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;
|
|
977
|
+
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;
|
|
968
978
|
} | undefined;
|
|
969
979
|
dstVocabSrc?: string | {
|
|
970
980
|
src: string;
|
|
@@ -977,7 +987,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
977
987
|
engine?: string | undefined;
|
|
978
988
|
expectedSize?: number | undefined;
|
|
979
989
|
sha256Checksum?: string | undefined;
|
|
980
|
-
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "llamacpp-decision" | "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;
|
|
990
|
+
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;
|
|
981
991
|
} | undefined;
|
|
982
992
|
normalize?: number | undefined;
|
|
983
993
|
pivotModel?: {
|
|
@@ -992,7 +1002,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
992
1002
|
engine?: string | undefined;
|
|
993
1003
|
expectedSize?: number | undefined;
|
|
994
1004
|
sha256Checksum?: string | undefined;
|
|
995
|
-
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "llamacpp-decision" | "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;
|
|
1005
|
+
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;
|
|
996
1006
|
};
|
|
997
1007
|
mode?: "full" | undefined;
|
|
998
1008
|
beamsize?: number | undefined;
|
|
@@ -1014,7 +1024,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
1014
1024
|
engine?: string | undefined;
|
|
1015
1025
|
expectedSize?: number | undefined;
|
|
1016
1026
|
sha256Checksum?: string | undefined;
|
|
1017
|
-
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "llamacpp-decision" | "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;
|
|
1027
|
+
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;
|
|
1018
1028
|
} | undefined;
|
|
1019
1029
|
dstVocabSrc?: string | {
|
|
1020
1030
|
src: string;
|
|
@@ -1027,7 +1037,7 @@ export declare const nmtConfigSchema: z.ZodPipe<z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
1027
1037
|
engine?: string | undefined;
|
|
1028
1038
|
expectedSize?: number | undefined;
|
|
1029
1039
|
sha256Checksum?: string | undefined;
|
|
1030
|
-
addon?: "embeddings" | "diffusion" | "audiogen" | "tts" | "ocr" | "vla" | "llamacpp-completion" | "whispercpp-transcription" | "bci-whispercpp-transcription" | "llamacpp-embedding" | "llamacpp-decision" | "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;
|
|
1040
|
+
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;
|
|
1031
1041
|
} | undefined;
|
|
1032
1042
|
normalize?: number | undefined;
|
|
1033
1043
|
} | undefined;
|
package/dist/surface.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { type LifecycleState, type ModelProgressUpdate, type LoadModelOptions, type LoadCustomPluginModelOptions, type DownloadAssetOptions, type Tool, type ToolCall, type ToolCallWithCall, type ToolCallError, type ToolCallEvent, type CompletionEvent, type CompletionFinal, type CompletionRun, type CompletionStats, type BatchCompletionEvent, type BatchCompletionResult, type BatchCompletionRun, type BatchPrompt, type EmbedStats, VERBOSITY, type Attachment, type TranscribeStreamSession, type TranscribeStreamMetadataSession, type TranscribeStreamConversationSession, type TranscribeStreamEvent, type VadStateEvent, type EndOfTurnEvent, type TranscribeSegment, type BciConfig, type BciTranscribeClientParams, type BciTranscribeStreamClientParams, type BciTranscribeStreamSession, type BciTranscribeStreamMetadataSession, type BciStreamOpts, type NeuralInput, type TextToSpeechStreamSession, type TextToSpeechStreamResponse, type TextToSpeechStreamClientParams, type CompletionParams, type ToolDialect, type RagSearchResult, type RagSaveEmbeddingsResult, type RagReindexResult, type RagEmbeddedDoc, type RagDoc, type RagWorkspaceInfo, type RagCloseWorkspaceParams, type RagDeleteWorkspaceParams, type RagIngestStage, type RagReindexStage, type RagSaveStage, ERROR_CODES, RAG_ERROR_CODES, type QvacConfig, type ModelInfo, type GetModelInfoParams, type GetLoadedModelInfoParams, type LoadedModelInfo, type GetSystemResourcesInput, type ResourceScope, type ResourceProvenance, type ResourceMetric, type GraphicsDriver, type GraphicsDriverCapabilities, type BackendProbeResult, type BackendDevice, type BackendDriver, type BackendFallback, type InferenceBackendDiagnostics, type CPUResourceCapabilities, type GPUResourceCapabilities, type SystemResourceCapabilities, type GPUResourceSample, type SystemResourceSample, type SystemResources, type LoadedInstance, type CacheFileInfo, toolSchema, type McpClient, type McpClientInput, type OCRClientParams, type OCRTextBlock, type OCROptions, type ClassifyClientParams, type ClassificationResult, type DiffusionClientParams, type DiffusionStreamResponse, type DiffusionStats, type VideoClientParams, type VideoStreamResponse, type VideoStats, type UpscaleClientParams, type UpscaleStreamResponse, type UpscaleStats, type VlaConfig, type VlaClientRunParams, type VlaClientRunResult, type VlaHparams, type VlaStats, definePlugin, defineHandler, defineDuplexHandler, type QvacPlugin, type CreateModelParams, type PluginModelResult, type ModelRegistryEntry, type ModelRegistryEntryAddon, PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_WHISPER, PLUGIN_BCI, PLUGIN_NMT, PLUGIN_TTS, PLUGIN_OCR, PLUGIN_DIFFUSION, PLUGIN_VLA, PLUGIN_CLASSIFICATION, BUILTIN_PLUGINS, type BuiltinPlugin, type ProfilerMode, type FinetuneValidation, type FinetuneRunParams, type FinetuneGetStateParams, type FinetuneStopParams, type FinetuneParams, type FinetuneStatus, type FinetuneProgress, type FinetuneStats, type FinetuneResult, MODEL_TYPES, ModelType } from './schemas/index.js';
|
|
2
2
|
export { type ToolInput, type ToolHandler } from './utils/tool-helpers.js';
|
|
3
3
|
export { TOOL_SEARCH_NAME, buildToolSearchTool, executeToolSearch, loadedToolNames, searchDeferredTools } from './utils/tools/defer.js';
|
|
4
|
+
export { untilAborted } from './utils/until-aborted.js';
|
|
4
5
|
export * from './schemas/index.js';
|
|
5
6
|
export * from './profiling/index.js';
|
|
6
7
|
export * from './constants/index.js';
|
|
@@ -11,7 +12,7 @@ export { readBackendDiagnostics } from './profiling/backend-diagnostics.js';
|
|
|
11
12
|
export { PUBLIC_MODEL_TYPES, ModelTypeAliases, modelTypeInputSchema, modelTypeSchema } from './schemas/model-types.js';
|
|
12
13
|
export * from './models/registry/index.js';
|
|
13
14
|
export { SUPPORTED_AUDIO_FORMATS } from './constants/audio.js';
|
|
14
|
-
export { RpcServerOperationError, InferenceCancelledError, ContextOverflowError, type ContextOverflowErrorSizes, RequestIdConflictError, RequestNotFoundError, RequestRejectedByPolicyError, RequestValidationFailedError, ModelNotLoadedError, TranslationFailedError, PluginDefinitionInvalidError, PluginModelTypeReservedError, PluginAlreadyRegisteredError, PluginLoggingInvalidError } from './errors/index.js';
|
|
15
|
+
export { RpcServerOperationError, InferenceCancelledError, ContextOverflowError, type ContextOverflowErrorSizes, RequestIdConflictError, RequestNotFoundError, RequestRejectedByPolicyError, RequestValidationFailedError, ModelNotLoadedError, ModelRegistryModelNotFoundError, TranslationFailedError, PluginDefinitionInvalidError, PluginModelTypeReservedError, PluginAlreadyRegisteredError, PluginLoggingInvalidError } from './errors/index.js';
|
|
15
16
|
export type { InferenceCancelledPartial } from './errors/index.js';
|
|
16
17
|
export { getLogger, LOG_ID, ALL_LOG_ID } from './logging/index.js';
|
|
17
18
|
export type { Logger, LogTransport, LoggerOptions } from './logging/index.js';
|
package/dist/surface.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// it alongside the engine.
|
|
5
5
|
export { VERBOSITY, ERROR_CODES, RAG_ERROR_CODES, toolSchema, definePlugin, defineHandler, defineDuplexHandler, PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_WHISPER, PLUGIN_BCI, PLUGIN_NMT, PLUGIN_TTS, PLUGIN_OCR, PLUGIN_DIFFUSION, PLUGIN_VLA, PLUGIN_CLASSIFICATION, BUILTIN_PLUGINS, MODEL_TYPES, ModelType } from './schemas/index.js';
|
|
6
6
|
export { TOOL_SEARCH_NAME, buildToolSearchTool, executeToolSearch, loadedToolNames, searchDeferredTools } from './utils/tools/defer.js';
|
|
7
|
+
export { untilAborted } from './utils/until-aborted.js';
|
|
7
8
|
// The full value-clean schema, profiling, and constant barrels: the @qvac/sdk client
|
|
8
9
|
// and worker source every internal schema/const/profiling name from here, so it
|
|
9
10
|
// carries no duplicate copies. All value-clean (only erased `import type` touches
|
|
@@ -24,7 +25,7 @@ export { SUPPORTED_AUDIO_FORMATS } from './constants/audio.js';
|
|
|
24
25
|
// Error classes consumers need for `instanceof` checks: on rejected promises,
|
|
25
26
|
// and on the synchronous throws of `plugins()` / `registerPlugin` (the plugin
|
|
26
27
|
// group below).
|
|
27
|
-
export { RpcServerOperationError, InferenceCancelledError, ContextOverflowError, RequestIdConflictError, RequestNotFoundError, RequestRejectedByPolicyError, RequestValidationFailedError, ModelNotLoadedError, TranslationFailedError, PluginDefinitionInvalidError, PluginModelTypeReservedError, PluginAlreadyRegisteredError, PluginLoggingInvalidError } from './errors/index.js';
|
|
28
|
+
export { RpcServerOperationError, InferenceCancelledError, ContextOverflowError, RequestIdConflictError, RequestNotFoundError, RequestRejectedByPolicyError, RequestValidationFailedError, ModelNotLoadedError, ModelRegistryModelNotFoundError, TranslationFailedError, PluginDefinitionInvalidError, PluginModelTypeReservedError, PluginAlreadyRegisteredError, PluginLoggingInvalidError } from './errors/index.js';
|
|
28
29
|
// Logging
|
|
29
30
|
export { getLogger, LOG_ID, ALL_LOG_ID } from './logging/index.js';
|
|
30
31
|
// Profiler
|
|
@@ -9,6 +9,8 @@ export interface LlmStats {
|
|
|
9
9
|
generatedTokens?: number;
|
|
10
10
|
avgConcurrentSeq?: number;
|
|
11
11
|
toolDefinitionsDropped?: number;
|
|
12
|
+
draftTokens?: number;
|
|
13
|
+
draftAcceptedTokens?: number;
|
|
12
14
|
backendDevice?: 'cpu' | 'gpu';
|
|
13
15
|
stopReason?: 'none' | 'eos' | 'antiprompt' | 'predictionLimit' | 'sequenceLimit' | 'contextOverflow';
|
|
14
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CompletionError, CompletionEvent, CompletionFinal, CompletionStats, StopReason, ToolCall, ToolCallError } from '../schemas/index.js';
|
|
2
|
-
import { type ToolHandlerMap } from '
|
|
2
|
+
import { type ToolHandlerMap } from '../utils/tool-helpers.js';
|
|
3
3
|
export type AggregatedEvents = {
|
|
4
4
|
contentText: string;
|
|
5
5
|
thinkingText: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { normalizeAssistantCacheContent } from '
|
|
2
|
-
import { attachHandlersToToolCalls } from '
|
|
1
|
+
import { normalizeAssistantCacheContent } from '../utils/cache-normalize.js';
|
|
2
|
+
import { attachHandlersToToolCalls } from '../utils/tool-helpers.js';
|
|
3
3
|
export function aggregateEvents(events) {
|
|
4
4
|
let contentText = '';
|
|
5
5
|
let thinkingText = '';
|
package/dist/utils/archive.js
CHANGED
|
@@ -3,9 +3,9 @@ import path from 'bare-path';
|
|
|
3
3
|
import { createGunzip } from 'bare-zlib';
|
|
4
4
|
import tarStream from 'tar-stream';
|
|
5
5
|
import Buffer from 'bare-buffer';
|
|
6
|
-
import { detectShardedModel, generateShardFilenames, extractTensorsFromShards, validateShardedModelCache } from '
|
|
6
|
+
import { detectShardedModel, generateShardFilenames, extractTensorsFromShards, validateShardedModelCache } from '../utils/shard-utils.js';
|
|
7
7
|
import { ModelLoadFailedError, ArchiveExtractionFailedError, ArchiveUnsupportedTypeError, ArchiveMissingShardsError, DownloadCancelledError } from '../errors/index.js';
|
|
8
|
-
import { isPathWithinBase } from '
|
|
8
|
+
import { isPathWithinBase } from '../utils/path-security.js';
|
|
9
9
|
import { getEngineLogger } from '../logging/index.js';
|
|
10
10
|
import { SUPPORTED_ARCHIVE_EXTENSIONS, filenameToArchiveTypeSchema } from '../schemas/model-file.js';
|
|
11
11
|
const logger = getEngineLogger();
|
|
@@ -30,7 +30,9 @@ export async function decodeAudioToStream(inputPath, audioFormat = 's16le', opti
|
|
|
30
30
|
const audioStream = fs.createReadStream(inputPath);
|
|
31
31
|
// bare-fs read streams are async-iterable over Buffer at runtime; the
|
|
32
32
|
// decoder types its input as AsyncIterable<Buffer>.
|
|
33
|
-
const response = decoder.run(audioStream
|
|
33
|
+
const response = decoder.run(audioStream, {
|
|
34
|
+
retainOutput: false
|
|
35
|
+
});
|
|
34
36
|
return decoderResponseToStream(response, {
|
|
35
37
|
inputPath,
|
|
36
38
|
inactivityTimeoutMs,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Readable } from 'bare-stream';
|
|
2
2
|
import fs from 'bare-fs';
|
|
3
3
|
import Buffer from 'bare-buffer';
|
|
4
|
-
import { needsDecoding, decodeAudioToStream } from '
|
|
4
|
+
import { needsDecoding, decodeAudioToStream } from '../utils/audio/decoder.js';
|
|
5
5
|
import { AudioFileNotFoundError, InvalidAudioChunkError } from '../errors/index.js';
|
|
6
6
|
/**
|
|
7
7
|
* Converts an AudioInput (base64 or filePath) into a Readable stream,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { CacheMessage } from '
|
|
1
|
+
import type { CacheMessage } from '../../utils/cache/types.js';
|
|
2
|
+
export declare function normalizeCacheMessage(message: CacheMessage): CacheMessage;
|
|
2
3
|
export declare function getAutoCacheLookupHistory(currentHistory: CacheMessage[]): CacheMessage[];
|
|
3
4
|
export declare function buildAutoCacheSaveHistory(currentHistory: CacheMessage[], assistantResponse: string): CacheMessage[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { normalizeAssistantCacheContent } from '
|
|
2
|
-
function normalizeCacheMessage(message) {
|
|
1
|
+
import { normalizeAssistantCacheContent } from '../../utils/cache-normalize.js';
|
|
2
|
+
export function normalizeCacheMessage(message) {
|
|
3
3
|
const { attachments, ...normalized } = message;
|
|
4
4
|
if (message.role === 'assistant') {
|
|
5
5
|
normalized.content = normalizeAssistantCacheContent(message.content);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import fs, { promises as fsPromises } from 'bare-fs';
|
|
2
2
|
import path from 'bare-path';
|
|
3
3
|
import { getConfiguredCacheDir } from '../../runtime/state.js';
|
|
4
|
-
import { getQvacPath } from '
|
|
5
|
-
import {
|
|
6
|
-
import { validateAndJoinPath, joinWithinBase } from '
|
|
7
|
-
import { generateShortHash } from '
|
|
4
|
+
import { getQvacPath } from '../../utils/qvac-paths.js';
|
|
5
|
+
import { calculateCachedFileChecksum } from '../../utils/checksum.js';
|
|
6
|
+
import { validateAndJoinPath, joinWithinBase } from '../../utils/path-security.js';
|
|
7
|
+
import { generateShortHash } from '../../utils/formatting.js';
|
|
8
8
|
import { getEngineLogger } from '../../logging/index.js';
|
|
9
9
|
import { nowMs } from '../../profiling/index.js';
|
|
10
|
-
import { resolveClearStorageTarget } from '
|
|
10
|
+
import { resolveClearStorageTarget } from '../../utils/clear-storage.js';
|
|
11
11
|
const logger = getEngineLogger();
|
|
12
12
|
export function getCacheDir(subDir) {
|
|
13
13
|
const cacheDir = getQvacPath(subDir);
|
|
@@ -117,7 +117,7 @@ export async function checkShardCompleteness(hyperdriveKey, shardFilenames, shar
|
|
|
117
117
|
}
|
|
118
118
|
if (fileMeta.sha256Checksum) {
|
|
119
119
|
const start = nowMs();
|
|
120
|
-
const actualChecksum = await
|
|
120
|
+
const actualChecksum = await calculateCachedFileChecksum(shardPath);
|
|
121
121
|
onChecksumTimeMs?.(nowMs() - start);
|
|
122
122
|
if (actualChecksum !== fileMeta.sha256Checksum) {
|
|
123
123
|
logger.warn(`File ${i + 1} checksum mismatch for ${fileMeta.filename}. Expected: ${fileMeta.sha256Checksum}. Actual: ${actualChecksum}. Will re-download.`);
|
package/dist/utils/checksum.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { DownloadHooks } from '../handlers/load-model/types.js';
|
|
2
2
|
export declare function calculateFileChecksum(filePath: string): Promise<string>;
|
|
3
|
+
/** Reuse a digest only while the file's identity and change metadata match. */
|
|
4
|
+
export declare function calculateCachedFileChecksum(filePath: string): Promise<string>;
|
|
3
5
|
export declare function measureChecksum(filePath: string, hooks?: DownloadHooks): Promise<string>;
|
package/dist/utils/checksum.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'bare-fs';
|
|
2
2
|
import crypto from 'bare-crypto';
|
|
3
|
-
import
|
|
3
|
+
import path from 'bare-path';
|
|
4
|
+
import { nowMs } from '../profiling/clock.js';
|
|
4
5
|
export async function calculateFileChecksum(filePath) {
|
|
5
6
|
return new Promise((resolve, reject) => {
|
|
6
7
|
try {
|
|
@@ -21,9 +22,47 @@ export async function calculateFileChecksum(filePath) {
|
|
|
21
22
|
}
|
|
22
23
|
});
|
|
23
24
|
}
|
|
25
|
+
// Process-local only: a new engine process must establish its own verification.
|
|
26
|
+
// Bound retention so applications visiting many model paths do not grow forever.
|
|
27
|
+
const checksumCache = new Map();
|
|
28
|
+
const MAX_CACHED_CHECKSUMS = 256;
|
|
29
|
+
async function fileFingerprint(filePath) {
|
|
30
|
+
const stats = await fs.promises.stat(filePath);
|
|
31
|
+
const fields = [stats.dev, stats.ino, stats.size, stats.mtimeMs, stats.ctimeMs];
|
|
32
|
+
// Runtimes/filesystems without usable identity metadata always hash the file.
|
|
33
|
+
if (!stats.isFile() || !stats.ino || !fields.every(Number.isFinite))
|
|
34
|
+
return undefined;
|
|
35
|
+
return fields.join(':');
|
|
36
|
+
}
|
|
37
|
+
/** Reuse a digest only while the file's identity and change metadata match. */
|
|
38
|
+
export async function calculateCachedFileChecksum(filePath) {
|
|
39
|
+
const key = path.resolve(filePath);
|
|
40
|
+
try {
|
|
41
|
+
const before = await fileFingerprint(key);
|
|
42
|
+
const cached = checksumCache.get(key);
|
|
43
|
+
if (before !== undefined && cached?.fingerprint === before)
|
|
44
|
+
return cached.checksum;
|
|
45
|
+
checksumCache.delete(key);
|
|
46
|
+
const checksum = await calculateFileChecksum(key);
|
|
47
|
+
const after = await fileFingerprint(key);
|
|
48
|
+
if (before !== after)
|
|
49
|
+
throw new Error(`File changed during checksum calculation: ${key}`);
|
|
50
|
+
if (after !== undefined) {
|
|
51
|
+
if (checksumCache.size >= MAX_CACHED_CHECKSUMS) {
|
|
52
|
+
checksumCache.delete(checksumCache.keys().next().value);
|
|
53
|
+
}
|
|
54
|
+
checksumCache.set(key, { fingerprint: after, checksum });
|
|
55
|
+
}
|
|
56
|
+
return checksum;
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
checksumCache.delete(key);
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
24
63
|
export async function measureChecksum(filePath, hooks) {
|
|
25
64
|
const start = nowMs();
|
|
26
|
-
const checksum = await
|
|
65
|
+
const checksum = await calculateCachedFileChecksum(filePath);
|
|
27
66
|
hooks?.addChecksumValidationTimeMs?.(nowMs() - start);
|
|
28
67
|
return checksum;
|
|
29
68
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const ARCHITECTURE_SCAN_BYTES: number;
|
|
2
|
+
/**
|
|
3
|
+
* The `general.architecture` value from a GGUF header, read from at most the
|
|
4
|
+
* first `ARCHITECTURE_SCAN_BYTES` of the file. Undefined when the file is
|
|
5
|
+
* unreadable, is not GGUF, or does not name an architecture in that range.
|
|
6
|
+
*/
|
|
7
|
+
export declare function readGgufArchitecture(filePath: string): Promise<string | undefined>;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import fs from 'bare-fs';
|
|
2
|
+
import Buffer from 'bare-buffer';
|
|
3
|
+
const GGUF_MAGIC = 0x46554747;
|
|
4
|
+
const STRING_TYPE = 8;
|
|
5
|
+
const ARRAY_TYPE = 9;
|
|
6
|
+
const FIXED_SIZES = {
|
|
7
|
+
0: 1,
|
|
8
|
+
1: 1,
|
|
9
|
+
2: 2,
|
|
10
|
+
3: 2,
|
|
11
|
+
4: 4,
|
|
12
|
+
5: 4,
|
|
13
|
+
6: 4,
|
|
14
|
+
7: 1,
|
|
15
|
+
10: 8,
|
|
16
|
+
11: 8,
|
|
17
|
+
12: 8
|
|
18
|
+
};
|
|
19
|
+
// GGUF writers put `general.architecture` first, ahead of the tokenizer arrays
|
|
20
|
+
// that make a header large, so a key past this point is not worth the read.
|
|
21
|
+
export const ARCHITECTURE_SCAN_BYTES = 1024 * 1024;
|
|
22
|
+
/**
|
|
23
|
+
* Walks the header in the first `end` bytes of `buffer` to
|
|
24
|
+
* `general.architecture`. Undefined when the header is not GGUF, holds a value
|
|
25
|
+
* type it cannot skip, or does not reach the key within those bytes.
|
|
26
|
+
*/
|
|
27
|
+
function scanForArchitecture(buffer, end) {
|
|
28
|
+
let offset = 0;
|
|
29
|
+
let bigEndian = false;
|
|
30
|
+
const fits = (bytes) => offset + bytes <= end;
|
|
31
|
+
function u32() {
|
|
32
|
+
if (!fits(4))
|
|
33
|
+
return undefined;
|
|
34
|
+
const value = bigEndian ? buffer.readUInt32BE(offset) : buffer.readUInt32LE(offset);
|
|
35
|
+
offset += 4;
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
function u64() {
|
|
39
|
+
if (!fits(8))
|
|
40
|
+
return undefined;
|
|
41
|
+
const value = bigEndian ? buffer.readBigUInt64BE(offset) : buffer.readBigUInt64LE(offset);
|
|
42
|
+
offset += 8;
|
|
43
|
+
return Number(value);
|
|
44
|
+
}
|
|
45
|
+
function skip(bytes) {
|
|
46
|
+
if (!fits(bytes))
|
|
47
|
+
return false;
|
|
48
|
+
offset += bytes;
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
function string() {
|
|
52
|
+
const length = u64();
|
|
53
|
+
if (length === undefined || !fits(length))
|
|
54
|
+
return undefined;
|
|
55
|
+
const value = buffer.toString('utf8', offset, offset + length);
|
|
56
|
+
offset += length;
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
function skipString() {
|
|
60
|
+
const length = u64();
|
|
61
|
+
return length !== undefined && skip(length);
|
|
62
|
+
}
|
|
63
|
+
function skipValue(type) {
|
|
64
|
+
const size = FIXED_SIZES[type];
|
|
65
|
+
if (size !== undefined)
|
|
66
|
+
return skip(size);
|
|
67
|
+
if (type === STRING_TYPE)
|
|
68
|
+
return skipString();
|
|
69
|
+
if (type !== ARRAY_TYPE)
|
|
70
|
+
return false;
|
|
71
|
+
const elementType = u32();
|
|
72
|
+
const count = u64();
|
|
73
|
+
if (elementType === undefined || count === undefined)
|
|
74
|
+
return false;
|
|
75
|
+
const elementSize = FIXED_SIZES[elementType];
|
|
76
|
+
if (elementSize !== undefined)
|
|
77
|
+
return skip(count * elementSize);
|
|
78
|
+
if (elementType !== STRING_TYPE)
|
|
79
|
+
return false;
|
|
80
|
+
for (let i = 0; i < count; i++) {
|
|
81
|
+
if (!skipString())
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
if (u32() !== GGUF_MAGIC)
|
|
87
|
+
return undefined;
|
|
88
|
+
// The magic is the same bytes in both byte orders. A big-endian header is
|
|
89
|
+
// told apart by its version, whose low 16 bits read 0 as little-endian.
|
|
90
|
+
let version = u32();
|
|
91
|
+
if (version === undefined)
|
|
92
|
+
return undefined;
|
|
93
|
+
if ((version & 0xffff) === 0) {
|
|
94
|
+
bigEndian = true;
|
|
95
|
+
version = buffer.readUInt32BE(4);
|
|
96
|
+
}
|
|
97
|
+
if (version !== 2 && version !== 3)
|
|
98
|
+
return undefined;
|
|
99
|
+
if (!skip(8))
|
|
100
|
+
return undefined;
|
|
101
|
+
const kvCount = u64();
|
|
102
|
+
if (kvCount === undefined)
|
|
103
|
+
return undefined;
|
|
104
|
+
for (let i = 0; i < kvCount; i++) {
|
|
105
|
+
const key = string();
|
|
106
|
+
const type = u32();
|
|
107
|
+
if (key === undefined || type === undefined)
|
|
108
|
+
return undefined;
|
|
109
|
+
if (key === 'general.architecture' && type === STRING_TYPE)
|
|
110
|
+
return string();
|
|
111
|
+
if (!skipValue(type))
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The `general.architecture` value from a GGUF header, read from at most the
|
|
118
|
+
* first `ARCHITECTURE_SCAN_BYTES` of the file. Undefined when the file is
|
|
119
|
+
* unreadable, is not GGUF, or does not name an architecture in that range.
|
|
120
|
+
*/
|
|
121
|
+
export async function readGgufArchitecture(filePath) {
|
|
122
|
+
let fd;
|
|
123
|
+
try {
|
|
124
|
+
fd = await fs.open(filePath, 'r');
|
|
125
|
+
const buffer = Buffer.alloc(ARCHITECTURE_SCAN_BYTES);
|
|
126
|
+
let length = 0;
|
|
127
|
+
while (length < buffer.length) {
|
|
128
|
+
const read = await fs.read(fd, buffer, length, buffer.length - length, length);
|
|
129
|
+
if (read === 0)
|
|
130
|
+
break;
|
|
131
|
+
length += read;
|
|
132
|
+
}
|
|
133
|
+
return scanForArchitecture(buffer, length);
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
finally {
|
|
139
|
+
if (fd !== undefined)
|
|
140
|
+
await fs.close(fd).catch(() => { });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -2,7 +2,7 @@ import { promises as fsPromises, createReadStream } from 'bare-fs';
|
|
|
2
2
|
import Buffer from 'bare-buffer';
|
|
3
3
|
import { getEngineLogger } from '../logging/index.js';
|
|
4
4
|
import { ModelLoadFailedError } from '../errors/index.js';
|
|
5
|
-
import { validateAndJoinPath } from '
|
|
5
|
+
import { validateAndJoinPath } from '../utils/path-security.js';
|
|
6
6
|
const logger = getEngineLogger();
|
|
7
7
|
// GGUF value types
|
|
8
8
|
const GGUF_TYPE = {
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
12
|
-
export * from '
|
|
13
|
-
export * from '
|
|
1
|
+
export * from '../utils/archive.js';
|
|
2
|
+
export * from '../utils/cache/types.js';
|
|
3
|
+
export * from '../utils/cache/auto-history.js';
|
|
4
|
+
export * from '../utils/cache/paths.js';
|
|
5
|
+
export * from '../utils/checksum.js';
|
|
6
|
+
export * from '../utils/config-transform.js';
|
|
7
|
+
export * from '../utils/formatting.js';
|
|
8
|
+
export * from '../utils/gguf-tensor-extractor.js';
|
|
9
|
+
export * from '../utils/image-dimensions.js';
|
|
10
|
+
export * from '../utils/path-sanitize.js';
|
|
11
|
+
export * from '../utils/path-security.js';
|
|
12
|
+
export * from '../utils/shard-utils.js';
|
|
13
|
+
export * from '../utils/url-security.js';
|