fix(ui): show also concrete backends in the backend list

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto
2026-04-16 17:44:25 +00:00
parent 7f88a3ba30
commit 61d34ccb11
2 changed files with 18 additions and 2 deletions

View File

@@ -74,9 +74,11 @@ export default function Backends() {
const filteredBackends = (() => {
let result = allBackends
// Show only meta backends unless "Show all" is toggled
// Hide concrete variants that are aliased by a meta backend unless
// "Show all" is toggled. Standalone backends (no meta referencing them)
// stay visible even when they don't declare capabilities themselves.
if (!showAllBackends) {
result = result.filter(b => b.isMeta)
result = result.filter(b => b.isMeta || !b.isAlias)
}
// Hide development backends unless toggled on

View File

@@ -824,6 +824,19 @@ func RegisterUIAPIRoutes(app *echo.Echo, cl *config.ModelConfigLoader, ml *model
})
}
// Collect concrete backend names that are referenced by any meta backend's
// CapabilitiesMap. These are the per-capability variants the UI hides by
// default behind "Show all" (the meta backend is the preferred entry).
aliasedByMeta := make(map[string]bool)
for _, b := range backends {
if !b.IsMeta() {
continue
}
for _, concreteName := range b.CapabilitiesMap {
aliasedByMeta[concreteName] = true
}
}
// Use the BackendManager's list to determine installed status.
// In standalone mode this checks the local filesystem; in distributed
// mode it aggregates from all healthy worker nodes.
@@ -940,6 +953,7 @@ func RegisterUIAPIRoutes(app *echo.Echo, cl *config.ModelConfigLoader, ml *model
"jobID": jobID,
"isDeletion": isDeletionOp,
"isMeta": b.IsMeta(),
"isAlias": aliasedByMeta[b.Name],
"isDevelopment": b.IsDevelopment(devSuffix),
})
}