# hewlettpackard/swarm-learning architecture

> Architecture diagram of the GitHub repository hewlettpackard/swarm-learning, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hewlettpackard/swarm-learning
- Repository: https://github.com/hewlettpackard/swarm-learning

## Overview

Swarm Learning is a decentralized framework for training models across data-owning sites while exchanging learned weights rather than raw data. The principal workflow is to configure and deploy a run, train locally through a platform-specific callback, synchronize model weights with the local Swarm Learning node, and repeat until training completes; SWCI and SLM-UI support management and monitoring. The Python client and orchestration relationships below are supported by excerpts or the README. Other runtime components are documented capabilities represented at their tree-supported directories; their internal implementation was not sampled.

Main entry points: [`lib/src/python-client/swarmlearning/client/swarm.py`](https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/client/swarm.py) (Swarm callback), [`docs/User/Working_of_a_Swarm_Learning_node.md`](https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Working_of_a_Swarm_Learning_node.md) (SL node), [`docs/User/Swarm_Learning_architecture.md`](https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Swarm_Learning_architecture.md) (Swarm Network), [`docs/User/Swarm_Operator_node_(SWOP).md`](https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Swarm_Operator_node_(SWOP).md) (SWOP tasks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deployment["Deployment and management"]
  node_swop["SWOP tasks"]
  node_slmui["SLM-UI"]
  node_license["AutoPass License Server"]
end

subgraph group_training["Model training"]
  node_mlapp["User ML program"]
  node_tf["TensorFlow and Keras<br/>[tf.py]"]
  node_pytorch["PyTorch<br/>[pyt.py]"]
  node_sklearn["Scikit-learn<br/>[sklearn.py]"]
  node_huggingface["Hugging Face<br/>[hf_transformers.py]"]
  node_callback["Swarm callback<br/>[swarm.py]"]
end

subgraph group_sync["Swarm coordination"]
  node_appif["Application interface<br/>[app2if.py]"]
  node_bridge["IPC bridge<br/>[bridge.py]"]
  node_sl["SL node"]
  node_sn["Swarm Network"]
  node_blockchain[("Blockchain metadata")]
end

subgraph group_observability["Monitoring"]
  node_swci["SWCI<br/>[swci.py]"]
  node_trainingstatus["Training progress"]
end

node_user(("Operator"))

node_user -->|"assigns tasks"| node_swop
node_user -->|"deploys run"| node_slmui
node_swop -->|"launches training"| node_mlapp
node_slmui -->|"monitors runs"| node_trainingstatus
node_user -->|"manages network"| node_swci
node_swci -->|"connects to"| node_sn
node_mlapp -->|"uses callback"| node_callback
node_tf -->|"extends"| node_callback
node_pytorch -->|"extends"| node_callback
node_sklearn -->|"uses base"| node_callback
node_huggingface -->|"extends"| node_callback
node_callback -->|"invokes interface"| node_appif
node_appif -->|"sends messages"| node_bridge
node_bridge -->|"exchanges weights"| node_sl
node_sl -->|"coordinates through"| node_sn
node_sn -->|"tracks metadata"| node_blockchain
node_sl -->|"reports progress"| node_trainingstatus
node_user -->|"licenses framework"| node_license

click node_swop "https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Swarm_Operator_node_(SWOP).md"
click node_slmui "https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Monitoring_Swarm_Learning_training_using_SLM-UI.md"
click node_swci "https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/swci.py"
click node_mlapp "https://github.com/hewlettpackard/swarm-learning/tree/master/examples"
click node_tf "https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/tf.py"
click node_pytorch "https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/pyt.py"
click node_sklearn "https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/sklearn.py"
click node_huggingface "https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/hf_transformers.py"
click node_callback "https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/client/swarm.py"
click node_appif "https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/client/app2if.py"
click node_bridge "https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/com/bridge.py"
click node_sl "https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Working_of_a_Swarm_Learning_node.md"
click node_sn "https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Swarm_Learning_architecture.md"
click node_blockchain "https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Swarm_Learning_architecture.md"
click node_license "https://github.com/hewlettpackard/swarm-learning/blob/master/docs/HPE%20AutoPass%20License%20Server%20User%20Guide.pdf"
click node_trainingstatus "https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Monitoring_Swarm_Learning_training_using_SLM-UI.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_swop,node_slmui,node_license toneBlue
class node_mlapp,node_tf,node_pytorch,node_sklearn,node_huggingface,node_callback toneAmber
class node_appif,node_bridge,node_sl,node_sn,node_blockchain toneMint
class node_swci,node_trainingstatus toneRose
class node_user toneIndigo
```

## Components

### Deployment and management

- [SWOP tasks](https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Swarm_Operator_node_(SWOP).md): `docs/User/Swarm_Operator_node_(SWOP).md`
- [SLM-UI](https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Monitoring_Swarm_Learning_training_using_SLM-UI.md): `docs/User/Monitoring_Swarm_Learning_training_using_SLM-UI.md`
- [AutoPass License Server](https://github.com/hewlettpackard/swarm-learning/blob/master/docs/HPE%20AutoPass%20License%20Server%20User%20Guide.pdf): `docs/HPE AutoPass License Server User Guide.pdf`

### Model training

- [User ML program](https://github.com/hewlettpackard/swarm-learning/tree/master/examples): `examples`
- [TensorFlow and Keras](https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/tf.py): `lib/src/python-client/swarmlearning/tf.py`
- [PyTorch](https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/pyt.py): `lib/src/python-client/swarmlearning/pyt.py`
- [Scikit-learn](https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/sklearn.py): `lib/src/python-client/swarmlearning/sklearn.py`
- [Hugging Face](https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/hf_transformers.py): `lib/src/python-client/swarmlearning/hf_transformers.py`
- [Swarm callback](https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/client/swarm.py): `lib/src/python-client/swarmlearning/client/swarm.py`

### Swarm coordination

- [Application interface](https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/client/app2if.py): `lib/src/python-client/swarmlearning/client/app2if.py`
- [IPC bridge](https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/com/bridge.py): `lib/src/python-client/swarmlearning/com/bridge.py`
- [SL node](https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Working_of_a_Swarm_Learning_node.md): `docs/User/Working_of_a_Swarm_Learning_node.md`
- [Swarm Network](https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Swarm_Learning_architecture.md): `docs/User/Swarm_Learning_architecture.md`
- [Blockchain metadata](https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Swarm_Learning_architecture.md): `docs/User/Swarm_Learning_architecture.md`

### Monitoring

- [SWCI](https://github.com/hewlettpackard/swarm-learning/blob/master/lib/src/python-client/swarmlearning/swci.py): `lib/src/python-client/swarmlearning/swci.py`
- [Training progress](https://github.com/hewlettpackard/swarm-learning/blob/master/docs/User/Monitoring_Swarm_Learning_training_using_SLM-UI.md): `docs/User/Monitoring_Swarm_Learning_training_using_SLM-UI.md`

### Other components

- **Operator**

## Connections

- Operator → SWOP tasks: assigns tasks (evidence: `README.md`)
- Operator → SLM-UI: deploys run (evidence: `README.md`)
- SWOP tasks → User ML program: launches training (evidence: `README.md`)
- SLM-UI → Training progress: monitors runs (evidence: `README.md`)
- Operator → SWCI: manages network (evidence: `README.md`)
- SWCI → Swarm Network: connects to (evidence: `README.md`)
- User ML program → Swarm callback: uses callback (evidence: `README.md`)
- TensorFlow and Keras → Swarm callback: extends (evidence: `lib/src/python-client/swarmlearning/tf.py`)
- PyTorch → Swarm callback: extends (evidence: `lib/src/python-client/swarmlearning/pyt.py`)
- Scikit-learn → Swarm callback: uses base (evidence: `lib/src/python-client/swarmlearning/sklearn.py`)
- Hugging Face → Swarm callback: extends (evidence: `lib/src/python-client/swarmlearning/hf_transformers.py`)
- Swarm callback → Application interface: invokes interface (evidence: `lib/src/python-client/swarmlearning/client/swarm.py`)
- Application interface → IPC bridge: sends messages (evidence: `lib/src/python-client/swarmlearning/client/app2if.py`)
- IPC bridge → SL node: exchanges weights (evidence: `README.md`)
- SL node → Swarm Network: coordinates through (evidence: `README.md`)
- Swarm Network → Blockchain metadata: tracks metadata (evidence: `README.md`)
- SL node → Training progress: reports progress (evidence: `README.md`)
- Operator → AutoPass License Server: licenses framework (evidence: `README.md`)
