Skip to main content

AI4OS extensions to the Python Flower federated learning framework (https://flower.dev)

Project description

logo

ai4-flwr

Conventional Commits GitHub license GitHub release PyPI Python versions

This repository contains the AI4OS extensions for the Flower framework.

Authentication

Authentication for Flower is implemented directly via GRPC: interceptors (server side) and authentication medatata plugins (client side).

In order to use it, the server must be initialized with any object of the ai4flwr.auth package as interceptor. See the examples below for more details.

Bearer token authentication

In your server, start it as follows:

import ai4flwr.auth.bearer

fl.server.start_server(
    server_address="0.0.0.0:5000",
    certificates=(...),
    interceptors=[ai4flwr.auth.bearer.BearerTokenInterceptor()]
)

In your client, start it as follows:

import ai4flwr.auth.bearer

token = "Your token as configured in the server"

fl.client.start_numpy_client(
    server_address=f"localhost:5000",
    client=...,
    root_certificates=...
    call_credentials=grpc.metadata_call_credentials(
        ai4flwr.auth.bearer.BearerTokenAuthPlugin(token)
    ),
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai4flwr-0.2.0.tar.gz (15.4 kB view hashes)

Uploaded Source

Built Distribution

ai4flwr-0.2.0-py3-none-any.whl (16.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page