@qvac/inference 0.22.0 → 0.24.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 +111 -60
- package/README.md +4 -2
- package/dist/api/assess-model-fit.d.ts +14 -14
- package/dist/api/assess-model-fit.js +14 -14
- package/dist/api/audio-gen.d.ts +2 -2
- package/dist/api/audio-gen.js +136 -45
- package/dist/api/batch-completion.js +2 -1
- package/dist/api/calc-tokens.d.ts +30 -0
- package/dist/api/calc-tokens.js +41 -0
- package/dist/api/classify.d.ts +5 -2
- package/dist/api/classify.js +5 -2
- package/dist/api/completion-stream.d.ts +2 -1
- package/dist/api/completion-stream.js +4 -1
- package/dist/api/decide.js +1 -1
- package/dist/api/delete-cache.d.ts +7 -1
- package/dist/api/delete-cache.js +11 -1
- package/dist/api/diffusion.d.ts +32 -2
- package/dist/api/diffusion.js +32 -2
- package/dist/api/download-asset.js +1 -1
- package/dist/api/embed.d.ts +82 -29
- package/dist/api/embed.js +64 -18
- package/dist/api/finetune.js +1 -1
- package/dist/api/get-model-info.d.ts +1 -1
- package/dist/api/index.d.ts +40 -38
- package/dist/api/index.js +39 -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/rag.d.ts +1 -1
- package/dist/api/rag.js +1 -1
- package/dist/api/registry.d.ts +18 -7
- package/dist/api/registry.js +37 -13
- 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 +14 -5
- package/dist/api/text-to-speech.js +83 -29
- package/dist/api/transcribe.d.ts +6 -2
- package/dist/api/transcribe.js +7 -1
- package/dist/api/unload-model.js +1 -1
- package/dist/api/vector-index.d.ts +25 -3
- package/dist/api/vector-index.js +17 -2
- package/dist/api/video-request.d.ts +15 -15
- 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 +11 -4
- package/dist/dispatch.js +80 -18
- package/dist/engine.d.ts +1 -1
- package/dist/errors/index.d.ts +76 -0
- package/dist/errors/index.js +141 -1
- package/dist/handlers/assess-model-fit.d.ts +3 -21
- package/dist/handlers/assess-model-fit.js +4 -303
- package/dist/handlers/cancelHandler.d.ts +10 -9
- package/dist/handlers/cancelHandler.js +18 -14
- package/dist/handlers/completion-orchestrate.d.ts +14 -2
- package/dist/handlers/completion-orchestrate.js +166 -24
- package/dist/handlers/delete-cache.d.ts +2 -1
- package/dist/handlers/delete-cache.js +6 -1
- package/dist/handlers/download-asset.js +13 -6
- package/dist/handlers/finetune.js +1 -1
- package/dist/handlers/get-loaded-model-info.js +3 -3
- package/dist/handlers/get-model-info.js +72 -3
- package/dist/handlers/load-model/coreml-sidecars.d.ts +15 -11
- package/dist/handlers/load-model/coreml-sidecars.js +51 -91
- package/dist/handlers/load-model/download-lock.d.ts +20 -0
- package/dist/handlers/load-model/download-lock.js +213 -0
- package/dist/handlers/load-model/download-manager.d.ts +11 -3
- package/dist/handlers/load-model/download-manager.js +62 -11
- 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 +97 -41
- 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 +330 -208
- package/dist/handlers/load-model/hyperdrive.d.ts +16 -1
- package/dist/handlers/load-model/hyperdrive.js +125 -52
- 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-client-options.d.ts +2 -0
- package/dist/handlers/load-model/registry-client-options.js +4 -2
- package/dist/handlers/load-model/registry-companion-set.d.ts +6 -1
- package/dist/handlers/load-model/registry-companion-set.js +20 -2
- package/dist/handlers/load-model/registry-delete.d.ts +5 -0
- package/dist/handlers/load-model/registry-delete.js +269 -0
- package/dist/handlers/load-model/registry-download-utils.d.ts +7 -5
- package/dist/handlers/load-model/registry-download-utils.js +95 -24
- package/dist/handlers/load-model/registry.d.ts +22 -2
- package/dist/handlers/load-model/registry.js +312 -179
- 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 +9 -6
- package/dist/handlers/load-model/types.d.ts +2 -0
- package/dist/handlers/logging-stream.d.ts +2 -1
- package/dist/handlers/logging-stream.js +35 -7
- package/dist/handlers/plugin-invoke.js +152 -39
- package/dist/handlers/registry.d.ts +2 -2
- package/dist/handlers/registry.js +108 -29
- package/dist/handlers/rpc-server.js +7 -7
- package/dist/handlers/session.d.ts +11 -0
- package/dist/handlers/session.js +40 -0
- package/dist/handlers/types.d.ts +7 -1
- package/dist/handlers/unload-model.js +8 -3
- package/dist/handlers/vector-index.js +118 -19
- 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 +11 -3
- package/dist/model-cache-layout.d.ts +1 -0
- package/dist/model-cache-layout.js +2 -0
- package/dist/model-fit/assess.d.ts +23 -0
- package/dist/model-fit/assess.js +110 -0
- package/dist/model-fit/describe.d.ts +12 -0
- package/dist/model-fit/describe.js +29 -0
- package/dist/{resources/model-fit/fit-stub/fetch-fit-stub.d.ts → model-fit/description/fetch.d.ts} +2 -2
- package/dist/{resources/model-fit/fit-stub/fetch-fit-stub.js → model-fit/description/fetch.js} +98 -19
- package/dist/{resources/model-fit/fit-stub/resolve-load-from-stubs.d.ts → model-fit/description/resolve-load.d.ts} +8 -6
- package/dist/{resources/model-fit/fit-stub/resolve-load-from-stubs.js → model-fit/description/resolve-load.js} +20 -20
- package/dist/model-fit/fit-load.d.ts +23 -0
- package/dist/model-fit/fit-load.js +29 -0
- package/dist/model-fit/load-check.d.ts +34 -0
- package/dist/model-fit/load-check.js +77 -0
- package/dist/model-fit/run/engine.d.ts +12 -0
- package/dist/model-fit/run/engine.js +9 -0
- package/dist/model-fit/run/run.d.ts +46 -0
- package/dist/model-fit/run/run.js +208 -0
- package/dist/model-fit/sum.d.ts +32 -0
- package/dist/model-fit/sum.js +60 -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 +1377 -130
- package/dist/models/registry/models.js +3622 -2312
- package/dist/plugins/builtin/asr-ggml/config.d.ts +19 -4
- package/dist/plugins/builtin/asr-ggml/config.js +39 -3
- package/dist/plugins/builtin/asr-ggml/fit.d.ts +18 -0
- package/dist/plugins/builtin/asr-ggml/fit.js +118 -0
- package/dist/plugins/builtin/audiogen-ggml/config.d.ts +6 -0
- package/dist/plugins/builtin/audiogen-ggml/config.js +9 -0
- package/dist/plugins/builtin/audiogen-ggml/fit.d.ts +3 -0
- package/dist/{resources/model-fit/native-probe/engines/audiogen.js → plugins/builtin/audiogen-ggml/fit.js} +28 -18
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-edit-stream.d.ts +3 -1
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-edit-stream.js +4 -3
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-encode.d.ts +17 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-encode.js +68 -0
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-run.d.ts +11 -3
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-run.js +47 -11
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.d.ts +3 -1
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-gen-stream.js +4 -3
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-understand.d.ts +3 -1
- package/dist/plugins/builtin/audiogen-ggml/ops/audio-understand.js +4 -3
- package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +203 -72
- package/dist/plugins/builtin/audiogen-ggml/plugin.js +17 -5
- package/dist/plugins/builtin/bci-whispercpp-transcription/fit.d.ts +3 -0
- package/dist/plugins/builtin/bci-whispercpp-transcription/fit.js +22 -0
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +71 -29
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +12 -10
- package/dist/plugins/builtin/ggml-classification/plugin.d.ts +8 -5
- package/dist/plugins/builtin/ggml-classification/plugin.js +89 -9
- package/dist/plugins/builtin/ggml-image-embedding/ops/embed.d.ts +24 -0
- package/dist/plugins/builtin/ggml-image-embedding/ops/embed.js +184 -0
- package/dist/plugins/builtin/ggml-image-embedding/plugin.d.ts +120 -0
- package/dist/plugins/builtin/ggml-image-embedding/plugin.js +39 -0
- package/dist/plugins/builtin/ggml-ocr/fit.d.ts +6 -0
- package/dist/plugins/builtin/ggml-ocr/fit.js +19 -0
- package/dist/plugins/builtin/ggml-ocr/params.d.ts +1 -1
- package/dist/plugins/builtin/ggml-ocr/plugin.d.ts +20 -13
- package/dist/plugins/builtin/ggml-ocr/plugin.js +111 -25
- package/dist/plugins/builtin/ggml-vla/ops/vla-run.d.ts +2 -2
- package/dist/plugins/builtin/ggml-vla/ops/vla-run.js +18 -2
- package/dist/plugins/builtin/ggml-vla/plugin.d.ts +15 -15
- package/dist/plugins/builtin/ggml-vla/plugin.js +3 -3
- package/dist/plugins/builtin/index.d.ts +16 -14
- package/dist/plugins/builtin/index.js +16 -14
- package/dist/plugins/builtin/llamacpp-completion/fit.d.ts +3 -0
- package/dist/plugins/builtin/llamacpp-completion/fit.js +28 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +6 -8
- package/dist/plugins/builtin/llamacpp-completion/ops/cache-logger.js +15 -4
- package/dist/plugins/builtin/llamacpp-completion/ops/calc-tokens.d.ts +2 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/calc-tokens.js +32 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +3 -1
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.js +6 -0
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.d.ts +18 -3
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +94 -21
- package/dist/plugins/builtin/llamacpp-completion/ops/finetune.d.ts +5 -4
- package/dist/plugins/builtin/llamacpp-completion/ops/finetune.js +54 -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 +315 -95
- package/dist/plugins/builtin/llamacpp-completion/plugin.js +51 -25
- 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.d.ts +3 -1
- package/dist/plugins/builtin/llamacpp-decision/ops/decide.js +6 -3
- package/dist/plugins/builtin/llamacpp-decision/plugin.d.ts +43 -35
- package/dist/plugins/builtin/llamacpp-decision/plugin.js +4 -3
- package/dist/plugins/builtin/llamacpp-embedding/fit.d.ts +3 -0
- package/dist/plugins/builtin/llamacpp-embedding/fit.js +23 -0
- package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +201 -10
- package/dist/plugins/builtin/llamacpp-embedding/plugin.js +52 -16
- package/dist/plugins/builtin/llamacpp-embedding/transform.d.ts +2 -2
- package/dist/plugins/builtin/llamacpp-embedding/transform.js +29 -2
- 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 +7 -0
- package/dist/plugins/builtin/llamacpp-rerank/ops/rerank.js +120 -0
- package/dist/plugins/builtin/llamacpp-rerank/plugin.d.ts +92 -0
- package/dist/plugins/builtin/llamacpp-rerank/plugin.js +44 -0
- package/dist/plugins/builtin/moss-transcribe/plugin.d.ts +46 -19
- package/dist/plugins/builtin/moss-transcribe/plugin.js +9 -7
- package/dist/plugins/builtin/nmtcpp-translation/fit.d.ts +3 -0
- package/dist/plugins/builtin/nmtcpp-translation/fit.js +11 -0
- package/dist/plugins/builtin/nmtcpp-translation/plugin.d.ts +32 -18
- package/dist/plugins/builtin/nmtcpp-translation/plugin.js +8 -6
- package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +234 -38
- package/dist/plugins/builtin/parakeet-transcription/plugin.js +42 -16
- package/dist/plugins/builtin/sdcpp-generation/fit.d.ts +3 -0
- package/dist/plugins/builtin/sdcpp-generation/fit.js +68 -0
- package/dist/plugins/builtin/sdcpp-generation/load-files.d.ts +30 -0
- package/dist/plugins/builtin/sdcpp-generation/load-files.js +121 -0
- package/dist/plugins/builtin/sdcpp-generation/ops/diffusion.d.ts +8 -2
- package/dist/plugins/builtin/sdcpp-generation/ops/diffusion.js +174 -53
- package/dist/plugins/builtin/sdcpp-generation/ops/upscale.d.ts +4 -1
- package/dist/plugins/builtin/sdcpp-generation/ops/upscale.js +107 -22
- package/dist/plugins/builtin/sdcpp-generation/ops/video.d.ts +7 -2
- package/dist/plugins/builtin/sdcpp-generation/ops/video.js +23 -9
- package/dist/plugins/builtin/sdcpp-generation/ops/world.d.ts +6 -4
- package/dist/plugins/builtin/sdcpp-generation/ops/world.js +8 -3
- package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +166 -47
- package/dist/plugins/builtin/sdcpp-generation/plugin.js +67 -155
- 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/fit.d.ts +3 -0
- package/dist/plugins/builtin/tts-ggml/fit.js +162 -0
- package/dist/plugins/builtin/tts-ggml/ops/cancel-binding.d.ts +2 -1
- package/dist/plugins/builtin/tts-ggml/ops/cancel-binding.js +4 -1
- package/dist/plugins/builtin/tts-ggml/ops/moss-options.d.ts +1 -1
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.d.ts +3 -2
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech-stream.js +24 -11
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.d.ts +2 -1
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +53 -18
- package/dist/plugins/builtin/tts-ggml/ops/voice-options.d.ts +50 -0
- package/dist/plugins/builtin/tts-ggml/ops/voice-options.js +74 -0
- package/dist/plugins/builtin/tts-ggml/plugin.d.ts +415 -57
- package/dist/plugins/builtin/tts-ggml/plugin.js +183 -34
- package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +104 -40
- package/dist/plugins/builtin/whispercpp-transcription/plugin.js +12 -10
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.js +2 -2
- package/dist/plugins/ops/bci-transcribe.d.ts +5 -4
- package/dist/plugins/ops/bci-transcribe.js +18 -4
- package/dist/plugins/ops/cancel.d.ts +1 -0
- package/dist/plugins/ops/cancel.js +11 -2
- package/dist/plugins/ops/embed.d.ts +5 -3
- package/dist/plugins/ops/embed.js +89 -34
- package/dist/plugins/ops/kv-cache-utils.d.ts +5 -3
- package/dist/plugins/ops/kv-cache-utils.js +21 -10
- package/dist/plugins/ops/load-model.d.ts +10 -2
- package/dist/plugins/ops/load-model.js +45 -19
- package/dist/plugins/ops/transcribe.d.ts +5 -4
- package/dist/plugins/ops/transcribe.js +63 -28
- package/dist/plugins/ops/translate.d.ts +2 -1
- package/dist/plugins/ops/translate.js +7 -4
- package/dist/plugins/ops/unload-model.d.ts +17 -1
- package/dist/plugins/ops/unload-model.js +32 -3
- package/dist/plugins/turbovec-backend.d.ts +1 -1
- package/dist/plugins/turbovec-backend.js +21 -6
- 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 +24 -21
- package/dist/profiling/operation-wrappers.js +3 -3
- package/dist/profiling/profiler.js +1 -1
- package/dist/rag/embedding-scope.d.ts +16 -0
- package/dist/rag/embedding-scope.js +81 -0
- package/dist/rag/handler.d.ts +25 -0
- package/dist/rag/handler.js +51 -17
- 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 +3 -7
- 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.d.ts +10 -1
- package/dist/rag/handlers/search.js +17 -8
- package/dist/rag/index.d.ts +11 -11
- package/dist/rag/index.js +11 -11
- package/dist/rag/rag-operation-manager.d.ts +27 -3
- package/dist/rag/rag-operation-manager.js +10 -27
- package/dist/rag/rag-workspace-manager.js +1 -1
- package/dist/registry.js +7 -1
- package/dist/resources/collector.d.ts +71 -37
- package/dist/resources/collector.js +9 -2
- 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/resources/types.d.ts +2 -0
- package/dist/rpc/inventory.js +1 -12
- package/dist/runtime/env.d.ts +5 -1
- package/dist/runtime/env.js +6 -21
- package/dist/runtime/index.d.ts +8 -5
- package/dist/runtime/index.js +4 -2
- package/dist/runtime/lifecycle.d.ts +6 -4
- package/dist/runtime/lifecycle.js +16 -12
- package/dist/runtime/model-config-utils.js +8 -1
- package/dist/runtime/model-registry.d.ts +30 -4
- package/dist/runtime/model-registry.js +48 -2
- package/dist/runtime/model-work-lock.d.ts +13 -0
- package/dist/runtime/model-work-lock.js +48 -0
- package/dist/runtime/registry-client.d.ts +47 -1
- package/dist/runtime/registry-client.js +446 -88
- package/dist/runtime/request-context.d.ts +11 -3
- package/dist/runtime/request-context.js +39 -2
- package/dist/runtime/request-registry.d.ts +56 -8
- package/dist/runtime/request-registry.js +190 -72
- package/dist/runtime/runtime-lifecycle.js +10 -1
- package/dist/runtime/session-id.d.ts +18 -0
- package/dist/runtime/session-id.js +20 -0
- package/dist/runtime/session-registry.d.ts +39 -0
- package/dist/runtime/session-registry.js +114 -0
- package/dist/runtime/state.d.ts +1 -1
- package/dist/runtime/state.js +2 -2
- package/dist/runtime/vector-index-backend.d.ts +6 -2
- package/dist/runtime/vector-index-registry.d.ts +26 -5
- package/dist/runtime/vector-index-registry.js +88 -27
- package/dist/schemas/abort-signal.d.ts +8 -0
- package/dist/schemas/assess-model-fit.d.ts +138 -282
- package/dist/schemas/assess-model-fit.js +85 -219
- package/dist/schemas/audio-gen.d.ts +291 -25
- package/dist/schemas/audio-gen.js +130 -26
- package/dist/schemas/batch-completion-stream.d.ts +113 -15
- package/dist/schemas/batch-completion-stream.js +10 -6
- package/dist/schemas/bci-config.d.ts +3 -1
- package/dist/schemas/bci-config.js +2 -2
- package/dist/schemas/bci.d.ts +55 -4
- package/dist/schemas/bci.js +13 -18
- package/dist/schemas/calc-tokens.d.ts +141 -0
- package/dist/schemas/calc-tokens.js +53 -0
- package/dist/schemas/cancel.d.ts +31 -0
- package/dist/schemas/cancel.js +11 -2
- package/dist/schemas/classification.d.ts +3 -0
- package/dist/schemas/classification.js +6 -2
- package/dist/schemas/common.d.ts +2209 -348
- package/dist/schemas/common.js +52 -33
- package/dist/schemas/completion-event.d.ts +11 -2
- package/dist/schemas/completion-event.js +5 -2
- package/dist/schemas/completion-stream.d.ts +173 -19
- package/dist/schemas/completion-stream.js +117 -20
- package/dist/schemas/config.d.ts +2064 -178
- package/dist/schemas/config.js +21 -23
- package/dist/schemas/decision.d.ts +12 -2
- package/dist/schemas/decision.js +16 -1
- package/dist/schemas/download-asset.d.ts +13 -6
- package/dist/schemas/download-asset.js +4 -7
- package/dist/schemas/embed.d.ts +286 -3
- package/dist/schemas/embed.js +162 -16
- package/dist/schemas/engine-addon-map.d.ts +3 -1
- package/dist/schemas/engine-addon-map.js +5 -3
- package/dist/schemas/errors.d.ts +13 -0
- package/dist/schemas/errors.js +71 -1
- package/dist/schemas/finetune.d.ts +14 -4
- package/dist/schemas/finetune.js +5 -6
- package/dist/schemas/heartbeat.d.ts +1 -0
- package/dist/schemas/heartbeat.js +5 -2
- package/dist/schemas/image-embedding.d.ts +27 -0
- package/dist/schemas/image-embedding.js +107 -0
- package/dist/schemas/index.d.ts +55 -50
- package/dist/schemas/index.js +54 -49
- package/dist/schemas/lifecycle.d.ts +3 -0
- package/dist/schemas/lifecycle.js +13 -6
- package/dist/schemas/llamacpp-config.d.ts +443 -20
- package/dist/schemas/llamacpp-config.js +188 -14
- package/dist/schemas/load-model.d.ts +8940 -1952
- package/dist/schemas/load-model.js +73 -9
- package/dist/schemas/logging-stream.d.ts +1 -0
- package/dist/schemas/logging-stream.js +5 -2
- package/dist/schemas/mcp-adapter.d.ts +1 -1
- package/dist/schemas/model-config-schemas.d.ts +731 -111
- package/dist/schemas/model-config-schemas.js +16 -12
- package/dist/schemas/model-fit-policy.d.ts +2 -2
- package/dist/schemas/model-info.d.ts +54 -56
- package/dist/schemas/model-info.js +18 -7
- package/dist/schemas/model-ops.d.ts +12 -0
- package/dist/schemas/model-ops.js +33 -5
- package/dist/schemas/model-src-utils.d.ts +14 -6
- package/dist/schemas/model-src-utils.js +2 -2
- package/dist/schemas/model-types.d.ts +12 -4
- package/dist/schemas/model-types.js +2 -0
- package/dist/schemas/ocr.d.ts +11 -4
- package/dist/schemas/ocr.js +7 -3
- package/dist/schemas/plugin.d.ts +70 -8
- package/dist/schemas/plugin.js +32 -4
- package/dist/schemas/profiling.d.ts +32 -32
- package/dist/schemas/profiling.js +1 -1
- package/dist/schemas/rag.d.ts +9 -0
- package/dist/schemas/rag.js +11 -17
- package/dist/schemas/registry.d.ts +38 -10
- package/dist/schemas/registry.js +16 -7
- package/dist/schemas/reload-config.d.ts +45 -6
- package/dist/schemas/reload-config.js +13 -6
- package/dist/schemas/request-base.d.ts +39 -0
- package/dist/schemas/request-base.js +64 -0
- package/dist/schemas/rerank.d.ts +132 -0
- package/dist/schemas/rerank.js +104 -0
- package/dist/schemas/rpc-server.d.ts +3 -0
- package/dist/schemas/rpc-server.js +15 -15
- package/dist/schemas/sdcpp-config.d.ts +144 -18
- package/dist/schemas/sdcpp-config.js +123 -28
- package/dist/schemas/session.d.ts +37 -0
- package/dist/schemas/session.js +53 -0
- package/dist/schemas/system-resources.d.ts +364 -179
- package/dist/schemas/system-resources.js +8 -3
- package/dist/schemas/text-to-speech.d.ts +1408 -275
- package/dist/schemas/text-to-speech.js +547 -33
- package/dist/schemas/tools.d.ts +7 -0
- package/dist/schemas/tools.js +29 -0
- package/dist/schemas/transcription-config.d.ts +267 -2
- package/dist/schemas/transcription-config.js +138 -7
- package/dist/schemas/transcription.d.ts +94 -7
- package/dist/schemas/transcription.js +99 -22
- package/dist/schemas/translate.d.ts +4 -2
- package/dist/schemas/translate.js +6 -10
- package/dist/schemas/translation-config.d.ts +40 -20
- package/dist/schemas/translation-config.js +1 -1
- package/dist/schemas/tts-pcm.d.ts +35 -0
- package/dist/schemas/tts-pcm.js +69 -0
- package/dist/schemas/vector-index.d.ts +47 -1
- package/dist/schemas/vector-index.js +37 -10
- package/dist/schemas/vla.d.ts +3 -3
- package/dist/surface.d.ts +4 -3
- package/dist/surface.js +4 -3
- package/dist/utils/addon-responses.d.ts +71 -2
- package/dist/utils/aggregate-events.d.ts +1 -1
- package/dist/utils/aggregate-events.js +2 -2
- package/dist/utils/archive.d.ts +7 -0
- package/dist/utils/archive.js +89 -30
- package/dist/utils/asr-events.d.ts +5 -0
- package/dist/utils/asr-events.js +10 -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 +5 -3
- package/dist/utils/cache/layout.d.ts +48 -0
- package/dist/utils/cache/layout.js +190 -0
- package/dist/utils/cache/paths.js +8 -10
- package/dist/utils/cache/types.d.ts +2 -1
- package/dist/utils/checksum.d.ts +7 -0
- package/dist/utils/checksum.js +59 -2
- package/dist/utils/completion-normalizer.js +287 -88
- package/dist/utils/gguf-architecture.d.ts +7 -0
- package/dist/utils/gguf-architecture.js +142 -0
- package/dist/utils/gguf-tensor-extractor.d.ts +0 -6
- package/dist/utils/gguf-tensor-extractor.js +1 -50
- 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 +0 -16
- package/dist/utils/shard-utils.js +14 -48
- package/dist/utils/tool-integration.d.ts +3 -2
- package/dist/utils/tool-integration.js +3 -6
- package/dist/utils/tools/defer.d.ts +50 -31
- package/dist/utils/tools/defer.js +115 -51
- 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/transcribe-metadata.d.ts +28 -2
- package/dist/utils/transcribe-metadata.js +16 -0
- package/dist/utils/tts-stats.d.ts +43 -1
- package/dist/utils/tts-stats.js +120 -22
- package/dist/utils/until-aborted.d.ts +7 -0
- package/dist/utils/until-aborted.js +34 -0
- package/package.json +67 -55
- package/dist/models/registry/resource-profiles.d.ts +0 -17
- package/dist/models/registry/resource-profiles.js +0 -5657
- package/dist/resources/model-fit/assess.d.ts +0 -72
- package/dist/resources/model-fit/assess.js +0 -679
- package/dist/resources/model-fit/fit-stub/project-fit-from-load.d.ts +0 -27
- package/dist/resources/model-fit/fit-stub/project-fit-from-load.js +0 -33
- package/dist/resources/model-fit/floor.d.ts +0 -31
- package/dist/resources/model-fit/floor.js +0 -65
- package/dist/resources/model-fit/kv-cache.d.ts +0 -23
- package/dist/resources/model-fit/kv-cache.js +0 -85
- package/dist/resources/model-fit/native-probe/advisory-fit.d.ts +0 -54
- package/dist/resources/model-fit/native-probe/advisory-fit.js +0 -248
- 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/classify-fit.d.ts +0 -6
- package/dist/resources/model-fit/native-probe/classify-fit.js +0 -166
- package/dist/resources/model-fit/native-probe/create-fit-request.d.ts +0 -31
- package/dist/resources/model-fit/native-probe/create-fit-request.js +0 -61
- package/dist/resources/model-fit/native-probe/engine-fit.d.ts +0 -73
- package/dist/resources/model-fit/native-probe/engine-fit.js +0 -13
- package/dist/resources/model-fit/native-probe/engines/asr.d.ts +0 -14
- package/dist/resources/model-fit/native-probe/engines/asr.js +0 -126
- package/dist/resources/model-fit/native-probe/engines/audiogen.d.ts +0 -8
- package/dist/resources/model-fit/native-probe/engines/diffusion.d.ts +0 -7
- package/dist/resources/model-fit/native-probe/engines/diffusion.js +0 -65
- package/dist/resources/model-fit/native-probe/engines/llama.d.ts +0 -12
- package/dist/resources/model-fit/native-probe/engines/llama.js +0 -41
- package/dist/resources/model-fit/native-probe/engines/nmt.d.ts +0 -8
- package/dist/resources/model-fit/native-probe/engines/nmt.js +0 -11
- package/dist/resources/model-fit/native-probe/engines/ocr.d.ts +0 -9
- package/dist/resources/model-fit/native-probe/engines/ocr.js +0 -13
- package/dist/resources/model-fit/native-probe/engines/tts.d.ts +0 -10
- package/dist/resources/model-fit/native-probe/engines/tts.js +0 -152
- package/dist/resources/model-fit/native-probe/fit-outcome.d.ts +0 -16
- 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/platform.js +0 -26
- package/dist/resources/model-fit/types.d.ts +0 -6
- package/dist/resources/model-fit/types.js +0 -1
- package/dist/schemas/model-resource-profile.d.ts +0 -108
- package/dist/schemas/model-resource-profile.js +0 -80
- /package/dist/{resources/model-fit/native-probe/engines → model-fit}/gpu.d.ts +0 -0
- /package/dist/{resources/model-fit/native-probe/engines → model-fit}/gpu.js +0 -0
- /package/dist/{resources/model-fit/native-probe/fit-outcome.js → schemas/abort-signal.js} +0 -0
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from 'bare-url';
|
|
2
|
-
import env from 'bare-env';
|
|
3
|
-
import spawnBare from 'bare-runtime/spawn';
|
|
4
|
-
import { arch, isAndroid, isBrowser, isIOS, platform } from 'which-runtime';
|
|
5
|
-
import { encodeFitProcessRequest, FIT_PROCESS_MAX_RESPONSE_BYTES, parseFitProcessResponse } from './fit-process.js';
|
|
6
|
-
/**
|
|
7
|
-
* The child is this package's own runner, built beside this module, so the
|
|
8
|
-
* engine dispatch it performs is the same code the in-process path runs.
|
|
9
|
-
*/
|
|
10
|
-
function resolveFitRunnerPath() {
|
|
11
|
-
return fileURLToPath(new URL('./fit-runner.js', import.meta.url));
|
|
12
|
-
}
|
|
13
|
-
const DEFAULT_TIMEOUT_MS = 60_000;
|
|
14
|
-
const TERMINATION_GRACE_MS = 1_000;
|
|
15
|
-
const FINAL_KILL_GRACE_MS = 1_000;
|
|
16
|
-
const DRAIN_GRACE_MS = 1_000;
|
|
17
|
-
const STDERR_TAIL_BYTES = 16 * 1024;
|
|
18
|
-
const FIT_ENVIRONMENT_KEYS = [
|
|
19
|
-
'HOME',
|
|
20
|
-
'PATH',
|
|
21
|
-
'TMPDIR',
|
|
22
|
-
'TMP',
|
|
23
|
-
'TEMP',
|
|
24
|
-
'SystemRoot',
|
|
25
|
-
'WINDIR',
|
|
26
|
-
'LD_LIBRARY_PATH',
|
|
27
|
-
'DYLD_LIBRARY_PATH',
|
|
28
|
-
'VK_ICD_FILENAMES',
|
|
29
|
-
'VK_DRIVER_FILES',
|
|
30
|
-
'CUDA_VISIBLE_DEVICES',
|
|
31
|
-
'HIP_VISIBLE_DEVICES',
|
|
32
|
-
'ROCR_VISIBLE_DEVICES'
|
|
33
|
-
];
|
|
34
|
-
function ignoreLateError() { }
|
|
35
|
-
function allowedEnvironment(environment) {
|
|
36
|
-
const allowed = {};
|
|
37
|
-
for (const key of FIT_ENVIRONMENT_KEYS) {
|
|
38
|
-
const value = environment[key];
|
|
39
|
-
if (value !== undefined)
|
|
40
|
-
allowed[key] = value;
|
|
41
|
-
}
|
|
42
|
-
return allowed;
|
|
43
|
-
}
|
|
44
|
-
function appendTail(current, chunk) {
|
|
45
|
-
const combined = Buffer.concat([current, Buffer.from(chunk)]);
|
|
46
|
-
if (combined.length <= STDERR_TAIL_BYTES)
|
|
47
|
-
return combined;
|
|
48
|
-
let start = combined.length - STDERR_TAIL_BYTES;
|
|
49
|
-
// A byte-offset trim can open mid-codepoint; walk forward past UTF-8
|
|
50
|
-
// continuation bytes (0b10xxxxxx) so toString() never leads with U+FFFD.
|
|
51
|
-
while (start < combined.length && (combined[start] & 0xc0) === 0x80)
|
|
52
|
-
start++;
|
|
53
|
-
return combined.subarray(start);
|
|
54
|
-
}
|
|
55
|
-
function unknown(reason, message, stderrTail) {
|
|
56
|
-
return stderrTail.length === 0
|
|
57
|
-
? { status: 'unknown', reason, message }
|
|
58
|
-
: { status: 'unknown', reason, message, stderrTail: stderrTail.toString() };
|
|
59
|
-
}
|
|
60
|
-
function formatError(error) {
|
|
61
|
-
return error instanceof Error ? `${error.name}: ${error.message}` : String(error);
|
|
62
|
-
}
|
|
63
|
-
function normalizeExitSignal(signal) {
|
|
64
|
-
return signal === null || signal === 0 ? null : String(signal);
|
|
65
|
-
}
|
|
66
|
-
function parseResponse(line, stderrTail) {
|
|
67
|
-
try {
|
|
68
|
-
const response = parseFitProcessResponse(JSON.parse(line));
|
|
69
|
-
if (response.status === 'invocation-error') {
|
|
70
|
-
return unknown('invocation-error', `${response.error.name}: ${response.error.message}`, stderrTail);
|
|
71
|
-
}
|
|
72
|
-
return { status: 'completed', probe: response.probe };
|
|
73
|
-
}
|
|
74
|
-
catch (error) {
|
|
75
|
-
return unknown('invalid-response', formatError(error), stderrTail);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
export function runIsolatedFit(probe, options = {}) {
|
|
79
|
-
const runtime = options.runtime ?? {
|
|
80
|
-
platform,
|
|
81
|
-
arch,
|
|
82
|
-
isAndroid,
|
|
83
|
-
isBrowser,
|
|
84
|
-
isIOS
|
|
85
|
-
};
|
|
86
|
-
if (runtime.isAndroid || runtime.isBrowser || runtime.isIOS) {
|
|
87
|
-
return Promise.resolve({
|
|
88
|
-
status: 'unknown',
|
|
89
|
-
reason: 'unsupported-platform',
|
|
90
|
-
message: `Fit subprocess isolation is unavailable on ${runtime.platform}`
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
const spawnProcess = options.spawnProcess ??
|
|
94
|
-
((context) => spawnBare(context.command, context.options));
|
|
95
|
-
const environment = options.environment ?? env;
|
|
96
|
-
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
97
|
-
const terminationGraceMs = options.terminationGraceMs ?? TERMINATION_GRACE_MS;
|
|
98
|
-
const finalKillGraceMs = options.finalKillGraceMs ?? FINAL_KILL_GRACE_MS;
|
|
99
|
-
const drainGraceMs = options.drainGraceMs ?? DRAIN_GRACE_MS;
|
|
100
|
-
return new Promise((resolve) => {
|
|
101
|
-
let child;
|
|
102
|
-
const streams = {
|
|
103
|
-
stdin: undefined,
|
|
104
|
-
stdout: undefined,
|
|
105
|
-
stderr: undefined
|
|
106
|
-
};
|
|
107
|
-
const timers = {
|
|
108
|
-
timeout: undefined,
|
|
109
|
-
forceKill: undefined,
|
|
110
|
-
finalKill: undefined,
|
|
111
|
-
drain: undefined
|
|
112
|
-
};
|
|
113
|
-
let settled = false;
|
|
114
|
-
let destroyingStreams = false;
|
|
115
|
-
let stdout = '';
|
|
116
|
-
let stdoutFailure;
|
|
117
|
-
let stderrTail = Buffer.alloc(0);
|
|
118
|
-
let pendingTermination;
|
|
119
|
-
let exitStatus;
|
|
120
|
-
function safely(action) {
|
|
121
|
-
try {
|
|
122
|
-
action();
|
|
123
|
-
}
|
|
124
|
-
catch { }
|
|
125
|
-
}
|
|
126
|
-
// A destroyed pipe or a reaped child can still emit EPIPE/ERR_STREAM_DESTROYED
|
|
127
|
-
// after the promise settles; without a listener that would take down the host,
|
|
128
|
-
// so the active handler is swapped for an inert one instead of removed.
|
|
129
|
-
function silenceErrors(emitter, active) {
|
|
130
|
-
if (emitter === undefined)
|
|
131
|
-
return;
|
|
132
|
-
safely(() => emitter.on('error', ignoreLateError));
|
|
133
|
-
safely(() => emitter.off('error', active));
|
|
134
|
-
}
|
|
135
|
-
function cleanup() {
|
|
136
|
-
if (timers.timeout !== undefined)
|
|
137
|
-
clearTimeout(timers.timeout);
|
|
138
|
-
if (timers.forceKill !== undefined)
|
|
139
|
-
clearTimeout(timers.forceKill);
|
|
140
|
-
if (timers.finalKill !== undefined)
|
|
141
|
-
clearTimeout(timers.finalKill);
|
|
142
|
-
if (timers.drain !== undefined)
|
|
143
|
-
clearTimeout(timers.drain);
|
|
144
|
-
options.signal?.removeEventListener('abort', onAbort);
|
|
145
|
-
safely(() => child?.off('exit', onExit));
|
|
146
|
-
safely(() => child?.off('close', onClose));
|
|
147
|
-
safely(() => streams.stdout?.off('data', onStdoutData));
|
|
148
|
-
safely(() => streams.stderr?.off('data', onStderrData));
|
|
149
|
-
silenceErrors(child, onChildError);
|
|
150
|
-
silenceErrors(streams.stdin, onStdinError);
|
|
151
|
-
silenceErrors(streams.stdout, onStdoutError);
|
|
152
|
-
silenceErrors(streams.stderr, onStderrError);
|
|
153
|
-
}
|
|
154
|
-
function settle(result) {
|
|
155
|
-
if (settled)
|
|
156
|
-
return;
|
|
157
|
-
settled = true;
|
|
158
|
-
cleanup();
|
|
159
|
-
resolve(result);
|
|
160
|
-
}
|
|
161
|
-
function kill(signal) {
|
|
162
|
-
safely(() => {
|
|
163
|
-
child?.kill(signal);
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
function requestTermination(reason, message, crashCanOverride = false) {
|
|
167
|
-
if (settled || exitStatus !== undefined || pendingTermination !== undefined)
|
|
168
|
-
return;
|
|
169
|
-
pendingTermination = { reason, message, crashCanOverride };
|
|
170
|
-
timers.forceKill = setTimeout(() => {
|
|
171
|
-
if (settled || exitStatus !== undefined)
|
|
172
|
-
return;
|
|
173
|
-
kill('SIGKILL');
|
|
174
|
-
if (exitStatus !== undefined)
|
|
175
|
-
return;
|
|
176
|
-
timers.finalKill = setTimeout(() => {
|
|
177
|
-
if (settled || exitStatus !== undefined || pendingTermination === undefined)
|
|
178
|
-
return;
|
|
179
|
-
// Bound liveness when the child cannot be observed as reaped after SIGKILL.
|
|
180
|
-
destroyLocalStreams();
|
|
181
|
-
settle(unknown(pendingTermination.reason, `${pendingTermination.message}; child did not report exit`, stderrTail));
|
|
182
|
-
}, finalKillGraceMs);
|
|
183
|
-
}, terminationGraceMs);
|
|
184
|
-
kill('SIGTERM');
|
|
185
|
-
}
|
|
186
|
-
function destroyLocalStreams() {
|
|
187
|
-
destroyingStreams = true;
|
|
188
|
-
safely(() => streams.stdin?.destroy());
|
|
189
|
-
safely(() => streams.stdout?.destroy());
|
|
190
|
-
safely(() => streams.stderr?.destroy());
|
|
191
|
-
}
|
|
192
|
-
function finalize(code, signal) {
|
|
193
|
-
const newlineIndex = stdout.indexOf('\n');
|
|
194
|
-
const hasTrailingTerminator = newlineIndex === stdout.length - 1;
|
|
195
|
-
const invalidFraming = newlineIndex !== -1 && !hasTrailingTerminator;
|
|
196
|
-
const line = hasTrailingTerminator ? stdout.slice(0, -1) : stdout;
|
|
197
|
-
const response = stdoutFailure === undefined && !invalidFraming && line !== ''
|
|
198
|
-
? parseResponse(line, stderrTail)
|
|
199
|
-
: undefined;
|
|
200
|
-
if (pendingTermination !== undefined && pendingTermination.crashCanOverride === false) {
|
|
201
|
-
settle(unknown(pendingTermination.reason, pendingTermination.message, stderrTail));
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
// A signalled death outranks the runner's own diagnosis: the response was
|
|
205
|
-
// written before whatever killed the child, so it cannot describe the exit.
|
|
206
|
-
if (signal === null &&
|
|
207
|
-
response?.status === 'unknown' &&
|
|
208
|
-
response.reason === 'invocation-error') {
|
|
209
|
-
settle(response);
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
if (code !== 0 || signal !== null) {
|
|
213
|
-
settle(unknown('crashed', `Fit subprocess exited with code ${String(code)} and signal ${String(signal)}`, stderrTail));
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
if (pendingTermination !== undefined) {
|
|
217
|
-
settle(unknown(pendingTermination.reason, pendingTermination.message, stderrTail));
|
|
218
|
-
return;
|
|
219
|
-
}
|
|
220
|
-
if (stdoutFailure !== undefined) {
|
|
221
|
-
settle(unknown('invalid-response', stdoutFailure, stderrTail));
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
if (invalidFraming || line === '') {
|
|
225
|
-
settle(unknown('invalid-response', invalidFraming
|
|
226
|
-
? 'Fit subprocess returned invalid line framing'
|
|
227
|
-
: `Fit subprocess exited with code ${String(code)} and signal ${String(signal)}`, stderrTail));
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
settle(response ?? parseResponse(line, stderrTail));
|
|
231
|
-
}
|
|
232
|
-
function onAbort() {
|
|
233
|
-
requestTermination('cancelled', 'Fit subprocess was cancelled');
|
|
234
|
-
}
|
|
235
|
-
function onChildError(error) {
|
|
236
|
-
requestTermination('spawn-failed', formatError(error));
|
|
237
|
-
}
|
|
238
|
-
function onExit(code, rawSignal) {
|
|
239
|
-
if (exitStatus !== undefined)
|
|
240
|
-
return;
|
|
241
|
-
const signal = normalizeExitSignal(rawSignal);
|
|
242
|
-
exitStatus = { code, signal };
|
|
243
|
-
if (timers.timeout !== undefined) {
|
|
244
|
-
clearTimeout(timers.timeout);
|
|
245
|
-
timers.timeout = undefined;
|
|
246
|
-
}
|
|
247
|
-
if (timers.forceKill !== undefined) {
|
|
248
|
-
clearTimeout(timers.forceKill);
|
|
249
|
-
timers.forceKill = undefined;
|
|
250
|
-
}
|
|
251
|
-
if (timers.finalKill !== undefined) {
|
|
252
|
-
clearTimeout(timers.finalKill);
|
|
253
|
-
timers.finalKill = undefined;
|
|
254
|
-
}
|
|
255
|
-
timers.drain = setTimeout(() => {
|
|
256
|
-
destroyLocalStreams();
|
|
257
|
-
finalize(code, signal);
|
|
258
|
-
}, drainGraceMs);
|
|
259
|
-
}
|
|
260
|
-
function onClose(code, rawSignal) {
|
|
261
|
-
const status = exitStatus ?? { code, signal: normalizeExitSignal(rawSignal) };
|
|
262
|
-
finalize(status.code, status.signal);
|
|
263
|
-
}
|
|
264
|
-
function onStdoutData(chunk) {
|
|
265
|
-
if (settled || pendingTermination !== undefined || destroyingStreams) {
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
if (Buffer.byteLength(stdout) + Buffer.byteLength(chunk) > FIT_PROCESS_MAX_RESPONSE_BYTES) {
|
|
269
|
-
if (exitStatus !== undefined) {
|
|
270
|
-
stdoutFailure = 'Fit subprocess response exceeds 1 MiB';
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
requestTermination('invalid-response', 'Fit subprocess response exceeds 1 MiB');
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
stdout += chunk;
|
|
277
|
-
const newlineIndex = stdout.indexOf('\n');
|
|
278
|
-
if (newlineIndex !== -1 && newlineIndex !== stdout.length - 1) {
|
|
279
|
-
if (exitStatus !== undefined) {
|
|
280
|
-
stdoutFailure = 'Fit subprocess returned invalid line framing';
|
|
281
|
-
}
|
|
282
|
-
else {
|
|
283
|
-
requestTermination('invalid-response', 'Fit subprocess returned invalid line framing');
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
function onStderrData(chunk) {
|
|
288
|
-
if (settled || destroyingStreams)
|
|
289
|
-
return;
|
|
290
|
-
stderrTail = appendTail(stderrTail, chunk);
|
|
291
|
-
}
|
|
292
|
-
function onStdinError(error) {
|
|
293
|
-
if (destroyingStreams)
|
|
294
|
-
return;
|
|
295
|
-
requestTermination('invalid-response', `Fit subprocess stdin failed: ${error.message}`, true);
|
|
296
|
-
}
|
|
297
|
-
function onStdoutError(error) {
|
|
298
|
-
if (destroyingStreams)
|
|
299
|
-
return;
|
|
300
|
-
requestTermination('invalid-response', `Fit subprocess stdout failed: ${error.message}`);
|
|
301
|
-
}
|
|
302
|
-
function onStderrError(error) {
|
|
303
|
-
if (destroyingStreams)
|
|
304
|
-
return;
|
|
305
|
-
requestTermination('invalid-response', `Fit subprocess stderr failed: ${error.message}`);
|
|
306
|
-
}
|
|
307
|
-
try {
|
|
308
|
-
const stdio = runtime.platform === 'win32'
|
|
309
|
-
? ['overlapped', 'overlapped', 'overlapped']
|
|
310
|
-
: ['pipe', 'pipe', 'pipe'];
|
|
311
|
-
child = spawnProcess({
|
|
312
|
-
command: 'bare',
|
|
313
|
-
options: {
|
|
314
|
-
args: [options.runnerPath ?? resolveFitRunnerPath(), ...(options.runnerArgs ?? [])],
|
|
315
|
-
platform: runtime.platform,
|
|
316
|
-
arch: runtime.arch,
|
|
317
|
-
stdio,
|
|
318
|
-
env: allowedEnvironment(environment)
|
|
319
|
-
}
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
catch (error) {
|
|
323
|
-
settle(unknown('spawn-failed', formatError(error), stderrTail));
|
|
324
|
-
return;
|
|
325
|
-
}
|
|
326
|
-
child.on('error', onChildError);
|
|
327
|
-
child.on('exit', onExit);
|
|
328
|
-
child.on('close', onClose);
|
|
329
|
-
const stdin = child.stdin;
|
|
330
|
-
const stdoutStream = child.stdout;
|
|
331
|
-
const stderrStream = child.stderr;
|
|
332
|
-
streams.stdin = stdin ?? undefined;
|
|
333
|
-
streams.stdout = stdoutStream ?? undefined;
|
|
334
|
-
streams.stderr = stderrStream ?? undefined;
|
|
335
|
-
options.signal?.addEventListener('abort', onAbort, { once: true });
|
|
336
|
-
timers.timeout = setTimeout(() => {
|
|
337
|
-
requestTermination('timeout', `Fit subprocess exceeded ${timeoutMs}ms`);
|
|
338
|
-
}, timeoutMs);
|
|
339
|
-
try {
|
|
340
|
-
streams.stdin?.on('error', onStdinError);
|
|
341
|
-
streams.stdout?.on('data', onStdoutData);
|
|
342
|
-
streams.stdout?.on('error', onStdoutError);
|
|
343
|
-
streams.stderr?.on('data', onStderrData);
|
|
344
|
-
streams.stderr?.on('error', onStderrError);
|
|
345
|
-
}
|
|
346
|
-
catch (error) {
|
|
347
|
-
requestTermination('invalid-response', `Fit subprocess stream setup failed: ${formatError(error)}`);
|
|
348
|
-
destroyLocalStreams();
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
if (stdin === null || stdoutStream === null || stderrStream === null) {
|
|
352
|
-
requestTermination('spawn-failed', 'Fit subprocess stdio pipes are unavailable');
|
|
353
|
-
destroyLocalStreams();
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
try {
|
|
357
|
-
stdoutStream.setEncoding('utf8');
|
|
358
|
-
stderrStream.setEncoding('utf8');
|
|
359
|
-
}
|
|
360
|
-
catch (error) {
|
|
361
|
-
requestTermination('invalid-response', `Fit subprocess stream setup failed: ${formatError(error)}`);
|
|
362
|
-
destroyLocalStreams();
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
if (options.signal?.aborted === true) {
|
|
366
|
-
onAbort();
|
|
367
|
-
return;
|
|
368
|
-
}
|
|
369
|
-
try {
|
|
370
|
-
stdin.end(encodeFitProcessRequest(probe));
|
|
371
|
-
}
|
|
372
|
-
catch (error) {
|
|
373
|
-
requestTermination('invalid-response', `Fit subprocess request write failed: ${formatError(error)}`);
|
|
374
|
-
destroyLocalStreams();
|
|
375
|
-
}
|
|
376
|
-
});
|
|
377
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ModelFitPlatform } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Maps the runtime's platform and architecture onto a platform this assessment
|
|
4
|
-
* covers.
|
|
5
|
-
*
|
|
6
|
-
* @returns `undefined` for any pair outside that set, which assesses as
|
|
7
|
-
* `unknown`.
|
|
8
|
-
*/
|
|
9
|
-
export declare function detectPlatform(): ModelFitPlatform | undefined;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import os from 'bare-os';
|
|
2
|
-
/**
|
|
3
|
-
* Maps the runtime's platform and architecture onto a platform this assessment
|
|
4
|
-
* covers.
|
|
5
|
-
*
|
|
6
|
-
* @returns `undefined` for any pair outside that set, which assesses as
|
|
7
|
-
* `unknown`.
|
|
8
|
-
*/
|
|
9
|
-
export function detectPlatform() {
|
|
10
|
-
const key = `${os.platform()}-${os.arch()}`;
|
|
11
|
-
switch (key) {
|
|
12
|
-
case 'darwin-arm64':
|
|
13
|
-
case 'darwin-x64':
|
|
14
|
-
case 'linux-arm64':
|
|
15
|
-
case 'linux-x64':
|
|
16
|
-
case 'win32-x64':
|
|
17
|
-
// No engine addon is built for win32-arm64 (`@qvac/llm-llamacpp/prebuilds`
|
|
18
|
-
// has no such target), so no load on it reaches a fitter.
|
|
19
|
-
case 'win32-arm64':
|
|
20
|
-
case 'android-arm64':
|
|
21
|
-
case 'ios-arm64':
|
|
22
|
-
return key;
|
|
23
|
-
default:
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Platforms this assessment covers. A platform absent from this list assesses
|
|
3
|
-
* as `unknown`, because nothing fixes the memory budget it would be judged
|
|
4
|
-
* against.
|
|
5
|
-
*/
|
|
6
|
-
export type ModelFitPlatform = 'darwin-arm64' | 'darwin-x64' | 'linux-arm64' | 'linux-x64' | 'win32-x64' | 'win32-arm64' | 'android-arm64' | 'ios-arm64';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* One group of transformer blocks that size their KV cache identically.
|
|
4
|
-
*
|
|
5
|
-
* Files that describe attention per layer (e.g. `gemma4`, whose
|
|
6
|
-
* `head_count_kv` and `sliding_window_pattern` hold one entry per block) are
|
|
7
|
-
* collapsed into these classes, so an estimator can sum the real cache instead
|
|
8
|
-
* of assuming every block is the widest one.
|
|
9
|
-
*/
|
|
10
|
-
export declare const kvLayerClassSchema: z.ZodObject<{
|
|
11
|
-
count: z.ZodNumber;
|
|
12
|
-
headCountKv: z.ZodNumber;
|
|
13
|
-
keyLength: z.ZodNumber;
|
|
14
|
-
valueLength: z.ZodNumber;
|
|
15
|
-
windowed: z.ZodBoolean;
|
|
16
|
-
}, z.core.$strip>;
|
|
17
|
-
/**
|
|
18
|
-
* Transformer shape facts read out of a model's GGUF key-value metadata at
|
|
19
|
-
* catalog-generation time, from what the registry captured at ingest.
|
|
20
|
-
*
|
|
21
|
-
* Absent for non-GGUF artifacts and for GGUF files whose metadata extraction
|
|
22
|
-
* failed — that absence is what makes a pre-download estimate unknown rather
|
|
23
|
-
* than wrong.
|
|
24
|
-
*/
|
|
25
|
-
export declare const ggufFactsSchema: z.ZodObject<{
|
|
26
|
-
architecture: z.ZodString;
|
|
27
|
-
blockCount: z.ZodNumber;
|
|
28
|
-
headCount: z.ZodNumber;
|
|
29
|
-
headCountKv: z.ZodNumber;
|
|
30
|
-
keyLength: z.ZodNumber;
|
|
31
|
-
valueLength: z.ZodNumber;
|
|
32
|
-
embeddingLength: z.ZodNumber;
|
|
33
|
-
contextLength: z.ZodNumber;
|
|
34
|
-
parameterCount: z.ZodOptional<z.ZodNumber>;
|
|
35
|
-
slidingWindow: z.ZodOptional<z.ZodNumber>;
|
|
36
|
-
keyLengthSwa: z.ZodOptional<z.ZodNumber>;
|
|
37
|
-
valueLengthSwa: z.ZodOptional<z.ZodNumber>;
|
|
38
|
-
kvLayerClasses: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
39
|
-
count: z.ZodNumber;
|
|
40
|
-
headCountKv: z.ZodNumber;
|
|
41
|
-
keyLength: z.ZodNumber;
|
|
42
|
-
valueLength: z.ZodNumber;
|
|
43
|
-
windowed: z.ZodBoolean;
|
|
44
|
-
}, z.core.$strip>>>;
|
|
45
|
-
fullAttentionInterval: z.ZodOptional<z.ZodNumber>;
|
|
46
|
-
ssmStateSize: z.ZodOptional<z.ZodNumber>;
|
|
47
|
-
ssmConvKernel: z.ZodOptional<z.ZodNumber>;
|
|
48
|
-
ssmInnerSize: z.ZodOptional<z.ZodNumber>;
|
|
49
|
-
ssmGroupCount: z.ZodOptional<z.ZodNumber>;
|
|
50
|
-
assumptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
51
|
-
}, z.core.$strip>;
|
|
52
|
-
/**
|
|
53
|
-
* Per-model facts the computed floor reads before download. Generated into
|
|
54
|
-
* `models/registry/resource-profiles.ts` alongside the model catalog.
|
|
55
|
-
*/
|
|
56
|
-
export declare const modelResourceProfileSchema: z.ZodObject<{
|
|
57
|
-
schemaVersion: z.ZodLiteral<1>;
|
|
58
|
-
engine: z.ZodEnum<{
|
|
59
|
-
"llamacpp-completion": "llamacpp-completion";
|
|
60
|
-
"whispercpp-transcription": "whispercpp-transcription";
|
|
61
|
-
"bci-whispercpp-transcription": "bci-whispercpp-transcription";
|
|
62
|
-
"llamacpp-embedding": "llamacpp-embedding";
|
|
63
|
-
"llamacpp-decision": "llamacpp-decision";
|
|
64
|
-
"nmtcpp-translation": "nmtcpp-translation";
|
|
65
|
-
"onnx-tts": "onnx-tts";
|
|
66
|
-
"tts-ggml": "tts-ggml";
|
|
67
|
-
"parakeet-transcription": "parakeet-transcription";
|
|
68
|
-
"moss-transcribe": "moss-transcribe";
|
|
69
|
-
"ggml-ocr": "ggml-ocr";
|
|
70
|
-
"sdcpp-generation": "sdcpp-generation";
|
|
71
|
-
"audiogen-ggml": "audiogen-ggml";
|
|
72
|
-
"ggml-vla": "ggml-vla";
|
|
73
|
-
"ggml-classification": "ggml-classification";
|
|
74
|
-
"onnx-vad": "onnx-vad";
|
|
75
|
-
}>;
|
|
76
|
-
artifactBytes: z.ZodNumber;
|
|
77
|
-
ggufFacts: z.ZodOptional<z.ZodObject<{
|
|
78
|
-
architecture: z.ZodString;
|
|
79
|
-
blockCount: z.ZodNumber;
|
|
80
|
-
headCount: z.ZodNumber;
|
|
81
|
-
headCountKv: z.ZodNumber;
|
|
82
|
-
keyLength: z.ZodNumber;
|
|
83
|
-
valueLength: z.ZodNumber;
|
|
84
|
-
embeddingLength: z.ZodNumber;
|
|
85
|
-
contextLength: z.ZodNumber;
|
|
86
|
-
parameterCount: z.ZodOptional<z.ZodNumber>;
|
|
87
|
-
slidingWindow: z.ZodOptional<z.ZodNumber>;
|
|
88
|
-
keyLengthSwa: z.ZodOptional<z.ZodNumber>;
|
|
89
|
-
valueLengthSwa: z.ZodOptional<z.ZodNumber>;
|
|
90
|
-
kvLayerClasses: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
91
|
-
count: z.ZodNumber;
|
|
92
|
-
headCountKv: z.ZodNumber;
|
|
93
|
-
keyLength: z.ZodNumber;
|
|
94
|
-
valueLength: z.ZodNumber;
|
|
95
|
-
windowed: z.ZodBoolean;
|
|
96
|
-
}, z.core.$strip>>>;
|
|
97
|
-
fullAttentionInterval: z.ZodOptional<z.ZodNumber>;
|
|
98
|
-
ssmStateSize: z.ZodOptional<z.ZodNumber>;
|
|
99
|
-
ssmConvKernel: z.ZodOptional<z.ZodNumber>;
|
|
100
|
-
ssmInnerSize: z.ZodOptional<z.ZodNumber>;
|
|
101
|
-
ssmGroupCount: z.ZodOptional<z.ZodNumber>;
|
|
102
|
-
assumptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
|
-
}, z.core.$strip>>;
|
|
104
|
-
assumptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
105
|
-
}, z.core.$strip>;
|
|
106
|
-
export type KvLayerClass = z.infer<typeof kvLayerClassSchema>;
|
|
107
|
-
export type GgufFacts = z.infer<typeof ggufFactsSchema>;
|
|
108
|
-
export type ModelResourceProfile = z.infer<typeof modelResourceProfileSchema>;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { modelRegistryEngineSchema } from './registry.js';
|
|
3
|
-
/**
|
|
4
|
-
* One group of transformer blocks that size their KV cache identically.
|
|
5
|
-
*
|
|
6
|
-
* Files that describe attention per layer (e.g. `gemma4`, whose
|
|
7
|
-
* `head_count_kv` and `sliding_window_pattern` hold one entry per block) are
|
|
8
|
-
* collapsed into these classes, so an estimator can sum the real cache instead
|
|
9
|
-
* of assuming every block is the widest one.
|
|
10
|
-
*/
|
|
11
|
-
export const kvLayerClassSchema = z.object({
|
|
12
|
-
count: z.number().describe('Number of blocks in this class.'),
|
|
13
|
-
headCountKv: z.number().describe('KV heads per block in this class.'),
|
|
14
|
-
keyLength: z.number().describe('Key head dimension for this class, in elements.'),
|
|
15
|
-
valueLength: z.number().describe('Value head dimension for this class, in elements.'),
|
|
16
|
-
windowed: z
|
|
17
|
-
.boolean()
|
|
18
|
-
.describe('True when these blocks use sliding-window attention, so their cache is capped at `slidingWindow` tokens rather than the full context.')
|
|
19
|
-
});
|
|
20
|
-
/**
|
|
21
|
-
* Transformer shape facts read out of a model's GGUF key-value metadata at
|
|
22
|
-
* catalog-generation time, from what the registry captured at ingest.
|
|
23
|
-
*
|
|
24
|
-
* Absent for non-GGUF artifacts and for GGUF files whose metadata extraction
|
|
25
|
-
* failed — that absence is what makes a pre-download estimate unknown rather
|
|
26
|
-
* than wrong.
|
|
27
|
-
*/
|
|
28
|
-
export const ggufFactsSchema = z.object({
|
|
29
|
-
architecture: z.string().describe('`general.architecture`, e.g. `qwen35`, `bert`.'),
|
|
30
|
-
blockCount: z.number().describe('Number of transformer blocks (layers).'),
|
|
31
|
-
headCount: z.number().describe('Attention heads per block.'),
|
|
32
|
-
headCountKv: z
|
|
33
|
-
.number()
|
|
34
|
-
.describe('KV heads per block; the maximum when the file stores one value per layer.'),
|
|
35
|
-
keyLength: z.number().describe('Key head dimension, in elements.'),
|
|
36
|
-
valueLength: z.number().describe('Value head dimension, in elements.'),
|
|
37
|
-
embeddingLength: z.number().describe('Model embedding width, in elements.'),
|
|
38
|
-
contextLength: z.number().describe('Trained context window, in tokens.'),
|
|
39
|
-
parameterCount: z.number().optional().describe('Total parameters, when the file records it.'),
|
|
40
|
-
slidingWindow: z
|
|
41
|
-
.number()
|
|
42
|
-
.optional()
|
|
43
|
-
.describe('Sliding-window size, in tokens, for sliding-window-attention models.'),
|
|
44
|
-
keyLengthSwa: z.number().optional().describe('Key head dimension on sliding-window blocks.'),
|
|
45
|
-
valueLengthSwa: z.number().optional().describe('Value head dimension on sliding-window blocks.'),
|
|
46
|
-
kvLayerClasses: z
|
|
47
|
-
.array(kvLayerClassSchema)
|
|
48
|
-
.optional()
|
|
49
|
-
.describe('Per-layer KV-cache breakdown, when the file describes attention per block. Absent means the flat fields above describe every block.'),
|
|
50
|
-
fullAttentionInterval: z
|
|
51
|
-
.number()
|
|
52
|
-
.optional()
|
|
53
|
-
.describe('For hybrid attention/recurrent models: only every Nth block holds a KV cache, the rest hold a fixed-size state.'),
|
|
54
|
-
ssmStateSize: z.number().optional().describe('SSM state size, for hybrid recurrent models.'),
|
|
55
|
-
ssmConvKernel: z.number().optional().describe('SSM convolution kernel width.'),
|
|
56
|
-
ssmInnerSize: z.number().optional().describe('SSM inner width.'),
|
|
57
|
-
ssmGroupCount: z.number().optional().describe('SSM group count.'),
|
|
58
|
-
assumptions: z
|
|
59
|
-
.array(z.string())
|
|
60
|
-
.optional()
|
|
61
|
-
.describe('Notes on any value that was derived rather than read from the file.')
|
|
62
|
-
});
|
|
63
|
-
/**
|
|
64
|
-
* Per-model facts the computed floor reads before download. Generated into
|
|
65
|
-
* `models/registry/resource-profiles.ts` alongside the model catalog.
|
|
66
|
-
*/
|
|
67
|
-
export const modelResourceProfileSchema = z.object({
|
|
68
|
-
schemaVersion: z.literal(1).describe('Bumped whenever the emitted profile shape changes.'),
|
|
69
|
-
engine: modelRegistryEngineSchema.describe('Canonical inference engine identifier.'),
|
|
70
|
-
artifactBytes: z
|
|
71
|
-
.number()
|
|
72
|
-
.describe('Total bytes that land on disk for this model: the summed shards, or every file of its companion set.'),
|
|
73
|
-
ggufFacts: ggufFactsSchema
|
|
74
|
-
.optional()
|
|
75
|
-
.describe('Absent when the model is not a GGUF or the registry has no usable metadata for it.'),
|
|
76
|
-
assumptions: z
|
|
77
|
-
.array(z.string())
|
|
78
|
-
.optional()
|
|
79
|
-
.describe('Notes on how the numbers above were derived.')
|
|
80
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|