Vertex Configuration Precision
Battle-tested setting for connect, claude, code, google. Includes structured workflows, validation checks, and reusable patterns for api.
Vertex Configuration Precision
Connect Claude Code to Google Vertex AI for enterprise-grade model access through Google Cloud Platform infrastructure.
When to Use This Setting
Apply this setting when you need to:
- Route Claude Code through Google Cloud Platform for unified GCP billing and IAM management
- Access multiple Claude model variants (Sonnet, Haiku, Opus) via Vertex AI Model Garden
- Comply with data residency requirements using GCP region-specific deployments
Consider alternatives when:
- Your organization primarily uses AWS infrastructure (use Bedrock configuration instead)
- You need direct Anthropic API access without cloud provider overhead
Quick Start
Configuration
name: vertex-configuration-precision type: setting category: api
Example Application
claude setting:apply vertex-configuration-precision
Example Output
Setting applied successfully. Configuration changes:
- CLAUDE_CODE_USE_VERTEX: 1
- ANTHROPIC_VERTEX_PROJECT_ID: your-gcp-project-id
- CLOUD_ML_REGION: global
- Models configured: Sonnet, Haiku, Opus variants
Core Concepts
Vertex AI Integration Overview
| Aspect | Details |
|---|---|
| Provider | Google Cloud Platform (Vertex AI) |
| Authentication | gcloud CLI / Service Account |
| Models Available | Claude 3.5 Sonnet, Haiku, 3.7 Sonnet, 4.x series |
| Region Strategy | Global endpoint with per-model region overrides |
| Billing | GCP project-level consolidated billing |
| Prerequisites | Vertex AI API enabled, Model Garden access |
Vertex AI Architecture
āāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāāāā
ā Claude Code āāāāā>ā Vertex AI Gateway ā
ā ā ā āāāāāāāāāāāāāāāāāāā ā
ā Config: ā ā ā Model Garden ā ā
ā - project ā ā ā āāāāāāāāāāāāāāā ā ā
ā - region ā ā ā ā Sonnet 4.5 ā ā ā
ā - models ā ā ā ā Haiku 3.5 ā ā ā
ā ā ā ā ā Opus 4.1 ā ā ā
āāāāāāāāāāāāāāāā ā ā āāāāāāāāāāāāāāā ā ā
ā āāāāāāāāāāāāāāāāāāā ā
ā IAM + Billing + Audit ā
āāāāāāāāāāāāāāāāāāāāāāāāā
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
| CLAUDE_CODE_USE_VERTEX | string | "0" | Enable Vertex AI routing ("1" to activate) |
| ANTHROPIC_VERTEX_PROJECT_ID | string | none | GCP project ID with Vertex AI enabled |
| CLOUD_ML_REGION | string | global | Default region for Vertex AI requests |
| ANTHROPIC_MODEL | string | claude-sonnet-4-5 | Primary model for code generation |
| ANTHROPIC_SMALL_FAST_MODEL | string | claude-3-5-haiku | Fast model for lightweight tasks |
Best Practices
-
Use Global Endpoints When Possible - Set CLOUD_ML_REGION to "global" for automatic routing to the nearest available region. This provides the best latency while maintaining high availability across GCP's infrastructure.
-
Authenticate via gcloud CLI - Run
gcloud auth application-default loginbefore applying this setting. Service account keys work but gcloud CLI integration provides automatic token refresh and integrates with your existing GCP identity. -
Enable Model Access in Model Garden - Each Claude model variant must be individually enabled in the Vertex AI Model Garden console. Apply for access to all models you plan to use before configuring region-specific overrides.
-
Configure Per-Model Regions - Use VERTEX_REGION_CLAUDE_* variables to route specific models to regions where they perform best or where you have quota. This is especially important for newer models that may have limited regional availability.
-
Monitor Quota and Usage - Set up GCP budget alerts and Vertex AI quota monitoring. Claude Code sessions can consume significant quota during intensive coding tasks, and quota exhaustion causes abrupt session failures.
Common Issues
-
Permission denied on model invocation - Verify that the
aiplatform.endpoints.predictIAM permission is granted to your authenticated identity and that the specific model is enabled in Model Garden for your project. -
Region mismatch errors - If a model is not available in your configured region, Vertex AI returns a cryptic error. Check model availability per region in the GCP console and update the corresponding VERTEX_REGION variable.
-
Stale gcloud credentials - Application default credentials expire after a period. Run
gcloud auth application-default loginagain if you encounter authentication errors after a long idle period.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Project Standards Config
Claude Code settings preset that enforces consistent coding standards. Configures TypeScript strict mode, ESLint rules, Prettier formatting, and naming conventions.
Bedrock Configuration Blueprint
All-in-one setting covering configure, claude, code, amazon. Includes structured workflows, validation checks, and reusable patterns for api.
Refined Corporate Preset
Production-ready setting that handles configure, proxy, settings, corporate. Includes structured workflows, validation checks, and reusable patterns for api.