REST API
The TAO Toolkit API exposes dataset and model endpoints for setting up and running actions.
User authentication is based on NGC API KEY.
Within the cluster, one can use the following command to know the node-port for the ingress controller. The node port would be the number after the 443 cluster port 443:<NodePort>
.
kubectl get services ingress-nginx-controller
the IP address would be the external IP of one of the cluster nodes.
..code:
hostname -i
A curl command to do user authentication would look like the following, where 172.17.169.89 is one of the node’s external IP, 30108 is the NodePort for the ingress controller and the NGC API KEY is zZYtczM5amdtdDcwNjk0cnA2bGU2bXQ3bnQ6NmQ4NjNhMDItMTdmZS00Y2QxLWI2ZjktNmE5M2YxZTc0OGyM. This will return the user ID and token.
curl https://172.17.169.89:30108/api/v1/login/zZYtczM5amdtdDcwNjk0cnA2bGU2bXQ3bnQ6NmQ4NjNhMDItMTdmZS00Y2QxLWI2ZjktNmE5M2YxZTc0OGyM
The following is a curl example of an API call with user authentication.
curl https://172.17.169.89:30108/api/v1/user/6eba330c-1019-4644-82cc-80eb5273b867/model \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dnZWRJbkFzIjoiYWRtaW4iLCJpYXQiOjE0MjI3Nzk2Mz"
The TAO Toolkit API service includes methods for dealing with the content of experimental workspaces, such as user datasets and models. It also includes methods for executing TAO actions applicable to data and specifications stored in such experimental workspaces.
A basic scenario would be for a user to first create a Dataset for a specific network type, create a Model experiment that is pointing to the dataset and a pretrained model, and customize specs before executing network-related actions.
/api/v1/dataset |
/api/v1/model |
---|---|
* List datasets for user |
* List models for user |
See the TAO Toolkit API Reference for more details.
The tutorial notebooks provide examples that demonstrate the various workflows.
Download the resource using the NGC CLI.
ngc registry resource download-version "nvidia/tao/tao-getting-started:4.0.0"
Find tutorial notebooks (
.ipynb
files).cd tao-getting-started_v4.0.0/notebooks/tao_api_starter_kit/api
Serve these Notebook examples using Jupyter.
pip3 install jupyter notebook jupyter notebook --ip 0.0.0.0