To get you started using Vertex AI, this page guides you through how to create a Google Cloud project and enable the Vertex AI APIs. If you don't have the permissions to perform these tasks, ask an administrator to setup a project and enable Vertex AI for you. Also covered in this page is how to set up the Google Cloud CLI in your local development environment.
Set up a project
Follow these steps to set up a project:
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Vertex AI API.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Vertex AI API.
Set up authentication
- Install the Google Cloud CLI.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
Update and install
gcloud
components:gcloud components update
gcloud components install beta - Install the Google Cloud CLI.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
Update and install
gcloud
components:gcloud components update
gcloud components install beta -
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
- Install the Google Cloud CLI.
-
To initialize the gcloud CLI, run the following command:
gcloud init
-
Update and install
gcloud
components:gcloud components update
gcloud components install beta
Select the tabs for how you plan to access the API:
Console
When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloud
To set up the gcloud CLI to use service account impersonation to authenticate to Google APIs, rather than your user credentials, run the following command:
gcloud config set auth/impersonate_service_account SERVICE_ACCT_EMAIL
For more information, see Service account impersonation.
Client libraries
To use client libraries in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
For more information, see Set up ADC for a local development environment in the Google Cloud authentication documentation.
To set up your local ADC file to use service account impersonation to authenticate to Google APIs, rather than your user credentials, run the following command:
gcloud auth application-default login --impersonate-service-account=SERVICE_ACCT_EMAIL
For more information, see Service account impersonation.
REST
To use the REST API in a local development environment, you use the credentials you provide to the gcloud CLI.
For more information, see Authenticate for using REST in the Google Cloud authentication documentation.
You can use service account impersonation to generate an access token for REST API requests. For more information, see Impersonated service account.
For information about setting up authentication for a production environment, see Set up Application Default Credentials for code running on Google Cloud in the Google Cloud authentication documentation.
Ask an administrator to set up a Vertex AI project for you
This section describes how an administrator grants the roles needed to use Vertex AI.
- Determine a meaningful project name and project ID to identify your project. If you are part of an organization or plan to create multiple projects, consider what naming conventions and folder hierarchies are followed, or could be followed, to make project organization clear.
- Required roles:
- Access to most Vertex AI capabilities is granted by the
Vertex AI
User
(roles/aiplatform.user)
IAM role and should suffice for most Vertex AI users. For full control of Vertex AI resources, you can request the Vertex AI Administrator(roles/aiplatform.admin)
role. To explore the differences between these and other Vertex AI roles, see Vertex AI access control with IAM. - If you also intend to use
Vertex AI Workbench
instances in Google Cloud, ask your administrator to grant you the
Notebooks
Administrator
(roles/notebooks.admin)
IAM role for the project, as well as the Service Account User(roles/iam.serviceAccountUser)
IAM role on either the project or the Compute Engine default service account. - Additionally, to enable the necessary APIs, you either need the
Service
Usage Admin
(roles/serviceusage.serviceUsageAdmin)
IAM role or your administrator needs to enable the APIs for you by following the first few steps.
- Access to most Vertex AI capabilities is granted by the
Vertex AI
User
- Ask your administrator to enable Vertex AI APIs for you.
If you're granted the
Service
Usage Admin
(roles/serviceusage.serviceUsageAdmin)
IAM role, then you'll be able to do this on your own.
What's next
Read an overview of Vertex AI.
Walk through one of the tutorials for using Vertex AI.
Learn how to use the Vertex AI SDK for Python, which provides another way to interact with Vertex AI.