2024-03-22 20:14:04 +00:00
|
|
|
package backend
|
|
|
|
|
|
|
|
import (
|
2024-06-23 08:24:36 +00:00
|
|
|
"github.com/mudler/LocalAI/core/config"
|
2024-03-22 20:14:04 +00:00
|
|
|
|
2024-06-23 08:24:36 +00:00
|
|
|
"github.com/mudler/LocalAI/pkg/grpc"
|
|
|
|
"github.com/mudler/LocalAI/pkg/model"
|
2024-03-22 20:14:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func StoreBackend(sl *model.ModelLoader, appConfig *config.ApplicationConfig, storeName string) (grpc.Backend, error) {
|
|
|
|
if storeName == "" {
|
|
|
|
storeName = "default"
|
|
|
|
}
|
|
|
|
|
|
|
|
sc := []model.Option{
|
|
|
|
model.WithBackendString(model.LocalStoreBackend),
|
|
|
|
model.WithAssetDir(appConfig.AssetsDestination),
|
|
|
|
model.WithModel(storeName),
|
|
|
|
}
|
|
|
|
|
|
|
|
return sl.BackendLoader(sc...)
|
|
|
|
}
|
|
|
|
|