Use an App from Flower Hub¶

Flower Hub is the home for federated applications. It provides a unified experience for discovering, running, and sharing federated apps across both simulation and deployment environments.

Create a New App from Hub¶

First, ensure that flwr is installed on your machine:

pip install flwr

Next, select the app you want to download. For example, to create an app from @flwrlabs/quickstart-pytorch, run:

flwr new @flwrlabs/quickstart-pytorch

This command downloads the application from Flower Hub into your local environment.

Run a Hub App¶

After creating the app, you can run it in either Simulation or Deployment runtime without modifying the source code.

If you are new to Flower, we recommend starting with Simulation Runtime, as it requires fewer components to be launched manually. By default, flwr run uses the Simulation Runtime.

Run with the Simulation Runtime¶

Tip

See the Simulation Runtime documentation to learn more about running simulations, scaling the number of virtual SuperNodes, and configuring CPU/GPU resources for your ClientApp.

First, install the dependencies defined in pyproject.toml:

cd <app_name>
pip install -e .

Then, run the app with the default settings:

flwr run .

This starts the simulation locally using Flower’s built-in Simulation Runtime.

Run with the Deployment Runtime¶

To run the app using Flower’s Deployment Runtime, point the SuperNode to the path where your data is. For prototyping and first-time users, we recommend generating demo data using Flower Datasets.

Next, launch the SuperNode passing as arguments the address of the SuperLink and the path to the data. For example:

flower-supernode \
    --insecure \
    --superlink <SUPERLINK-FLEET-API> \
    --node-config="data-path='/path/to/demo_data/partition_0'"

Tip

For a detailed walkthrough, see the step-by-step guide on using the Deployment Runtime.

Note

In this example, data-path is an application-specific configuration key used by the ClientApp to locate its local dataset. The required --node-config parameters depend on the specific app you are running. Always refer to the app’s README for the exact configuration keys and expected values.

Make sure the environment of each SuperNode has all required dependencies for the app you envision it to run installed.

Finally, launch the run using flwr run, pointing to the appropriate SuperLink connection:

flwr run . <SUPERLINK-CONNECTION> --stream

Tip

Afterward, consider enabling secure TLS connections and configuring SuperNode authentication for production deployments.

Tip

Learn more about SuperLink connections and how to configure them in the Flower Configuration documentation.

Run a Hub App Without Creating It Locally¶

In the Deployment Runtime, you can run an app directly from Flower Hub without first creating it locally. Note this assumes SuperNodes are already connected to the SuperLink:

flwr run @<account_name>/<app_name> --stream

In this case, the SuperLink downloads the app from Flower Hub and distributes the FAB file to each SuperNode for execution.