Skip to content

Commit 61d34cc

Browse files
committed
fix(ui): show also concrete backends in the backend list
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 7f88a3b commit 61d34cc

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

core/http/react-ui/src/pages/Backends.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,11 @@ export default function Backends() {
7474
const filteredBackends = (() => {
7575
let result = allBackends
7676

77-
// Show only meta backends unless "Show all" is toggled
77+
// Hide concrete variants that are aliased by a meta backend unless
78+
// "Show all" is toggled. Standalone backends (no meta referencing them)
79+
// stay visible even when they don't declare capabilities themselves.
7880
if (!showAllBackends) {
79-
result = result.filter(b => b.isMeta)
81+
result = result.filter(b => b.isMeta || !b.isAlias)
8082
}
8183

8284
// Hide development backends unless toggled on

core/http/routes/ui_api.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,19 @@ func RegisterUIAPIRoutes(app *echo.Echo, cl *config.ModelConfigLoader, ml *model
824824
})
825825
}
826826

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

0 commit comments

Comments
 (0)