What is Syft-Flwr?
Syft-Flwr is a privacy-preserving federated learning framework that bridges Flower (a production-ready FL framework) with SyftBox’s file-based communication infrastructure. It enables researchers and organizations to conduct federated learning experiments with strong privacy guarantees, supporting both traditional SyftBox deployments and peer-to-peer scenarios.Design Philosophy
Syft-Flwr is built on three core principles:1. File-Based Communication
Unlike traditional FL frameworks that require always-on network connections, Syft-Flwr uses asynchronous file-based messaging. This means:- Participants don’t need to be online simultaneously
- Training can continue across network disruptions
- Communication happens through filesystem synchronization (SyftBox or Google Drive)
2. Transport Abstraction
The framework abstracts the underlying transport layer, supporting:- SyftBox Transport: Local file sync with RPC and optional encryption
- P2P Transport: Cloud-based sync via Google Drive for remote collaboration
3. Privacy by Design
Privacy guarantees are built into the architecture:- Data never leaves participant devices
- Only model updates are shared
- Optional end-to-end encryption (via X3DH)
- File-based audit trails
Key Components
Syft-Flwr consists of several architectural layers:Flower App Layer
Your federated learning logic using standard Flower APIs:ClientApp: Defines local training behaviorServerApp: Defines aggregation strategy- No modifications needed to support file-based communication
FL Orchestrator
Coordinates message flow between Flower and the transport layer:- SyftGrid: Server-side message orchestrator implementing Flower’s Grid protocol
- FlowerClient: Client-side message handler
- Manages serialization, encryption, and response tracking
Transport Abstraction
Plugin system for different communication backends:- Client Protocol:
SyftFlwrClientdefines datasite paths and email - RPC Protocol:
SyftFlwrRpchandles request/response messaging - Events Protocol:
SyftFlwrEventsmonitors incoming messages
Communication Backends
SyftBox Transport (traditional):- Uses local SyftBox installation
- File watching via
watchdog - Optional X3DH encryption
- RPC futures database
- Uses Google Drive API directly
- No local SyftBox required
- Polling-based message detection
- No encryption (relies on Google’s security)
Architecture Highlights
Plugin System
Syft-Flwr uses factory functions to create appropriate implementations:Message Flow
Server → Client:- Server creates Flower
Messageobject SyftGridserializes to protobuf bytes- RPC layer writes
.requestfile to client’s inbox - Client’s events layer detects new file
- Client deserializes and processes message
- Client writes
.responsefile to server’s inbox - Server polls and retrieves response
Bootstrap Process
Initializing a Syft-Flwr project:pyproject.toml with:
- Transport configuration
- Participant emails
- Unique app identifier
- syft_flwr as a dependency
Extension Points
Custom Transport Layers
Implement the protocol classes to add new backends:Custom Aggregation Strategies
Use any Flower strategy - Syft-Flwr is transport-agnostic:Next Steps
Architecture Deep Dive
Explore the detailed component architecture
File-Based Communication
Understand the messaging model
Transport Layers
Compare SyftBox vs P2P transports
Privacy Model
Learn about privacy guarantees