<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Cradicle Explorer</title>
    <link href="/css/bootstrap/bootstrap.min.css" rel="stylesheet">
    <style>
      .form-control-dark::placeholder {
          color: #aaa;
          opacity: 1;
      }
    </style>
    <link rel="stylesheet" href="/assets/fontawesome/css/all.min.css">
    <link rel="icon" type="image/png" href="/favicon.png">


                <link href="/css/dashboard.css" rel="stylesheet">
                </head>
                <body>
                <header class="navbar navbar-dark sticky-top bg-dark flex-md-nowrap p-0 shadow">
                  <a class="navbar-brand col-md-3 col-lg-2 me-0 px-3 fs-6" href="/">Cradicle Explorer</a>
                  <button class="navbar-toggler position-absolute d-md-none collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                  </button>
                  <form method="get" action="/cgi-bin/main" style="width:100%;"><input class="form-control form-control-dark w-100 rounded-0 border-0" type="text" name="q" placeholder="Search repos" aria-label="Search"></form>
                  <div class="navbar-nav flex-row">
                    <div class="nav-item text-nowrap">
                      <a class="nav-link px-3 active" href="/cgi-bin/repo?id=z3ndBN2sk1FbiY8rpnV7tTvqckmod">quickstart-jax</a>
                    </div>
                  </div>
                </header>
                <div class="container-fluid">
                  <div class="row">
                    <nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-dark sidebar collapse">
                      <div class="position-sticky pt-3 sidebar-sticky">
                        <ul class="nav flex-column">
                          <li class="nav-item">
                            <a class="nav-link active" href="/cgi-bin/repo?id=z3ndBN2sk1FbiY8rpnV7tTvqckmod">
                              <i class="align-text-bottom fa-solid fa-info"></i>
                              Info
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z3ndBN2sk1FbiY8rpnV7tTvqckmod&issue=list">
                              <i class="align-text-bottom fa-solid fa-layer-group"></i>
                              Issues
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z3ndBN2sk1FbiY8rpnV7tTvqckmod&patch=list">
                              <i class="align-text-bottom fa-solid fa-vest-patches"></i>
                              Patches
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z3ndBN2sk1FbiY8rpnV7tTvqckmod&wallet=list">
                              <i class="align-text-bottom fa-solid fa-wallet"></i>
                              Wallets
                            </a>
                          </li>
                          <li class="nav-item">
                            <a class="nav-link" href="/cgi-bin/repo?id=z3ndBN2sk1FbiY8rpnV7tTvqckmod&source=.">
                              <i class="align-text-bottom fa-solid fa-code"></i>
                              Source
                            </a>
                          </li>
                        <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted text-uppercase">
                          <span></span>
                        </h6>
                        <ul class="nav flex-column mb-2">
                        
                        </ul>
                      </div>
                    </nav>
                <main class="col-md-9 ms-sm-auto col-lg-10">
                  <div class="container px-1 py-3">
        

    <div class="list-group">
    <div class="list-group-item">
    <div style="font-size:1.3rem;">quickstart-jax</div>
    <div class="repo-item">flower example with jax</div>
    <div>rad:z3ndBN2sk1FbiY8rpnV7tTvqckmod</div>
    </div>
    <div class="list-group-item">
    <div>Visibility</div>
    <div class="repo-item">public</div>
    </div>
    <div class="list-group-item">
    <div>Delegates</div><div class="repo-item">did:key:z6MkhjFHykN28RFbwJMGJrpaJdPgT1ZfGc9FpBXngqaoqiKU</div>
    </div>
    <div class="list-group-item">
    <div>Default branch</div>
    <div><span class="repo-item">main &#8594 40213171a5925b318a04a1d9c2acd61ef259c398</span> (Fri Dec 19 05:13:41 2025)</div>
    </div>
    <div class="list-group-item">
    <div>Threshold</div>
    <div class="repo-item">1</div>
    </div>
    </div>
    
        <div class="list-group mt-3">
        <div class="list-group-item">
        <div class="mb-2" style="font-weight:bold;"><i class="fa-solid fa-book"></i> README.md</div>
        <pre style="margin:0; font-size:0.85rem; overflow-x:auto; color:#fafafa;">---
tags: [quickstart, linear regression]
dataset: [Synthetic]
framework: [JAX, FLAX]
---

# Federated Learning with JAX and Flower (Quickstart Example)

