xaynet
Library Archived
The Xayn Network project is building a privacy layer for machine learning so that AI projects can meet compliance such as GDPR and CCPA. The approach relies on Federated Learning as enabling technology that allows production AI applications to be fully privacy compliant.
- Downloads
- 0
- Dependents
- 0
- Stars
- 202
- Forks
- 28
- Contributors
- 19
- Commits
- 2,776
- Latest release
- 0.11.0 ·
Why Archived
GitHub reports the repository as archived.
Exact rules: Instant archive. The check on applied thresholds version 9.
Every rule outcome, as the check records it
instant-archive: repository is archived
About

Xaynet: Train on the Edge with Federated Learning
Want a framework that supports federated learning on the edge, in desktop browsers, integrates well with mobile apps, is performant, and preserves privacy? Welcome to XayNet, written entirely in Rust!
Making federated learning easy for developers
Frameworks for machine learning - including those expressly for federated learning - exist already. These frameworks typically facilitate federated learning of cross-silo use cases - for example in collaborative learning across a limited number of hospitals or for instance across multiple banks working on a common use case without the need to share valuable and sensitive data.
Read the full README
This repository focusses on masked cross-device federated learning to enable the orchestration of machine learning in millions of low-power edge devices, such as smartphones or even cars. By doing this, we hope to also increase the pace and scope of adoption of federated learning in practice and especially allow the protection of end user data. All data remains in private local premises, whereby only encrypted AI models get automatically and asynchronously aggregated. Thus, we provide a solution to the AI privacy dilemma and bridge the often-existing gap between privacy and convenience. Imagine, for example, a voice assistant to learn new words directly on device level and sharing this knowledge with all other instances, without recording and collecting your voice input centrally. Or, think about search engine that learns to personalise search results without collecting your often sensitive search queries centrally… There are thousands of such use cases that right today still trade privacy for convenience. We think this shouldn’t be the case and we want to provide an alternative to overcome this dilemma.
Concretely, we provide developers with:
- App dev tools: An SDK to integrate federated learning into apps written in Dart or other languages of choice for mobile development, as well as frameworks like Flutter.
- Privacy via cross-device federated learning: Train your AI models locally on edge devices such as mobile phones, browsers, or even in cars. Federated learning automatically aggregates the local models into a global model. Thus, all insights inherent in the local models are captured, while the user data stays private on end devices.
- Security Privacy via homomorphic encryption: Aggregate models with the highest security and trust. Xayn’s masking protocol encrypts all models homomorphically. This enables you to aggregate encrypted local models into a global one – without having to decrypt local models at all. This protects private and even the most sensitive data.
The case for writing this framework in Rust
Our framework for federated learning is not only a framework for machine learning as such. Rather, it supports the federation of machine learning that takes place on possibly heterogeneous devices and where use cases involve many such devices.
The programming language in which this framework is written should therefore give us strong support for the following:
- Runs "everywhere": the language should not require its own runtime and code should compile on a wide range of devices.
- Memory and concurrency safety: code that compiles should be both memory safe and free of data races.
- Secure communication: state of the art cryptography should be available in vetted implementations.
- Asynchronous communication: abstractions for asynchronous communication should exist that make federated learning scale.
- Fast and functional: the language should offer functional abstractions but also compile code into fast executables.
Rust is one of the very few choices of modern programming languages that meets these requirements:
- its concepts of Ownership and Borrowing make it both memory and thread-safe (hence avoiding many common concurrency issues).
- it has a strong and static type discipline and traits, which describe shareable functionality of a type.
- it is a modern systems programming language, with some functional style features such as pattern matching, closures and iterators.
- its idiomatic code compares favourably to idiomatic C in performance.
- it compiles to WASM and can therefore be applied natively in browser settings.
- it is widely deployable and doesn't necessarily depend on a runtime, unlike languages such as Java and their need for a virtual machine to run its code. Foreign Function Interfaces support calls from other languages/frameworks, including Dart, Python and Flutter.
- it compiles into LLVM, and so it can draw from the abundant tool suites for LLVM.
Getting Started
Minimum supported rust version
rustc 1.51.0
Running the platform
There are a few different ways to run the backend: via docker, or by deploying it to a Kubernetes cluster or by compiling the code and running the binary manually.
- Everything described below assumes your shell's working directory to be the root of the repository.
- The following instructions assume you have pre-existing knowledge on some
of the referenced software (like
dockeranddocker-compose) and/or a working setup (if you decide to compile the Rust code and run the binary manually). - In case you need help with setting up your system accordingly, we recommend you refer to the official documentation of each tool, as supporting them here would be beyond the scope of this project:
Note:
With Xaynet v0.11 the coordinator needs a connection to a redis instance in order to save its state.
Don't connect the coordinator to a Redis instance that is used in production!
We recommend connecting the coordinator to its own Redis instance. We have invested a lot of time to make sure that the coordinator only deletes its own data but in the current state of development, we cannot guarantee that this will always be the case.
Using Docker
The convenience of using the docker setup is that there's no need to setup a working Rust environment on your system, as everything is done inside the container.
Run an image from Docker Hub
Docker images of the latest releases are provided on Docker Hub.
You can try them out with the default configs/docker-dev.toml by running:
Xaynet below v0.11
docker run -v ${PWD}/configs/docker-dev.toml:/app/config.toml -p 8081:8081 xaynetwork/xaynet:v0.10.0 /app/coordinator -c /app/config.toml
Xaynet v0.11+
# don't forget to adjust the Redis url in configs/docker-dev.toml
docker run -v ${PWD}/configs/docker-dev.toml:/app/config.toml -p 8081:8081 xaynetwork/xaynet:v0.11.0
The docker image contains a release build of the coordinator without optional features.
Run a coordinator with additional infrastructure
Start the coordinator by pointing to the docker/docker-compose.yml file. It spins up all
infrastructure that is essential to run the coordinator with default or optional features.
Keep in mind that this file is used for development only.
docker-compose -f docker/docker-compose.yml up --build
Create a release build
If you would like, you can create an optimized release build of the coordinator, but keep in mind that the compilation will be slower.
docker build --build-arg RELEASE_BUILD=1 -f ./docker/Dockerfile .
Build a coordinator with optional features
Optional features can be specified via the build argument COORDINATOR_FEATURES.
docker build --build-arg COORDINATOR_FEATURES=tls,metrics -f ./docker/Dockerfile .
Using Kubernetes
To deploy an instance of the coordinator to your Kubernetes cluster, use the manifests that are
located inside the k8s/coordinator folder. The manifests rely on kustomize to be generated
(kustomize is officially supported by kubectl since v1.14). We recommend you thoroughly go
through the manifests and adjust them according to your own setup (namespace, ingress, etc.).
Remember to also check (and adjust if necessary) the default configuration for the coordinator, available
at k8s/coordinator/development/config.toml.
Please adjust the domain used in the k8s/coordinator/development/ingress.yaml file so it matches
your needs (you can also skip ingress altogether, just make sure you remove its reference from
k8s/coordinator/development/kustomization.yaml).
Keep in mind that the ingress configuration that is shown on k8s/coordinator/development/ingress.yaml
relies on resources that aren't available in this repository, due to their sensitive nature
(TLS key and certificate, for instance).
To verify the generated manifests, run:
kubectl kustomize k8s/coordinator/development
To apply them:
kubectl apply -k k8s/coordinator/development
In case you are not exposing your coordinator via ingress, you can still reach it using a port-forward.
The example below creates a port-forward at port 8081 assuming the coordinator pod is still using the
app=coordinator label:
kubectl port-forward $(kubectl get pods -l "app=coordinator" -o jsonpath="{.items[0].metadata.name}") 8081
Building the project manually
The coordinator without optional features can be built and started with:
cd rust
cargo run --bin coordinator -- -c ../configs/config.toml
Running the example
The example can be found under rust/examples/. It uses a dummy model but is network-capable, so it's a good starting point for checking connectivity with the coordinator.
test-drive
Make sure you have a running instance of the coordinator and that the clients you will spawn with the command below are able to reach it through the network.
Here is an example on how to start 20 participants that will connect to a coordinator
running on 127.0.0.1:8081:
cd rust
RUST_LOG=info cargo run --example test-drive -- -n 20 -u http://127.0.0.1:8081
For more in-depth details on how to run examples, see the accompanying Getting Started guide under rust/xaynet-server/src/examples.rs.
Troubleshooting
If you have any difficulties running the project, please reach out to us by opening an issue and describing your setup and the problems you're facing.
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- Required
- Binds native code: libsodium-sys
- Python bindings
- No Python binding crate found
- License
- Apache-2.0
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
The Xayn Network project is building a privacy layer for machine learning so that AI projects can meet compliance such as GDPR and CCPA. The approach relies on Federated Learning as enabling technology that allows production AI applications to be fully privacy compliant. |
0 downloads over 30 days | 0 | 202 | 0.11.0 | GPU support unknown | Binds native code: libsodium-sys | Apache-2.0 |
|
mlx-rs Featured
Unofficial rust wrapper for Apple's mlx machine learning library. |
33,398 downloads over 30 days | 36 | 389 | 0.34.0 | Metal | Binds native code: mach-sys, mlx, mlx-sys. Build uses a native toolchain: bindgen, cc, cmake | Apache-2.0 OR MIT |
|
Machine Learning Framework for Hackers |
110 downloads over 30 days | 0 | 5,539 | 0.2.1 | CUDA | No native code found | Apache-2.0 OR MIT |
|
rustyml Listed
Machine learning models, neural networks, metrics, and data utilities in Rust |
59 downloads over 30 days | 0 | 345 | 0.17.0 | GPU support unknown | No native code found | MIT |
|
Trains GPT-style language models from a YAML config and a tokenized dataset: dense GQA transformers, Mamba 1, 2 and 3, MLA and MoE layers on CPU or CUDA. Runs the training loop, optimizer, checkpoints, evaluation and metrics on boostr, and builds speech corpora through voxr. |
27 downloads over 30 days | Not applicable | 8 | 0.1.1 | CUDA | Binds native code: nvml-wrapper-sys (feature cuda) | Apache-2.0 |
|
A machine learning library for Rust. |
25 downloads over 30 days | 0 | 333 | 0.2.1 | GPU support unknown | Binds native code: curl-sys (feature mnist), libz-sys (feature mnist) | Apache-2.0 OR MIT |
|
HAL: a machine learning library that is able to run on Nvidia, OpenCL or CPU BLAS based compute backends. It currently provides stackable classical neural networks, RNN's and soon to be LSTM's. |
2 downloads over 30 days | 0 | 92 | 0.2.0 | GPU support unknown | No native code found | BSD-3-Clause |
Crates7 crates
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption0 active dependents, 0 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 0 | crates.io database dump | Yes | |
| New dependents (365 days) | 0 | crates.io database dump | Yes | |
| Peak active dependents | 0 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceNot measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | Not measured | Yes | ||
| Latest release | 2021-01-18 | crates.io database dump | Yes | |
| First release | 2020-07-24 | crates.io database dump | Yes | |
| Latest version | 0.11.0 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 2322 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 0 | GitHub repository | Yes | |
| Repository archived | true | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution3 releases, 0 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 3 | crates.io database dump | Yes | |
| Downloads over 30 days | 0 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository202 stars, 28 forks, 19 contributors, 2,776 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 202 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 28 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 19 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 2776 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | Apache-2.0 | GitHub repository | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | Binds native code: libsodium-sys | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 0 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.