NanoFed - Federated Learning Library¶
Beta Release
NanoFed is currently in beta. APIs may change in future versions.
Overview¶
NanoFed is a lightweight, modular federated learning library. Built on PyTorch, it enables distributed model training while preserving data privacy.
pip install nanofed
poetry install nanofed # Using poetry
Key Features¶
Client data never leaves local devices
Secure model update transmission
Privacy-preserving aggregation
Simple, intuitive API
PyTorch integration
Clear documentation
Custom model support
Pluggable aggregation strategies
Extensible architecture
Async communication
Robust error handling
Comprehensive logging
Quick Example¶
Train a model using federated learning in just a few lines of code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
Components¶
The client component handles local training and server communication:
Local model training
Secure update submission
Data privacy preservation
Training metrics collection
The server coordinates the federated process:
Global model distribution
Update aggregation
Training coordination
Client synchronization
The coordinator manages the overall training process:
Round management
Client tracking
Progress monitoring
Checkpointing
Installation¶
Basic Installation
Install using pip:
pip install nanofed
Development Installation
For development:
git clone https://github.com/camille-004/nanofed.git
cd nanofed
make install
Requirements¶
Required Dependencies¶
Python >=3.10
PyTorch
aiohttp
pydantic
Getting Help¶
Report bugs and request features on our GitHub issue tracker.
Read our comprehensive documentation and guides.
Browse the source code on GitHub.
Warning
This is a beta release. While the core functionality is stable, APIs may change in future versions. Please report any issues you encounter.
License¶
NanoFed is available under the GPL-3.0 License.