Velocity-FL¶
The uv of Federated Learning: Rust speed, Python ergonomics.
Rust Core | Python API | Faster Aggregation
What Is Velocity-FL?
Velocity-FL 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 Rust aggregation kernel runs far faster than the pure-Python fallback (FedAvg: 42.2 ms vs 5.82 s at 10M params, ~138× on the latest idle-box snapshot). The measured claim is on aggregation only, not end-to-end training; see the benchmarks page for full methodology and per-tier numbers.
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, Bulyan, GeometricMedian, ArKrum — 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. Far faster aggregation than the pure-Python fallback, widening with parameter count (FedAvg: 4.0 ms vs 545 ms at 1M params, 42.2 ms vs 5.82 s at 10M); the numpy buffer-protocol return path closed the former PyO3 marshaling overhead.
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.