Sypha AI Docs
Provider config

GCP Vertex AI

Configure GCP Vertex AI with Sypha to access leading generative AI models like Claude 3.5 Sonnet v2. This guide covers GCP environment setup, authentication, and secure integration for enterprise teams.

Introduction

GCP Vertex AI:
A comprehensive managed service delivering access to cutting-edge generative AI models—including Anthropic's Claude 3.5 Sonnet v2—via Google Cloud infrastructure.
Learn more about GCP Vertex AI.

This documentation targets organizations operating mature GCP infrastructures (utilizing IAM roles, service accounts, and resource management best practices) to maintain secure and policy-compliant operations.


Step 1: Configure Your GCP Infrastructure

1.1 Establish or Utilize a GCP Project

  • Authenticate to GCP Console:
    Google Cloud Console
  • Choose or Establish a Project:
    Employ an existing project or establish a new one specifically for Vertex AI operations.

1.2 Configure IAM Permissions and Service Accounts

  • Allocate Required Roles:

    • Provide your user (or service account) the Vertex AI User role (roles/aiplatform.user)
    • For service accounts, additionally associate the Vertex AI Service Agent role (roles/aiplatform.serviceAgent) to facilitate specific operations
    • Evaluate additional predefined roles as necessary:
      • Vertex AI Platform Express Admin
      • Vertex AI Platform Express User
      • Vertex AI Migration Service User
  • Cross-Project Resource Authorization:

    • For BigQuery tables residing in separate projects, allocate the BigQuery Data Viewer role
    • For Cloud Storage buckets in different projects, allocate the Storage Object Viewer role
    • For external data sources, consult the GCP Vertex AI Access Control documentation

Step 2: Confirm Regional and Model Availability

2.1 Determine and Validate a Region

Vertex AI operates across multiple regions. Choose a region satisfying your latency, compliance, and capacity requirements. Available regions include:

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

The Global endpoint may provide enhanced availability and minimize resource exhaustion issues. Only Gemini models receive support.

2.2 Activate the Claude 3.5 Sonnet v2 Model

  • Access Vertex AI Model Garden:
    Within the Cloud Console, navigate to Vertex AI → Model Garden
  • Activate Claude 3.5 Sonnet v2:
    Find the model card for Claude 3.5 Sonnet v2 and select Enable

Step 3: Set Up the Sypha VS Code Extension

3.1 Deploy and Launch Sypha

  • Obtain VS Code:
    Download Visual Studio Code
  • Deploy the Sypha Extension:
    • Launch VS Code
    • Access the Extensions Marketplace (Ctrl+Shift+X or Cmd+Shift+X)
    • Locate Sypha and complete the extension installation
Sypha extension in VS Code

3.2 Adjust Sypha Configuration

  • Access Sypha Configuration:
    Select the settings ⚙️ icon within the Sypha extension
  • Designate API Provider:
    Pick GCP Vertex AI from the API Provider selector
  • Provide Your Google Cloud Project ID:
    Supply the project ID you configured earlier
  • Choose the Region:
    Pick one of the available regions (for instance, us-east5)
  • Choose the Model:
    From the presented options, select Claude 3.5 Sonnet v2
  • Preserve and Validate:
    Commit your configuration and verify by submitting a straightforward prompt (for example, "Generate a Python function to check if a number is prime.")

Step 4: Authentication and Credentials Configuration

Option A: Utilizing Your Google Account (User Credentials)

  1. Deploy the Google Cloud CLI:
    Consult the installation guide

  2. Initialize and Authenticate:

    gcloud init
    gcloud auth application-default login
    • This establishes Application Default Credentials (ADC) utilizing your Google account
  3. Restart VS Code:
    Verify VS Code is restarted so the Sypha extension recognizes the new credentials

Option B: Utilizing a Service Account (JSON Key)

  1. Establish a Service Account:

    • Within the GCP Console, navigate to IAM & Admin > Service Accounts
    • Generate a new service account (for instance, "vertex-ai-client")
  2. Allocate Roles:

    • Associate Vertex AI User (roles/aiplatform.user)
    • Associate Vertex AI Service Agent (roles/aiplatform.serviceAgent)
    • Optionally, include additional roles as needed
  3. Create a JSON Key:

    • Within the Service Accounts section, manage keys for your service account and retrieve the JSON key
  4. Configure the Environment Variable:

    export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account-key.json"
    • This directs Google Cloud client libraries (and Sypha) to employ this key
  5. Restart VS Code:
    Initiate VS Code from a terminal where the GOOGLE_APPLICATION_CREDENTIALS variable is configured


5.1 Implement Least Privilege

  • Least Privilege Principle:
    Grant only minimal necessary permissions. Custom roles can provide more granular control versus expansive predefined roles
  • Recommended Practices:
    Consult GCP IAM Best Practices

5.2 Administer Resource Access

  • Project vs. Resource-Level Authorization:
    Access administration occurs at both levels. Note that resource-level permissions (such as for BigQuery or Cloud Storage) supplement, but don't supersede, project-level policies

5.3 Track Usage and Quotas

  • Model Observability Dashboard:

    • Within the Vertex AI Console, access the Model Observability dashboard
    • Track indicators including request throughput, latency, and error frequencies (including 429 quota errors)
  • Quota Administration:

5.4 Service Agents and Cross-Project Factors

  • Service Agents:
    Recognize the different service agents:

    • Vertex AI Service Agent
    • Vertex AI RAG Data Service Agent
    • Vertex AI Custom Code Service Agent
    • Vertex AI Extension Service Agent
  • Cross-Project Authorization:
    For resources in separate projects (such as BigQuery, Cloud Storage), verify that suitable roles (BigQuery Data Viewer, Storage Object Viewer) are allocated


Summary

Following these procedures, your enterprise team can safely integrate GCP Vertex AI with the Sypha VS Code extension to harness Claude 3.5 Sonnet v2 capabilities:

  • Configure Your GCP Infrastructure:
    Establish or utilize a project, configure IAM with least privilege, and verify necessary roles (including the Vertex AI Service Agent role) are associated
  • Validate Regional and Model Availability:
    Verify your chosen region accommodates Claude 3.5 Sonnet v2 and that the model is activated
  • Configure Sypha in VS Code:
    Deploy Sypha, supply your project ID, choose the suitable region, and select the model
  • Configure Authentication:
    Employ either user credentials (via gcloud auth application-default login) or a service account with a JSON key
  • Apply Security and Monitoring Practices:
    Follow recommended approaches for IAM, administer resource access carefully, and track usage with the Model Observability dashboard

For comprehensive information, consult the GCP Vertex AI Documentation and your internal security protocols.
Happy coding!

This documentation will receive updates as GCP Vertex AI and Sypha advance. Consistently reference current documentation for modern practices.

On this page