Skip to main content

EdgeFL

Documentation

EdgeFL is a lightweight experimentation toolkit for federated learning scenarios deployed on edge devices. It provides utilities for generating synthetic datasets, defining lightweight models, and orchestrating end-to-end simulations of collaborative training sessions across heterogeneous clients.

Features

  • Synthetic data generation tailored to environmental sensing scenarios.
  • Composable model abstractions with a shared BaseModel interface.
  • Federated simulation tools including ready-to-use ClientNode and FederatedServer implementations.
  • Extensible utilities for experimenting with aggregation strategies and evaluation metrics.

Installation

EdgeFL is published as a standard Python package and can be installed with pip:

pip install edgefl

To include documentation or testing dependencies, install the corresponding extras:

pip install edgefl[docs]
pip install edgefl[tests]

Quick start

Get up and running with a minimal synchronous simulation:

git clone https://github.com/edgefl/EdgeFL.git
cd EdgeFL
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\\Scripts\\activate
pip install -e .[docs]

Then launch a basic FL experiment:

from edgefl import ClientNode, FederatedServer, SklearnLinearModel, generate_clients_data

clients_data = generate_clients_data(n_clients=5, n_samples=200)
clients = [
    ClientNode(i, X, y, model=SklearnLinearModel())
    for i, (X, y) in enumerate(clients_data)
]

server = FederatedServer(model=SklearnLinearModel(), clients=clients)
result = server.train_round()
print(result["validation"])

You can also layer in the multi-agent system (MAS) abstractions:

from edgefl import (
    Agent,
    AgentCoordinator,
    ClientNode,
    SklearnLinearModel,
    generate_clients_data,
)

clients_data = generate_clients_data(n_clients=5, n_samples=200)
agents = [
    Agent(ClientNode(i, X, y, model=SklearnLinearModel()))
    for i, (X, y) in enumerate(clients_data)
]

coordinator = AgentCoordinator(model=SklearnLinearModel(), agents=agents)
result = coordinator.train_round()
print(result["validation"])

For a runnable MAS + FL script, see:

python examples/agentfl_quickstart.py

MAS layer concepts

EdgeFL's MAS layer adds decision and coordination logic on top of standard FL training.

  • Agent: wraps a ClientNode and tracks state such as energy budget, trust score, activity, and participation history.
  • Policy: pluggable logic for participation and local training. Policies determine when and how agents contribute.
  • Coordinator: AgentCoordinator runs rounds, applies policies, schedules events, aggregates updates, and records MAS-level metrics.
  • Scenarios: environment builders (e.g., churn, adversarial, energy-constrained) that inject events like dropouts, returns, and trust/energy shifts.

MAS quickstart snippet

from edgefl import Agent, AgentCoordinator, ClientNode, SklearnLinearModel, generate_clients_data
from edgefl.environment import churn_scenario

clients_data = generate_clients_data(n_clients=6, n_samples=180, seed=7)
agents = [
    Agent(ClientNode(i, X, y, model=SklearnLinearModel()))
    for i, (X, y) in enumerate(clients_data)
]

scheduler = churn_scenario(num_agents=6, rounds=8, dropout_rate=0.2, return_rate=0.15, seed=11)
coordinator = AgentCoordinator(model=SklearnLinearModel(), agents=agents, scheduler=scheduler)

for r in range(8):
    result = coordinator.train_round(round_index=r)
    print(r, result["num_agents"], result["metrics"]["participation_rate"])

MAS metrics

Each coordinator round includes the following metrics:

  • communication_cost: proxy for total communication volume in the round.
  • participation_rate: fraction of agents that contributed updates.
  • jains_fairness: fairness index over cumulative participation counts.
  • system_utility: combined utility signal (participation, fairness, optional validation and communication weighting).

Research framing: MAS + FL hybrid

EdgeFL is designed as a hybrid of federated learning and multi-agent systems:

  • Policy-driven participation from MAS allows each agent to adapt to local constraints (for example, trust, energy, or availability).
  • Coordinated aggregation from FL preserves a global model objective while supporting decentralized, heterogeneous behavior.

This pairing enables controlled studies of strategic participation, robustness, and efficiency under realistic edge-network dynamics.

Project Structure

  • edgefl/data – Synthetic dataset generators for typical edge deployments.
  • edgefl/models – Base classes and reference implementations for models.
  • edgefl/simulation – Core simulation loop and orchestrator utilities.
  • docs/ – Project documentation sources.
  • examples/ – Usage examples and notebooks.

Documentation

Build the static site locally with MkDocs:

pip install -e .[docs]
mkdocs serve  # live preview at http://127.0.0.1:8000/
mkdocs build  # outputs site/ with static assets

To publish the documentation to GitHub Pages:

  1. Enable GitHub Pages in the repository settings, selecting the gh-pages branch.
  2. Run mkdocs gh-deploy --force locally (after authenticating with GitHub). This command builds the site and pushes the result to the gh-pages branch.
  3. Visit https://<your-account>.github.io/EdgeFL/ to verify the deployment.

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub to propose enhancements or bug fixes.

License

EdgeFL is released under the Apache License 2.0.

Metadata

Release files for edgefl 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for edgefl 0.1.0
File Size Uploaded
edgefl-0.1.0.tar.gz 40.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for edgefl 0.1.0
File Interpreter ABI Platform
edgefl-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 81.9 kB

Release files / edgefl-0.1.0.tar.gz

Download URL edgefl-0.1.0.tar.gz
Size 40.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f411aee70041587162addf3a765702c5d9ea18741608ac0286390f2d8a5deaf8
BLAKE2b-256 checksum
How to use checksums
02b93e863adbc9d15fece8464922e87949c0d7bbb729162ef4792a4bb5124852
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / edgefl-0.1.0-py3-none-any.whl

Download URL edgefl-0.1.0-py3-none-any.whl
Size 41.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78e0be092b61c45c71fb08f776cb18d6780573cd375cf95c0d83c77381889165
BLAKE2b-256 checksum
How to use checksums
4dffe21fbe6970ffb71ad5af23a5e27de9f16630e09053f9e72a1bd0e959d481
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page