Vertex AI¶
Run models through Google Cloud's Vertex AI platform. Both claude-vertex and gemini-vertex use Application Default Credentials (ADC) — no API keys to manage.
Prerequisites¶
- A Google Cloud project with the Vertex AI API enabled
- Application Default Credentials configured:
IAM Roles
Your account needs the Vertex AI User role (roles/aiplatform.user) on the GCP project.
Environment Variables¶
| Env Var | Required | Default | Description |
|---|---|---|---|
GOOGLE_CLOUD_PROJECT |
Yes | -- | GCP project ID |
GOOGLE_CLOUD_LOCATION |
No | us-central1 (gemini) / global (claude) |
GCP region |
claude-vertex¶
Claude models on Vertex AI via @anthropic-ai/vertex-sdk with the createClient pattern, wrapped by @langchain/anthropic.
Default region is global
Unlike other Vertex AI models, Claude on Vertex defaults to the global region, not us-central1. Set GOOGLE_CLOUD_LOCATION explicitly if you need a specific region.
Model Naming¶
Model names match the Anthropic API format -- no special Vertex-specific naming required.
| API Name | Vertex Name |
|---|---|
claude-opus-4-6 |
claude-opus-4-6 |
claude-sonnet-4-20250514 |
claude-sonnet-4-20250514 |
Setup¶
Usage¶
pnpm run generate -- --provider claude-vertex
# Override region
GOOGLE_CLOUD_LOCATION=us-east5 pnpm run generate -- --provider claude-vertex
gemini-vertex¶
Gemini models on Vertex AI via @langchain/google-vertexai (ChatVertexAI). The GCP project is passed via authOptions.projectId.
Setup¶
Usage¶
pnpm run generate -- --provider gemini-vertex
# Override model and region
pnpm run generate -- --provider gemini-vertex --model gemini-2.5-pro \
GOOGLE_CLOUD_LOCATION=europe-west1
Region Availability¶
Check model availability by region
Not all models are available in all regions. Consult the Vertex AI documentation for current regional availability: