> ## Documentation Index
> Fetch the complete documentation index at: https://context7.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Vertex AI

> Use Gemini and Claude models and Gemini embeddings through Google Cloud Vertex AI

Context7 On-Premise can use Vertex AI for parsing, source-code documentation, reranking, and embeddings. It signs in with the Google Cloud identity of its deployment, so you store no API key.

> [!NOTE]
>
> The **Google** provider has two options. **Google AI Studio** uses a Gemini API key. **Google Vertex AI** uses a Google Cloud project, as this page describes.

## Prerequisites

* A Google Cloud project with the Vertex AI API (`aiplatform.googleapis.com`) turned on.
* For Claude models, each model enabled for the project in [Vertex AI Model Garden](https://console.cloud.google.com/vertex-ai/model-garden). Gemini models need no extra step.
* Network access from Context7 to `aiplatform.googleapis.com`, or to a regional host such as `europe-west4-aiplatform.googleapis.com`.

## Set up the identity

You set up the identity where Context7 runs, not in the Context7 dashboard. Give it the **Vertex AI User** role (`roles/aiplatform.user`) on the project.

> [tab] GKE
>
> Use Workload Identity. Context7 gets short-lived tokens from GKE, so no key is stored anywhere. Autopilot clusters have Workload Identity on. On a Standard cluster, [turn it on](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) first.
>
> 1. Create a Kubernetes service account in the Context7 namespace:
>
>    ```bash theme={null}
>    kubectl create serviceaccount context7 --namespace context7
>    ```
>
> 2. Give it the Vertex AI User role. Replace `PROJECT_ID` and `PROJECT_NUMBER`:
>
>    ```bash theme={null}
>    gcloud projects add-iam-policy-binding PROJECT_ID \
>      --role=roles/aiplatform.user \
>      --member=principal://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/PROJECT_ID.svc.id.goog/subject/ns/context7/sa/context7
>    ```
>
> 3. Run the Context7 pods as that service account.
>
>    With the [Helm chart](https://context7.com/docs/enterprise/deployment/helm.md), add this value to the command you install or upgrade with:
>
>    ```bash theme={null}
>    --set serviceAccountName=context7
>    ```
>
>    With your own manifests, set it in the pod spec of the Deployment or StatefulSet:
>
>    ```yaml theme={null}
>    spec:
>      template:
>        spec:
>          serviceAccountName: context7
>    ```

> [tab] Compute Engine VM
>
> Attach a service account to the VM and give it the Vertex AI User role. Context7 uses it with no extra setting, also when it runs in Docker on the VM.

> [tab] Service account key
>
> Use a key file when Context7 runs outside Google Cloud. Mount the file and set `GOOGLE_APPLICATION_CREDENTIALS` to its path:
>
> ```yaml theme={null}
> environment:
>   GOOGLE_APPLICATION_CREDENTIALS: /secrets/vertex-sa.json
> volumes:
>   - ./vertex-sa.json:/secrets/vertex-sa.json:ro
> ```
>
> The user that runs the container must be able to read the file.

> [tab] Local testing
>
> Run `gcloud auth application-default login`, then mount the credentials file. The image sets `HOME=/data/home`:
>
> ```yaml theme={null}
> volumes:
>   - ~/.config/gcloud/application_default_credentials.json:/data/home/.config/gcloud/application_default_credentials.json:ro
> ```
>
> Use this only for testing. The file holds your personal Google credentials.

## Configure Context7

**1. Choose Google Vertex AI**

In the setup wizard, select **Google**, then **Google Vertex AI**, and enter:

| Field | Value |
| - | - |
| Google Cloud project | Your project ID. You can leave it empty when the container sets `GOOGLE_CLOUD_PROJECT` or `GCLOUD_PROJECT`. |
| Location | Optional. Default `global`, or `GOOGLE_CLOUD_LOCATION` when the container sets it. Use a region, such as `europe-west4`, for data residency. |
| Model | A Gemini or Claude model, such as `gemini-3.8-flash` or `claude-sonnet-5-5`. |

Values in the dashboard take precedence over these variables.

![The Google provider with Google Vertex AI selected, a Google Cloud project, the global location, and gemini-3.8-flash](https://mintcdn.com/context7/pDmHneZdlqyQu-NU/images/enterprise/integrations/vertex-ai-provider.png?fit=max\&auto=format\&n=pDmHneZdlqyQu-NU\&q=85\&s=3bd15436858a90149f90c7e9f4e70d46)

**2. Choose the embeddings**

Select **Same as LLM** to use Vertex AI embeddings with `gemini-embedding-001`.

![Same as LLM selected for embeddings, with gemini-embedding-001 from the Google Vertex AI project](https://mintcdn.com/context7/pDmHneZdlqyQu-NU/images/enterprise/integrations/vertex-ai-embeddings.png?fit=max\&auto=format\&n=pDmHneZdlqyQu-NU\&q=85\&s=5696acad9d3fcb14fe029379c4c6636c)

**3. Test**

Select **Test connection** on each step, finish the wizard, and parse a small repository. Then query it to check that search works.

## Change the settings

Open **Workspace Settings** in the top bar and select **AI models** under **Indexing**. Change the project, location, or model in the **Language model** card, select **Test connection**, then **Save and apply**.

![Workspace Settings, AI models: the Language model card with Google Vertex AI, a Google Cloud project, the global location, and gemini-3.8-flash](https://mintcdn.com/context7/pDmHneZdlqyQu-NU/images/enterprise/integrations/vertex-ai-settings.png?fit=max\&auto=format\&n=pDmHneZdlqyQu-NU\&q=85\&s=38ce323d8b7144848b373503da0e0817)

To change the embedding model, run the setup wizard again. Vectors from different embedding models cannot be searched together, so refresh your libraries afterwards to rebuild their vectors. Until a library is refreshed, it may not appear in search.

## Models

| Use | Models |
| - | - |
| Parsing, reranking, and CodeDocs | Gemini: `gemini-3.8-flash` (default), `gemini-3.7-flash`, `gemini-3.5-flash-lite` |
| Parsing, reranking, and CodeDocs | Claude: `claude-sonnet-5-5`, `claude-haiku-5-5`, `claude-opus-5-5`, `claude-haiku-4-5` |
| Embeddings | `gemini-embedding-001` (default), `gemini-embedding-2`, `text-embedding-005` |

* Reranking uses `gemini-3.5-flash-lite` unless you set a rerank model.
* The `global` location has the newest models. Regional locations have fewer, so check that yours serves the model you pick.
* `gemini-embedding-2` is available only in `global`.

> [!NOTE]
>
> If your organization blocks structured outputs for partner models (`constraints/vertexai.allowedPartnerModelFeatures`), Context7 asks Claude for plain-text JSON instead. Parsing keeps working, and the log shows one warning for each model.

## Egress proxy

If Context7 reaches Google only through a proxy, set `HTTPS_PROXY`. Context7 still connects directly to the GKE metadata server, so Workload Identity keeps working. See [Egress proxy](https://context7.com/docs/enterprise/deployment/docker.md#egress-proxy).

> [!NOTE]
>
> An offline Context7 license still needs network access to Google Cloud for Vertex AI. The selected Vertex AI models process the content that Context7 parses, embeds, and reranks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.