VelocityFL¶
The uv of Federated Learning — Rust speed, Python ergonomics.
Rust Core | Python API | 4–10× Faster Aggregation
What Is VelocityFL?
VelocityFL is a federated learning orchestration framework with a Rust core for hot-path aggregation and attack simulation, wrapped in a Python-first API for researchers using Hugging Face, PEFT, and PyTorch. Configure a server, run rounds, inspect metrics — every hot loop runs in compiled code.
Rust core, Python surface
A PyO3 extension runs the aggregation math; a Typer CLI and a thin Python API keep experimentation friction low. Prefect wraps each round so you get flow-level visibility without custom logging glue. The aggregation kernel runs 4–10× faster than the pure-Python fallback, widening with parameter count (6.9× at 1M params, 10.4× at 10M, FedAvg) — the measured claim is on aggregation only, not end-to-end training, with honest caveats on PyO3 marshaling cost.
One API, Full Pipeline
Python config → federated clients → Rust aggregation → Prefect-tracked round summaries
Explore the Docs
Install with maturin develop, run your first round in minutes.
Every velocity command — run, simulate-attack, strategies.
How the Rust crate, PyO3 bindings, and Python orchestrator fit together.
Server options, strategy knobs, and attack parameters — every field explained.
FedAvg, FedProx, FedMedian, TrimmedMean, Krum, Multi-Krum — and where to add your own.
Model poisoning, Sybil nodes, Gaussian noise, label flipping.
Python surface: VelocityServer, Strategy, ClientUpdate.
Key Features
Aggregation, median, Krum/Multi-Krum, and attack simulation compiled to Rust via PyO3. 4–10× faster aggregation than the pure-Python fallback, widening with parameter count (FedAvg: 77.8 ms vs 538 ms at 1M params, 817 ms vs 8.48 s at 10M); PyO3 list-marshaling on the return path is the remaining FFI overhead (tracked).
Python API designed around Hugging Face model IDs, PEFT adapters, and PyTorch tensors. Pure-Python fallback when the Rust extension is unavailable.
Prefect-native flows expose round metrics, client updates, and attack results as first-class events — no custom logging glue needed.
Register Byzantine attacks alongside your strategy and watch how aggregation holds up, round by round.