mirror of
https://github.com/mudler/LocalAI.git
synced 2025-03-10 22:43:59 +00:00
24 lines
573 B
Go
24 lines
573 B
Go
package routes
|
|
|
|
import (
|
|
"github.com/go-skynet/LocalAI/core/config"
|
|
"github.com/go-skynet/LocalAI/core/http/endpoints/localai"
|
|
"github.com/go-skynet/LocalAI/pkg/model"
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
func RegisterPagesRoutes(app *fiber.App,
|
|
cl *config.BackendConfigLoader,
|
|
ml *model.ModelLoader,
|
|
appConfig *config.ApplicationConfig,
|
|
auth func(*fiber.Ctx) error) {
|
|
|
|
models, _ := ml.ListModels()
|
|
backendConfigs := cl.GetAllBackendConfigs()
|
|
|
|
if !appConfig.DisableWelcomePage {
|
|
app.Get("/", auth, localai.WelcomeEndpoint(appConfig, models, backendConfigs))
|
|
}
|
|
|
|
}
|