Skip to content

Commit

Permalink
Feature/SK-974 | Add example notebook for tuning of server side hyper…
Browse files Browse the repository at this point in the history
…parameters (#697)
  • Loading branch information
benjaminastrand authored Sep 12, 2024
1 parent bcc02f1 commit 3883fc1
Show file tree
Hide file tree
Showing 2 changed files with 1,295 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/apiclient.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FEDn comes with an *APIClient* - a Python3 library that can be used to interact
In this tutorial we show how to use the APIClient to initialize the server-side with the compute package and seed models,
run and control training sessions, use different aggregators, and to retrieve models and metrics.

We assume a basic understanding of the FEDn framework, i.e. that the user have taken the Getting Started tutorial: :ref:`quickstart-label`
We assume a basic understanding of the FEDn framework, i.e. that the user has taken the :ref:`quickstart-label` tutorial.

**Installation**

Expand All @@ -20,7 +20,10 @@ The APIClient is available as a Python package on PyPI, and can be installed usi
**Initialize the APIClient to a FEDn Studio project**

The FEDn REST API is available at <controller-host>/api/v1/. To access this API you need the url to the controller-host, as well as an admin API token. The controller host can be found in the project dashboard (top right corner).
To obtain an admin API token, navigate to the "Settings" tab in your Studio project and click on the "Generate token" button. Copy the 'access' token and use it to access the API using the instructions below.
To obtain an admin API token,

#. Navigate to the "Settings" tab in your Studio project and click on the "Generate token" button.
#. Copy the 'access' token and use it to access the API using the instructions below.

.. code-block:: python
Expand All @@ -30,6 +33,7 @@ To obtain an admin API token, navigate to the "Settings" tab in your Studio proj
Alternatively, the access token can be sourced from an environment variable.

.. code-block:: bash
$ export FEDN_AUTH_TOKEN=<access-token>
Then passing a token as an argument is not required.
Expand All @@ -45,8 +49,6 @@ To set the active compute package in the FEDn Studio Project:

.. code:: python
>>> from fedn import APIClient
>>> client = APIClient(host="<controller-host>", token="<access-token>", secure=True, verify=True)
>>> client.set_active_package("package.tgz", helper="numpyhelper")
>>> client.set_active_model("seed.npz")
Expand Down
Loading

0 comments on commit 3883fc1

Please sign in to comment.