feat(ui): detect model usage and display link (#4864)

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2025-02-18 19:27:07 +01:00 committed by GitHub
parent 28fb8e607a
commit 5b19af99ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 2 deletions

View file

@ -400,6 +400,15 @@ func (cfg *BackendConfig) SetDefaults(opts ...ConfigLoaderOption) {
cfg.Debug = &trueV
}
if len(cfg.KnownUsecaseStrings) == 0 {
// Infer use case if not provided
for k, usecase := range GetAllBackendConfigUsecases() {
if cfg.HasUsecases(usecase) {
cfg.KnownUsecaseStrings = append(cfg.KnownUsecaseStrings, k)
}
}
}
guessDefaultsFromFile(cfg, lo.modelPath)
}