feat(distributed): declarative per-model scheduling via env/args#10308
Merged
Conversation
…seeding Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
… seeding Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
| } | ||
|
|
||
| if configPath != "" { | ||
| data, err := os.ReadFile(configPath) |
…duling config Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In distributed mode, per-model scheduling (node-label selector + min/max replicas) could previously only be set through the WebUI or API. This adds a declarative startup surface so it can be configured programmatically for unattended/IaC installs, plus a new "spread to all matching nodes" mode.
PRELOAD_MODELS/PRELOAD_MODELS_CONFIG):LOCALAI_MODEL_SCHEDULING- inline JSON list of scheduling entriesLOCALAI_MODEL_SCHEDULING_CONFIG- path to a YAML file with the same listinitDistributedbefore the reconciler starts. Set withoutLOCALAI_DISTRIBUTED-> warn and ignore.spread_allmode (replicas: allalias in the config): runs one replica on every node matching the selector (all healthy backend nodes when the selector is empty), tracked as nodes join/leave. Implemented as a dynamicMin==Max==matching-node-counttarget in the reconciler, reusing the existing scale-up/scale-down machinery. Mutually exclusive withmin_replicas/max_replicas.spread_allexposed on the scheduling endpoint with mutual-exclusion validation.MAX_REPLICAS_PER_MODEL=1).Entry shape (YAML):
Test Plan
go test ./core/services/nodes/passes (parser, registry round-trip/seeding, reconciler spread behavior, against testcontainers PostgreSQL)go test ./core/http/endpoints/localai/spread_all validation specs passgo build+go vetclean on all touched Go packagesnpm run buildsucceedsLOCALAI_MODEL_SCHEDULING_CONFIGand confirm a labelled model spreads across matching workers