> ## Documentation Index
> Fetch the complete documentation index at: https://codinitdev-mintlify-update-changelog-codinit-dev-90028.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Gemini

> Configure GCP Vertex AI to access Gemini and Claude models through Google Cloud.

Access leading AI models like Gemini and Claude 4.5 Sonnet through Google Cloud's Vertex AI platform.

**Website:** [https://cloud.google.com/vertex-ai](https://cloud.google.com/vertex-ai)

## Prerequisites

* GCP account with billing enabled
* GCP project created
* IAM permissions configured

## Setup Steps

### 1. Prepare GCP Environment

1. **Sign in:** [Google Cloud Console](https://console.cloud.google.com/)
2. **Create/select project:** Use existing or create new project
3. **Set up IAM:**
   * Grant **Vertex AI User** role (`roles/aiplatform.user`)
   * For service accounts, add **Vertex AI Service Agent** role (`roles/aiplatform.serviceAgent`)

### 2. Choose Region and Enable Models

1. **Select region:** Choose region for latency/compliance needs (e.g., `us-east5`, `us-central1`, `europe-west1`)
   * Use `global` endpoint for higher availability (Gemini only)
2. **Enable models:** Go to Vertex AI → Model Garden and enable desired models (e.g., Claude 4.5 Sonnet v2)

### 3. Configure CodinIT

1. Install CodinIT extension in VS Code
2. Click settings icon (⚙️)
3. Select **GCP Vertex AI** as API Provider
4. Enter your **Google Cloud Project ID**
5. Select your **Region**
6. Choose your **Model** (e.g., Claude 4.5 Sonnet v2)
7. Save and test

### 4. Authentication

**Option A: User Credentials**

```bash theme={null}
gcloud init
gcloud auth application-default login
```

Restart VS Code after authentication.

**Option B: Service Account**

1. Create service account in GCP Console
2. Assign Vertex AI User and Service Agent roles
3. Generate JSON key
4. Set environment variable:
   ```bash theme={null}
   export GOOGLE_APPLICATION_CREDENTIALS="/path/to/key.json"
   ```
5. Launch VS Code from terminal with this variable set

## Supported Regions

* `us-east5` (Columbus, Ohio)
* `us-central1` (Iowa)
* `europe-west1` (Belgium)
* `europe-west4` (Netherlands)
* `asia-southeast1` (Singapore)
* `global` (Global - Gemini only)

## Notes

* **Cross-region inference:** Check "Cross Region Inference" for models requiring inference profiles
* **First-time use:** Some models (e.g., Anthropic) require submitting use case form via Console
* **Permissions:** Minimal required: `bedrock:InvokeModel`, `bedrock:InvokeModelWithResponseStream`
* **Monitoring:** Use CloudWatch and CloudTrail for logging and monitoring
* **Security:** Follow [GCP IAM Best Practices](https://cloud.google.com/iam/best-practices)

## Resources

* [GCP Vertex AI Documentation](https://cloud.google.com/vertex-ai/docs)
* [Access Control](https://cloud.google.com/vertex-ai/general/access-control)
* [Quotas](https://cloud.google.com/vertex-ai/quotas)
