Skip to content

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

settings Config
group Clients
memory Rust Core
scatter_plot Aggregate
bug_report Attack Sim
trending_up Metrics

Python config → federated clients → Rust aggregation → Prefect-tracked round summaries

Key Features

bolt Rust Hot Path

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).

science Research-Friendly

Python API designed around Hugging Face model IDs, PEFT adapters, and PyTorch tensors. Pure-Python fallback when the Rust extension is unavailable.

visibility Observable by Default

Prefect-native flows expose round metrics, client updates, and attack results as first-class events — no custom logging glue needed.

shield Resilience Testing

Register Byzantine attacks alongside your strategy and watch how aggregation holds up, round by round.

Technology Stack

Core Rust + PyO3
API Python
Build maturin + uv
Orchestration Prefect
CLI Typer
Validation Pydantic
ML HuggingFace + PEFT + Torch
Docs Zensical

Get started

Clone, maturin develop, run your first round.

Read the Quickstart
AJ Barea · 2026