Skip to content

Custom models🔗

After exploring the platform's capabilities using the models pre-defined by Apheris, you have the option to add your own models. This requires the creation of a custom federated model and its integration into the Apheris infrastructure, which allows you to update your model at any time.

If you would like to build your own custom model please contact Apheris via your personal representative or support@apheris.com who can provide the necessary credentials and more details on this process.

The development path🔗

There are three main paths to develop federated models to the Apheris platform:

  • porting an existing model to use a federation framework
  • creating a federated model from scratch
  • wrap an existing docker image with our automated "black box" wrapping pipeline.

Currently the main federation framework we support is NVFlare. This list provides a starting point for using NVFlare with Apheris.

The black box pipeline allows you to integrate most docker images into Apheris, without modifying the code on your end. This integration is currently performed by Apheris as a service. You will need to provide a docker image and an example script to launch a computation inside of it.

Model sharing🔗

All models in the Apheris platform run as containers. Once you have developed a federated model that you want to share, you will need to containerize it. The container image needs to be uploaded to a container image repository, which Apheris will create and provide you access to.

To upload your federated model image, you will get the following values from Apheris:

  • the repository_name;
  • associated credentials your_quay_username and your_quay_password.

To login to the registry please use the following command and provide the password your_quay_password when prompted

docker login -u <your_quay_username> quay.io

To tag your image (in other words assign a version to your model) with quay_tag use the following docker command

docker tag <local_image_name>:<local_tag> quay.io/apheris/<repository_name>:<remote_tag>

An example command to push your image to the repository repository_name

docker push quay.io/apheris/<repository_name>:<remote_tag>

Please register the following information while pushing the image to the repository:

  • the name of the repository repository_name where the image has been pushed
  • the tag remote_tag you assign to your image (also known as a model version)
  • the digest of your image that you can see while performing the push command (last line of the command output)
    <remote_tag>: digest: <digest> size: <size>
    

Model activation🔗

Please communicate the information specified in the previous section (repository_name, quay_tag, and digest) to your Apheris representative. As soon as Apheris adds the model to the Model Registry the new version of the model will then appear on the platform and can be treated like any other model.

Adding a new version to an existing model🔗

To add a new version to an existing model you need to have the model manager role. As an owner of an organization you can add the model manager role during the user creation or update it later.
Read more about user management.

Once the user has this role, updating the the model version can be achieved via the Apheris CLI models add-version CLI command.

Apheris Governance Portal user management
To update a custom model, a user needs to have the model manager role. It can be set in the Governance Portal by owner users.

You can use the models list-versions CLI command to list all versions of a given model that are available in your Model Registry.

Running the model🔗

To run the model, a data custodian must have selected this particular model in the permissions section when setting the asset policy.