LocalAI/core/http/react-ui
Ettore Di Giacinto 3280b9a287
Some checks failed
Security Scan / tests (push) Has been cancelled
fix(distributed): per-replica backend logs (store aggregation + UI)
The multi-replica refactor (PR #9583) changed the worker's process key
from `modelID` to `modelID#replicaIndex`, but the BackendLogStore kept
the bare-modelID lookup. Result: every distributed deployment lost
backend logs in the Nodes UI — single-replica too, since even the
default capacity of 1 produces a `#0` suffix.

Two changes wired together:

* pkg/model: BackendLogStore.GetLines/Subscribe now treat a modelID
  without `#` as a model prefix and merge across all `modelID#N` replica
  buffers (timestamp-sorted for GetLines; fan-in for Subscribe). Calls
  with a full `modelID#N` key resolve exactly. ListModels strips
  replica suffixes and deduplicates so the listing surfaces one entry
  per loaded model.

* react-ui: per-replica log streams as the default. Loaded Models
  table disambiguates each row with a `rep N` pill (only when the node
  hosts >1 replica of a model). Each row's "View logs" link routes to
  the per-replica process key so operators see only that replica's
  output. The logs page renders the replica context as a chip in the
  title and surfaces a segmented control — `Replica 0 / 1 / … / All
  merged` — when the model has multiple replicas; the merged segment
  uses the bare-modelID URL (delegating to the store's prefix
  aggregation) for the side-by-side comparison case. Single-replica
  deployments see no extra UI.

Tests added first (TDD): the regression set in
backend_log_store_test.go reproduces the bug at the exact failure
point — GetLines/ListModels/Subscribe assertions all fail against the
broken code, all pass against the fix. TestSubscribe_PerReplicaFilter
pins the exact-key path so a future change can't silently break it.

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Assisted-by: claude-code:opus-4-7 [Edit] [Skill:critique] [Skill:audit] [Skill:polish] [Skill:distill]
2026-04-27 20:55:24 +00:00
..
e2e feat(distributed): support multiple replicas of one model on the same node (#9583) 2026-04-27 21:20:05 +02:00
src fix(distributed): per-replica backend logs (store aggregation + UI) 2026-04-27 20:55:24 +00:00
bun.lock feat(ui): Interactive model config editor with autocomplete (#9149) 2026-04-07 14:42:23 +02:00
eslint.config.js feat(ui): move to React for frontend (#8772) 2026-03-05 21:47:12 +01:00
index.html feat(react-ui): editorial refresh with Nord palette and polished primitives (#9550) 2026-04-24 23:35:59 +02:00
package-lock.json chore(deps): bump postcss from 8.5.8 to 8.5.10 in /core/http/react-ui in the npm_and_yarn group across 1 directory (#9544) 2026-04-24 22:02:41 +02:00
package.json chore(deps): bump dompurify from 3.3.2 to 3.4.0 in /core/http/react-ui in the npm_and_yarn group across 1 directory (#9376) 2026-04-17 09:06:32 +02:00
playwright.config.js feat(ui, gallery): Show model backends and add searchable model/backend selector (#9060) 2026-03-18 21:14:41 +01:00
vite.config.js fix(ui): fix /app redirect 2026-03-05 21:43:46 +00:00