Quick answer

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
Authenticate with Google Cloud, set GOOGLE_CLOUD_PROJECT and the region, then select the Vertex provider and an available model.
Best for
Teams operating model access and identity through Google Cloud.

Know before you start: Model availability, quotas, endpoints, and data residency depend on the project and selected Google Cloud region.

Overview

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

  • Access to Gemini 1.5 Pro, Gemini 1.5 Flash, and Gemini 2.0
  • Open-source models like Llama 3.1 and Mistral through Model Garden
  • Up to 2 million token context window with Gemini
  • Enterprise security with Google Cloud IAM
  • Regional endpoints for data residency
  • Integration with existing GCP infrastructure

Long context: Gemini 1.5 Pro offers a 2 million token context window, making it ideal for analyzing large codebases or documentation.

Setup

Get started with GCP Vertex AI.

Prerequisites

  • Google Cloud project with Vertex AI API enabled
  • Service account with Vertex AI User role
  • gcloud CLI installed and configured

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

# Option 1: Application Default Credentials (recommended for development)
gcloud auth application-default login

# Option 2: Service account key
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"

Configure Autohand

# Set environment variables
export GOOGLE_CLOUD_PROJECT="your-project-id"
export GOOGLE_CLOUD_REGION="us-central1"

# Or configure via CLI
autohand config set vertex.project "your-project-id"
autohand config set vertex.region "us-central1"

Verify your configuration:

# Start with Vertex AI provider
autohand --provider vertex --model gemini-1.5-pro

# Test with a prompt
autohand --prompt "Hello, which model are you?"

CLI configuration

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

{
  "provider": "vertex",
  "vertex": {
    "project": "${GOOGLE_CLOUD_PROJECT}",
    "region": "us-central1",
    "model": "gemini-1.5-pro",
    "maxTokens": 8192,
    "temperature": 0.7
  }
}

Configuration options

OptionDescriptionDefault
projectGoogle Cloud project ID-
regionGCP region for Vertex AIus-central1
modelModel to usegemini-1.5-pro
maxTokensMaximum response tokens8192
temperatureResponse randomness0.7
credentialsPath to service account JSONADC

Available models

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

Gemini models

ModelContextBest for
gemini-2.0-flash1MFastest, multimodal
gemini-1.5-pro2MLong context, complex tasks
gemini-1.5-flash1MFast and cost-effective

Model Garden (open-source)

ModelContextBest for
llama-3.1-70b128KOpen-source, flexible
mistral-large128KEfficient reasoning
codellama-34b16KCode generation

Switch models

# Set default model
autohand config set model "gemini-1.5-pro"

# Use during a session
/model vertex/gemini-2.0-flash

Best practices

  • Use ADC in development: Application Default Credentials are easier to manage locally.
  • Use service accounts in production: Create dedicated service accounts with minimal permissions.
  • 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 Gemini 1.5 Pro for large context: Ideal for analyzing entire codebases.

Recommended configuration

{
  "vertex": {
    "model": "gemini-1.5-pro",
    "temperature": 0.3,
    "maxTokens": 8192
  }
}

Resources

Troubleshooting

Common issues

IssueSolution
Permission deniedGrant Vertex AI User role to service account
API not enabledRun gcloud services enable aiplatform.googleapis.com
Region not supportedUse a supported region like us-central1
Quota exceededRequest quota increase in GCP Console

Debug mode

# Enable verbose logging
AUTOHAND_DEBUG=true autohand --provider vertex

# Test authentication
gcloud auth application-default print-access-token

Common questions

GCP Vertex AI integration FAQ

How do I configure the Autohand GCP Vertex AI integration?

Authenticate with Google Cloud, set GOOGLE_CLOUD_PROJECT and the region, then select the Vertex provider and an available model.

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.