feat(welcome): add simple welcome page (#1912)

* feat(welcome): add simple welcome page

* feat(api): add 404 handling
This commit is contained in:
Ettore Di Giacinto 2024-03-27 21:10:58 +01:00 committed by GitHub
parent 93f0b7ae03
commit 66ee4afb95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 189 additions and 1 deletions

11
main.go
View file

@ -189,6 +189,12 @@ func main() {
EnvVars: []string{"WATCHDOG_IDLE"},
Value: false,
},
&cli.BoolFlag{
Name: "disable-welcome",
Usage: "Disable welcome pages",
EnvVars: []string{"DISABLE_WELCOME"},
Value: false,
},
&cli.BoolFlag{
Name: "enable-watchdog-busy",
Usage: "Enable watchdog for stopping busy backends that exceed a defined threshold.",
@ -264,6 +270,11 @@ For a list of compatible model, check out: https://localai.io/model-compatibilit
idleWatchDog := ctx.Bool("enable-watchdog-idle")
busyWatchDog := ctx.Bool("enable-watchdog-busy")
if ctx.Bool("disable-welcome") {
opts = append(opts, config.DisableWelcomePage)
}
if idleWatchDog || busyWatchDog {
opts = append(opts, config.EnableWatchDog)
if idleWatchDog {