Skip to main content
Syft-Flwr combines the flexibility of Flower (a popular federated learning framework) with the privacy-preserving networking capabilities of SyftBox. This section provides hands-on examples that demonstrate different use cases and deployment options.

Available Examples

Explore these complete, production-ready examples to learn how to build federated learning applications:

Diabetes Prediction

Train a neural network for diabetes prediction using federated learning across multiple data owners.

Federated Analytics

Compute aggregated statistics and histograms on distributed datasets without centralizing data.

FedRAG

Build a Federated Retrieval Augmented Generation system for privacy-preserving question answering.

Local Simulation

Run complete federated learning workflows on your local machine for development and testing.

Deployment Options

Each example supports multiple deployment modes to fit your development and production needs:

Local Simulation

Test locally with Jupyter notebooks simulating multiple parties on one machine.

Google Drive

Zero-setup federated learning using only Google Colab notebooks.

SyftBox Network

Deploy across real distributed nodes using the SyftBox client.

Quick Start

All examples follow a similar structure and workflow:

1. Clone the Example

git clone https://github.com/OpenMined/syft-flwr.git _tmp \
    && mv _tmp/notebooks/<example-name> . \
    && rm -rf _tmp && cd <example-name>

2. Install Dependencies

uv sync

3. Run Locally

Start with the local notebooks to understand the workflow:
  • Data Owners: Open local/do1.ipynb and local/do2.ipynb
  • Data Scientist: Open local/ds.ipynb
Switch between notebooks as indicated to simulate the complete federated workflow.

4. Deploy Distributed

Once you understand the local workflow, scale to real distributed deployment:
  • Use Google Colab notebooks for zero-setup deployment
  • Or install SyftBox client for production deployments

Key Features Demonstrated

These examples showcase the core capabilities of Syft-Flwr:
  • Privacy Preservation: Raw data never leaves data owner environments
  • Data Governance: Data owners review and approve all computational jobs
  • Flexible Aggregation: Support for both model updates (FL) and statistics (analytics)
  • Production Ready: Real deployment options from local dev to distributed production
  • Framework Integration: Built on standard Flower patterns with SyftBox privacy layer

Example Comparison

ExampleUse CaseComplexityKey Technology
Diabetes PredictionBinary classification with federated learningIntermediatePyTorch, SMOTE, FedAvg
Federated AnalyticsPrivacy-preserving data analysisBeginnerPandas, NumPy, Matplotlib
FedRAGDistributed document retrieval for LLMsAdvancedFAISS, Transformers, RAG

Learning Path

We recommend exploring the examples in this order:
  1. Start with Local Simulation: Understand the basics by running everything on your machine
  2. Try Federated Analytics: Learn federated workflows with a simpler use case
  3. Build Diabetes Prediction: Implement a complete federated learning pipeline
  4. Explore FedRAG: Advanced use case combining federated learning with RAG
  5. Deploy with Google Drive: Experience zero-setup distributed deployment

Next Steps

View API Reference

Explore the complete Syft-Flwr API documentation.

Join Community

Get help and share your federated learning projects.
All examples use the PIMA Indians Diabetes Database for demonstration purposes. The dataset is split across multiple data owners to simulate real-world federated scenarios.

Build docs developers (and LLMs) love