feat: materialize Hugging Face model artifacts (#10825)

* feat(config): add model artifact source contract

Assisted-by: Codex:GPT-5 [Codex]

* feat(downloader): add authenticated raw-byte progress

Assisted-by: Codex:GPT-5 [Codex]

* feat(huggingface): resolve immutable snapshot manifests

Assisted-by: Codex:GPT-5 [Codex]

* feat(models): add artifact storage primitives

Assisted-by: Codex:GPT-5 [Codex]

* feat(models): materialize pinned Hugging Face snapshots

Assisted-by: Codex:GPT-5 [Codex]

* feat(models): bind managed snapshots at runtime

Assisted-by: Codex:GPT-5 [Codex]

* feat(gallery): materialize model artifacts during install

Assisted-by: Codex:GPT-5 [Codex]

* feat(gallery): declare managed Hugging Face artifacts

Assisted-by: Codex:GPT-5 [Codex]

* feat(models): preload managed model artifacts

Assisted-by: Codex:GPT-5 [Codex]

* fix(gallery): retain shared artifact caches on delete

Assisted-by: Codex:GPT-5 [Codex]

* feat(models): report artifact acquisition progress

Assisted-by: Codex:GPT-5 [Codex]

* refactor(backends): load managed models from ModelFile

Assisted-by: Codex:GPT-5 [Codex]

* refactor(backends): load staged speech model snapshots

Assisted-by: Codex:GPT-5 [Codex]

* refactor(backends): use staged snapshots in engine backends

Assisted-by: Codex:GPT-5 [Codex]

* test(distributed): cover staged artifact snapshots

Assisted-by: Codex:GPT-5 [Codex]

* docs: explain managed model artifacts

Assisted-by: Codex:GPT-5 [Codex]

* docs: add product design context

Assisted-by: Codex:GPT-5 [Codex]

* feat(ui): show model artifact download progress

Assisted-by: Codex:GPT-5 [Codex]

* Eagerly materialize Hugging Face artifacts

Materialize HF-backed model references as managed GGUF artifacts during load, with lazy download retained only as fallback.

Assisted-by: Codex:GPT-5 [shell]

* Refactor HF
  downloads through a shared executor

Assisted-by: Codex:GPT-5 [shell]

* drop

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

---------

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
LocalAI [bot]
2026-07-15 01:09:33 +02:00
committed by GitHub
parent d82c38ee77
commit bcc41219f7
83 changed files with 4315 additions and 339 deletions

View File

@@ -77,4 +77,30 @@ var _ = Describe("ApplyRemoteChange", func() {
Expect(ok1).To(BeTrue())
Expect(ok2).To(BeTrue())
})
It("loads a peer-persisted artifact binding without materializing", func() {
const relative = ".artifacts/huggingface/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef/snapshot"
writeYAML("peer-managed", map[string]any{
"backend": "transformers",
"artifacts": []map[string]any{{
"name": "model", "target": "model",
"source": map[string]any{"type": "huggingface", "repo": "owner/repo", "revision": "main"},
"resolved": map[string]any{
"endpoint": "https://huggingface.co",
"revision": "0123456789abcdef0123456789abcdef01234567",
"cache_key": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
},
}},
"parameters": map[string]any{"model": "owner/repo"},
})
Expect(ApplyRemoteChange(loader, nil, dir, messaging.CacheInvalidateEvent{
Element: "peer-managed", Op: "install",
})).To(Succeed())
loaded, found := loader.GetModelConfig("peer-managed")
Expect(found).To(BeTrue())
Expect(loaded.Model).To(Equal("owner/repo"))
Expect(loaded.ModelFileName()).To(Equal(relative))
Expect(loaded.Artifacts).To(HaveLen(1))
Expect(loaded.Artifacts[0].Resolved.CacheKey).To(HaveLen(64))
})
})