mirror of
https://github.com/mudler/LocalAI.git
synced 2026-08-02 11:30:44 -04:00
Variant.MinMemory was an authored override for when the live probe misreads a variant's footprint. It duplicated an existing field: probeEntryMemory already passes the entry's declared size: into EstimateModelMultiContext, whose cascade prefers that declared size over its own guesswork. Correcting size: on the referenced entry fixes the figure for every consumer rather than only for variant selection, so min_memory shadowed the right answer. A variant is now nothing but a name. Its effective size is exactly the probe result, and an unknown stays unknown: it survives the filter and ranks last. EffectiveMemory loses its error return along with the field. The authored string was the only thing that could fail to parse, so the error had no remaining source and was propagating dead nil-checks through SelectVariant, DescribeVariants and the pin warning. Selection behaviour is unchanged. The specs covering probe-derived sizing, ranking, filtering, the unknown-size path, pin recall, entry/variant metadata split and deep-copy isolation all survive; the three install specs that needed a definite size now declare it through the referenced entry's own size:, which exercises the documented escape hatch directly. gallery/index.yaml is untouched: no entry ever carried the key. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
19 lines
891 B
Go
19 lines
891 B
Go
package gallery
|
|
|
|
// Variant is one option in a gallery entry's variant list. It references an
|
|
// existing gallery entry by name, and that is all an author has to write.
|
|
//
|
|
// Authored order carries no meaning. Selection filters out what this host
|
|
// cannot run and then ranks what is left, so hardware knowledge lives in the
|
|
// selector rather than being pushed onto whoever edits the gallery.
|
|
//
|
|
// There is deliberately no authored memory figure here. When the live probe
|
|
// misreads a variant's footprint, the fix is the referenced entry's own `size:`
|
|
// field: the estimator already prefers a declared size over its own guesswork,
|
|
// so correcting it there fixes the figure for every consumer rather than only
|
|
// for this one selection pass.
|
|
type Variant struct {
|
|
// Model is the name of a gallery entry that declares no variants of its own.
|
|
Model string `json:"model" yaml:"model"`
|
|
}
|