This repository provides a modular Federated Learning (FL) simulator built with PyTorch. It supports both single-machine simulation and LAN-distributed remote clients (e.g., another PC on your local network).
-
Modular OOP-based FL architecture
-
Local clients (GPU/CPU) + optional remote clients over LAN
-
YAML-based configuration
-
Managed with the uv package manager
-
Easy to extend for research or custom FL strategies
- Install Dependencies
The environment is managed with the uv package manager.
uv sync
- Move to the Scripts Directory
cd scripts
- Configure the Simulation
All settings can be customized via YAML.
Edit:
configs/FLSimulatorConfig.yaml
- (Optional) Launch Remote Clients
If you want to include devices on the LAN (e.g., another PC):
On each remote machine:
uv run uvicorn remote:app
Make sure these clients stay running during the simulation.
- (Optional) Configure Remote Client Addresses
After launching remote clients, set their ip_address and port in:
configs/RemoteClientConfig.yaml
- Run the Simulation
uv run main.py
Note: Start all remote clients before running the simulation.