mirror of
https://github.com/mudler/LocalAI.git
synced 2026-03-02 13:46:34 -05:00
* feat: split remaining backends and drop embedded backends - Drop silero-vad, huggingface, and stores backend from embedded binaries - Refactor Makefile and Dockerfile to avoid building grpc backends - Drop golang code that was used to embed backends - Simplify building by using goreleaser Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * chore(gallery): be specific with llama-cpp backend templates Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * chore(docs): update Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * chore(ci): minor fixes Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * chore: drop all ffmpeg references Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * fix: run protogen-go Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Always enable p2p mode Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Update gorelease file Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * fix(stores): do not always load Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Fix linting issues Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Simplify Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * Mac OS fixup Signed-off-by: Ettore Di Giacinto <mudler@localai.io> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
37 lines
1.0 KiB
Go
37 lines
1.0 KiB
Go
package localai
|
|
|
|
import (
|
|
"github.com/gofiber/fiber/v2"
|
|
"github.com/mudler/LocalAI/core/config"
|
|
"github.com/mudler/LocalAI/core/schema"
|
|
"github.com/mudler/LocalAI/pkg/model"
|
|
)
|
|
|
|
// SystemInformations returns the system informations
|
|
// @Summary Show the LocalAI instance information
|
|
// @Success 200 {object} schema.SystemInformationResponse "Response"
|
|
// @Router /system [get]
|
|
func SystemInformations(ml *model.ModelLoader, appConfig *config.ApplicationConfig) func(*fiber.Ctx) error {
|
|
return func(c *fiber.Ctx) error {
|
|
availableBackends := []string{}
|
|
loadedModels := ml.ListModels()
|
|
for b := range appConfig.ExternalGRPCBackends {
|
|
availableBackends = append(availableBackends, b)
|
|
}
|
|
for b := range ml.GetAllExternalBackends(nil) {
|
|
availableBackends = append(availableBackends, b)
|
|
}
|
|
|
|
sysmodels := []schema.SysInfoModel{}
|
|
for _, m := range loadedModels {
|
|
sysmodels = append(sysmodels, schema.SysInfoModel{ID: m.ID})
|
|
}
|
|
return c.JSON(
|
|
schema.SystemInformationResponse{
|
|
Backends: availableBackends,
|
|
Models: sysmodels,
|
|
},
|
|
)
|
|
}
|
|
}
|