Overview
Bootstrapping is the process of configuring a Flower FL project to work with Syft-Flwr. This transforms a standard Flower project into a privacy-preserving federated learning setup that can run across multiple datasites.Prerequisites
Before bootstrapping, you need:- An existing Flower project with
pyproject.toml - Valid datasite email addresses for participants
- An aggregator (server) email address
- Python 3.9 or higher
Basic Bootstrap Process
Using the CLI
The simplest way to bootstrap a project is using thesyft_flwr CLI:
Interactive Mode
If you don’t provide the required arguments, the CLI will prompt you:Using Python API
Transport Configuration
Syft-Flwr supports two transport mechanisms:- SyftBox (Default)
- P2P (Colab/Drive)
Uses local SyftBox client with RPC and end-to-end encryption.Features:
- End-to-end encryption enabled by default
- Uses SyftBox Go client for file sync
- RPC communication via futures database
- Best for production deployments
Auto-Detection
Whentransport=None, Syft-Flwr automatically detects the environment:
What Bootstrap Does
1. Validates Project Structure
Bootstrap verifies:pyproject.tomlexists in the project directorymain.pydoesn’t already exist (to avoid overwriting)- All email addresses are valid datasites
2. Updates pyproject.toml
Bootstrap adds Syft-Flwr configuration to yourpyproject.toml:
3. Generates main.py
Creates the entry point that orchestrates your FL workflow:Project Structure
After bootstrapping, your project structure looks like:Email Validation
Datasite and aggregator emails must be valid:Complete Example
Here’s a full workflow from creating a Flower project to bootstrapping:Troubleshooting
”main.py already exists”
Bootstrap won’t overwrite existingmain.py. Remove it first:
“Invalid datasite” Error
Ensure all emails match the pattern[email protected]:
“pyproject.toml not found”
Make sure you’re in a valid Flower project directory:Next Steps
Run Simulations
Test your bootstrapped project locally
Transport Configuration
Deep dive into transport options
Multi-Client Setup
Deploy across multiple datasites