feat(backends): add system backend, refactor (#6059)

- Add a system backend path
- Refactor and consolidate system information in system state
- Use system state in all the components to figure out the system paths
  to used whenever needed
- Refactor BackendConfig -> ModelConfig. This was otherway misleading as
  now we do have a backend configuration which is not the model config.

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto
2025-08-14 19:38:26 +02:00
committed by GitHub
parent 253b7537dc
commit 089efe05fd
85 changed files with 999 additions and 652 deletions

View File

@@ -15,6 +15,7 @@ import (
"github.com/mudler/LocalAI/pkg/grpc"
"github.com/mudler/LocalAI/pkg/model"
"github.com/mudler/LocalAI/pkg/store"
"github.com/mudler/LocalAI/pkg/system"
)
func normalize(vecs [][]float32) {
@@ -46,7 +47,7 @@ var _ = Describe("Integration tests for the stores backend(s) and internal APIs"
debug := true
bc := config.BackendConfig{
bc := config.ModelConfig{
Name: "store test",
Debug: &debug,
Backend: model.LocalStoreBackend,
@@ -57,7 +58,12 @@ var _ = Describe("Integration tests for the stores backend(s) and internal APIs"
model.WithModel("test"),
}
sl = model.NewModelLoader("", false)
systemState, err := system.GetSystemState(
system.WithModelPath(tmpdir),
)
Expect(err).ToNot(HaveOccurred())
sl = model.NewModelLoader(systemState, false)
sc, err = sl.Load(storeOpts...)
Expect(err).ToNot(HaveOccurred())
Expect(sc).ToNot(BeNil())