This example demonstrates how you can deploy a function that performs secure sentiment analysis using a TensorFlow Lite model. By using Cape, the model is protected because it can only be accessed within a secure enclave. The input data is also protected because it is encrypted prior to being uploaded, and is sent over TLS into the Cape enclave.
Clone the capeprivacy/functions public repository:
git clone firstname.lastname@example.org:capeprivacy/functions.git
Navigate into the folder containing the code for the sentiment analysis function:
Install the required dependencies into a target folder (named
deploy in our example):
docker run -v `pwd`:/build -w /build --rm -it python:3.9-slim-bullseye pip install -r requirements.txt --target ./deploy/
sudo may be required when running this command.
Log in to Cape using:
Your CLI confirmation code is: <SOME_CODE>
Visit this URL to complete the login process: https://login.capeprivacy.com/activate?user_code=<SOME_CODE>
Congratulations, you're all set!
Deploy your function to Cape using:
cape deploy ./deploy
Deploying function to Cape ...
Success! Deployed function to Cape
Function ID ➜ QF7NRfns5o4qWC9sjxhfB5
Checksum ➜ eb989a5ef2fabf377a11ad5464b81b67757fada90a268c8c6d8f2d95013c4681
Invoke your function using:
cape run QF7NRfns5o4qWC9sjxhfB5 "This was a great film"
Feel free to try with other phrases:
cape run QF7NRfns5o4qWC9sjxhfB5 "This was a terrible film"