Vertex AI lets you build, train, and deploy machine learning models
and AI applications in Google Distributed Cloud (GDC) Sandbox. This document provides
an overview of the CPU-based and GPU-based usage models for running AI
workloads, followed by instructions for setting up Vertex AI API
access and authentication.

## Usage models for Vertex AI in GDC Sandbox

Vertex AI is a machine learning (ML) platform that lets you train and
deploy ML models and AI applications. You can use API on GDC Sandbox
in two different ways:

1. CPU-based: run your workload in your GDC Sandbox user cluster, without using GPUs. This option is slower due to running only on CPUs.
2. GPU-based: take advantage of the GPU support included in the GDC Sandbox AI Optimized SKU, by configuring the workload to use the GPUs associated with the `sandbox-gpu-project` project. This project is only present in GDC Sandbox instances provisioned with the GDC Sandbox AI Optimized SKU.

[Deploy GPU container workloads](https://docs.cloud.google.com/distributed-cloud/sandbox/latest/services/gpu) describes how
to configure a workload to use GPUs.

## Set up to use Vertex AI

The use of Vertex AI on GDC Sandbox is not the same as
Google Distributed Cloud (GDC) air-gapped. Rather than using the specialized
Vertex AI APIs that are part of the Google Distributed Cloud air-gapped
platform, you use the regular Google Cloud version of this API.
You need a Google Cloud billing account to use this API.

1. Visit the [Vertex AI environment setup page](https://docs.cloud.google.com/vertex-ai/docs/start/cloud-environment) and:
   1. Create or identify a Google Cloud project,
   2. Make sure that billing is enabled for your project, and
   3. Enable the Vertex AI API.
2. Authenticate to Vertex AI API. Authentication for APIs can be achieved through various methods tailored to specific requirements - see [Authentication methods at Google](https://docs.cloud.google.com/docs/authentication).
   - To authenticate to Vertex AI API using an API key, generate an [API key](https://docs.cloud.google.com/docs/authentication/api-keys).
   - To authenticate to Vertex AI API using a service account, create a service account key json file by following the instructions at [Create a service account key](https://docs.cloud.google.com/iam/docs/keys-create-delete#creating).

After this, you can install the Vertex AI client library for the
language you plan to use. Libraries are [available](https://docs.cloud.google.com/vertex-ai/docs/start/client-libraries#client_libraries) for many languages, including Python, Java,
and Go. The example applications on the following pages include
instructions for installing the appropriate library.