Deployments Client

Importing

1
from gradient import DeploymentsClient
2
api_key='YOUR_API_KEY'
3
4
deployment_client = DeploymentsClient(api_key)
Copied!

Select model to deploy

Get a model to deploy by either selecting experiment output or filtering based on some criteria from a project
1
model = models_client.list(experiment_id = experiment_id)[0]
Copied!

Deployment parameters

1
deployment_param = {
2
"deployment_type" : "Tensorflow Serving on K8s",
3
"image_url": "tensorflow/serving:latest-gpu",
4
"name": "sdk_tutorial",
5
"machine_type": "K80",
6
"instance_count": 2,
7
"model_id" : model.id
8
}
Copied!

Create the deployment

1
deployment_id = deployment_client.create(**deploy_param)
Copied!

Start the deployment

1
deployment_client.start(deployment_id)
Copied!

Stop a deployment

1
deployment_client.stop(deployment_id)
Copied!

Last modified 2yr ago