> ## Documentation index
> Fetch the complete documentation index at: https://upstash-context7-git-ctx7-4280-helm-registry-login-c44ca5.docs7.io/llms.txt
> Ask it with GET https://upstash-context7-git-ctx7-4280-helm-registry-login-c44ca5.docs7.io/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.
> Feature requests: https://upstash-context7-git-ctx7-4280-helm-registry-login-c44ca5.docs7.io/resources/feature-requests.md lists what users asked for and how to vote for a request or add one.
> Page rating: `GET https://upstash-context7-git-ctx7-4280-helm-registry-login-c44ca5.docs7.io/feedback?path=/enterprise/integrations/google-vertex-ai&helpful={true|false}&comment={comment}` records whether this page helped. The `comment` (URL-encoded, at most 500 characters) says what helped, or what was missing or wrong; a `helpful=false` rating needs it. It is anonymous and needs no key. Comments hold no code, secrets or personal data.

# 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.
</Note>

## 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.

<Tabs>
  <Tab title="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
       kubectl create serviceaccount context7 --namespace context7
       ```

    2. Give it the Vertex AI User role. Replace `PROJECT_ID` and `PROJECT_NUMBER`:

       ```bash
       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](/enterprise/deployment/helm), add this value to the command you install or upgrade with:

       ```bash
       --set serviceAccountName=context7
       ```

       With your own manifests, set it in the pod spec of the Deployment or StatefulSet:

       ```yaml
       spec:
         template:
           spec:
             serviceAccountName: context7
       ```
  </Tab>
  <Tab title="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>
  <Tab title="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
    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>
  <Tab title="Local testing">
    Run `gcloud auth application-default login`, then mount the credentials file. The image sets `HOME=/data/home`:

    ```yaml
    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.
  </Tab>
</Tabs>

## Configure Context7

<Steps>
  <Step title="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.

    <Frame>
      <img src="/images/enterprise/integrations/vertex-ai-provider.png" alt="The Google provider with Google Vertex AI selected, a Google Cloud project, the global location, and gemini-3.8-flash" />
    </Frame>
  </Step>
  <Step title="Choose the embeddings">
    Select **Same as LLM** to use Vertex AI embeddings with `gemini-embedding-001`.

    <Frame>
      <img src="/images/enterprise/integrations/vertex-ai-embeddings.png" alt="Same as LLM selected for embeddings, with gemini-embedding-001 from the Google Vertex AI project" />
    </Frame>
  </Step>
  <Step title="Test">
    Select **Test connection** on each step, finish the wizard, and parse a small repository. Then query it to check that search works.
  </Step>
</Steps>

## 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**.

<Frame>
  <img src="/images/enterprise/integrations/vertex-ai-settings.png" alt="Workspace Settings, AI models: the Language model card with Google Vertex AI, a Google Cloud project, the global location, and gemini-3.8-flash" />
</Frame>

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.
</Note>

## 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](/enterprise/deployment/docker#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.
</Note>
