@atomic-chat/core 0.5.1 → 0.13.6
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/README.md +22 -0
- package/dist/app-daemon.js +20 -67
- package/dist/app-daemon.js.map +1 -1
- package/dist/backend/advisor/advisor.d.ts +132 -0
- package/dist/backend/advisor/advisor.js +537 -0
- package/dist/backend/advisor/advisor.js.map +1 -0
- package/dist/backend/advisor/index.d.ts +6 -0
- package/dist/backend/advisor/index.js +7 -0
- package/dist/backend/advisor/index.js.map +1 -0
- package/dist/backend/advisor/policy.d.ts +81 -0
- package/dist/backend/advisor/policy.js +154 -0
- package/dist/backend/advisor/policy.js.map +1 -0
- package/dist/backend/catalog/archive.d.ts +21 -7
- package/dist/backend/catalog/archive.js +57 -17
- package/dist/backend/catalog/archive.js.map +1 -1
- package/dist/backend/catalog/bundled-manifest-baseline.js +42 -26
- package/dist/backend/catalog/bundled-manifest-baseline.js.map +1 -1
- package/dist/backend/catalog/cuda-family.d.ts +12 -2
- package/dist/backend/catalog/cuda-family.js +30 -7
- package/dist/backend/catalog/cuda-family.js.map +1 -1
- package/dist/backend/catalog/index.d.ts +5 -0
- package/dist/backend/catalog/index.js +5 -0
- package/dist/backend/catalog/index.js.map +1 -1
- package/dist/backend/catalog/manifest.d.ts +5 -3
- package/dist/backend/catalog/manifest.js +12 -9
- package/dist/backend/catalog/manifest.js.map +1 -1
- package/dist/backend/catalog/migrate.d.ts +8 -6
- package/dist/backend/catalog/migrate.js +26 -15
- package/dist/backend/catalog/migrate.js.map +1 -1
- package/dist/backend/catalog/prism-catalog.d.ts +42 -0
- package/dist/backend/catalog/prism-catalog.js +101 -0
- package/dist/backend/catalog/prism-catalog.js.map +1 -0
- package/dist/backend/catalog/prism-manifest-baseline.d.ts +2 -0
- package/dist/backend/catalog/prism-manifest-baseline.js +11 -0
- package/dist/backend/catalog/prism-manifest-baseline.js.map +1 -0
- package/dist/backend/catalog/prism-manifest-baseline.json +134 -0
- package/dist/backend/catalog/prism-manifest.d.ts +90 -0
- package/dist/backend/catalog/prism-manifest.js +171 -0
- package/dist/backend/catalog/prism-manifest.js.map +1 -0
- package/dist/backend/catalog/turboquant-catalog.d.ts +60 -0
- package/dist/backend/catalog/turboquant-catalog.js +162 -0
- package/dist/backend/catalog/turboquant-catalog.js.map +1 -0
- package/dist/backend/catalog/turboquant-index.d.ts +104 -0
- package/dist/backend/catalog/turboquant-index.js +260 -0
- package/dist/backend/catalog/turboquant-index.js.map +1 -0
- package/dist/backend/index.d.ts +1 -0
- package/dist/backend/index.js +1 -0
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/install/runtime-backend.d.ts +6 -6
- package/dist/backend/install/runtime-backend.js +23 -20
- package/dist/backend/install/runtime-backend.js.map +1 -1
- package/dist/backend/install/service.d.ts +106 -5
- package/dist/backend/install/service.js +247 -21
- package/dist/backend/install/service.js.map +1 -1
- package/dist/backend/installed/bundled.d.ts +19 -0
- package/dist/backend/installed/bundled.js +45 -0
- package/dist/backend/installed/bundled.js.map +1 -0
- package/dist/backend/installed/index.d.ts +1 -0
- package/dist/backend/installed/index.js +1 -0
- package/dist/backend/installed/index.js.map +1 -1
- package/dist/backend/installed/installed.js +3 -0
- package/dist/backend/installed/installed.js.map +1 -1
- package/dist/backend/optimal/optimal-cache.d.ts +27 -8
- package/dist/backend/optimal/optimal-cache.js +38 -19
- package/dist/backend/optimal/optimal-cache.js.map +1 -1
- package/dist/backend/optimal/optimal-store.js +1 -1
- package/dist/backend/optimal/optimal-store.js.map +1 -1
- package/dist/backend/select/categories.d.ts +2 -1
- package/dist/backend/select/categories.js +8 -1
- package/dist/backend/select/categories.js.map +1 -1
- package/dist/backend/select/features.d.ts +13 -5
- package/dist/backend/select/features.js +36 -6
- package/dist/backend/select/features.js.map +1 -1
- package/dist/backend/select/index.d.ts +2 -0
- package/dist/backend/select/index.js +2 -0
- package/dist/backend/select/index.js.map +1 -1
- package/dist/backend/select/prism.d.ts +54 -0
- package/dist/backend/select/prism.js +212 -0
- package/dist/backend/select/prism.js.map +1 -0
- package/dist/backend/select/recovery.d.ts +4 -2
- package/dist/backend/select/recovery.js +17 -5
- package/dist/backend/select/recovery.js.map +1 -1
- package/dist/backend/select/tiers.d.ts +20 -11
- package/dist/backend/select/tiers.js +49 -11
- package/dist/backend/select/tiers.js.map +1 -1
- package/dist/backend/select/turboquant-tiers.d.ts +45 -0
- package/dist/backend/select/turboquant-tiers.js +114 -0
- package/dist/backend/select/turboquant-tiers.js.map +1 -0
- package/dist/backend/types.d.ts +6 -69
- package/dist/cli/commands/backends.d.ts +10 -0
- package/dist/cli/commands/backends.js +142 -0
- package/dist/cli/commands/backends.js.map +1 -0
- package/dist/cli/commands/hardware.d.ts +13 -0
- package/dist/cli/commands/hardware.js +71 -0
- package/dist/cli/commands/hardware.js.map +1 -0
- package/dist/cli/commands/host-step.d.ts +28 -0
- package/dist/cli/commands/host-step.js +67 -0
- package/dist/cli/commands/host-step.js.map +1 -0
- package/dist/cli/commands/index.d.ts +4 -1
- package/dist/cli/commands/index.js +4 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/serve.js +4 -4
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/shared.d.ts +6 -1
- package/dist/cli/commands/shared.js +7 -0
- package/dist/cli/commands/shared.js.map +1 -1
- package/dist/cli/io.d.ts +11 -0
- package/dist/cli/io.js +28 -3
- package/dist/cli/io.js.map +1 -1
- package/dist/cli/launch.js +2 -2
- package/dist/cli/launch.js.map +1 -1
- package/dist/cli/main.d.ts +1 -1
- package/dist/cli/main.js +11 -1
- package/dist/cli/main.js.map +1 -1
- package/dist/client/control-client.d.ts +128 -7
- package/dist/client/control-client.js +211 -12
- package/dist/client/control-client.js.map +1 -1
- package/dist/cloud/registry.js +9 -1
- package/dist/cloud/registry.js.map +1 -1
- package/dist/config/paths.d.ts +137 -0
- package/dist/config/paths.js +163 -0
- package/dist/config/paths.js.map +1 -1
- package/dist/contracts/backend-advisor.d.ts +225 -0
- package/dist/contracts/backend-advisor.js +14 -0
- package/dist/contracts/backend-advisor.js.map +1 -0
- package/dist/contracts/control-api.d.ts +7 -1
- package/dist/contracts/control-api.js +7 -1
- package/dist/contracts/control-api.js.map +1 -1
- package/dist/contracts/decision.d.ts +394 -0
- package/dist/contracts/decision.js +69 -0
- package/dist/contracts/decision.js.map +1 -0
- package/dist/contracts/diffusion.d.ts +62 -9
- package/dist/contracts/embedding.d.ts +103 -0
- package/dist/contracts/embedding.js +24 -0
- package/dist/contracts/embedding.js.map +1 -0
- package/dist/contracts/engine-builds.d.ts +108 -0
- package/dist/contracts/engine-builds.js +11 -0
- package/dist/contracts/engine-builds.js.map +1 -0
- package/dist/contracts/engines.d.ts +157 -0
- package/dist/contracts/engines.js +50 -0
- package/dist/contracts/engines.js.map +1 -0
- package/dist/contracts/environment.d.ts +774 -0
- package/dist/contracts/environment.js +116 -0
- package/dist/contracts/environment.js.map +1 -0
- package/dist/contracts/errors.d.ts +43 -2
- package/dist/contracts/errors.js +41 -0
- package/dist/contracts/errors.js.map +1 -1
- package/dist/contracts/events.d.ts +82 -4
- package/dist/contracts/hardware.d.ts +79 -6
- package/dist/contracts/hardware.js +9 -5
- package/dist/contracts/hardware.js.map +1 -1
- package/dist/contracts/index.d.ts +8 -0
- package/dist/contracts/index.js +8 -0
- package/dist/contracts/index.js.map +1 -1
- package/dist/contracts/model-compatibility.d.ts +97 -0
- package/dist/contracts/model-compatibility.js +6 -0
- package/dist/contracts/model-compatibility.js.map +1 -0
- package/dist/contracts/model-setup.d.ts +115 -0
- package/dist/contracts/model-setup.js +33 -0
- package/dist/contracts/model-setup.js.map +1 -0
- package/dist/contracts/model-yml.d.ts +14 -0
- package/dist/contracts/model-yml.js +1 -0
- package/dist/contracts/model-yml.js.map +1 -1
- package/dist/contracts/session.d.ts +45 -2
- package/dist/contracts/session.js +14 -1
- package/dist/contracts/session.js.map +1 -1
- package/dist/contracts/settings.d.ts +44 -1
- package/dist/contracts/settings.js.map +1 -1
- package/dist/core/atomic-core.d.ts +46 -5
- package/dist/core/atomic-core.js +25 -0
- package/dist/core/atomic-core.js.map +1 -1
- package/dist/core/create.js +523 -23
- package/dist/core/create.js.map +1 -1
- package/dist/core/gpu/index.d.ts +6 -0
- package/dist/core/gpu/index.js +7 -0
- package/dist/core/gpu/index.js.map +1 -0
- package/dist/core/gpu/policy.d.ts +68 -0
- package/dist/core/gpu/policy.js +99 -0
- package/dist/core/gpu/policy.js.map +1 -0
- package/dist/core/gpu/residency.d.ts +44 -0
- package/dist/core/gpu/residency.js +101 -0
- package/dist/core/gpu/residency.js.map +1 -0
- package/dist/core/gpu-residency.d.ts +39 -0
- package/dist/core/gpu-residency.js +32 -0
- package/dist/core/gpu-residency.js.map +1 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/core/managed-engines.d.ts +207 -0
- package/dist/core/managed-engines.js +579 -0
- package/dist/core/managed-engines.js.map +1 -0
- package/dist/core/managed-environment.d.ts +72 -0
- package/dist/core/managed-environment.js +218 -0
- package/dist/core/managed-environment.js.map +1 -0
- package/dist/core/model-setup/index.d.ts +4 -0
- package/dist/core/model-setup/index.js +5 -0
- package/dist/core/model-setup/index.js.map +1 -0
- package/dist/core/model-setup/plan.d.ts +56 -0
- package/dist/core/model-setup/plan.js +158 -0
- package/dist/core/model-setup/plan.js.map +1 -0
- package/dist/core/model-setup/service.d.ts +92 -0
- package/dist/core/model-setup/service.js +329 -0
- package/dist/core/model-setup/service.js.map +1 -0
- package/dist/core/model-setup/store.d.ts +29 -0
- package/dist/core/model-setup/store.js +116 -0
- package/dist/core/model-setup/store.js.map +1 -0
- package/dist/core/model-setup/wiring.d.ts +59 -0
- package/dist/core/model-setup/wiring.js +132 -0
- package/dist/core/model-setup/wiring.js.map +1 -0
- package/dist/core/prism.d.ts +38 -0
- package/dist/core/prism.js +43 -0
- package/dist/core/prism.js.map +1 -0
- package/dist/core/public-server.d.ts +7 -0
- package/dist/core/public-server.js +5 -2
- package/dist/core/public-server.js.map +1 -1
- package/dist/core/sessions.d.ts +6 -1
- package/dist/core/sessions.js +18 -14
- package/dist/core/sessions.js.map +1 -1
- package/dist/core/tensorrt-llm.d.ts +169 -0
- package/dist/core/tensorrt-llm.js +428 -0
- package/dist/core/tensorrt-llm.js.map +1 -0
- package/dist/core/types.d.ts +43 -1
- package/dist/core/types.js.map +1 -1
- package/dist/decision/args.d.ts +110 -0
- package/dist/decision/args.js +126 -0
- package/dist/decision/args.js.map +1 -0
- package/dist/decision/backoff.d.ts +25 -0
- package/dist/decision/backoff.js +33 -0
- package/dist/decision/backoff.js.map +1 -0
- package/dist/decision/engine-candidates.d.ts +52 -0
- package/dist/decision/engine-candidates.js +138 -0
- package/dist/decision/engine-candidates.js.map +1 -0
- package/dist/decision/engine-fallback.d.ts +41 -0
- package/dist/decision/engine-fallback.js +57 -0
- package/dist/decision/engine-fallback.js.map +1 -0
- package/dist/decision/engine-version.d.ts +27 -0
- package/dist/decision/engine-version.js +54 -0
- package/dist/decision/engine-version.js.map +1 -0
- package/dist/decision/engine.d.ts +114 -0
- package/dist/decision/engine.js +253 -0
- package/dist/decision/engine.js.map +1 -0
- package/dist/decision/http.d.ts +36 -0
- package/dist/decision/http.js +73 -0
- package/dist/decision/http.js.map +1 -0
- package/dist/decision/index.d.ts +20 -0
- package/dist/decision/index.js +21 -0
- package/dist/decision/index.js.map +1 -0
- package/dist/decision/model-facts.d.ts +32 -0
- package/dist/decision/model-facts.js +40 -0
- package/dist/decision/model-facts.js.map +1 -0
- package/dist/decision/outcome.d.ts +35 -0
- package/dist/decision/outcome.js +105 -0
- package/dist/decision/outcome.js.map +1 -0
- package/dist/decision/process.d.ts +71 -0
- package/dist/decision/process.js +142 -0
- package/dist/decision/process.js.map +1 -0
- package/dist/decision/readiness.d.ts +74 -0
- package/dist/decision/readiness.js +165 -0
- package/dist/decision/readiness.js.map +1 -0
- package/dist/decision/request.d.ts +11 -0
- package/dist/decision/request.js +56 -0
- package/dist/decision/request.js.map +1 -0
- package/dist/decision/service.d.ts +202 -0
- package/dist/decision/service.js +711 -0
- package/dist/decision/service.js.map +1 -0
- package/dist/decision/upstream-version.d.ts +23 -0
- package/dist/decision/upstream-version.js +34 -0
- package/dist/decision/upstream-version.js.map +1 -0
- package/dist/decision/wiring.d.ts +67 -0
- package/dist/decision/wiring.js +101 -0
- package/dist/decision/wiring.js.map +1 -0
- package/dist/diffusion/args.d.ts +7 -4
- package/dist/diffusion/args.js +31 -7
- package/dist/diffusion/args.js.map +1 -1
- package/dist/diffusion/compat.d.ts +1 -1
- package/dist/diffusion/compat.js +6 -2
- package/dist/diffusion/compat.js.map +1 -1
- package/dist/diffusion/image-job.js +1 -1
- package/dist/diffusion/image-job.js.map +1 -1
- package/dist/diffusion/install.d.ts +35 -11
- package/dist/diffusion/install.js +74 -49
- package/dist/diffusion/install.js.map +1 -1
- package/dist/diffusion/job-kind.d.ts +33 -7
- package/dist/diffusion/jobs.d.ts +6 -1
- package/dist/diffusion/jobs.js +64 -18
- package/dist/diffusion/jobs.js.map +1 -1
- package/dist/diffusion/parse.d.ts +1 -2
- package/dist/diffusion/parse.js +1 -13
- package/dist/diffusion/parse.js.map +1 -1
- package/dist/diffusion/progress.js +3 -0
- package/dist/diffusion/progress.js.map +1 -1
- package/dist/diffusion/server-process.d.ts +6 -0
- package/dist/diffusion/server-process.js +3 -2
- package/dist/diffusion/server-process.js.map +1 -1
- package/dist/diffusion/service.d.ts +52 -6
- package/dist/diffusion/service.js +215 -40
- package/dist/diffusion/service.js.map +1 -1
- package/dist/diffusion/session.d.ts +27 -3
- package/dist/diffusion/session.js +108 -17
- package/dist/diffusion/session.js.map +1 -1
- package/dist/diffusion/state.d.ts +19 -1
- package/dist/diffusion/state.js +10 -0
- package/dist/diffusion/state.js.map +1 -1
- package/dist/diffusion/tracker.d.ts +21 -1
- package/dist/diffusion/tracker.js +43 -6
- package/dist/diffusion/tracker.js.map +1 -1
- package/dist/diffusion/types.d.ts +7 -0
- package/dist/diffusion/types.js +11 -0
- package/dist/diffusion/types.js.map +1 -1
- package/dist/diffusion/validate.js +2 -2
- package/dist/diffusion/validate.js.map +1 -1
- package/dist/diffusion/video-estimate.d.ts +214 -0
- package/dist/diffusion/video-estimate.js +402 -0
- package/dist/diffusion/video-estimate.js.map +1 -0
- package/dist/diffusion/video-eta.d.ts +90 -0
- package/dist/diffusion/video-eta.js +248 -0
- package/dist/diffusion/video-eta.js.map +1 -0
- package/dist/diffusion/video-history.d.ts +45 -0
- package/dist/diffusion/video-history.js +121 -0
- package/dist/diffusion/video-history.js.map +1 -0
- package/dist/diffusion/video-job.d.ts +13 -5
- package/dist/diffusion/video-job.js +42 -15
- package/dist/diffusion/video-job.js.map +1 -1
- package/dist/diffusion/video-recipe.js +3 -0
- package/dist/diffusion/video-recipe.js.map +1 -1
- package/dist/diffusion/video-tiling.d.ts +54 -0
- package/dist/diffusion/video-tiling.js +70 -0
- package/dist/diffusion/video-tiling.js.map +1 -0
- package/dist/diffusion/wiring.d.ts +14 -1
- package/dist/diffusion/wiring.js +7 -0
- package/dist/diffusion/wiring.js.map +1 -1
- package/dist/diffusion/workflow.d.ts +8 -2
- package/dist/diffusion/workflow.js +13 -5
- package/dist/diffusion/workflow.js.map +1 -1
- package/dist/downloads/downloader.d.ts +22 -0
- package/dist/downloads/downloader.js +57 -2
- package/dist/downloads/downloader.js.map +1 -1
- package/dist/downloads/protocol.d.ts +3 -8
- package/dist/downloads/protocol.js.map +1 -1
- package/dist/downloads/segmented.d.ts +40 -0
- package/dist/downloads/segmented.js +170 -0
- package/dist/downloads/segmented.js.map +1 -0
- package/dist/embedding/args.d.ts +39 -0
- package/dist/embedding/args.js +46 -0
- package/dist/embedding/args.js.map +1 -0
- package/dist/embedding/engine.d.ts +50 -0
- package/dist/embedding/engine.js +100 -0
- package/dist/embedding/engine.js.map +1 -0
- package/dist/embedding/ffmpeg.d.ts +18 -0
- package/dist/embedding/ffmpeg.js +63 -0
- package/dist/embedding/ffmpeg.js.map +1 -0
- package/dist/embedding/index.d.ts +16 -0
- package/dist/embedding/index.js +17 -0
- package/dist/embedding/index.js.map +1 -0
- package/dist/embedding/model-facts.d.ts +51 -0
- package/dist/embedding/model-facts.js +84 -0
- package/dist/embedding/model-facts.js.map +1 -0
- package/dist/embedding/process.d.ts +70 -0
- package/dist/embedding/process.js +140 -0
- package/dist/embedding/process.js.map +1 -0
- package/dist/embedding/readiness.d.ts +56 -0
- package/dist/embedding/readiness.js +114 -0
- package/dist/embedding/readiness.js.map +1 -0
- package/dist/embedding/request.d.ts +43 -0
- package/dist/embedding/request.js +285 -0
- package/dist/embedding/request.js.map +1 -0
- package/dist/embedding/service.d.ts +152 -0
- package/dist/embedding/service.js +602 -0
- package/dist/embedding/service.js.map +1 -0
- package/dist/embedding/wiring.d.ts +51 -0
- package/dist/embedding/wiring.js +79 -0
- package/dist/embedding/wiring.js.map +1 -0
- package/dist/engine-builds/builds.d.ts +54 -0
- package/dist/engine-builds/builds.js +151 -0
- package/dist/engine-builds/builds.js.map +1 -0
- package/dist/engine-builds/index.d.ts +10 -0
- package/dist/engine-builds/index.js +11 -0
- package/dist/engine-builds/index.js.map +1 -0
- package/dist/engine-builds/install.d.ts +42 -0
- package/dist/engine-builds/install.js +100 -0
- package/dist/engine-builds/install.js.map +1 -0
- package/dist/engine-builds/manifest.d.ts +121 -0
- package/dist/engine-builds/manifest.js +254 -0
- package/dist/engine-builds/manifest.js.map +1 -0
- package/dist/engine-builds/order.d.ts +24 -0
- package/dist/engine-builds/order.js +44 -0
- package/dist/engine-builds/order.js.map +1 -0
- package/dist/engine-builds/select.d.ts +123 -0
- package/dist/engine-builds/select.js +223 -0
- package/dist/engine-builds/select.js.map +1 -0
- package/dist/engine-builds/service.d.ts +123 -0
- package/dist/engine-builds/service.js +392 -0
- package/dist/engine-builds/service.js.map +1 -0
- package/dist/engines/descriptor-order.d.ts +28 -0
- package/dist/engines/descriptor-order.js +60 -0
- package/dist/engines/descriptor-order.js.map +1 -0
- package/dist/engines/engine-build.d.ts +23 -0
- package/dist/engines/engine-build.js +58 -0
- package/dist/engines/engine-build.js.map +1 -0
- package/dist/engines/index.d.ts +10 -0
- package/dist/engines/index.js +11 -0
- package/dist/engines/index.js.map +1 -0
- package/dist/engines/llamacpp.d.ts +71 -0
- package/dist/engines/llamacpp.js +176 -0
- package/dist/engines/llamacpp.js.map +1 -0
- package/dist/engines/managed.d.ts +49 -0
- package/dist/engines/managed.js +88 -0
- package/dist/engines/managed.js.map +1 -0
- package/dist/engines/service.d.ts +46 -0
- package/dist/engines/service.js +61 -0
- package/dist/engines/service.js.map +1 -0
- package/dist/engines/versions.d.ts +65 -0
- package/dist/engines/versions.js +259 -0
- package/dist/engines/versions.js.map +1 -0
- package/dist/hardware/cpu-flags.d.ts +44 -0
- package/dist/hardware/cpu-flags.js +206 -0
- package/dist/hardware/cpu-flags.js.map +1 -0
- package/dist/hardware/drm-sysfs.d.ts +51 -0
- package/dist/hardware/drm-sysfs.js +67 -0
- package/dist/hardware/drm-sysfs.js.map +1 -0
- package/dist/hardware/facts.d.ts +42 -0
- package/dist/hardware/facts.js +92 -0
- package/dist/hardware/facts.js.map +1 -0
- package/dist/hardware/index.d.ts +19 -3
- package/dist/hardware/index.js +19 -3
- package/dist/hardware/index.js.map +1 -1
- package/dist/hardware/merge.d.ts +55 -0
- package/dist/hardware/merge.js +141 -0
- package/dist/hardware/merge.js.map +1 -0
- package/dist/hardware/nvidia-smi.d.ts +43 -0
- package/dist/hardware/nvidia-smi.js +118 -0
- package/dist/hardware/nvidia-smi.js.map +1 -0
- package/dist/hardware/probe-common.d.ts +72 -0
- package/dist/hardware/probe-common.js +106 -0
- package/dist/hardware/probe-common.js.map +1 -0
- package/dist/hardware/probe-darwin.d.ts +20 -0
- package/dist/hardware/probe-darwin.js +76 -0
- package/dist/hardware/probe-darwin.js.map +1 -0
- package/dist/hardware/probe-linux.d.ts +9 -0
- package/dist/hardware/probe-linux.js +133 -0
- package/dist/hardware/probe-linux.js.map +1 -0
- package/dist/hardware/probe-windows.d.ts +7 -0
- package/dist/hardware/probe-windows.js +50 -0
- package/dist/hardware/probe-windows.js.map +1 -0
- package/dist/hardware/probe.d.ts +16 -0
- package/dist/hardware/probe.js +65 -0
- package/dist/hardware/probe.js.map +1 -0
- package/dist/hardware/service.d.ts +60 -0
- package/dist/hardware/service.js +114 -0
- package/dist/hardware/service.js.map +1 -0
- package/dist/hardware/vulkan.d.ts +47 -0
- package/dist/hardware/vulkan.js +148 -0
- package/dist/hardware/vulkan.js.map +1 -0
- package/dist/hardware/windows-video.d.ts +97 -0
- package/dist/hardware/windows-video.js +214 -0
- package/dist/hardware/windows-video.js.map +1 -0
- package/dist/host/app-daemon.d.ts +47 -0
- package/dist/host/app-daemon.js +146 -0
- package/dist/host/app-daemon.js.map +1 -0
- package/dist/host/index.d.ts +5 -3
- package/dist/host/index.js +5 -3
- package/dist/host/index.js.map +1 -1
- package/dist/host/log-file.d.ts +74 -0
- package/dist/host/log-file.js +214 -0
- package/dist/host/log-file.js.map +1 -0
- package/dist/host/recipes/enable-wsl.d.ts +63 -0
- package/dist/host/recipes/enable-wsl.js +73 -0
- package/dist/host/recipes/enable-wsl.js.map +1 -0
- package/dist/host/recipes/executor-io-windows.d.ts +69 -0
- package/dist/host/recipes/executor-io-windows.js +235 -0
- package/dist/host/recipes/executor-io-windows.js.map +1 -0
- package/dist/host/recipes/executor-io.d.ts +80 -0
- package/dist/host/recipes/executor-io.js +211 -0
- package/dist/host/recipes/executor-io.js.map +1 -0
- package/dist/host/recipes/executor.d.ts +81 -0
- package/dist/host/recipes/executor.js +678 -0
- package/dist/host/recipes/executor.js.map +1 -0
- package/dist/host/recipes/guest-executor.d.ts +29 -0
- package/dist/host/recipes/guest-executor.js +76 -0
- package/dist/host/recipes/guest-executor.js.map +1 -0
- package/dist/host/recipes/index.d.ts +16 -0
- package/dist/host/recipes/index.js +17 -0
- package/dist/host/recipes/index.js.map +1 -0
- package/dist/host/recipes/install-container-runtime.d.ts +389 -0
- package/dist/host/recipes/install-container-runtime.js +796 -0
- package/dist/host/recipes/install-container-runtime.js.map +1 -0
- package/dist/host/recipes/openpgp.d.ts +23 -0
- package/dist/host/recipes/openpgp.js +153 -0
- package/dist/host/recipes/openpgp.js.map +1 -0
- package/dist/host/recipes/request-file.d.ts +96 -0
- package/dist/host/recipes/request-file.js +103 -0
- package/dist/host/recipes/request-file.js.map +1 -0
- package/dist/lock/process-journal.d.ts +5 -2
- package/dist/lock/process-journal.js.map +1 -1
- package/dist/models/capabilities.d.ts +7 -0
- package/dist/models/capabilities.js +17 -1
- package/dist/models/capabilities.js.map +1 -1
- package/dist/models/compatibility/index.d.ts +10 -0
- package/dist/models/compatibility/index.js +11 -0
- package/dist/models/compatibility/index.js.map +1 -0
- package/dist/models/compatibility/inspect.d.ts +28 -0
- package/dist/models/compatibility/inspect.js +90 -0
- package/dist/models/compatibility/inspect.js.map +1 -0
- package/dist/models/compatibility/resolve.d.ts +59 -0
- package/dist/models/compatibility/resolve.js +219 -0
- package/dist/models/compatibility/resolve.js.map +1 -0
- package/dist/models/compatibility/rules-baseline.d.ts +2 -0
- package/dist/models/compatibility/rules-baseline.js +10 -0
- package/dist/models/compatibility/rules-baseline.js.map +1 -0
- package/dist/models/compatibility/rules-baseline.json +292 -0
- package/dist/models/compatibility/rules-service.d.ts +36 -0
- package/dist/models/compatibility/rules-service.js +109 -0
- package/dist/models/compatibility/rules-service.js.map +1 -0
- package/dist/models/compatibility/rules.d.ts +81 -0
- package/dist/models/compatibility/rules.js +164 -0
- package/dist/models/compatibility/rules.js.map +1 -0
- package/dist/models/compatibility/service.d.ts +62 -0
- package/dist/models/compatibility/service.js +138 -0
- package/dist/models/compatibility/service.js.map +1 -0
- package/dist/models/decision-checkpoint.d.ts +22 -0
- package/dist/models/decision-checkpoint.js +33 -0
- package/dist/models/decision-checkpoint.js.map +1 -0
- package/dist/models/gguf/classify.d.ts +27 -1
- package/dist/models/gguf/classify.js +78 -2
- package/dist/models/gguf/classify.js.map +1 -1
- package/dist/models/gguf/index.d.ts +1 -0
- package/dist/models/gguf/index.js +1 -0
- package/dist/models/gguf/index.js.map +1 -1
- package/dist/models/gguf/tensors.d.ts +57 -0
- package/dist/models/gguf/tensors.js +239 -0
- package/dist/models/gguf/tensors.js.map +1 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/dist/models/index.js.map +1 -1
- package/dist/router/resolve.d.ts +7 -1
- package/dist/router/resolve.js +14 -1
- package/dist/router/resolve.js.map +1 -1
- package/dist/runtime/container/argv.d.ts +88 -0
- package/dist/runtime/container/argv.js +406 -0
- package/dist/runtime/container/argv.js.map +1 -0
- package/dist/runtime/container/docker-binary.d.ts +4 -0
- package/dist/runtime/container/docker-binary.js +34 -0
- package/dist/runtime/container/docker-binary.js.map +1 -0
- package/dist/runtime/container/env.d.ts +17 -0
- package/dist/runtime/container/env.js +52 -0
- package/dist/runtime/container/env.js.map +1 -0
- package/dist/runtime/container/exec.d.ts +27 -0
- package/dist/runtime/container/exec.js +79 -0
- package/dist/runtime/container/exec.js.map +1 -0
- package/dist/runtime/container/execution-journal.d.ts +55 -0
- package/dist/runtime/container/execution-journal.js +167 -0
- package/dist/runtime/container/execution-journal.js.map +1 -0
- package/dist/runtime/container/heartbeat.d.ts +47 -0
- package/dist/runtime/container/heartbeat.js +78 -0
- package/dist/runtime/container/heartbeat.js.map +1 -0
- package/dist/runtime/container/index.d.ts +30 -0
- package/dist/runtime/container/index.js +31 -0
- package/dist/runtime/container/index.js.map +1 -0
- package/dist/runtime/container/operations.d.ts +40 -0
- package/dist/runtime/container/operations.js +233 -0
- package/dist/runtime/container/operations.js.map +1 -0
- package/dist/runtime/container/pull.d.ts +48 -0
- package/dist/runtime/container/pull.js +280 -0
- package/dist/runtime/container/pull.js.map +1 -0
- package/dist/runtime/container/reconcile.d.ts +34 -0
- package/dist/runtime/container/reconcile.js +79 -0
- package/dist/runtime/container/reconcile.js.map +1 -0
- package/dist/runtime/container/types.d.ts +124 -0
- package/dist/runtime/container/types.js +2 -0
- package/dist/runtime/container/types.js.map +1 -0
- package/dist/runtime/container/watchdog.d.ts +114 -0
- package/dist/runtime/container/watchdog.js +418 -0
- package/dist/runtime/container/watchdog.js.map +1 -0
- package/dist/runtime/container/wiring.d.ts +78 -0
- package/dist/runtime/container/wiring.js +92 -0
- package/dist/runtime/container/wiring.js.map +1 -0
- package/dist/runtime/container/wsl-exec.d.ts +13 -0
- package/dist/runtime/container/wsl-exec.js +18 -0
- package/dist/runtime/container/wsl-exec.js.map +1 -0
- package/dist/runtime/environment/cached-document.d.ts +128 -0
- package/dist/runtime/environment/cached-document.js +218 -0
- package/dist/runtime/environment/cached-document.js.map +1 -0
- package/dist/runtime/environment/canonical-json.d.ts +78 -0
- package/dist/runtime/environment/canonical-json.js +86 -0
- package/dist/runtime/environment/canonical-json.js.map +1 -0
- package/dist/runtime/environment/descriptor-provider.d.ts +121 -0
- package/dist/runtime/environment/descriptor-provider.js +159 -0
- package/dist/runtime/environment/descriptor-provider.js.map +1 -0
- package/dist/runtime/environment/descriptor.d.ts +35 -0
- package/dist/runtime/environment/descriptor.js +239 -0
- package/dist/runtime/environment/descriptor.js.map +1 -0
- package/dist/runtime/environment/diagnostics.d.ts +50 -0
- package/dist/runtime/environment/diagnostics.js +114 -0
- package/dist/runtime/environment/diagnostics.js.map +1 -0
- package/dist/runtime/environment/document-fields.d.ts +39 -0
- package/dist/runtime/environment/document-fields.js +96 -0
- package/dist/runtime/environment/document-fields.js.map +1 -0
- package/dist/runtime/environment/environment-manifest-provider.d.ts +65 -0
- package/dist/runtime/environment/environment-manifest-provider.js +89 -0
- package/dist/runtime/environment/environment-manifest-provider.js.map +1 -0
- package/dist/runtime/environment/environment-manifest.d.ts +35 -0
- package/dist/runtime/environment/environment-manifest.js +131 -0
- package/dist/runtime/environment/environment-manifest.js.map +1 -0
- package/dist/runtime/environment/guest-host.d.ts +43 -0
- package/dist/runtime/environment/guest-host.js +88 -0
- package/dist/runtime/environment/guest-host.js.map +1 -0
- package/dist/runtime/environment/host-exec.d.ts +38 -0
- package/dist/runtime/environment/host-exec.js +145 -0
- package/dist/runtime/environment/host-exec.js.map +1 -0
- package/dist/runtime/environment/host-step-failure.d.ts +33 -0
- package/dist/runtime/environment/host-step-failure.js +34 -0
- package/dist/runtime/environment/host-step-failure.js.map +1 -0
- package/dist/runtime/environment/index.d.ts +56 -0
- package/dist/runtime/environment/index.js +57 -0
- package/dist/runtime/environment/index.js.map +1 -0
- package/dist/runtime/environment/installations.d.ts +25 -0
- package/dist/runtime/environment/installations.js +70 -0
- package/dist/runtime/environment/installations.js.map +1 -0
- package/dist/runtime/environment/inventory.d.ts +42 -0
- package/dist/runtime/environment/inventory.js +57 -0
- package/dist/runtime/environment/inventory.js.map +1 -0
- package/dist/runtime/environment/linux-blockers.d.ts +130 -0
- package/dist/runtime/environment/linux-blockers.js +251 -0
- package/dist/runtime/environment/linux-blockers.js.map +1 -0
- package/dist/runtime/environment/linux-docker-facts.d.ts +200 -0
- package/dist/runtime/environment/linux-docker-facts.js +342 -0
- package/dist/runtime/environment/linux-docker-facts.js.map +1 -0
- package/dist/runtime/environment/linux-docker-network.d.ts +80 -0
- package/dist/runtime/environment/linux-docker-network.js +195 -0
- package/dist/runtime/environment/linux-docker-network.js.map +1 -0
- package/dist/runtime/environment/linux-host.d.ts +22 -0
- package/dist/runtime/environment/linux-host.js +98 -0
- package/dist/runtime/environment/linux-host.js.map +1 -0
- package/dist/runtime/environment/linux-plan.d.ts +126 -0
- package/dist/runtime/environment/linux-plan.js +392 -0
- package/dist/runtime/environment/linux-plan.js.map +1 -0
- package/dist/runtime/environment/linux-probe.d.ts +245 -0
- package/dist/runtime/environment/linux-probe.js +315 -0
- package/dist/runtime/environment/linux-probe.js.map +1 -0
- package/dist/runtime/environment/linux-provisioner.d.ts +102 -0
- package/dist/runtime/environment/linux-provisioner.js +734 -0
- package/dist/runtime/environment/linux-provisioner.js.map +1 -0
- package/dist/runtime/environment/provisioner-descriptors.d.ts +17 -0
- package/dist/runtime/environment/provisioner-descriptors.js +62 -0
- package/dist/runtime/environment/provisioner-descriptors.js.map +1 -0
- package/dist/runtime/environment/recovery.d.ts +74 -0
- package/dist/runtime/environment/recovery.js +121 -0
- package/dist/runtime/environment/recovery.js.map +1 -0
- package/dist/runtime/environment/rootfs-download.d.ts +2 -0
- package/dist/runtime/environment/rootfs-download.js +47 -0
- package/dist/runtime/environment/rootfs-download.js.map +1 -0
- package/dist/runtime/environment/service.d.ts +280 -0
- package/dist/runtime/environment/service.js +776 -0
- package/dist/runtime/environment/service.js.map +1 -0
- package/dist/runtime/environment/state.d.ts +163 -0
- package/dist/runtime/environment/state.js +479 -0
- package/dist/runtime/environment/state.js.map +1 -0
- package/dist/runtime/environment/store-models.d.ts +19 -0
- package/dist/runtime/environment/store-models.js +30 -0
- package/dist/runtime/environment/store-models.js.map +1 -0
- package/dist/runtime/environment/store.d.ts +210 -0
- package/dist/runtime/environment/store.js +438 -0
- package/dist/runtime/environment/store.js.map +1 -0
- package/dist/runtime/environment/windows-environment-record.d.ts +48 -0
- package/dist/runtime/environment/windows-environment-record.js +89 -0
- package/dist/runtime/environment/windows-environment-record.js.map +1 -0
- package/dist/runtime/environment/windows-forwarding.d.ts +27 -0
- package/dist/runtime/environment/windows-forwarding.js +84 -0
- package/dist/runtime/environment/windows-forwarding.js.map +1 -0
- package/dist/runtime/environment/windows-guest-setup.d.ts +48 -0
- package/dist/runtime/environment/windows-guest-setup.js +157 -0
- package/dist/runtime/environment/windows-guest-setup.js.map +1 -0
- package/dist/runtime/environment/windows-host.d.ts +46 -0
- package/dist/runtime/environment/windows-host.js +163 -0
- package/dist/runtime/environment/windows-host.js.map +1 -0
- package/dist/runtime/environment/windows-plan.d.ts +78 -0
- package/dist/runtime/environment/windows-plan.js +216 -0
- package/dist/runtime/environment/windows-plan.js.map +1 -0
- package/dist/runtime/environment/windows-probe.d.ts +135 -0
- package/dist/runtime/environment/windows-probe.js +261 -0
- package/dist/runtime/environment/windows-probe.js.map +1 -0
- package/dist/runtime/environment/windows-provisioner.d.ts +113 -0
- package/dist/runtime/environment/windows-provisioner.js +782 -0
- package/dist/runtime/environment/windows-provisioner.js.map +1 -0
- package/dist/runtime/environment/wiring.d.ts +117 -0
- package/dist/runtime/environment/wiring.js +354 -0
- package/dist/runtime/environment/wiring.js.map +1 -0
- package/dist/runtime/foundation-models/runtime.d.ts +8 -0
- package/dist/runtime/foundation-models/runtime.js +5 -2
- package/dist/runtime/foundation-models/runtime.js.map +1 -1
- package/dist/runtime/llamacpp/args.d.ts +10 -1
- package/dist/runtime/llamacpp/args.js +43 -7
- package/dist/runtime/llamacpp/args.js.map +1 -1
- package/dist/runtime/llamacpp/fit-margin.d.ts +46 -0
- package/dist/runtime/llamacpp/fit-margin.js +47 -0
- package/dist/runtime/llamacpp/fit-margin.js.map +1 -0
- package/dist/runtime/llamacpp/index.d.ts +1 -0
- package/dist/runtime/llamacpp/index.js +1 -0
- package/dist/runtime/llamacpp/index.js.map +1 -1
- package/dist/runtime/llamacpp/load-plan.d.ts +23 -1
- package/dist/runtime/llamacpp/load-plan.js +82 -1
- package/dist/runtime/llamacpp/load-plan.js.map +1 -1
- package/dist/runtime/llamacpp/policy.d.ts +16 -0
- package/dist/runtime/llamacpp/policy.js +20 -0
- package/dist/runtime/llamacpp/policy.js.map +1 -1
- package/dist/runtime/llamacpp/probe.d.ts +21 -1
- package/dist/runtime/llamacpp/probe.js +32 -6
- package/dist/runtime/llamacpp/probe.js.map +1 -1
- package/dist/runtime/llamacpp/runtime.d.ts +56 -1
- package/dist/runtime/llamacpp/runtime.js +142 -15
- package/dist/runtime/llamacpp/runtime.js.map +1 -1
- package/dist/runtime/managed-engines/index.d.ts +8 -0
- package/dist/runtime/managed-engines/index.js +9 -0
- package/dist/runtime/managed-engines/index.js.map +1 -0
- package/dist/runtime/managed-engines/runtime.d.ts +140 -0
- package/dist/runtime/managed-engines/runtime.js +402 -0
- package/dist/runtime/managed-engines/runtime.js.map +1 -0
- package/dist/runtime/managed-engines/spec.d.ts +70 -0
- package/dist/runtime/managed-engines/spec.js +39 -0
- package/dist/runtime/managed-engines/spec.js.map +1 -0
- package/dist/runtime/managed-models/check.d.ts +50 -0
- package/dist/runtime/managed-models/check.js +157 -0
- package/dist/runtime/managed-models/check.js.map +1 -0
- package/dist/runtime/managed-models/compatibility.d.ts +256 -0
- package/dist/runtime/managed-models/compatibility.js +594 -0
- package/dist/runtime/managed-models/compatibility.js.map +1 -0
- package/dist/runtime/managed-models/delete.d.ts +15 -0
- package/dist/runtime/managed-models/delete.js +60 -0
- package/dist/runtime/managed-models/delete.js.map +1 -0
- package/dist/runtime/managed-models/guest-files.d.ts +8 -0
- package/dist/runtime/managed-models/guest-files.js +49 -0
- package/dist/runtime/managed-models/guest-files.js.map +1 -0
- package/dist/runtime/managed-models/index.d.ts +17 -0
- package/dist/runtime/managed-models/index.js +18 -0
- package/dist/runtime/managed-models/index.js.map +1 -0
- package/dist/runtime/managed-models/location.d.ts +22 -0
- package/dist/runtime/managed-models/location.js +53 -0
- package/dist/runtime/managed-models/location.js.map +1 -0
- package/dist/runtime/managed-models/migrate.d.ts +30 -0
- package/dist/runtime/managed-models/migrate.js +119 -0
- package/dist/runtime/managed-models/migrate.js.map +1 -0
- package/dist/runtime/managed-models/model-dir.d.ts +36 -0
- package/dist/runtime/managed-models/model-dir.js +136 -0
- package/dist/runtime/managed-models/model-dir.js.map +1 -0
- package/dist/runtime/managed-models/quant-format.d.ts +71 -0
- package/dist/runtime/managed-models/quant-format.js +299 -0
- package/dist/runtime/managed-models/quant-format.js.map +1 -0
- package/dist/runtime/managed-models/registry.d.ts +26 -0
- package/dist/runtime/managed-models/registry.js +66 -0
- package/dist/runtime/managed-models/registry.js.map +1 -0
- package/dist/runtime/managed-text/adapter.d.ts +283 -0
- package/dist/runtime/managed-text/adapter.js +96 -0
- package/dist/runtime/managed-text/adapter.js.map +1 -0
- package/dist/runtime/managed-text/backend-target.d.ts +3 -0
- package/dist/runtime/managed-text/backend-target.js +52 -0
- package/dist/runtime/managed-text/backend-target.js.map +1 -0
- package/dist/runtime/managed-text/deployment.d.ts +14 -0
- package/dist/runtime/managed-text/deployment.js +32 -0
- package/dist/runtime/managed-text/deployment.js.map +1 -0
- package/dist/runtime/managed-text/engine-cache.d.ts +15 -0
- package/dist/runtime/managed-text/engine-cache.js +64 -0
- package/dist/runtime/managed-text/engine-cache.js.map +1 -0
- package/dist/runtime/managed-text/gateway.d.ts +158 -0
- package/dist/runtime/managed-text/gateway.js +535 -0
- package/dist/runtime/managed-text/gateway.js.map +1 -0
- package/dist/runtime/managed-text/generation-defaults.d.ts +23 -0
- package/dist/runtime/managed-text/generation-defaults.js +51 -0
- package/dist/runtime/managed-text/generation-defaults.js.map +1 -0
- package/dist/runtime/managed-text/index.d.ts +26 -0
- package/dist/runtime/managed-text/index.js +27 -0
- package/dist/runtime/managed-text/index.js.map +1 -0
- package/dist/runtime/managed-text/lifecycle.d.ts +284 -0
- package/dist/runtime/managed-text/lifecycle.js +896 -0
- package/dist/runtime/managed-text/lifecycle.js.map +1 -0
- package/dist/runtime/managed-text/load-policy.d.ts +47 -0
- package/dist/runtime/managed-text/load-policy.js +111 -0
- package/dist/runtime/managed-text/load-policy.js.map +1 -0
- package/dist/runtime/managed-text/mount-source.d.ts +14 -0
- package/dist/runtime/managed-text/mount-source.js +18 -0
- package/dist/runtime/managed-text/mount-source.js.map +1 -0
- package/dist/runtime/managed-text/readiness.d.ts +33 -0
- package/dist/runtime/managed-text/readiness.js +88 -0
- package/dist/runtime/managed-text/readiness.js.map +1 -0
- package/dist/runtime/managed-text/request-rules.d.ts +18 -0
- package/dist/runtime/managed-text/request-rules.js +62 -0
- package/dist/runtime/managed-text/request-rules.js.map +1 -0
- package/dist/runtime/managed-text/types.d.ts +88 -0
- package/dist/runtime/managed-text/types.js +12 -0
- package/dist/runtime/managed-text/types.js.map +1 -0
- package/dist/runtime/managed-text/wsl-deployment.d.ts +24 -0
- package/dist/runtime/managed-text/wsl-deployment.js +70 -0
- package/dist/runtime/managed-text/wsl-deployment.js.map +1 -0
- package/dist/runtime/mlx/errors.d.ts +6 -1
- package/dist/runtime/mlx/errors.js +7 -2
- package/dist/runtime/mlx/errors.js.map +1 -1
- package/dist/runtime/mlx/runtime.d.ts +36 -1
- package/dist/runtime/mlx/runtime.js +85 -4
- package/dist/runtime/mlx/runtime.js.map +1 -1
- package/dist/runtime/shared/backend-output.d.ts +23 -0
- package/dist/runtime/shared/backend-output.js +32 -0
- package/dist/runtime/shared/backend-output.js.map +1 -0
- package/dist/runtime/shared/bounded-output.d.ts +24 -0
- package/dist/runtime/shared/bounded-output.js +63 -0
- package/dist/runtime/shared/bounded-output.js.map +1 -0
- package/dist/runtime/shared/external-sessions.js +9 -1
- package/dist/runtime/shared/external-sessions.js.map +1 -1
- package/dist/runtime/shared/gpu-occupancy.d.ts +60 -0
- package/dist/runtime/shared/gpu-occupancy.js +10 -0
- package/dist/runtime/shared/gpu-occupancy.js.map +1 -0
- package/dist/runtime/shared/index.d.ts +4 -0
- package/dist/runtime/shared/index.js +4 -0
- package/dist/runtime/shared/index.js.map +1 -1
- package/dist/runtime/shared/local-runtime.d.ts +35 -0
- package/dist/runtime/shared/ports.d.ts +16 -0
- package/dist/runtime/shared/ports.js +42 -1
- package/dist/runtime/shared/ports.js.map +1 -1
- package/dist/runtime/shared/process.d.ts +11 -0
- package/dist/runtime/shared/process.js +20 -0
- package/dist/runtime/shared/process.js.map +1 -1
- package/dist/runtime/shared/redact-args.d.ts +7 -0
- package/dist/runtime/shared/redact-args.js +26 -0
- package/dist/runtime/shared/redact-args.js.map +1 -0
- package/dist/runtime/shared/sidecar.d.ts +15 -0
- package/dist/runtime/shared/sidecar.js +43 -8
- package/dist/runtime/shared/sidecar.js.map +1 -1
- package/dist/runtime/tensorrt-llm/adapter.d.ts +247 -0
- package/dist/runtime/tensorrt-llm/adapter.js +1028 -0
- package/dist/runtime/tensorrt-llm/adapter.js.map +1 -0
- package/dist/runtime/tensorrt-llm/check.d.ts +12 -0
- package/dist/runtime/tensorrt-llm/check.js +22 -0
- package/dist/runtime/tensorrt-llm/check.js.map +1 -0
- package/dist/runtime/tensorrt-llm/compatibility.d.ts +124 -0
- package/dist/runtime/tensorrt-llm/compatibility.js +213 -0
- package/dist/runtime/tensorrt-llm/compatibility.js.map +1 -0
- package/dist/runtime/tensorrt-llm/cuda-graphs.d.ts +32 -0
- package/dist/runtime/tensorrt-llm/cuda-graphs.js +33 -0
- package/dist/runtime/tensorrt-llm/cuda-graphs.js.map +1 -0
- package/dist/runtime/tensorrt-llm/delete.d.ts +15 -0
- package/dist/runtime/tensorrt-llm/delete.js +60 -0
- package/dist/runtime/tensorrt-llm/delete.js.map +1 -0
- package/dist/runtime/tensorrt-llm/engine.d.ts +3 -0
- package/dist/runtime/tensorrt-llm/engine.js +30 -0
- package/dist/runtime/tensorrt-llm/engine.js.map +1 -0
- package/dist/runtime/tensorrt-llm/guest-files.d.ts +8 -0
- package/dist/runtime/tensorrt-llm/guest-files.js +49 -0
- package/dist/runtime/tensorrt-llm/guest-files.js.map +1 -0
- package/dist/runtime/tensorrt-llm/host-facts.d.ts +55 -0
- package/dist/runtime/tensorrt-llm/host-facts.js +87 -0
- package/dist/runtime/tensorrt-llm/host-facts.js.map +1 -0
- package/dist/runtime/tensorrt-llm/index.d.ts +30 -0
- package/dist/runtime/tensorrt-llm/index.js +31 -0
- package/dist/runtime/tensorrt-llm/index.js.map +1 -0
- package/dist/runtime/tensorrt-llm/installation.d.ts +23 -0
- package/dist/runtime/tensorrt-llm/installation.js +53 -0
- package/dist/runtime/tensorrt-llm/installation.js.map +1 -0
- package/dist/runtime/tensorrt-llm/kv-cache.d.ts +41 -0
- package/dist/runtime/tensorrt-llm/kv-cache.js +48 -0
- package/dist/runtime/tensorrt-llm/kv-cache.js.map +1 -0
- package/dist/runtime/tensorrt-llm/location.d.ts +20 -0
- package/dist/runtime/tensorrt-llm/location.js +48 -0
- package/dist/runtime/tensorrt-llm/location.js.map +1 -0
- package/dist/runtime/tensorrt-llm/model-dir.d.ts +38 -0
- package/dist/runtime/tensorrt-llm/model-dir.js +137 -0
- package/dist/runtime/tensorrt-llm/model-dir.js.map +1 -0
- package/dist/runtime/tensorrt-llm/prelaunch.d.ts +20 -0
- package/dist/runtime/tensorrt-llm/prelaunch.js +168 -0
- package/dist/runtime/tensorrt-llm/prelaunch.js.map +1 -0
- package/dist/runtime/tensorrt-llm/quant-format.d.ts +65 -0
- package/dist/runtime/tensorrt-llm/quant-format.js +189 -0
- package/dist/runtime/tensorrt-llm/quant-format.js.map +1 -0
- package/dist/runtime/tensorrt-llm/registry.d.ts +26 -0
- package/dist/runtime/tensorrt-llm/registry.js +68 -0
- package/dist/runtime/tensorrt-llm/registry.js.map +1 -0
- package/dist/runtime/tensorrt-llm/route-policy.d.ts +19 -0
- package/dist/runtime/tensorrt-llm/route-policy.js +17 -0
- package/dist/runtime/tensorrt-llm/route-policy.js.map +1 -0
- package/dist/runtime/tensorrt-llm/runtime.d.ts +130 -0
- package/dist/runtime/tensorrt-llm/runtime.js +395 -0
- package/dist/runtime/tensorrt-llm/runtime.js.map +1 -0
- package/dist/runtime/tensorrt-llm/settings.d.ts +7 -0
- package/dist/runtime/tensorrt-llm/settings.js +48 -0
- package/dist/runtime/tensorrt-llm/settings.js.map +1 -0
- package/dist/runtime/vllm/adapter.d.ts +46 -0
- package/dist/runtime/vllm/adapter.js +425 -0
- package/dist/runtime/vllm/adapter.js.map +1 -0
- package/dist/runtime/vllm/engine.d.ts +16 -0
- package/dist/runtime/vllm/engine.js +37 -0
- package/dist/runtime/vllm/engine.js.map +1 -0
- package/dist/runtime/vllm/index.d.ts +11 -0
- package/dist/runtime/vllm/index.js +12 -0
- package/dist/runtime/vllm/index.js.map +1 -0
- package/dist/runtime/vllm/memory.d.ts +69 -0
- package/dist/runtime/vllm/memory.js +123 -0
- package/dist/runtime/vllm/memory.js.map +1 -0
- package/dist/runtime/vllm/settings.d.ts +52 -0
- package/dist/runtime/vllm/settings.js +151 -0
- package/dist/runtime/vllm/settings.js.map +1 -0
- package/dist/runtime/wsl/guest-paths.d.ts +33 -0
- package/dist/runtime/wsl/guest-paths.js +83 -0
- package/dist/runtime/wsl/guest-paths.js.map +1 -0
- package/dist/runtime/wsl/guest-scope.d.ts +14 -0
- package/dist/runtime/wsl/guest-scope.js +98 -0
- package/dist/runtime/wsl/guest-scope.js.map +1 -0
- package/dist/runtime/wsl/index.d.ts +12 -0
- package/dist/runtime/wsl/index.js +13 -0
- package/dist/runtime/wsl/index.js.map +1 -0
- package/dist/runtime/wsl/keeper.d.ts +29 -0
- package/dist/runtime/wsl/keeper.js +48 -0
- package/dist/runtime/wsl/keeper.js.map +1 -0
- package/dist/runtime/wsl/transport.d.ts +106 -0
- package/dist/runtime/wsl/transport.js +181 -0
- package/dist/runtime/wsl/transport.js.map +1 -0
- package/dist/server/control/index.d.ts +1 -1
- package/dist/server/control/router.js +16 -1
- package/dist/server/control/router.js.map +1 -1
- package/dist/server/control/routes/backends.js +26 -0
- package/dist/server/control/routes/backends.js.map +1 -1
- package/dist/server/control/routes/decision.d.ts +10 -0
- package/dist/server/control/routes/decision.js +43 -0
- package/dist/server/control/routes/decision.js.map +1 -0
- package/dist/server/control/routes/diffusion-video.js +4 -0
- package/dist/server/control/routes/diffusion-video.js.map +1 -1
- package/dist/server/control/routes/diffusion.d.ts +1 -1
- package/dist/server/control/routes/diffusion.js +4 -9
- package/dist/server/control/routes/diffusion.js.map +1 -1
- package/dist/server/control/routes/embedding.d.ts +9 -0
- package/dist/server/control/routes/embedding.js +43 -0
- package/dist/server/control/routes/embedding.js.map +1 -0
- package/dist/server/control/routes/engine-builds.d.ts +14 -0
- package/dist/server/control/routes/engine-builds.js +82 -0
- package/dist/server/control/routes/engine-builds.js.map +1 -0
- package/dist/server/control/routes/engines.d.ts +17 -0
- package/dist/server/control/routes/engines.js +152 -0
- package/dist/server/control/routes/engines.js.map +1 -0
- package/dist/server/control/routes/environments.d.ts +16 -0
- package/dist/server/control/routes/environments.js +207 -0
- package/dist/server/control/routes/environments.js.map +1 -0
- package/dist/server/control/routes/hardware.d.ts +1 -1
- package/dist/server/control/routes/hardware.js +11 -6
- package/dist/server/control/routes/hardware.js.map +1 -1
- package/dist/server/control/routes/model-setups.d.ts +11 -0
- package/dist/server/control/routes/model-setups.js +55 -0
- package/dist/server/control/routes/model-setups.js.map +1 -0
- package/dist/server/control/routes/models.d.ts +3 -2
- package/dist/server/control/routes/models.js +45 -2
- package/dist/server/control/routes/models.js.map +1 -1
- package/dist/server/control/types.d.ts +172 -10
- package/dist/server/control/types.js.map +1 -1
- package/dist/server/http.d.ts +9 -1
- package/dist/server/http.js +51 -1
- package/dist/server/http.js.map +1 -1
- package/dist/server/public/decision-preview.d.ts +17 -0
- package/dist/server/public/decision-preview.js +119 -0
- package/dist/server/public/decision-preview.js.map +1 -0
- package/dist/server/public/decision.d.ts +32 -0
- package/dist/server/public/decision.js +135 -0
- package/dist/server/public/decision.js.map +1 -0
- package/dist/server/public/embedding.d.ts +31 -0
- package/dist/server/public/embedding.js +126 -0
- package/dist/server/public/embedding.js.map +1 -0
- package/dist/server/public/errors.d.ts +2 -1
- package/dist/server/public/errors.js +5 -2
- package/dist/server/public/errors.js.map +1 -1
- package/dist/server/public/forward.js +75 -3
- package/dist/server/public/forward.js.map +1 -1
- package/dist/server/public/gates.d.ts +18 -0
- package/dist/server/public/gates.js +41 -14
- package/dist/server/public/gates.js.map +1 -1
- package/dist/server/public/index.d.ts +6 -2
- package/dist/server/public/index.js +23 -7
- package/dist/server/public/index.js.map +1 -1
- package/dist/server/public/listing.d.ts +13 -2
- package/dist/server/public/listing.js +33 -9
- package/dist/server/public/listing.js.map +1 -1
- package/dist/server/public/policy.d.ts +9 -0
- package/dist/server/public/policy.js +68 -0
- package/dist/server/public/policy.js.map +1 -0
- package/dist/server/public/responses.js +10 -0
- package/dist/server/public/responses.js.map +1 -1
- package/dist/server/public/trace.d.ts +2 -2
- package/dist/server/public/trace.js +6 -2
- package/dist/server/public/trace.js.map +1 -1
- package/dist/server/public/types.d.ts +91 -1
- package/dist/settings/decision.d.ts +15 -0
- package/dist/settings/decision.js +88 -0
- package/dist/settings/decision.js.map +1 -0
- package/dist/settings/embedding.d.ts +12 -0
- package/dist/settings/embedding.js +82 -0
- package/dist/settings/embedding.js.map +1 -0
- package/dist/settings/index.d.ts +2 -0
- package/dist/settings/index.js +2 -0
- package/dist/settings/index.js.map +1 -1
- package/dist/settings/schema/atomic-prism.json +433 -0
- package/dist/settings/schema/tensorrt-llm.json +253 -0
- package/dist/settings/schema/vllm.json +273 -0
- package/dist/settings/schema.js +58 -0
- package/dist/settings/schema.js.map +1 -1
- package/dist/settings/store.d.ts +13 -2
- package/dist/settings/store.js +44 -0
- package/dist/settings/store.js.map +1 -1
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.js +1 -0
- package/dist/util/index.js.map +1 -1
- package/dist/util/result.d.ts +19 -0
- package/dist/util/result.js +15 -0
- package/dist/util/result.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +2 -2
- package/src/settings/schema/atomic-prism.json +433 -0
- package/src/settings/schema/tensorrt-llm.json +253 -0
- package/src/settings/schema/vllm.json +273 -0
package/dist/core/create.js
CHANGED
|
@@ -3,29 +3,42 @@
|
|
|
3
3
|
* the runtimes and backend services, start the control listener, construct the facade, reap what a
|
|
4
4
|
* previous owner left running and only then publish the endpoint.
|
|
5
5
|
*/
|
|
6
|
+
import { randomUUID } from 'node:crypto';
|
|
6
7
|
import { homedir } from 'node:os';
|
|
7
8
|
import { join } from 'node:path';
|
|
9
|
+
import { AtomicCoreError, ENGINE_KINDS } from '../contracts/index.js';
|
|
8
10
|
import { dataLayout, nodeDataFolderEnv, resolveCliDataFolder, resolveDataFolder } from '../config/index.js';
|
|
9
11
|
import { CoreEmitter } from '../events/index.js';
|
|
10
12
|
import { InstanceLock, ProcessJournal, writeControlToken } from '../lock/index.js';
|
|
11
13
|
import { EmbedService, ModelCapabilityService, ModelRegistry } from '../models/index.js';
|
|
12
|
-
import { LlamacppRuntime } from '../runtime/llamacpp/index.js';
|
|
14
|
+
import { LlamacppRuntime, processPackDirs } from '../runtime/llamacpp/index.js';
|
|
13
15
|
import { ExternalSessions } from '../runtime/index.js';
|
|
14
16
|
import { FoundationModelsRuntime } from '../runtime/foundation-models/index.js';
|
|
15
17
|
import { MlxRuntime } from '../runtime/mlx/index.js';
|
|
16
18
|
import { SettingsStore } from '../settings/index.js';
|
|
19
|
+
import { TRANSCRIPTION_MODEL_ID } from '../speculative/index.js';
|
|
17
20
|
import { ApiKeyStore, ChatGptAuth } from '../credentials/index.js';
|
|
18
21
|
import { CloudRegistry, listSubscriptionModels } from '../cloud/index.js';
|
|
19
|
-
import {
|
|
20
|
-
import { BackendService, ensureBackend, ensureTurboquantCudart, ensureUpstreamCudart, ManifestSessionCache, OptimalBackendStore, fetchLiveManifest,
|
|
22
|
+
import { HardwareService, nodeProbeDeps, probeSystemInfo, probeUnifiedMemory } from '../hardware/index.js';
|
|
23
|
+
import { BackendAdvisor, BackendService, PrismCatalogService, TurboquantCatalogService, ensureBackend, ensureTurboquantCudart, ensureUpstreamCudart, ManifestSessionCache, probeLinuxRocmHost, OptimalBackendStore, fetchLiveManifest, manifestTransportFromFetch, readRuntimeSettings, resolveBackendExe, selectInstalledBackend, } from '../backend/index.js';
|
|
24
|
+
import { noticeEngineInstall, wireDecision } from '../decision/index.js';
|
|
25
|
+
import { EngineBuildEngine, EnginesService, LlamacppEngine, ManagedEngine, hostEngines, } from '../engines/index.js';
|
|
26
|
+
import { DEFAULT_ENVIRONMENT_ID } from '../runtime/environment/index.js';
|
|
27
|
+
import { noticeEmbeddingEngineInstall, wireEmbedding } from '../embedding/index.js';
|
|
21
28
|
import { wireDiffusion } from '../diffusion/index.js';
|
|
22
|
-
import {
|
|
29
|
+
import { EngineBuildsService, EngineManifestSource, IDLE_ENGINE_HOST, manifestKinds, } from '../engine-builds/index.js';
|
|
30
|
+
import { Downloader, availableDiskSpace, defaultAvailableSpace, policyFetchFor } from '../downloads/index.js';
|
|
23
31
|
import { lanAddresses, reapTunnelOrphan, wireRemoteAccess } from '../remote-access/index.js';
|
|
24
32
|
import { ClientRegistry, CLIENT_EXPIRY_MS, ControlServer } from '../server/index.js';
|
|
25
33
|
import { captureReport, createCoreReporter, processFailureReport, reportCoreEvents, } from '../telemetry/index.js';
|
|
26
34
|
import { CORE_VERSION } from '../version.js';
|
|
35
|
+
import { wireManagedEnvironment } from './managed-environment.js';
|
|
36
|
+
import { compatibilityFor, wireModelSetups } from './model-setup/index.js';
|
|
37
|
+
import { currentPrismPack, wirePrismCompatibility } from './prism.js';
|
|
38
|
+
import { DIFFUSION_GPU_PROVIDER, wireGpuResidency } from './gpu-residency.js';
|
|
27
39
|
import { reapOrphans } from './reap-orphans.js';
|
|
28
|
-
import { sessionsOf } from './sessions.js';
|
|
40
|
+
import { sessionsOf, unknownProvider } from './sessions.js';
|
|
41
|
+
import { leftoverContainers, managedEngineRegistry, managedModelDeleter, managedModelExclusivity, managedSessionUnloader, managedModelLocation, managedModelRegistry, createStoreMigration, windowsModelFilesFor, wiredExec, wireManagedEngine, wireManagedModelCheck, } from './managed-engines.js';
|
|
29
42
|
import { LOCAL_PROVIDER } from './types.js';
|
|
30
43
|
/**
|
|
31
44
|
* Take ownership of a data folder and start the control listener. `construct` builds the facade
|
|
@@ -34,6 +47,12 @@ import { LOCAL_PROVIDER } from './types.js';
|
|
|
34
47
|
export async function createAtomicCore(options, construct) {
|
|
35
48
|
const log = options.logger ?? (() => { });
|
|
36
49
|
const warn = (message) => log('warn', message);
|
|
50
|
+
// The core logger as the local runtimes and diffusion take it: they may also say `debug`, which is
|
|
51
|
+
// dropped here, because the host's `logger` only understands three levels.
|
|
52
|
+
const runtimeLog = (level, message) => {
|
|
53
|
+
if (level !== 'debug')
|
|
54
|
+
log(level, message);
|
|
55
|
+
};
|
|
37
56
|
const scope = options.ownerScope ?? 'cli';
|
|
38
57
|
const root = options.dataFolder ??
|
|
39
58
|
(scope === 'app'
|
|
@@ -105,14 +124,24 @@ export async function createAtomicCore(options, construct) {
|
|
|
105
124
|
const externalSessions = new ExternalSessions({ emit: (name, payload) => emitter.emit(name, payload) });
|
|
106
125
|
const journal = await ProcessJournal.open(layout);
|
|
107
126
|
const clients = new ClientRegistry();
|
|
127
|
+
const platform = options.platform ?? process.platform;
|
|
108
128
|
// One per core process, in memory: hardware changes between runs, and a stale file claiming
|
|
109
|
-
// a GPU that is gone would pick a backend that cannot start. The same
|
|
129
|
+
// a GPU that is gone would pick a backend that cannot start. The same service is deliberately
|
|
110
130
|
// shared by control and the runtime: accepting an override that load never reads is worse
|
|
111
|
-
// than rejecting the endpoint, because it tells the app a hardware handover succeeded.
|
|
112
|
-
|
|
131
|
+
// than rejecting the endpoint, because it tells the app a hardware handover succeeded. The
|
|
132
|
+
// probe starts now and runs while the rest is wired; the first load waits for it.
|
|
133
|
+
const hardware = new HardwareService({
|
|
134
|
+
probe: options.hardware?.probe ??
|
|
135
|
+
(() => probeSystemInfo(nodeProbeDeps({ platform, arch: process.arch, env: options.env ?? process.env }))),
|
|
136
|
+
arch: process.arch,
|
|
137
|
+
platform,
|
|
138
|
+
log,
|
|
139
|
+
});
|
|
140
|
+
hardware.start();
|
|
113
141
|
// One downloader per core process: it owns the active-task table that `cancel` works from, so
|
|
114
142
|
// two of them would each know only half of what is running.
|
|
115
143
|
const downloader = new Downloader({
|
|
144
|
+
...(options.downloadStreams !== undefined ? { streams: options.downloadStreams } : {}),
|
|
116
145
|
dataFolder: layout.root,
|
|
117
146
|
platform: process.platform,
|
|
118
147
|
fetch: options.fetch ?? fetch,
|
|
@@ -121,9 +150,9 @@ export async function createAtomicCore(options, construct) {
|
|
|
121
150
|
const registries = new Map([
|
|
122
151
|
[LOCAL_PROVIDER, new ModelRegistry(layout, LOCAL_PROVIDER)],
|
|
123
152
|
['llamacpp', new ModelRegistry(layout, 'llamacpp')],
|
|
153
|
+
['atomic-prism', new ModelRegistry(layout, 'atomic-prism')],
|
|
124
154
|
]);
|
|
125
|
-
|
|
126
|
-
// Both llama.cpp providers run through one runtime class; what differs — backend ids, the
|
|
155
|
+
// The three llama.cpp providers run through one runtime class; what differs — backend ids, the
|
|
127
156
|
// argument rules and Windows CUDA runtime repair — is decided by the provider it is given.
|
|
128
157
|
const llamacppRuntime = (provider) => new LlamacppRuntime({
|
|
129
158
|
layout,
|
|
@@ -137,24 +166,48 @@ export async function createAtomicCore(options, construct) {
|
|
|
137
166
|
const backendDir = join(layout.provider(provider).backendsDir, repairVersion, repairBackend);
|
|
138
167
|
const taskId = `${provider}-cudart-${repairVersion}/${repairBackend}`.replace(/[^A-Za-z0-9_/:-]/g, '_');
|
|
139
168
|
const deps = { layout, downloader, platform, log: (message) => log('warn', message) };
|
|
169
|
+
// A PrismML pack is installed with its CUDA runtime in place; there is nothing to repair.
|
|
170
|
+
if (provider === 'atomic-prism')
|
|
171
|
+
return Promise.resolve();
|
|
140
172
|
const repair = provider === 'llamacpp'
|
|
141
173
|
? ensureTurboquantCudart(repairBackend, backendDir, taskId, deps)
|
|
142
174
|
: ensureUpstreamCudart(repairVersion, repairBackend, backendDir, taskId, deps);
|
|
143
175
|
return repair.then(() => { }, (e) => log('warn', `cudart pre-flight for ${repairVersion}/${repairBackend} failed: ${String(e)}`));
|
|
144
176
|
}),
|
|
145
177
|
cpuInfo: async () => {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
// The no-AVX policy knows `x86_64`, not Node's `x64`: pass the raw name and it never fires.
|
|
150
|
-
return { arch: platformArch(process.arch), extensions: hardware.cpuExtensions([]) };
|
|
178
|
+
// Unknown flags stay `undefined`: the no-AVX preflight fires on a positive signal only.
|
|
179
|
+
const facts = await hardware.facts();
|
|
180
|
+
return facts.cpuExtensions ? { arch: facts.arch, extensions: facts.cpuExtensions } : undefined;
|
|
151
181
|
},
|
|
182
|
+
// The voice model the app loads next to a chat model: auxiliary, like an embedding model —
|
|
183
|
+
// never auto-unloaded, never evicted by GPU residency, never evicting.
|
|
184
|
+
transcriptionModelId: TRANSCRIPTION_MODEL_ID,
|
|
185
|
+
claimGpu: (claim, signal) => gpuResidency.hook(provider)(claim, signal),
|
|
186
|
+
checkCompatibility: (target) => prismCompatibility.gate(provider, target),
|
|
187
|
+
unifiedMemory: async () => probeUnifiedMemory(nodeProbeDeps({ platform, arch: process.arch, env: options.env ?? process.env })),
|
|
188
|
+
log: runtimeLog,
|
|
152
189
|
...(options.fetch ? { fetch: options.fetch } : {}),
|
|
190
|
+
...(options.backendOutput ? { backendOutput: options.backendOutput } : {}),
|
|
153
191
|
});
|
|
192
|
+
// The managed engines this core can run (change `add-vllm-runtime`, design D3).
|
|
193
|
+
const managedEngines = managedEngineRegistry();
|
|
154
194
|
const runtimes = new Map([
|
|
155
195
|
[LOCAL_PROVIDER, llamacppRuntime('llamacpp-upstream')],
|
|
156
196
|
['llamacpp', llamacppRuntime('llamacpp')],
|
|
197
|
+
['atomic-prism', llamacppRuntime('atomic-prism')],
|
|
157
198
|
]);
|
|
199
|
+
// The facade, constructed last: what GPU residency and an engine removal stop a session through,
|
|
200
|
+
// exactly as a client's unload would. Read when they act, never before.
|
|
201
|
+
const facade = () => core;
|
|
202
|
+
// GPU residency (task 2.15, spec `gpu-residency`): one resident model per card across every local
|
|
203
|
+
// engine of this core. Every part is read at claim time — image generation, the Docker executor's
|
|
204
|
+
// leftovers and the facade are wired further down.
|
|
205
|
+
const gpuResidency = wireGpuResidency({
|
|
206
|
+
runtimes,
|
|
207
|
+
diffusion: () => diffusion,
|
|
208
|
+
leftovers: () => managedLeftovers(),
|
|
209
|
+
sessions: facade,
|
|
210
|
+
});
|
|
158
211
|
if (platform === 'darwin') {
|
|
159
212
|
const mlxRegistry = new ModelRegistry(layout, 'mlx');
|
|
160
213
|
registries.set('mlx', mlxRegistry);
|
|
@@ -163,17 +216,26 @@ export async function createAtomicCore(options, construct) {
|
|
|
163
216
|
registry: mlxRegistry,
|
|
164
217
|
instanceId: lock.instanceId,
|
|
165
218
|
resourcesDir: options.resourcesDir,
|
|
219
|
+
// The newest of the installer's `mlx-server` and the ones the core downloaded, per load.
|
|
220
|
+
resolveBinary: () => engineBuilds.resolveMlxBinary(),
|
|
166
221
|
readSettings: async () => settings.get('mlx'),
|
|
167
222
|
journal,
|
|
168
223
|
emit: (name, payload) => emitter.emit(name, payload),
|
|
224
|
+
claimGpu: gpuResidency.hook('mlx'),
|
|
225
|
+
log: runtimeLog,
|
|
226
|
+
...(options.backendOutput ? { backendOutput: options.backendOutput } : {}),
|
|
169
227
|
}));
|
|
170
228
|
runtimes.set('foundation-models', new FoundationModelsRuntime({
|
|
171
229
|
instanceId: lock.instanceId,
|
|
172
230
|
resourcesDir: options.resourcesDir,
|
|
173
231
|
journal,
|
|
174
232
|
emit: (name, payload) => emitter.emit(name, payload),
|
|
233
|
+
log: runtimeLog,
|
|
234
|
+
...(options.backendOutput ? { backendOutput: options.backendOutput } : {}),
|
|
175
235
|
}));
|
|
176
236
|
}
|
|
237
|
+
// The public server's trusted hosts, kept in this one array for every session gateway to read.
|
|
238
|
+
const managedTrustedHosts = [];
|
|
177
239
|
const optimalStore = await OptimalBackendStore.open(layout.core.optimalBackend, (provider, state) => {
|
|
178
240
|
emitter.emit('backend:optimal-changed', { provider, ...state });
|
|
179
241
|
});
|
|
@@ -188,6 +250,74 @@ export async function createAtomicCore(options, construct) {
|
|
|
188
250
|
unload: (provider, modelId) => core.unload(provider, modelId),
|
|
189
251
|
fetch: options.fetch ?? fetch,
|
|
190
252
|
});
|
|
253
|
+
// The proxy policy of one request decides that request's fetch; nothing about it is kept.
|
|
254
|
+
const fetchFor = (proxy) => policyFetchFor({ proxy: proxy ?? null }, options.fetch ?? fetch);
|
|
255
|
+
// One release-index service for the fork: its memory TTL and in-flight coalescing only help
|
|
256
|
+
// when every caller shares them.
|
|
257
|
+
const turboquantCatalog = new TurboquantCatalogService({
|
|
258
|
+
layout,
|
|
259
|
+
fetchFor,
|
|
260
|
+
platform,
|
|
261
|
+
log: (level, message) => log(level, message),
|
|
262
|
+
});
|
|
263
|
+
// Test hooks (docs/contracts.md "Test hooks"): where the PrismML manifest, the model rules and
|
|
264
|
+
// model files are read from. Unset in production.
|
|
265
|
+
const prismManifestUrl = env['ATOMIC_PRISM_MANIFEST_URL'];
|
|
266
|
+
const prismRulesUrl = env['ATOMIC_PRISM_MODEL_RULES_URL'];
|
|
267
|
+
const hfEndpoint = env['ATOMIC_HF_ENDPOINT'];
|
|
268
|
+
const prismCatalog = new PrismCatalogService({
|
|
269
|
+
layout,
|
|
270
|
+
fetchFor,
|
|
271
|
+
...(prismManifestUrl ? { url: prismManifestUrl } : {}),
|
|
272
|
+
log,
|
|
273
|
+
});
|
|
274
|
+
// One compatibility service for the control routes and every llama.cpp load gate; the gate
|
|
275
|
+
// reads only what is cached, so a load never waits on the network for it.
|
|
276
|
+
const prismCompatibility = wirePrismCompatibility({
|
|
277
|
+
...(options.remoteGgufTimeoutMs !== undefined
|
|
278
|
+
? { remoteGgufTimeoutMs: options.remoteGgufTimeoutMs }
|
|
279
|
+
: {}),
|
|
280
|
+
layout,
|
|
281
|
+
settings,
|
|
282
|
+
hardware,
|
|
283
|
+
prismCatalog,
|
|
284
|
+
fetch: fetchFor(),
|
|
285
|
+
...(prismRulesUrl ? { rulesUrl: prismRulesUrl } : {}),
|
|
286
|
+
env,
|
|
287
|
+
log,
|
|
288
|
+
});
|
|
289
|
+
const allowPrismCandidates = () => settings.get('atomic-prism')['allow_candidate_builds'] === true;
|
|
290
|
+
const advisors = new Map();
|
|
291
|
+
const backendAdvisor = (provider) => {
|
|
292
|
+
const existing = advisors.get(provider);
|
|
293
|
+
if (existing)
|
|
294
|
+
return existing;
|
|
295
|
+
const created = new BackendAdvisor({
|
|
296
|
+
provider,
|
|
297
|
+
layout,
|
|
298
|
+
hardware: () => hardware.facts(),
|
|
299
|
+
currentVersionBackend: () => String(settings.get(provider)['version_backend'] ?? ''),
|
|
300
|
+
optimalStore,
|
|
301
|
+
emit: (name, payload) => emitter.emit(name, payload),
|
|
302
|
+
fetchFor,
|
|
303
|
+
manifestCache,
|
|
304
|
+
turboquantCatalog,
|
|
305
|
+
prismCatalog,
|
|
306
|
+
allowCandidateBuilds: allowPrismCandidates,
|
|
307
|
+
// The Windows tier check runs `--list-devices` on the installed pack of that tier.
|
|
308
|
+
listDevices: async (installed) => {
|
|
309
|
+
const exePath = await resolveBackendExe(layout, provider, installed.version, installed.backend);
|
|
310
|
+
if (!exePath)
|
|
311
|
+
return [];
|
|
312
|
+
const runtime = core.runtime(provider);
|
|
313
|
+
return runtime instanceof LlamacppRuntime ? runtime.getDevices(exePath) : [];
|
|
314
|
+
},
|
|
315
|
+
platform,
|
|
316
|
+
log: (level, message) => log(level, message),
|
|
317
|
+
});
|
|
318
|
+
advisors.set(provider, created);
|
|
319
|
+
return created;
|
|
320
|
+
};
|
|
191
321
|
const backendServices = new Map();
|
|
192
322
|
const backendService = (provider) => {
|
|
193
323
|
const existing = backendServices.get(provider);
|
|
@@ -198,16 +328,32 @@ export async function createAtomicCore(options, construct) {
|
|
|
198
328
|
provider,
|
|
199
329
|
downloader,
|
|
200
330
|
optimalStore,
|
|
331
|
+
prismCatalog,
|
|
332
|
+
resourcesDir: options.resourcesDir,
|
|
333
|
+
// An install or removal by any route; an update and an activation report themselves.
|
|
334
|
+
onChanged: (reason) => emitter.emit('engine:changed', { engine: provider, reason }),
|
|
335
|
+
// Read when a removal or update acts: the runtime's load queue and what its sessions, the
|
|
336
|
+
// decision model and the embedding model run from (change `unify-engine-lifecycle`, 2.4).
|
|
337
|
+
host: {
|
|
338
|
+
exclusive: (fn) => {
|
|
339
|
+
const runtime = runtimes.get(provider);
|
|
340
|
+
return runtime instanceof LlamacppRuntime ? runtime.exclusive(fn) : fn();
|
|
341
|
+
},
|
|
342
|
+
inUse: async () => {
|
|
343
|
+
const runtime = runtimes.get(provider);
|
|
344
|
+
return [
|
|
345
|
+
...(runtime instanceof LlamacppRuntime ? runtime.buildDirsInUse() : []),
|
|
346
|
+
...processPackDirs([decision.getStatus(), embedding.getStatus()]),
|
|
347
|
+
];
|
|
348
|
+
},
|
|
349
|
+
},
|
|
201
350
|
readManifest: async (proxy) => {
|
|
202
351
|
const cached = manifestCache.get();
|
|
203
352
|
if (cached)
|
|
204
353
|
return cached;
|
|
205
|
-
const fetchImpl = proxy
|
|
206
|
-
? createPolicyFetch({ proxy, ignore_ssl: proxy.ignore_ssl })
|
|
207
|
-
: (options.fetch ?? fetch);
|
|
208
354
|
return fetchLiveManifest({
|
|
209
355
|
cache: manifestCache,
|
|
210
|
-
transports: [manifestTransportFromFetch('core fetch',
|
|
356
|
+
transports: [manifestTransportFromFetch('core fetch', fetchFor(proxy))],
|
|
211
357
|
onWarn: (message) => log('warn', message),
|
|
212
358
|
});
|
|
213
359
|
},
|
|
@@ -215,22 +361,289 @@ export async function createAtomicCore(options, construct) {
|
|
|
215
361
|
backendServices.set(provider, created);
|
|
216
362
|
return created;
|
|
217
363
|
};
|
|
364
|
+
// One model-setup runner per core: it owns the in-memory table of runs and the shared engine
|
|
365
|
+
// installs that a cancel works from. The records survive a restart as `interrupted`.
|
|
366
|
+
const modelFile = async (provider, modelId) => {
|
|
367
|
+
const registry = registries.get(provider);
|
|
368
|
+
if (!(registry instanceof ModelRegistry))
|
|
369
|
+
throw unknownProvider(provider, registries.keys());
|
|
370
|
+
const yml = await registry.read(modelId);
|
|
371
|
+
return {
|
|
372
|
+
modelPath: registry.resolvePaths(yml).modelPath,
|
|
373
|
+
...(yml.model_sha256 ? { sha256: yml.model_sha256 } : {}),
|
|
374
|
+
};
|
|
375
|
+
};
|
|
376
|
+
const modelSetupDeps = {
|
|
377
|
+
layout,
|
|
378
|
+
compatibility: prismCompatibility,
|
|
379
|
+
prismCatalog,
|
|
380
|
+
hardware: () => hardware.facts(),
|
|
381
|
+
offer: () => ({ coreVersion: CORE_VERSION, allowCandidates: allowPrismCandidates() }),
|
|
382
|
+
currentPack: () => currentPrismPack({ layout, settings, hardware }),
|
|
383
|
+
installEngine: (version, backend, opts) => backendService('atomic-prism').install(version, backend, opts),
|
|
384
|
+
selectEngine: (versionBackend) => settings.update('atomic-prism', { version_backend: versionBackend }),
|
|
385
|
+
downloader,
|
|
386
|
+
register: async (provider, modelId, yml) => {
|
|
387
|
+
await registries.get(provider).write(modelId, yml);
|
|
388
|
+
},
|
|
389
|
+
modelFile,
|
|
390
|
+
emit: (name, payload) => emitter.emit(name, payload),
|
|
391
|
+
freeBytes: () => availableDiskSpace(layout.root, undefined),
|
|
392
|
+
fetchFor,
|
|
393
|
+
newId: () => randomUUID(),
|
|
394
|
+
...(hfEndpoint ? { hfEndpoint } : {}),
|
|
395
|
+
env,
|
|
396
|
+
platform,
|
|
397
|
+
...(platform === 'linux' ? { rocmProbe: () => probeLinuxRocmHost() } : {}),
|
|
398
|
+
log,
|
|
399
|
+
};
|
|
400
|
+
const modelSetups = wireModelSetups(modelSetupDeps);
|
|
218
401
|
const diffusion = wireDiffusion({
|
|
219
402
|
layout,
|
|
220
403
|
journal,
|
|
221
404
|
instanceId: lock.instanceId,
|
|
405
|
+
hardware,
|
|
222
406
|
emit: (name, payload) => emitter.emit(name, payload),
|
|
223
|
-
log:
|
|
407
|
+
log: runtimeLog,
|
|
224
408
|
platform,
|
|
225
409
|
env,
|
|
410
|
+
claimGpu: gpuResidency.hook(DIFFUSION_GPU_PROVIDER),
|
|
226
411
|
...(options.diffusion ? { overrides: options.diffusion } : {}),
|
|
412
|
+
...(options.backendOutput ? { backendOutput: options.backendOutput } : {}),
|
|
227
413
|
});
|
|
414
|
+
// sd.cpp and MLX builds (change `move-sdcpp-mlx-install-to-core`): the core reads conf's
|
|
415
|
+
// manifests, installs, activates and removes them; image generation and the MLX runtime lend it
|
|
416
|
+
// their load locks and their sessions.
|
|
417
|
+
const engineManifestKinds = manifestKinds(layout);
|
|
418
|
+
const mlxRuntime = runtimes.get('mlx');
|
|
419
|
+
const engineBuilds = new EngineBuildsService({
|
|
420
|
+
dataFolder: layout.root,
|
|
421
|
+
roots: { 'sd-cpp': layout.diffusion.backendsDir, 'mlx': layout.provider('mlx').backendsDir },
|
|
422
|
+
failedBackendsFile: join(layout.diffusion.root, 'failed-backends.json'),
|
|
423
|
+
resourcesDir: options.resourcesDir,
|
|
424
|
+
platform,
|
|
425
|
+
downloader,
|
|
426
|
+
manifests: {
|
|
427
|
+
'sd-cpp': new EngineManifestSource(engineManifestKinds['sd-cpp'], { env, fetchFor, log }),
|
|
428
|
+
'mlx': new EngineManifestSource(engineManifestKinds.mlx, { env, fetchFor, log }),
|
|
429
|
+
},
|
|
430
|
+
hardware: () => hardware.facts(),
|
|
431
|
+
hosts: {
|
|
432
|
+
'sd-cpp': diffusion.engineHost(),
|
|
433
|
+
// Off macOS there is no MLX runtime: nothing runs, so nothing to hold off or unload.
|
|
434
|
+
'mlx': mlxRuntime instanceof MlxRuntime ? mlxRuntime.engineHost() : IDLE_ENGINE_HOST,
|
|
435
|
+
},
|
|
436
|
+
availableSpace: defaultAvailableSpace,
|
|
437
|
+
emit: (name, payload) => emitter.emit(name, payload),
|
|
438
|
+
log,
|
|
439
|
+
});
|
|
440
|
+
// The managed container environment and the one Docker executor of this core (task 2.6). The
|
|
441
|
+
// `tensorrt-llm` provider (task 2.14) takes `managedContainers`, never a second executor, and the
|
|
442
|
+
// environment's machine (`managedHost`: the e2e stand-in under `ATOMIC_MANAGED_TEST_HOST`, whose
|
|
443
|
+
// platform counts as Linux). A removal unloads the provider's loaded model first.
|
|
444
|
+
// TensorRT-LLM's models move into the managed model store before anything lists or loads one
|
|
445
|
+
// (change `add-vllm-runtime`, design D5), under this core's lock on its data folder. On Linux the
|
|
446
|
+
// old root is in the data folder; on Windows it is in the guest and moves on first use (below).
|
|
447
|
+
const storeMigration = createStoreMigration(log);
|
|
448
|
+
if (process.platform !== 'win32')
|
|
449
|
+
await storeMigration.onLinux(layout);
|
|
450
|
+
const { managed, containers: managedContainers, platform: managedPlatform, host: managedHost, arch: managedArch, windows: managedWindows, } = wireManagedEnvironment({
|
|
451
|
+
env,
|
|
452
|
+
platform,
|
|
453
|
+
layout,
|
|
454
|
+
instanceId: lock.instanceId,
|
|
455
|
+
emit: (name, payload) => emitter.emit(name, payload),
|
|
456
|
+
newId: () => randomUUID(),
|
|
457
|
+
log,
|
|
458
|
+
onWarn: (message) => log('warn', message),
|
|
459
|
+
...(options.fetch ? { fetch: options.fetch } : {}),
|
|
460
|
+
...(options.dockerPath !== undefined ? { dockerPath: options.dockerPath } : {}),
|
|
461
|
+
engines: managedEngines.descriptorSources(),
|
|
462
|
+
storeMigration: storeMigration.current,
|
|
463
|
+
unloadEngineSessions: managedSessionUnloader(() => managedRuntimes, facade),
|
|
464
|
+
});
|
|
465
|
+
// Containers a previous core left that startup reconcile could not confirm stopped: they hold every
|
|
466
|
+
// card for GPU residency until a retried stop is confirmed.
|
|
467
|
+
const managedLeftovers = leftoverContainers({
|
|
468
|
+
containers: managedContainers,
|
|
469
|
+
instanceId: lock.instanceId,
|
|
470
|
+
log,
|
|
471
|
+
dockerConfigDir: layout.managed.dockerConfigDir,
|
|
472
|
+
// On Windows the executor is the guest's docker through WSL: its retries go the same way.
|
|
473
|
+
...(managedWindows === undefined ? {} : { exec: wiredExec }),
|
|
474
|
+
});
|
|
475
|
+
// Every engine of the managed engine registry, wired the same way (change `add-vllm-runtime`,
|
|
476
|
+
// design D3): offered on Linux and on Windows with Atomic Chat's WSL distribution, absent elsewhere.
|
|
477
|
+
// `engine_id` is the provider id, so each runtime registers under its own engine id.
|
|
478
|
+
const managedRuntimes = new Map();
|
|
479
|
+
const releaseElsewhere = managedModelExclusivity(() => managedRuntimes, facade);
|
|
480
|
+
const managedModelChecks = {};
|
|
481
|
+
for (const engine of managedEngines.list()) {
|
|
482
|
+
const provider = engine.provider;
|
|
483
|
+
// Shared by the runtime and its model check: one settings reader, not two.
|
|
484
|
+
const settingsOf = () => settings.get(provider);
|
|
485
|
+
const runtime = wireManagedEngine(engine, {
|
|
486
|
+
platform: managedPlatform,
|
|
487
|
+
arch: managedArch,
|
|
488
|
+
...(managedWindows === undefined ? {} : { windows: managedWindows }),
|
|
489
|
+
layout,
|
|
490
|
+
instanceId: lock.instanceId,
|
|
491
|
+
scope,
|
|
492
|
+
descriptors: managed.descriptors,
|
|
493
|
+
installations: managed.installations,
|
|
494
|
+
containers: managedContainers,
|
|
495
|
+
host: managedHost,
|
|
496
|
+
trustedHosts: managedTrustedHosts,
|
|
497
|
+
settings: settingsOf,
|
|
498
|
+
emit: (name, payload) => emitter.emit(name, payload),
|
|
499
|
+
log,
|
|
500
|
+
claimGpu: gpuResidency.hook(provider),
|
|
501
|
+
// One store model, one managed provider (design D11): another engine lets it go first.
|
|
502
|
+
releaseModelElsewhere: releaseElsewhere(engine.provider),
|
|
503
|
+
// The engine container runs as this core's own user (final review I-1, ADR
|
|
504
|
+
// 2026-09-29-the-engine-container-runs-as-the-invoking-user).
|
|
505
|
+
containerUser: process.getuid !== undefined && process.getgid !== undefined
|
|
506
|
+
? { uid: process.getuid(), gid: process.getgid() }
|
|
507
|
+
: null,
|
|
508
|
+
});
|
|
509
|
+
if (runtime !== null) {
|
|
510
|
+
runtimes.set(provider, runtime);
|
|
511
|
+
managedRuntimes.set(engine.provider, runtime);
|
|
512
|
+
}
|
|
513
|
+
// `POST /models/<engine>/check`: composed apart from the runtime (its own deps, never Docker), so
|
|
514
|
+
// a compatibility question answers the same whether or not the engine is even installed yet.
|
|
515
|
+
const check = wireManagedModelCheck(managedPlatform, engine, {
|
|
516
|
+
descriptors: managed.descriptors,
|
|
517
|
+
installations: managed.installations,
|
|
518
|
+
host: managedHost,
|
|
519
|
+
settings: settingsOf,
|
|
520
|
+
arch: managedArch,
|
|
521
|
+
...(managedWindows === undefined ? {} : { windows: managedWindows }),
|
|
522
|
+
});
|
|
523
|
+
if (check !== null)
|
|
524
|
+
managedModelChecks[engine.provider] = check;
|
|
525
|
+
}
|
|
526
|
+
// The managed models' registry: the same gate as the runtimes, so the two are never offered one
|
|
527
|
+
// without the other.
|
|
528
|
+
const storeRegistry = managedModelRegistry(managedPlatform, layout, managedWindows);
|
|
529
|
+
for (const provider of managedRuntimes.keys())
|
|
530
|
+
registries.set(provider, storeRegistry);
|
|
531
|
+
// Windows moves this scope's TensorRT-LLM models into the store in the guest before the first look
|
|
532
|
+
// at it (`windowsStoreMigration`); the outcome goes to the environment diagnostics.
|
|
533
|
+
if (managedWindows !== undefined && managedRuntimes.size > 0)
|
|
534
|
+
storeMigration.onWindows(managedWindows);
|
|
535
|
+
/** A managed runtime, or `PROVIDER_NOT_FOUND` where this core does not offer it. */
|
|
536
|
+
const managedOr = (provider) => {
|
|
537
|
+
const runtime = managedRuntimes.get(provider);
|
|
538
|
+
if (runtime === undefined)
|
|
539
|
+
throw unknownProvider(provider, runtimes.keys());
|
|
540
|
+
return runtime;
|
|
541
|
+
};
|
|
542
|
+
// Deleting a downloaded model: wherever a managed provider is offered.
|
|
543
|
+
const managedModelDelete = managedRuntimes.size === 0
|
|
544
|
+
? null
|
|
545
|
+
: managedModelDeleter({
|
|
546
|
+
runtimes: () => managedRuntimes,
|
|
547
|
+
sessions: facade,
|
|
548
|
+
registry: storeRegistry,
|
|
549
|
+
paths: layout.managed,
|
|
550
|
+
...(managedWindows === undefined
|
|
551
|
+
? {}
|
|
552
|
+
: { windowsFiles: windowsModelFilesFor(managedWindows, layout) }),
|
|
553
|
+
});
|
|
554
|
+
// The decision model: its own process outside the sessions registry. Started (in the background,
|
|
555
|
+
// nothing waits for it) only once the facade exists, below.
|
|
556
|
+
// Both start on the user's own llama.cpp build first when it is new enough: it runs on this machine.
|
|
557
|
+
const upstreamBackend = () => String(settings.get('llamacpp-upstream')['version_backend'] ?? '');
|
|
558
|
+
const decision = wireDecision({
|
|
559
|
+
layout,
|
|
560
|
+
settings,
|
|
561
|
+
upstreamBackend,
|
|
562
|
+
journal,
|
|
563
|
+
instanceId: lock.instanceId,
|
|
564
|
+
hardware,
|
|
565
|
+
emit: (name, payload) => emitter.emit(name, payload),
|
|
566
|
+
on: (name, listener) => emitter.on(name, listener),
|
|
567
|
+
log: runtimeLog,
|
|
568
|
+
platform,
|
|
569
|
+
env,
|
|
570
|
+
...(options.decision ? { overrides: options.decision } : {}),
|
|
571
|
+
...(options.backendOutput ? { backendOutput: options.backendOutput } : {}),
|
|
572
|
+
});
|
|
573
|
+
// The embedding model the public `/v1/embeddings` serves by name: its own process too, started
|
|
574
|
+
// with the decision model below.
|
|
575
|
+
const embedding = wireEmbedding({
|
|
576
|
+
layout,
|
|
577
|
+
settings,
|
|
578
|
+
upstreamBackend,
|
|
579
|
+
journal,
|
|
580
|
+
instanceId: lock.instanceId,
|
|
581
|
+
emit: (name, payload) => emitter.emit(name, payload),
|
|
582
|
+
on: (name, listener) => emitter.on(name, listener),
|
|
583
|
+
log: runtimeLog,
|
|
584
|
+
platform,
|
|
585
|
+
env,
|
|
586
|
+
...(options.embedding ? { overrides: options.embedding } : {}),
|
|
587
|
+
...(options.backendOutput ? { backendOutput: options.backendOutput } : {}),
|
|
588
|
+
});
|
|
589
|
+
// The `/engines` layer (change `unify-engine-lifecycle`): one handle per engine of this host, over
|
|
590
|
+
// the system that installs it. Every part is read when a command arrives.
|
|
591
|
+
const engineHandles = [];
|
|
592
|
+
for (const engine of hostEngines(platform, [...managedRuntimes.keys()])) {
|
|
593
|
+
const kind = ENGINE_KINDS[engine];
|
|
594
|
+
if (kind === 'llamacpp') {
|
|
595
|
+
const provider = engine;
|
|
596
|
+
engineHandles.push(new LlamacppEngine({
|
|
597
|
+
engine: provider,
|
|
598
|
+
backends: backendService(provider),
|
|
599
|
+
advisor: backendAdvisor(provider),
|
|
600
|
+
currentVersionBackend: () => String(settings.get(provider)['version_backend'] ?? ''),
|
|
601
|
+
selectVersionBackend: async (versionBackend) => {
|
|
602
|
+
await settings.update(provider, { version_backend: versionBackend });
|
|
603
|
+
},
|
|
604
|
+
// The facade's unload, as a client's would go: it also lets go of the model's claims.
|
|
605
|
+
unloadSessions: async () => {
|
|
606
|
+
for (const modelId of runtimes.get(provider)?.getLoadedModels() ?? []) {
|
|
607
|
+
const result = await core.unload(provider, modelId);
|
|
608
|
+
if (!result.success)
|
|
609
|
+
throw new AtomicCoreError('LLAMA_CPP_PROCESS_ERROR', result.error ?? `The unload of ${modelId} failed.`);
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
emit: (name, payload) => emitter.emit(name, payload),
|
|
613
|
+
onInstalled: (installed) => {
|
|
614
|
+
noticeEngineInstall(decision, provider, installed);
|
|
615
|
+
noticeEmbeddingEngineInstall(embedding, provider, installed);
|
|
616
|
+
},
|
|
617
|
+
log: (level, message) => log(level, message),
|
|
618
|
+
}));
|
|
619
|
+
}
|
|
620
|
+
else if (kind === 'engine-build') {
|
|
621
|
+
engineHandles.push(new EngineBuildEngine({ engine: engine, builds: engineBuilds }));
|
|
622
|
+
}
|
|
623
|
+
else {
|
|
624
|
+
const runtime = managedRuntimes.get(engine);
|
|
625
|
+
if (runtime !== undefined)
|
|
626
|
+
engineHandles.push(new ManagedEngine({
|
|
627
|
+
engine,
|
|
628
|
+
environmentId: DEFAULT_ENVIRONMENT_ID,
|
|
629
|
+
platform: managedArch === 'arm64' ? 'linux/arm64' : 'linux/amd64',
|
|
630
|
+
installations: () => managed.installations.list(),
|
|
631
|
+
newSetup: (engineId) => managed.descriptors.forNewSetup(engineId),
|
|
632
|
+
residentModels: () => runtime.residentModels(),
|
|
633
|
+
environment: managed.service,
|
|
634
|
+
}));
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
const engines = new EnginesService({ engines: engineHandles });
|
|
228
638
|
const control = await ControlServer.start({
|
|
229
639
|
token,
|
|
230
640
|
instanceId: lock.instanceId,
|
|
231
641
|
version: CORE_VERSION,
|
|
232
642
|
ownerScope: scope,
|
|
233
643
|
dataFolder: layout.root,
|
|
644
|
+
environments: managed.service,
|
|
645
|
+
environmentsSnapshot: managed.environments,
|
|
646
|
+
environmentOperations: managed.operations,
|
|
234
647
|
emitter,
|
|
235
648
|
clients,
|
|
236
649
|
sessions: () => sessionsOf(runtimes),
|
|
@@ -247,7 +660,16 @@ export async function createAtomicCore(options, construct) {
|
|
|
247
660
|
: Promise.resolve('unavailable');
|
|
248
661
|
},
|
|
249
662
|
models: {
|
|
250
|
-
capabilities: (provider, modelId) =>
|
|
663
|
+
capabilities: async (provider, modelId) => managedEngines.has(provider)
|
|
664
|
+
? managedOr(provider).capabilities(modelId)
|
|
665
|
+
: capabilities.capabilities(provider, modelId),
|
|
666
|
+
logs: async (provider, modelId) => {
|
|
667
|
+
if (managedEngines.has(provider))
|
|
668
|
+
return managedOr(provider).logs(modelId);
|
|
669
|
+
if (!runtimes.has(provider))
|
|
670
|
+
throw unknownProvider(provider, runtimes.keys());
|
|
671
|
+
throw new AtomicCoreError('INVALID_ARGUMENT', `The provider "${provider}" runs no container, so it keeps no model logs.`, provider);
|
|
672
|
+
},
|
|
251
673
|
validateGguf: (path) => capabilities.validateGguf(path),
|
|
252
674
|
devices: async (provider) => {
|
|
253
675
|
// Asking a backend what devices it sees needs a backend; with none installed the
|
|
@@ -260,14 +682,42 @@ export async function createAtomicCore(options, construct) {
|
|
|
260
682
|
},
|
|
261
683
|
embed: (provider, modelId, input, ubatchSize) => embeddings.embed(provider, modelId, input, ubatchSize),
|
|
262
684
|
},
|
|
685
|
+
modelSetups: {
|
|
686
|
+
compatibility: (request) => compatibilityFor(modelSetupDeps, request),
|
|
687
|
+
plan: (request) => modelSetups.plan(request),
|
|
688
|
+
families: () => prismCompatibility.families(),
|
|
689
|
+
start: (request) => modelSetups.start(request),
|
|
690
|
+
list: () => modelSetups.list(),
|
|
691
|
+
get: (setupId) => modelSetups.get(setupId),
|
|
692
|
+
cancel: (setupId) => modelSetups.cancel(setupId),
|
|
693
|
+
resume: (setupId, opts) => modelSetups.resume(setupId, opts),
|
|
694
|
+
snapshot: () => modelSetups.snapshot(),
|
|
695
|
+
},
|
|
696
|
+
managedModelChecks,
|
|
697
|
+
...(managedModelDelete !== null ? { managedModelDelete } : {}),
|
|
698
|
+
// Where clients put tensorrt-llm models (change `add-tensorrt-llm-windows`, task 2.8): wherever
|
|
699
|
+
// the provider itself is offered.
|
|
700
|
+
...(managedRuntimes.size > 0
|
|
701
|
+
? { managedModelLocation: managedModelLocation(managedPlatform, layout, managedWindows) }
|
|
702
|
+
: {}),
|
|
263
703
|
backends: {
|
|
264
704
|
list: (provider, current) => backendService(provider).listInstalled(current),
|
|
265
|
-
install: (provider, version, backend, opts) =>
|
|
266
|
-
|
|
705
|
+
install: async (provider, version, backend, opts) => {
|
|
706
|
+
const result = await backendService(provider).install(version, backend, opts);
|
|
707
|
+
// The core emits no `backend:download-finished` for its own installs, so the decision
|
|
708
|
+
// module hears about a new TurboQuant build here: it may be the first to serve `--decision`.
|
|
709
|
+
noticeEngineInstall(decision, provider, result.installed);
|
|
710
|
+
noticeEmbeddingEngineInstall(embedding, provider, result.installed);
|
|
711
|
+
return result;
|
|
712
|
+
},
|
|
713
|
+
remove: (provider, version, backend) => backendService(provider).remove(version, backend, () => String(settings.get(provider)['version_backend'] ?? '')),
|
|
267
714
|
cancel: (taskId) => downloader.cancel(taskId),
|
|
268
715
|
getOptimal: (provider) => backendService(provider).getOptimalCache(),
|
|
269
716
|
setOptimal: (provider, record, expectedRevision) => backendService(provider).setOptimalCache(record, expectedRevision),
|
|
270
717
|
optimalSnapshot: () => optimalStore.snapshot(),
|
|
718
|
+
catalog: (provider, request) => backendAdvisor(provider).catalog(request),
|
|
719
|
+
recommend: (provider, request) => backendAdvisor(provider).recommend(request),
|
|
720
|
+
checkUpdates: (provider, request) => backendAdvisor(provider).checkUpdates(request),
|
|
271
721
|
},
|
|
272
722
|
disk: { available: (path) => availableDiskSpace(layout.root, path) },
|
|
273
723
|
remoteAccess: {
|
|
@@ -277,6 +727,31 @@ export async function createAtomicCore(options, construct) {
|
|
|
277
727
|
stop: () => core.stopRemoteAccess(),
|
|
278
728
|
},
|
|
279
729
|
diffusion,
|
|
730
|
+
engineBuilds,
|
|
731
|
+
engines,
|
|
732
|
+
decision: {
|
|
733
|
+
status: () => decision.getStatus(),
|
|
734
|
+
config: () => decision.getConfig(),
|
|
735
|
+
configure: (patch) => decision.configure(patch),
|
|
736
|
+
load: () => decision.load(),
|
|
737
|
+
unload: () => decision.unload(),
|
|
738
|
+
score: (request) => decision.scoreCandidates(request.task, request.criterion, request.candidates, {
|
|
739
|
+
...(request.timeout_ms !== undefined ? { timeoutMs: request.timeout_ms } : {}),
|
|
740
|
+
...(request.truncation !== undefined ? { truncation: request.truncation } : {}),
|
|
741
|
+
}),
|
|
742
|
+
decide: (request) => decision.decide(request.state, request.questions, {
|
|
743
|
+
...(request.timeout_ms !== undefined ? { timeoutMs: request.timeout_ms } : {}),
|
|
744
|
+
...(request.truncation !== undefined ? { truncation: request.truncation } : {}),
|
|
745
|
+
}),
|
|
746
|
+
},
|
|
747
|
+
embedding: {
|
|
748
|
+
status: () => embedding.getStatus(),
|
|
749
|
+
config: () => embedding.getConfig(),
|
|
750
|
+
configure: (patch) => embedding.configure(patch),
|
|
751
|
+
load: () => embedding.load(),
|
|
752
|
+
unload: () => embedding.unload(),
|
|
753
|
+
embed: (body) => embedding.embed(body),
|
|
754
|
+
},
|
|
280
755
|
settings: {
|
|
281
756
|
get: (provider) => settings.get(provider),
|
|
282
757
|
revision: () => settings.revision,
|
|
@@ -306,6 +781,7 @@ export async function createAtomicCore(options, construct) {
|
|
|
306
781
|
logout: () => chatgpt.logout(),
|
|
307
782
|
models: () => listSubscriptionModels(chatgptBackend),
|
|
308
783
|
},
|
|
784
|
+
downloads: () => downloader.snapshot(),
|
|
309
785
|
publicServer: {
|
|
310
786
|
setInspecting: (enabled) => {
|
|
311
787
|
;
|
|
@@ -338,6 +814,7 @@ export async function createAtomicCore(options, construct) {
|
|
|
338
814
|
appLeaseTimer.unref();
|
|
339
815
|
}
|
|
340
816
|
core = construct({
|
|
817
|
+
...(options.publicApiKeys !== undefined ? { publicApiKeys: options.publicApiKeys } : {}),
|
|
341
818
|
layout,
|
|
342
819
|
events: emitter,
|
|
343
820
|
settings,
|
|
@@ -355,6 +832,10 @@ export async function createAtomicCore(options, construct) {
|
|
|
355
832
|
externalSessions,
|
|
356
833
|
appLeaseTimer,
|
|
357
834
|
diffusion,
|
|
835
|
+
managed,
|
|
836
|
+
managedTrustedHosts,
|
|
837
|
+
decision,
|
|
838
|
+
embedding,
|
|
358
839
|
errors: reporter,
|
|
359
840
|
telemetry: reporter,
|
|
360
841
|
remoteAccess: await wireRemoteAccess({
|
|
@@ -370,12 +851,31 @@ export async function createAtomicCore(options, construct) {
|
|
|
370
851
|
}),
|
|
371
852
|
});
|
|
372
853
|
await reapOrphans(journal, lock.instanceId, log);
|
|
854
|
+
// Model containers a previous core left running are stopped and removed before the first load is
|
|
855
|
+
// served, like `reapOrphans` above does for native backends. Linux with a docker CLI only. This
|
|
856
|
+
// wires the executor first, so a setup recovered just below (a pull in flight) finds it; the
|
|
857
|
+
// `tensorrt-llm` provider uses the same handle. A failure here is not "no docker": the handle
|
|
858
|
+
// tries again at the next load, which says the runtime failed to initialise, and why.
|
|
859
|
+
await managedContainers
|
|
860
|
+
.resolve()
|
|
861
|
+
.catch((e) => warn(`managed runtime container reconcile: ${String(e)}`));
|
|
862
|
+
// A setup the previous core was in the middle of is reconciled against the machine before the
|
|
863
|
+
// endpoint is published, so the first snapshot a client sees already describes it.
|
|
864
|
+
await managed.recover().catch((e) => warn(`managed runtime recovery: ${String(e)}`));
|
|
865
|
+
// Before the first load (design D5): downloaded engine builds no newer than the installer's, the
|
|
866
|
+
// ones a session kept on the last install, the leftovers of an interrupted install.
|
|
867
|
+
await engineBuilds.startupCleanup();
|
|
868
|
+
// A model setup a stopped core left mid-way becomes `interrupted`, resumable from its files.
|
|
869
|
+
await modelSetups.recover().catch((e) => warn(`model setup recovery: ${String(e)}`));
|
|
373
870
|
// A tunnel is worse to orphan than a backend: it keeps a public URL pointed at a local port.
|
|
374
871
|
await reapTunnelOrphan(layout.core.remoteAccessTunnel, { log: warn });
|
|
375
872
|
// Atomic Chat 2.0.40 journalled its tunnel at the data root and reaped it at its own startup; the
|
|
376
873
|
// app that replaced it does not. Same checks, and the file is consumed. Only the app owner's folder
|
|
377
874
|
// can hold it: a CLI owner refuses the app's folder, and one app instance runs at a time.
|
|
378
875
|
await reapTunnelOrphan(layout.legacyRemoteAccessTunnel, { log: warn });
|
|
876
|
+
// An enabled and configured decision model starts now; its shutdown belongs to the facade.
|
|
877
|
+
decision.start();
|
|
878
|
+
embedding.start();
|
|
379
879
|
await lock.publish(control.host, control.port);
|
|
380
880
|
log('info', `core ${CORE_VERSION} owns ${layout.root} (control ${control.url})`);
|
|
381
881
|
return core;
|