Skip to content

Declearn: a modular and extensible framework for Federated Learning


declearn is a python package providing with a framework to perform federated learning, i.e. to train machine learning models by distributing computations across a set of data owners that, consequently, only have to share aggregated information (rather than individual data samples) with an orchestrating server (and, by extension, with each other).

The aim of declearn is to provide both real-world end-users and algorithm researchers with a modular and extensible framework that:

  • builds on abstractions general enough to write backbone algorithmic code agnostic to the actual computation framework, statistical model details or network communications setup
  • designs modular and combinable objects, so that algorithmic features, and more generally any specific implementation of a component (the model, network protocol, client or server optimizer...) may easily be plugged into the main federated learning process - enabling users to experiment with configurations that intersect unitary features
  • provides with functioning tools that may be used out-of-the-box to set up federated learning tasks using some popular computation frameworks (scikit- learn, tensorflow, pytorch...) and federated learning algorithms (FedAvg, Scaffold, FedYogi...)
  • provides with tools that enable extending the support of existing tools and APIs to custom functions and classes without having to hack into the source code, merely adding new features (tensor libraries, model classes, optimization plug-ins, orchestration algorithms, communication protocols...) to the party

At the moment, declearn has been focused on so-called "centralized" federated learning that implies a central server orchestrating computations, but it might become more oriented towards decentralized processes in the future, that remove the use of a central agent.

Explore the documentation

The documentation is structured this way:

  • Installation guide:
    Learn how to set up for and install declearn.
  • Quickstart example:
    See in a glance what end-user declearn code looks like.
  • User guide:
    Learn about declearn's take on Federated Learning, its current capabilities, how to implement your own use case, and the API's structure and key points.
  • API Reference:
    Full API documentation, auto-generated from the source code.
  • Developer guide:
    Information on how to contribute, codings rules and how to run tests.

Declearn is an open-source software developed by people from the Magnet team at Inria.


Current core developers are listed under the pyproject.toml file. A more detailed acknowledgement and history of authors and contributors to declearn can be found in the AUTHORS file.


Declearn distributed under the Apache-2.0 license. All code files should therefore contain the following mention, which also applies to the present README file:

Copyright 2023 Inria (Institut National de la Recherche en Informatique
et Automatique)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.