Skip to content
/ p2pfl Public

P2PFL is a decentralized federated learning library that enables federated learning on peer-to-peer networks using gossip protocols, making collaborative AI model training possible without reliance on central servers.

License

Notifications You must be signed in to change notification settings

p2pfl/p2pfl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

GitHub Logo

P2PFL - Federated Learning over P2P networks

GitHub license GitHub issues GitHub contributors GitHub forks GitHub stars GitHub activity Coverage badge Slack

P2PFL is a general-purpose open-source library designed for the execution (simulated and in real environments) of Decentralized Federated Learning systems, specifically making use of P2P networks and the gossip protocols.

✨ Key Features

P2PFL offers a range of features designed to make decentralized federated learning accessible and efficient. For detailed information, please refer to our documentation.

Feature Description
πŸš€ Easy to Use Get started quickly with our intuitive API.
πŸ›‘οΈ Reliable Built for fault tolerance and resilience.
🌐 Scalable Leverages the power of peer-to-peer networks.
πŸ§ͺ Versatile Experiment in simulated or real-world environments.
πŸ”’ Private Prioritizes data privacy with decentralized architecture.
🧩 Flexible Designed to be easy to modify.
πŸ“ˆ Real-time Monitoring Manage and track experiment through P2PFL Web Services platform.
🧠 ML Frameworks Seamlessly integrate PyTorch, TensorFlow/Keras, and JAX models.
πŸ“‘ Communication Protocol Agnostic Choose the communication protocol that best suits your needs (e.g., gRPC).
πŸ”Œ Integrations Enhanced capabilities through integrations: Hugging Face Datasets, ML frameworks, communication protocols, and Ray for large-scale simulations.

πŸ“₯ Installation

πŸ‘¨πŸΌβ€πŸ’» For Users

pip install "p2pfl[torch]"

πŸ‘¨πŸΌβ€πŸ”§ For Developers

Open in GitHub Codespaces

🐍 Python (using UV)

git clone https://github.com/p2pfl/p2pfl.git
cd p2pfl
uv sync --all-extras

Note: The above command installs all dependencies (PyTorch, TensorFlow, and Ray). If you only need specific frameworks, you can use:

  • uv sync - Install only core dependencies
  • uv sync --extra torch - Install with PyTorch support
  • uv sync --extra tensorflow - Install with TensorFlow support
  • uv sync --extra ray - Install with Ray support

Use --no-dev to exclude development dependencies.

⚠️ Important for Ray users: If you're using Ray, we recommend activating the virtual environment traditionally instead of using uv run to avoid dependency issues with Ray workers. See the installation guide for details.

🐳 Docker

docker build -t p2pfl .
docker run -it --rm p2pfl bash

🎬 Quickstart

To start using P2PFL, follow our quickstart guide in the documentation.

πŸ“š Documentation & Resources

🀝 Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines. Please adhere to the project's code of conduct in CODE_OF_CONDUCT.md.

πŸ’¬ Community

Connect with us and stay updated:

⭐ Star History

A big thank you to the community for your interest in P2PFL! We appreciate your support and contributions.

Star History Chart

πŸ“œ License

GNU General Public License, Version 3.0

About

P2PFL is a decentralized federated learning library that enables federated learning on peer-to-peer networks using gossip protocols, making collaborative AI model training possible without reliance on central servers.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 9