From model-bridge
Set up Google Cloud and Vertex AI for using Imagen and other Google AI models.
How this skill is triggered — by the user, by Claude, or both
Slash command
/model-bridge:vertex-setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Set up Google Cloud and Vertex AI for using Imagen and other Google AI models.
Set up Google Cloud and Vertex AI for using Imagen and other Google AI models.
Use this skill when the user wants to:
This workflow has three phases executed sequentially. Each step has explicit success criteria - do not proceed until verified.
Phase 1: gcloud CLI Setup (10 min)
↓
Phase 2: Project and API Configuration (5 min)
↓
Phase 3: Verification and Testing (5 min)
Goal: Install and authenticate the Google Cloud CLI.
Action: Install the gcloud command-line tool.
# macOS (via Homebrew)
brew install --cask google-cloud-sdk
# Linux (via install script)
curl https://sdk.cloud.google.com | bash
exec -l $SHELL
# Verify installation
gcloud --version
Success Criteria: gcloud --version shows version information (e.g., Google Cloud SDK 450.0.0).
Failure Handling:
source ~/.bashrc (Linux) or source ~/.zshrc (macOS)/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Action: Log in to your Google Cloud account.
# Authenticate with Google Cloud
gcloud auth login
# This opens a browser window for authentication
# Select your Google account and grant permissions
Success Criteria: Browser shows "You are now authenticated with the gcloud CLI!" message.
Failure Handling:
gcloud auth login --no-browser and follow the instructionsgcloud auth login --force to re-authenticateAction: Select or create a Google Cloud project.
# List existing projects
gcloud projects list
# Set default project (replace PROJECT_ID)
gcloud config set project PROJECT_ID
# Verify configuration
gcloud config get-value project
Success Criteria: gcloud config get-value project shows your selected project ID.
Failure Handling:
gcloud projects list)Goal: Enable required APIs and configure authentication for Vertex AI.
Action: Enable the Vertex AI API for your project.
# Enable Vertex AI API
gcloud services enable aiplatform.googleapis.com
# Verify API is enabled
gcloud services list --enabled | grep aiplatform
Success Criteria: Output shows aiplatform.googleapis.com in the enabled services list.
Failure Handling:
Service Usage Admin role or higherAction: Set up authentication for local development.
IMPORTANT: Choose ONE approach based on your use case.
Option A: Application Default Credentials (ADC) - Development
Best for local testing and development.
# Set up ADC
gcloud auth application-default login
# This opens browser for additional authentication
# Grant permissions for Application Default Credentials
Success Criteria: Browser shows "Application Default Credentials are now set up!" message.
Trade-offs:
Option B: Service Account - Production
Best for production deployments or shared environments.
# Create service account
gcloud iam service-accounts create vertex-ai-user \
--display-name="Vertex AI User"
# Grant Vertex AI User role
gcloud projects add-iam-policy-binding PROJECT_ID \
--member="serviceAccount:vertex-ai-user@PROJECT_ID.iam.gserviceaccount.com" \
--role="roles/aiplatform.user"
# Create and download key
gcloud iam service-accounts keys create ~/vertex-ai-key.json \
--iam-account=vertex-ai-user@PROJECT_ID.iam.gserviceaccount.com
# Set environment variable (add to ~/.bashrc or ~/.zshrc)
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/vertex-ai-key.json"
Success Criteria: JSON key file exists at ~/vertex-ai-key.json.
Trade-offs:
Failure Handling:
Service Account Admin roleProject IAM Admin roleAction: Configure default region for Vertex AI operations.
# Set region (us-central1 has broadest model availability)
gcloud config set ai/region us-central1
# Verify
gcloud config get-value ai/region
Success Criteria: Command shows us-central1 (or your chosen region).
Available Regions for Vertex AI:
us-central1 - Broadest availability, lowest latency (US)us-east4 - East coast USeurope-west4 - Europeasia-southeast1 - SingaporeGoal: Confirm setup works end-to-end.
Action: Verify credentials are working.
# Test authentication
gcloud auth application-default print-access-token
# Should output a long token string (starts with "ya29.")
Success Criteria: Command outputs an access token without errors.
Failure Handling:
gcloud auth application-default login againGOOGLE_APPLICATION_CREDENTIALS path is correctAction: Test that you can access Vertex AI API.
# List available models in Vertex AI (requires API to be enabled)
gcloud ai models list --region=us-central1 2>&1
# If no models exist, this is fine - just shouldn't error
Success Criteria: Command completes without "permission denied" or "API not enabled" errors.
Failure Handling:
roles/aiplatform.user minimum)us-central1 as the default regionAction: Verify Python library can authenticate.
# Install Vertex AI SDK
pip install google-cloud-aiplatform
# Test connection
python3 << 'EOF'
from google.cloud import aiplatform
# Initialize SDK
aiplatform.init(project="PROJECT_ID", location="us-central1")
print("✓ Vertex AI SDK initialized successfully!")
print(f" Project: {aiplatform.initializer.global_config.project}")
print(f" Location: {aiplatform.initializer.global_config.location}")
EOF
Success Criteria: Script prints success message with project and location.
Failure Handling:
pip install google-cloud-aiplatformgcloud config get-value project"ERROR: (gcloud.auth.application-default.login) The project property is set to the empty string"
# Fix: Set project first
gcloud config set project PROJECT_ID
gcloud auth application-default login
"API [aiplatform.googleapis.com] not enabled on project"
# Fix: Enable the API
gcloud services enable aiplatform.googleapis.com
# Verify
gcloud services list --enabled | grep aiplatform
"Permission denied" when calling Vertex AI
# Check your current authenticated account
gcloud auth list
# Check IAM roles
gcloud projects get-iam-policy PROJECT_ID \
--flatten="bindings[].members" \
--format="table(bindings.role)" \
--filter="bindings.members:$(gcloud config get-value account)"
# Required role: roles/aiplatform.user (minimum)
Fix: Add required role
gcloud projects add-iam-policy-binding PROJECT_ID \
--member="user:[email protected]" \
--role="roles/aiplatform.user"
"Quota exceeded" errors
Vertex AI has quota limits. Check and request increases:
# View quota usage
gcloud compute project-info describe --project=PROJECT_ID
# Request quota increase at:
# https://console.cloud.google.com/iam-admin/quotas
"Invalid authentication credentials"
# Clear and re-authenticate
gcloud auth application-default revoke
gcloud auth application-default login
# Or for service accounts, verify environment variable
echo $GOOGLE_APPLICATION_CREDENTIALS
# Should point to valid JSON key file
Service account key file lost or corrupted
# Create new key (old keys remain valid until deleted)
gcloud iam service-accounts keys create ~/vertex-ai-key-new.json \
--iam-account=vertex-ai-user@PROJECT_ID.iam.gserviceaccount.com
# Update environment variable
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/vertex-ai-key-new.json"
# Delete old key (find key ID first)
gcloud iam service-accounts keys list \
--iam-account=vertex-ai-user@PROJECT_ID.iam.gserviceaccount.com
gcloud iam service-accounts keys delete KEY_ID \
--iam-account=vertex-ai-user@PROJECT_ID.iam.gserviceaccount.com
# Install gcloud
brew install --cask google-cloud-sdk
# Authenticate
gcloud auth login
gcloud auth application-default login
# Configure project
gcloud config set project PROJECT_ID
gcloud config set ai/region us-central1
# Enable Vertex AI
gcloud services enable aiplatform.googleapis.com
# Test connection
gcloud auth application-default print-access-token
# Verify setup
gcloud ai models list --region=us-central1
| Method | Command | Use Case |
|---|---|---|
| ADC (Development) | gcloud auth application-default login | Local testing |
| Service Account | export GOOGLE_APPLICATION_CREDENTIALS=path/to/key.json | Production |
| Role | Purpose |
|---|---|
roles/aiplatform.user | Call Vertex AI APIs (minimum) |
roles/aiplatform.admin | Manage models and endpoints |
roles/serviceusage.serviceUsageAdmin | Enable APIs |
# For service account authentication
export GOOGLE_APPLICATION_CREDENTIALS="$HOME/vertex-ai-key.json"
# For custom endpoints (advanced)
export GOOGLE_CLOUD_PROJECT="your-project-id"
export GOOGLE_CLOUD_REGION="us-central1"
Before marking setup complete, verify:
gcloud --version works)gcloud auth list shows account)gcloud config get-value project shows project ID)gcloud services list --enabled | grep aiplatform)gcloud auth application-default print-access-token works)gcloud config get-value ai/region shows region)gcloud ai models list --region=us-central1)Once setup is complete:
imagen-prompt skill to generate imagesgcloud ai models list --region=us-central1You are now ready to use Vertex AI and Imagen. The setup provides secure, authenticated access to Google's AI models with proper project configuration and API enablement.
npx claudepluginhub lando-labs/claude-plugins --plugin model-bridgeProvisions Vertex AI infrastructure with Terraform: Model Garden models, Gemini endpoints, vector search indices, ML pipelines, encryption, auto-scaling, and IAM.
Designs, implements, and deploys Firebase apps with secure Vertex AI Gemini integration in Cloud Functions for Auth, Firestore, Storage, Hosting.
Orchestrates Google Vertex AI multimodal operations: video analysis with Gemini 2.5, image generation with Imagen 4, audio with Lyria, and marketing campaign automation via Python SDK.