Skip to content
Esc
↑↓navigate↵open⌘Jpreview
Start
On this page

GCP Vertex AI

Access Google's Gemini models and open-source models through Vertex AI. Enterprise-grade infrastructure with Google Cloud security and compliance.

What is the Autohand GCP Vertex AI integration?

The Autohand GCP Vertex AI integration sends coding-agent requests through a Google Cloud project and region. It uses Google Cloud authentication and a Vertex AI model that is available to the configured project.

Status Available
Requires A Google Cloud project with Vertex AI enabled, supported credentials, a region, and model access.
Configure with Add a vertexai block to the Autohand config with projectId, region (default global), authToken and model, and set provider to vertexai.
Best for Teams operating model access and identity through Google Cloud.

Overview

Google Cloud Vertex AI provides enterprise access to AI models with Google Cloud infrastructure. When integrated with Autohand, you get:

  • Access to Gemini models such as google/gemini-3.1-pro and google/gemini-3.1-flash
  • Partner and open models from Model Garden, such as Claude and GLM
  • Enterprise security with Google Cloud IAM
  • Regional endpoints for data residency
  • Integration with existing GCP infrastructure

Setup

Get started with GCP Vertex AI.

Prerequisites

  • Google Cloud project with Vertex AI API enabled
  • A user or service account with the Vertex AI User role
  • gcloud CLI installed and signed in

Enable Vertex AI

# Enable the Vertex AI API
gcloud services enable aiplatform.googleapis.com

# Set your project
gcloud config set project YOUR_PROJECT_ID

Configure authentication

# Sign in as a user
gcloud auth login

# Or activate a service account
gcloud auth activate-service-account --key-file=/path/to/service-account.json

# Print an access token for the authToken setting
gcloud auth print-access-token

Autohand authenticates with the bearer token in vertexai.authToken. It does not read Application Default Credentials or GOOGLE_APPLICATION_CREDENTIALS. When the token is a gcloud token (it starts with ya29.), Autohand refreshes it by running gcloud auth print-access-token, caching the result for 25 minutes and retrying once after an authentication error, so keep gcloud on your PATH. Other tokens are used as written and stop working when they expire.

Configure Autohand

# Guided setup: choose Vertex AI, then enter the token, project ID and region
autohand --setup

Or edit the config file directly (see CLI configuration). Autohand does not read GOOGLE_CLOUD_PROJECT or a region environment variable.

Verify your configuration:

autohand --prompt "Hello, which model are you?"

CLI configuration

Configure Vertex AI in your ~/.autohand/config.json:

{
  "provider": "vertexai",
  "vertexai": {
    "projectId": "your-project-id",
    "region": "global",
    "authToken": "ya29.your-gcloud-access-token",
    "model": "google/gemini-3.1-pro"
  }
}

Write values literally; Autohand does not expand ${VAR} placeholders. projectId, authToken and model are required. Autohand calls the Vertex AI OpenAI-compatible endpoint at https://{endpoint}/v1/projects/{projectId}/locations/{region}/endpoints/openapi.

Configuration options

Option Description Default
projectId Google Cloud project ID -
region Vertex AI location, such as global or us-central1 global
authToken Google Cloud access token from gcloud auth print-access-token -
model Model ID in publisher/model form anthropic/claude-opus-4-7 in the bundled catalog
endpoint Vertex AI API host aiplatform.googleapis.com

Available models

Vertex AI offers Google’s Gemini models and open-source alternatives.

Gemini models

Model Context Best for
google/gemini-3.1-pro See Vertex AI Long context, complex tasks
google/gemini-3.1-flash See Vertex AI Fast and cost-effective

Model Garden (partner and open models)

Model Context Best for
anthropic/claude-opus-4-7 See Vertex AI Autohand’s default Vertex AI model
zai-org/glm-5-maas See Vertex AI Open model served by Vertex AI

Switch models

# Set the default Vertex AI model
autohand config set vertexai.model "google/gemini-3.1-flash"

# During a session, open the model picker (it takes no arguments)
/model

Best practices

  • Use gcloud tokens: a ya29. token from gcloud auth print-access-token is refreshed automatically while gcloud is installed.
  • Use service accounts in production: Create dedicated service accounts with minimal permissions and activate them in gcloud.
  • Choose the right region: Deploy in regions close to your users for lower latency.
  • Monitor costs: Use Google Cloud Billing to track AI spending.
  • Use a Gemini Pro model for large context: Check the model’s context window in Vertex AI before analyzing large codebases.
{
  "provider": "vertexai",
  "vertexai": {
    "projectId": "your-project-id",
    "region": "global",
    "authToken": "ya29.your-gcloud-access-token",
    "model": "google/gemini-3.1-pro"
  }
}

Resources

Troubleshooting

Common issues

Issue Solution
Permission denied Grant Vertex AI User role to service account
API not enabled Run gcloud services enable aiplatform.googleapis.com
Region not supported Use global or a region where the model is available, such as us-central1
Authentication failed Refresh vertexai.authToken with gcloud auth print-access-token
Quota exceeded Request quota increase in GCP Console

Debug mode

# Enable verbose logging
AUTOHAND_DEBUG=true AUTOHAND_PROVIDER=vertexai autohand

# Test authentication
gcloud auth print-access-token
How do I configure the Autohand GCP Vertex AI integration?

Add a vertexai block to the Autohand config with projectId, region (default global), authToken and model, and set provider to vertexai.

What does the Autohand GCP Vertex AI integration require?

A Google Cloud project with Vertex AI enabled, supported credentials, a region, and model access.

What limitations should I know about?

Model availability, quotas, endpoints, and data residency depend on the project and selected Google Cloud region.

Last updated on

Was this helpful?

Send Feedback

Help us improve this documentation page. Your feedback is valuable.

We'll only contact you if we need clarification