You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(slm): run a role on more than one node — horizontal scaling per role #19706
Maintainer decision (2026-10-26): the user chooses the environment and its size (Docker, VMs or bare metal) and can separate roles onto their own nodes and scale them.
Today
Separating roles works: the SLM assigns each role to a node.
Scaling one role across several nodes does not. check_role_uniqueness in autobot-slm-backend/services/role_registry.py lets a role sit on one node only. MULTI_NODE_ROLES covers just autobot_shared and slm-agent.
So "scale a role horizontally" (for example two backend nodes behind the frontend, or several NPU or LLM workers) cannot be configured.
Acceptance criteria
For each role, a decision (recorded here) on whether it can run on several nodes, and what that requires: state sharing via Redis or Postgres, sticky sessions, leader election, and how traffic is spread across nodes.
Roles marked scalable can be assigned to more than one node in the SLM, and the role check allows it for exactly those roles.
A role on several nodes gets traffic spread across them (load balancing or service discovery) and per-node health, and one node failing doesn't take the role down.
The landing page and the install docs then say roles can be scaled. Until this lands they say only that roles can be separated and each node sized.
Maintainer decision: no code yet. A per-role table comes first, showing whether each role can scale, what that requires and how big the work is. The maintainer rules on that table.
Per-role table for the maintainer's ruling. Read from main; no code changed. Sizes are estimates, not measured (S up to a few days, M up to two weeks, L more). "Read" means the cited code was opened; "inferred" means deduced from structure.
Role
Can scale?
What blocks it
Requires
Size
Basis
autobot_shared, slm-agent
Already
Nothing; both are in MULTI_NODE_ROLES
Nothing
None
Read
npu-worker
Yes, closest to ready
Inference uses one URL (ai_hardware_accelerator.py:203), though NPUWorkerPool exists (autobot_shared/npu/integration.py:381). Whether the main path uses the pool is not confirmed
Route through the pool; take the worker list from SLM assignments
M
Read, call path unknown
frontend
Yes
One backend upstream (autobot-user.conf:5-7)
A load balancer in front; same build on each node
S
Inferred
tts-worker
Yes
One host (ssot_config.py:178). The real server code was not read
URL list or load balancer in the client
S
Inferred
autobot-llm-cpu
Yes
One default endpoint plus one GPU endpoint (config/model_config.py:118-135)
Endpoint list and a picker; same models on each node
M
Read
autobot-llm-gpu
With work
As above, plus the co-location rule with npu-worker
As above
M
Read
ai-stack
With work
One host and port (ssot_config.py:175). Hidden state not ruled out
URL list or load balancer; check for state
M
Inferred
browser-service
With work
Sessions held in memory (session-store.js)
Sticky routing by session, or a session registry in Redis
M
Read
celery
With work
Shares the backend's local SQLite and files. Task code not read
Backend's shared-state fix
M
Inferred
backend
With work
One upstream, and local state: secrets.db, conversation_files.db, project_state.db, transcriber.db, chat JSON files
Move state to Postgres, Redis or a shared volume; multi-server upstream; sticky sessions and in-process caches not yet audited
L
Read for blockers, inferred for size
redis
With work
One host (ssot_config.py:174), no Sentinel or cluster found. Other roles keep shared state here
Sentinel or Cluster; client changes
L
Read
postgres
With work
One server, no failover found
Primary and replica, failover, routing
L
Inferred
slm-frontend
With work, moot
Points at 127.0.0.1:8000. Only useful with a scaled slm-backend
Scaled slm-backend
S
Inferred
scheduler
No, stay single
A second celery beat fires every task twice; no leader election found
Stay single (S), or a lease for failover (M)
S or M
Read
slm-backend
No, stay single
In-process loops and WebSocket connections (main.py:330, api/websocket.py:147), one advisory lock only
Leader election, pub/sub, agent failover address
L
Read
slm-database
No, until a Postgres HA decision
Single Postgres. A Replication model exists and was not read
Separate project
L
Read in part
slm-monitoring
No, stay single
Static Prometheus targets
Two independent scrapers; not analysed further
M
Inferred
chromadb
No, stay single
One host, and some code uses local PersistentClient, so nodes would diverge
Data replication, which this repo does not provide
L
Read
vnc
No, stay single
Bound to one display and session (ssot_config.py:1832)
Per-session node mapping; not investigated
M
Inferred
docker
Not applicable
Infrastructure role with no service. Not in MULTI_NODE_ROLES; how the role check treats it was not checked
None
S
Read
Needed by every scaled role:
Role check:check_role_uniqueness (role_registry.py:647-669) becomes a per-role flag, and get_role_owners (:672) and api/roles.py:169-179 return a list. Callers are nodes.py:977, deployments.py:226 and blue_green.py:80. The database already allows many nodes per role (models/database.py:976).
Traffic: no generic load balancing or discovery exists. Consumers read one host per service (ssot_config.py:171-180). zero_downtime_deploy.py:707-763 generates multi-server upstreams and may be reusable; not read in depth.
Health: fleet health counts a role as up if any node is active (api/roles.py:205-260), so one dead node of a scaled role would not show as degraded. Nothing removes a failed node from an upstream.
Not looked at: how the SLM generates each node's AUTOBOT_*_HOST values, the docker and vnc Ansible roles, the Windows NPU worker, and the landing and install text.
Suggested first step, for the ruling: the role-check change and per-node health, then npu-worker, the LLM roles, tts-worker and frontend. They give real scaling without moving the backend's state. backend is the largest and most asked-for, and is a project of its own.
Maintainer decision on the table above: first the shared changes (a per-role flag, a list of nodes in the API, per-node health), then npu-worker, the LLM roles, tts-worker and frontend. backend is a separate project later.
Verified against main at the merge train (PR #20661), merge 6c34ee1. Members touching this issue: #20599. It delivers only the NPU-worker slice, so no criterion is ticked.
AC
Evidence
Per-role decision on multi-node, and what it requires
NOT ticked. No per-role decision is recorded on the issue.
Scalable roles assignable to more than one node; role check allows exactly those
NOT ticked. MULTI_NODE_ROLES = {"autobot_shared", "slm-agent"} is unchanged on main (autobot-slm-backend/services/role_registry.py:636).
Traffic spread across a role's nodes, per-node health, one node failing does not take the role down
NOT ticked, partial for NPU workers only. autobot-backend/services/npu_worker_routing.py (_spread, npu_worker_urls, post_inference_with_failover) sends requests to every healthy paired worker with failover. No equivalent for other roles.
Landing page and install docs say roles can be scaled
NOT ticked. Depends on the criteria above; README.md:185 only says to add nodes and NPU workers.
Checked against origin/main. This train carried only the npu-worker slice (#20601); the issue's scope is wider.
Criterion
Verdict
Evidence
Per-role decision recorded here (scalable or not, and what it requires)
not met
A per-role table is posted as a comment, but no maintainer ruling on it is recorded. Nothing to tick until the ruling exists.
Scalable roles can be assigned to more than one node; role check allows it for exactly those roles
not met
autobot-slm-backend/services/role_registry.py:636 MULTI_NODE_ROLES = {"autobot_shared", "slm-agent"} is unchanged; check_role_uniqueness (:647) still refuses a second node for every other role, npu-worker included.
Traffic spread across nodes, per-node health, one node failing doesn't take the role down
not met
Only the npu-worker client side exists: autobot-backend/services/npu_worker_routing.py (request order over paired workers), services/npu_client.py:191 (workers tried in order), ai_hardware_accelerator.py:268 (NPU available if any worker is). No SLM-level load balancing or service discovery for roles in general.
Landing page and install docs say roles can be scaled
not met
Depends on the rows above; no role is assignable to several nodes yet.
Closure check against origin/main (T82 #20897, merge 19e62c8; PR #20597 content is commit 2ecc0c7, an ancestor). The issue stays open: 0 of 4 ticked. PR #20597 said Refs and delivers the shared groundwork only.
AC
Evidence
Ticked
Per-role decision (recorded here) on scalability and what it requires
The per-role table (comment 6564730165) and the maintainer's ruling on order (comment 6565209098) are on the issue. The ruling names the first slice (npu-worker, LLM roles, tts-worker, frontend) and defers backend, but does not state a decision for every role in the table (scheduler, chromadb, redis, postgres, vnc and others). Not a code-checkable criterion.
no
Scalable roles assignable to more than one node, role check allows exactly those roles
Mechanism delivered: autobot-slm-backend/services/role_registry.py:638MULTI_NODE_ROLES = frozenset(r["name"] for r in DEFAULT_ROLES if r.get("multi_node")); check_role_uniqueness (:659) exempts them. But "multi_node": True appears 2 times (lines 431, 451: autobot_shared, slm-agent), both infrastructure roles. No service role is scalable, so no user can scale a role yet.
no
Traffic spread across nodes, per-node health, one node failing doesn't take the role down
Per-node health delivered: autobot-slm-backend/services/role_nodes.pyclassify_role_nodes, get_roles_with_nodes_down, surfaced as roles_with_nodes_down in fleet health. Traffic spreading: 0 hits for load balancing, service discovery or sticky routing in role_registry.py or role_nodes.py; nothing removes a failed node from an upstream. Per-node health also only covers service roles with the flag, currently 0.
no
Landing page and install docs say roles can be scaled
docs/guides/slm-docker-ansible-deployment.md only documents the /api/roles/owners and fleet-health response shapes. README.md "scale" hits (lines 41, 57, 138, 185, 219, 241) are the general deploy/operate/scale claim, not role scaling. Correctly absent until a role can be scaled.
no
Left: flag the first service roles (npu-worker, LLM roles, tts-worker, frontend) once their traffic reaches every node, add the traffic spreading, record the remaining per-role decisions, then update the docs. Host behaviour of per-node health is untested on a live fleet (the PR said "Not tried on a host").
Activity
mrveiss commentedon Nov 1, 2026
Maintainer decision: no code yet. A per-role table comes first, showing whether each role can scale, what that requires and how big the work is. The maintainer rules on that table.
mrveiss commentedon Nov 1, 2026
Per-role table for the maintainer's ruling. Read from
main; no code changed. Sizes are estimates, not measured (S up to a few days, M up to two weeks, L more). "Read" means the cited code was opened; "inferred" means deduced from structure.autobot_shared,slm-agentMULTI_NODE_ROLESnpu-workerai_hardware_accelerator.py:203), thoughNPUWorkerPoolexists (autobot_shared/npu/integration.py:381). Whether the main path uses the pool is not confirmedfrontendautobot-user.conf:5-7)tts-workerssot_config.py:178). The real server code was not readautobot-llm-cpuconfig/model_config.py:118-135)autobot-llm-gpunpu-workerai-stackssot_config.py:175). Hidden state not ruled outbrowser-servicesession-store.js)celerybackendsecrets.db,conversation_files.db,project_state.db,transcriber.db, chat JSON filesredisssot_config.py:174), no Sentinel or cluster found. Other roles keep shared state herepostgresslm-frontend127.0.0.1:8000. Only useful with a scaledslm-backendslm-backendschedulerslm-backendmain.py:330,api/websocket.py:147), one advisory lock onlyslm-databaseReplicationmodel exists and was not readslm-monitoringchromadbPersistentClient, so nodes would divergevncssot_config.py:1832)dockerMULTI_NODE_ROLES; how the role check treats it was not checkedNeeded by every scaled role:
check_role_uniqueness(role_registry.py:647-669) becomes a per-role flag, andget_role_owners(:672) andapi/roles.py:169-179return a list. Callers arenodes.py:977,deployments.py:226andblue_green.py:80. The database already allows many nodes per role (models/database.py:976).ssot_config.py:171-180).zero_downtime_deploy.py:707-763generates multi-server upstreams and may be reusable; not read in depth.api/roles.py:205-260), so one dead node of a scaled role would not show as degraded. Nothing removes a failed node from an upstream.Not looked at: how the SLM generates each node's
AUTOBOT_*_HOSTvalues, thedockerandvncAnsible roles, the Windows NPU worker, and the landing and install text.Suggested first step, for the ruling: the role-check change and per-node health, then
npu-worker, the LLM roles,tts-workerandfrontend. They give real scaling without moving the backend's state.backendis the largest and most asked-for, and is a project of its own.mrveiss commentedon Nov 1, 2026
Maintainer decision on the table above: first the shared changes (a per-role flag, a list of nodes in the API, per-node health), then
npu-worker, the LLM roles,tts-workerandfrontend.backendis a separate project later.fix(slm): count only scaled service roles and serving nodes in role h…
fix(npu): shared deadline across workers, probe every worker, trim th…
fix(npu): offer assigned nodes for an admin to pair instead of pairin…
mrveiss commentedon Nov 2, 2026
Verified against
mainat the merge train (PR #20661), merge 6c34ee1. Members touching this issue: #20599. It delivers only the NPU-worker slice, so no criterion is ticked.MULTI_NODE_ROLES = {"autobot_shared", "slm-agent"}is unchanged on main (autobot-slm-backend/services/role_registry.py:636).autobot-backend/services/npu_worker_routing.py(_spread,npu_worker_urls,post_inference_with_failover) sends requests to every healthy paired worker with failover. No equivalent for other roles.README.md:185only says to add nodes and NPU workers.The issue stays open.
mrveiss commentedon Nov 3, 2026
Acceptance criteria after merge train #20768
Checked against
origin/main. This train carried only the npu-worker slice (#20601); the issue's scope is wider.MULTI_NODE_ROLES = {"autobot_shared", "slm-agent"}is unchanged;check_role_uniqueness(:647) still refuses a second node for every other role, npu-worker included.Issue stays open: 0 of 4 met.
feat(npu): pair workers on nodes the SLM assigned the role (mrveiss#1…
mrveiss commentedon Nov 6, 2026
Closure check against
origin/main(T82 #20897, merge 19e62c8; PR #20597 content is commit 2ecc0c7, an ancestor). The issue stays open: 0 of 4 ticked. PR #20597 saidRefsand delivers the shared groundwork only.autobot-slm-backend/services/role_registry.py:638MULTI_NODE_ROLES = frozenset(r["name"] for r in DEFAULT_ROLES if r.get("multi_node"));check_role_uniqueness(:659) exempts them. But"multi_node": Trueappears 2 times (lines 431, 451:autobot_shared,slm-agent), both infrastructure roles. No service role is scalable, so no user can scale a role yet.autobot-slm-backend/services/role_nodes.pyclassify_role_nodes,get_roles_with_nodes_down, surfaced asroles_with_nodes_downin fleet health. Traffic spreading: 0 hits for load balancing, service discovery or sticky routing inrole_registry.pyorrole_nodes.py; nothing removes a failed node from an upstream. Per-node health also only covers service roles with the flag, currently 0.docs/guides/slm-docker-ansible-deployment.mdonly documents the/api/roles/ownersandfleet-healthresponse shapes.README.md"scale" hits (lines 41, 57, 138, 185, 219, 241) are the general deploy/operate/scale claim, not role scaling. Correctly absent until a role can be scaled.Left: flag the first service roles (npu-worker, LLM roles, tts-worker, frontend) once their traffic reaches every node, add the traffic spreading, record the remaining per-role decisions, then update the docs. Host behaviour of per-node health is untested on a live fleet (the PR said "Not tried on a host").
feat(slm): per-role multi-node flag, node lists and per-node health (m…