Files
zeekay 9546c92611 Replace placeholders with real working examples
ML examples:
- credit_scoring: Credit risk prediction with HMEQ data
- disease_prediction: Healthcare ML on encrypted records
- cifar: Encrypted image classification
- federated_learning: Distributed FHE training
- hybrid_model: Mixed FHE/plaintext inference

Deployment:
- breast_cancer: Cancer detection API
- sentiment_analysis: Encrypted NLP
- server: FHE inference server

Blockchain:
- hardhat-template: Solidity + FHE
- react-template: Full dApp with FHE
2026-01-25 20:46:26 -08:00

1.7 KiB

Deployment

In this folder we show how to deploy a Torus ML model that classifies images from CIFAR-10, either through Docker or Amazon Web Services. We use the model showcased in CIFAR QAT training from scratch.

Get started

To run this example on AWS you will also need to have the AWS CLI properly setup on your system. To do so please refer to AWS documentation. One can also run this example locally using Docker, or just by running the scripts locally.

Deployment this model on your personal machine is not recommended as running a VGG in FHE is computationally intensive. It is recommended to run this on a m6i.metal instance from AWS.

  1. To compile your model you can use compile.py, or compile_with_docker.py to use Docker. This will compile the model to an FHE circuit and serialize it. This will result in a new folder called ./dev.
  2. Once that's done you can use the script provided in Torus ML in use_case_examples/deployment/server/, use deploy_to_docker.py.
  • python use_case_examples/deployment/server/deploy_to_docker.py
  1. Once that's done you can launch the build_docker_client_image.py script to build a client Docker image.
  2. You can then run the client by using the client.sh script. This will run the container in interactive mode. To interact with the server you can launch the client.py script using URL="<my_url>" python client.py where <my_url> is the content of the url.txt file.

And here it is you deployed a deep-learning model and ran an inference using Fully Homormophic Encryption.