This introductory example to Flower uses JAX, but deep knowledge of JAX is not necessarily required to run the example. However, it will help you understand how to adapt Flower to your use case. Running this example in itself is quite easy. This example uses [FLAX](https://flax.readthedocs.io/en/latest/index.html) to define and train a small CNN model. This example uses [Flower Datasets](https://flower.ai/docs/datasets/) to download, partition and preprocess the MINST dataset.

## Set up the project

### Fetch the app

Install Flower:

```shell
pip install flwr
```

Fetch the app:

```shell
flwr new @flwrlabs/quickstart-jax
```

This will create a new directory called `quickstart-jax` with the following structure:

```shell
quickstart-jax
├── jaxexample
│   ├── __init__.py
│   ├── client_app.py   # Defines your ClientApp
│   ├── server_app.py   # Defines your ServerApp
│   └── task.py         # Defines your model, training and data loading
├── pyproject.toml      # Project metadata like dependencies and configs
└── README.md
```

### Install dependencies and project

Install the dependencies defined in `pyproject.toml` as well as the `jaxexample` package.

```bash
pip install -e .
```

## Run the project

You can run your Flower project in both _simulation_ and _deployment_ mode without making changes to the code. If you are starting with Flower, we recommend you using the _simulation_ mode as it requires fewer components to be launched manually. By default, `flwr run` will make use of the Simulation Engine.

### Run with the Simulation Engine

&gt; [!NOTE]
&gt; Check the [Simulation Engine documentation](https://flower.ai/docs/framework/how-to-run-simulations.html) to learn more about Flower simulations and how to optimize them.

```bash
flwr run .
```

You can also override some of the settings for your `ClientApp` and `ServerApp` defined in `pyproject.toml`. For example:

```bash
flwr run . --run-config &quot;num-server-rounds=5 batch-size=32&quot;
```

&gt; [!TIP]
&gt; For a more detailed walk-through check our [quickstart JAX tutorial](https://flower.ai/docs/framework/tutorial-quickstart-jax.html)

### Run with the Deployment Engine

Follow this [how-to guide](https://flower.ai/docs/framework/how-to-run-flower-with-deployment-engine.html) to run the same app in this example but with Flower&#x27;s Deployment Engine. After that, you might be intersted in setting up [secure TLS-enabled communications](https://flower.ai/docs/framework/how-to-enable-tls-connections.html) and [SuperNode authentication](https://flower.ai/docs/framework/how-to-authenticate-supernodes.html) in your federation.

If you are already familiar with how the Deployment Engine works, you may want to learn how to run it using Docker. Check out the [Flower with Docker](https://flower.ai/docs/framework/docker/index.html) documentation.

## Multi-Device Deployment 🚀

This project is configured for easy deployment across multiple physical devices over WiFi using Flower&#x27;s SuperLink architecture.

### Quick Start (3 devices: 1 server + 2 clients)

**See [QUICKSTART.md](QUICKSTART.md) for a quick reference guide.**

**See [DEPLOYMENT.md](DEPLOYMENT.md) for detailed instructions.**

### What&#x27;s Included

- `start_server.sh` - Start SuperLink on the server device
- `start_superexec.sh` - Start SuperExec on the server device (2nd terminal)
- `start_client.sh` - Start SuperNode on each client device
- `check_network.sh` - Verify network connectivity before deployment
- `DEPLOYMENT.md` - Complete deployment guide with troubleshooting
- `QUICKSTART.md` - Quick reference for starting all components

### Prerequisites

- All devices on the same WiFi network
- Git repository accessible from all devices
- Python 3.8+ installed on all devices
- Ports 9092, 9093, 9094 open in firewall

### Basic Setup

1. **On all devices**: Clone this repo and install dependencies
   ```bash
   rad clone rad:z3ndBN2sk1FbiY8rpnV7tTvqckmod
   cd quickstart-jax
   pip install -e .
   ```

2. **On server device**: Run in two terminals
   ```bash
   # Terminal 1
   ./start_server.sh
   
   # Terminal 2  
   ./start_superexec.sh
   ```

3. **On each client device**: 
   ```bash
   ./start_client.sh &lt;SERVER_IP&gt; &lt;CLIENT_ID&gt; &lt;TOTAL_CLIENTS&gt;
   
   # Example:
   ./start_client.sh 192.168.1.100 0 2  # Client 1
   ./start_client.sh 192.168.1.100 1 2  # Client 2
   ```

Training starts automatically once all components connect!
</pre>
        </div>
        </div>

</div>
</main>
</div>
</div>


</body>
</html>

