Using GCP Vertex AI With Roo Code
Roo Code supports accessing models through Google Cloud Platform's Vertex AI, a managed machine learning platform that provides access to various foundation models, including Anthropic's Claude family.
Website: https://cloud.google.com/vertex-ai
Prerequisites
- Google Cloud Account: You need an active Google Cloud Platform (GCP) account.
- Project: You need a GCP project with the Vertex AI API enabled.
- Model Access: You must request and be granted access to the specific Claude models on Vertex AI you want to use. See the Google Cloud documentation for instructions.
- Application Default Credentials (ADC): Roo Code uses Application Default Credentials to authenticate with Vertex AI. The easiest way to set this up is to:
- Install the Google Cloud CLI: https://cloud.google.com/sdk/docs/install
- Authenticate using:
gcloud auth application-default login
- Service Account Key (Alternative): Alternatively, you can authenticate using a Google Cloud Service Account key file. You'll need to generate this key in your GCP project. See the Google Cloud documentation on creating service account keys.
Supported Models
Roo Code supports the following models through Vertex AI:
Default Model
If no model is specified, Roo Code defaults to claude-sonnet-4@20250514
.
Google Gemini Models
Standard Models
gemini-2.5-flash
- Production version with prompt caching supportgemini-2.5-flash-preview-05-20
- Preview with 1M context windowgemini-2.5-flash-preview-04-17
- Preview without cachinggemini-2.5-flash-lite-preview-06-17
- Lite version with lower pricinggemini-2.5-pro
- Production version with reasoning supportgemini-2.5-pro-preview-03-25
- Pro preview versiongemini-2.5-pro-preview-05-06
- Pro preview versiongemini-2.5-pro-preview-06-05
- Pro preview with reasoning supportgemini-2.5-pro-exp-03-25
- Experimental version (free)gemini-2.0-flash-001
- 2.0 Flash modelgemini-2.0-flash-lite-001
- 2.0 Flash lite versiongemini-2.0-flash-thinking-exp-01-21
- Thinking/reasoning modelgemini-2.0-pro-exp-02-05
- 2.0 Pro experimentalgemini-1.5-flash-002
- 1.5 Flash modelgemini-1.5-pro-002
- 1.5 Pro model
Thinking/Reasoning Models
These models support enhanced reasoning capabilities with the :thinking
suffix:
gemini-2.5-flash-preview-05-20:thinking
gemini-2.5-flash-preview-04-17:thinking
Thinking Models: Models with :thinking
suffix enable step-by-step reasoning. The suffix is stripped before sending to the API but enables reasoning features in Roo Code. You'll need to enable the reasoning budget in settings to use these models effectively.
Anthropic Claude Models
claude-opus-4-1@20250805
claude-opus-4@20250514
claude-sonnet-4@20250514
(Default)claude-3-7-sonnet@20250219
claude-3-7-sonnet@20250219:thinking
- With reasoning supportclaude-3-5-sonnet-v2@20241022
claude-3-5-sonnet@20240620
claude-3-5-haiku@20241022
claude-3-opus@20240229
claude-3-haiku@20240307
Other Models
llama-4-maverick-17b-128e-instruct-maas
- Meta Llama 4 model with 128K context window
Refer to the Google Cloud documentation on Vertex AI Models for the most up-to-date list of available models and their IDs.
Configuration in Roo Code
-
Open Roo Code Settings: Click the gear icon () in the Roo Code panel.
-
Select Provider: Choose "GCP Vertex AI" from the "API Provider" dropdown.
-
Configure Authentication:
Roo Code uses the following authentication priority:
- Google Cloud Credentials (JSON): If provided, this takes precedence
- Google Cloud Key File Path: If provided and no JSON credentials, this is used
- Application Default Credentials (ADC): Used as fallback when neither above is provided
Option 1 - Using ADC (Simplest):
- Install the Google Cloud CLI and run
gcloud auth application-default login
- No further configuration needed in Roo Code
Option 2 - Using Service Account Key:
- Either paste the JSON content directly into Google Cloud Credentials field
- Or provide the file path in Google Cloud Key File Path field
-
Enter Project ID: Enter your Google Cloud Project ID.
-
Select Region: Choose the region where your Vertex AI resources are located (e.g.,
us-east5
). -
Select Model: Choose your desired model from the "Model" dropdown.
Advanced Features
Gemini-Specific Features
When using Gemini models through Vertex AI, additional grounding features become available:
URL Context
Enable URL context to allow Gemini models to access and analyze web content directly. This feature allows Roo to:
- Read and understand web pages in real-time
- Analyze documentation from URLs
- Review online code repositories
- Access current information from websites
Enabling URL Context:
- Select a Gemini model in your Vertex AI configuration
- Enable the "URL Context" option that appears
- Save your settings
Google Search Grounding
Enable Google Search grounding to enhance Gemini's responses with real-time search results. This provides:
- Up-to-date information from web searches
- Fact-checking capabilities
- Current event awareness
- Enhanced accuracy for technical queries
Enabling Search Grounding:
- Select a Gemini model in your Vertex AI configuration
- Enable the "Google Search Grounding" option that appears
- Save your settings
URL Context and Google Search Grounding options only appear when a Gemini model is selected. These features may incur additional costs.
Tips and Notes
- Permissions: Ensure your Google Cloud account has the necessary permissions to access Vertex AI and the specific models you want to use.
- Pricing: Refer to the Vertex AI pricing page for details.