End to end tutorial

In this example, we are showcasing how to use the SDK to create an end-to-end pipeline. We'll train a model, watch the state transitions, stream the logs, inspect it's accuracy, and then deploy it as a RESTful API endpoint behind a multi-instance, load-balanced GPU cluster.

The SDK is bundled with the Gradient CLI. You'll need the latest version which you can download by adding --pre when installing (or upgrading) the CLI.

Getting Started

#Import the SDK Client from the gradient package
from gradient import sdk_client, ProjectsClient
#create a API Key
api_key = "API_KEY_HERE"
deployment_client = sdk_client.DeploymentsClient(api_key)
models_client = sdk_client.ModelsClient(api_key)
jobs_client = sdk_client.JobsClient(api_key)
projects_client = ProjectsClient(api_key)
experiment_client = sdk_client.ExperimentsClient(api_key)

#or access them all from a single client
#client = sdk_client.SdkClient(api_key)

Create project

Parameters of the experiment

Create an experiment & view its state

Start experiment

Watching the state transitions of an experiment

Create a log stream & print all logs for the duration of experiment

Get model created by experiment

View Model Accuracy

Create a deployment from the model

Last updated