gitmyhub

flower

Python ★ 7.0k updated 13h ago

Flower: A Friendly Federated AI Framework

A Python framework for federated learning that trains AI models across many devices or computers without ever moving private data to a central server, supporting PyTorch, TensorFlow, Hugging Face, mobile devices, and more.

PythonPyTorchTensorFlowJAXsetup: moderatecomplexity 4/5

Flower is a Python framework for building federated AI systems. Federated learning is a way to train AI models across many different computers or devices without ever moving the raw data to a central location. Instead, each device trains on its own local data, and only the learned updates get shared. This matters a lot for situations where data is sensitive, like medical records or personal phone data, because the original information never leaves its source.

The project was started at the University of Oxford and is designed to be flexible enough for both research experiments and real-world applications. You can connect Flower to almost any popular machine learning library, including PyTorch, TensorFlow, Hugging Face, scikit-learn, JAX, and many others. It also supports working with mobile devices like Android and iOS, which means you can run federated training directly on phones.

The codebase is organized around a few priorities. It is meant to be customizable, so different teams can adjust it to fit very different situations. It is built to be extended, meaning researchers can swap in new components to test new ideas. And it is written to stay readable and well-maintained, which the project treats as important for a community that wants to both use and contribute to the code.

Flower comes with a set of community-contributed baselines, which are pre-built reproductions of well-known federated learning research papers. These let researchers quickly test whether a new idea improves on existing approaches without having to rebuild the comparison from scratch. There are also many quickstart code examples showing how to connect Flower with different libraries and run a training job.

A tutorial series walks through the core ideas step by step, starting with what federated learning actually is, then moving on to strategies, customization, and communication between the central server and the individual devices doing the training. The framework is open source and has an active Slack community for questions and discussion.

Where it fits