Set up a project and a development environment

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:

  1. 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.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  3. Make sure that billing is enabled for your Google Cloud project.

  4. Enable the Vertex AI API.

    Enable the API

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Go to project selector

  6. Make sure that billing is enabled for your Google Cloud project.

  7. Enable the Vertex AI API.

    Enable the API

Set up authentication

    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

  1. Install the Google Cloud CLI.
  2. To initialize the gcloud CLI, run the following command:

    gcloud init
  3. Update and install gcloud components:

    gcloud components update
    gcloud components install beta
  4. 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.

    1. Install the Google Cloud CLI.
    2. To initialize the gcloud CLI, run the following command:

      gcloud init
    3. Update and install gcloud components:

      gcloud components update
      gcloud components install beta
    4. 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.

    For more information, see Set up authentication 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.

    1. Install the Google Cloud CLI.
    2. To initialize the gcloud CLI, run the following command:

      gcloud init
    3. Update and install gcloud components:

      gcloud components update
      gcloud components install beta

    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.

  1. 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.
  2. Required roles:
    1. 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.
    2. 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.
    3. 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.
  3. 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