Skip to main content

Context7 On-Premise can call Vertex AI directly for parsing, source-code documentation, reranking, and embeddings. It uses your Google Cloud project and its credentials. On GKE, Workload Identity is enough.

Note

The Google provider in Context7 has two options. Google AI Studio uses a Gemini API key. Google Vertex AI uses a Google Cloud project with Application Default Credentials, as this page describes. Choose Google Vertex AI when your organization does not issue API keys.

Prerequisites#

  • A Google Cloud project with the Vertex AI API (aiplatform.googleapis.com) turned on.
  • An identity for Context7 with the Vertex AI User role (roles/aiplatform.user) on that project.
  • For Claude models: enable each model for the project in Vertex AI Model Garden. Gemini models need no extra step.
  • Network access from the Context7 container to aiplatform.googleapis.com, or to the regional host, such as europe-west4-aiplatform.googleapis.com.

Authenticate#

Context7 uses Google Application Default Credentials. It looks for credentials in this order:

  1. A service account key file named by GOOGLE_APPLICATION_CREDENTIALS.
  2. The local credentials file from gcloud auth application-default login.
  3. The identity of the workload, from the metadata server.

Recommended for production. Context7 gets short-lived tokens from the GKE metadata server, so no key is stored anywhere.

  1. Give a Kubernetes service account the Vertex AI User role. Use Workload Identity Federation for GKE with a principal binding, or an iam.gke.io/gcp-service-account annotation that points to a Google service account with the role.
  2. Run the Context7 pods as that service account. With the Helm chart, set serviceAccountName:

On a Compute Engine VM, the service account attached to the VM works the same way.

Configure Context7#

Configure the LLM

In the setup wizard or Workspace Settings › AI models, select Google, then choose Google Vertex AI. Enter:

FieldValue
Google Cloud projectYour project ID. Optional when the container has GOOGLE_CLOUD_PROJECT or GCLOUD_PROJECT.
LocationOptional. Default global, or GOOGLE_CLOUD_LOCATION when the container has it. Use a region, such as europe-west4, for data residency.
ModelA Gemini or Claude model ID, such as gemini-3.8-flash or claude-sonnet-5-5.

The fields in the dashboard take precedence over GOOGLE_CLOUD_PROJECT, GCLOUD_PROJECT, and GOOGLE_CLOUD_LOCATION.

Configure embeddings

In the setup wizard, select Same as LLM to use Vertex AI embeddings, or select Separate provider, Google, and then Google Vertex AI. The default model is gemini-embedding-001.

The LLM and embedding configurations share one project and location.

Test and verify

Test both connections, save the configuration, and parse a small repository. Query the resulting library to verify that parsing and semantic search both work.

Models#

UseModels
Parsing, reranking, and CodeDocsGemini, such as gemini-3.8-flash (default), gemini-3.7-flash, or gemini-3.5-flash-lite
Parsing, reranking, and CodeDocsClaude, such as claude-sonnet-5-5, claude-haiku-5-5, claude-opus-5-5, or claude-haiku-4-5
Embeddingsgemini-embedding-001 (default), gemini-embedding-2, or text-embedding-005
  • Reranking uses gemini-3.5-flash-lite on Vertex AI unless you set a rerank model.
  • The global location serves the newest Gemini models. A regional location offers a smaller set, so check that it serves the models you pick.
  • gemini-embedding-2 is available only in the global location.
Note

Some organizations restrict partner model features with the constraints/vertexai.allowedPartnerModelFeatures policy. When the policy blocks structured outputs, Context7 asks Claude for JSON as plain text instead. Parsing keeps working, and the server log shows one warning for each model.

Egress proxy#

If the container reaches Google only through an egress proxy, set HTTPS_PROXY. Context7 sends Vertex AI calls through the proxy and always connects directly to the GKE metadata server (169.254.169.254 and metadata.google.internal), so Workload Identity keeps working. See Egress proxy.

Note

An offline Context7 license removes the Context7 Cloud license check, but Vertex AI still requires network access to Google Cloud. Content sent for parsing, embedding, reranking, or source-code documentation is processed by the selected Vertex AI models.

Changing embedding models#

Vertex AI indexes are stored separately from other vector indexes, because their dimensions can differ. After changing the embedding provider or model, refresh the libraries that should be available under the new embedding configuration.