Google Vertex AI Gemini
Vertex AI is Google Cloud's fully-managed AI development platform that provides access to Google's large generative models, including the older generation (PaLM2) and the newer generation (Gemini).
To utilize Vertex AI, one must first create a Google Cloud Platform account.
Get started
Create Google Cloud Account
If you're new to Google Cloud, you can create a new account by clicking on the [create an account] button located under Get set up on Google Cloud dropdown menu on the following page:
Create a project within your Google Cloud Platform account.
Within your Google Cloud Account create a new project and enable the Vertex AI APIs by following the steps outlined below:
Note your PROJECT_ID as it will be required for future API calls.
Select the Google Cloud authentication strategy
There are several ways on how your application authenticates to Google Cloud services and APIs. For example, you can create a service account and set up environment variable GOOGLE_APPLICATION_CREDENTIALS to the path of the JSON file that contains your credentials.
You can discover all the authentication strategies here. But for simplicity of local testing we will be using authentication via gcloud utility.
Install Google Cloud CLI (Optional)
To access your cloud projects locally, you can install gcloud tool by following the installation instructions. For GNU/Linux operating systems, the installation steps are as follows:
- Download SDK:
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-467.0.0-linux-x86_64.tar.gz
- Extract an archive:
tar -xf google-cloud-cli-467.0.0-linux-x86_64.tar.gz
- Run an installation script:
cd google-cloud-sdk/
./install.sh
- Run the following command to set up a default project and authentication credentials:
gcloud auth application-default login
This authentication method is compatible with both the vertex-ai (Embedding models, PaLM2) and vertex-ai-gemini (Gemini) packages.