Overview
The Google on Vertex AI provider gives you access to Gemini chat, embedding, and native image models as well as Imagen through Google Cloud. It uses the same model behavior as@core-ai/google-genai, while configuring the Google
SDK for Vertex AI authentication and regional endpoints.
Installation
createGoogleVertex()
Create a Google provider targeting one Google Cloud project and region.Options
Google Cloud project ID. Required unless a preconfigured client is supplied.
Vertex AI location, such as
europe-west1 or us-central1. Required unless
a preconfigured client is supplied.Parsed service-account JSON. When omitted, the Google SDK uses Application
Default Credentials.
A preconfigured Google client. When supplied,
projectId, region, and
credentials are not used.Returns
GoogleVertexProvider with chatModel(), embeddingModel(), and imageModel() methods.
Authentication
Application Default Credentials
Without explicit credentials, the provider uses Application Default Credentials (ADC):Service-account credentials
Parse a service-account JSON key and pass the resulting object:GOOGLE_APPLICATION_CREDENTIALS_JSON accepts either plain JSON or
base64-encoded JSON. This is separate from Google’s standard
GOOGLE_APPLICATION_CREDENTIALS env var, which points to a credentials file
path for ADC.Custom client
You can inject a preconfigured Google client:Models and regions
Use model IDs available to your project in the selected Vertex AI region:imagen-4.0-generate-001 are also supported when they
are available to the selected project and region.
Examples
Chat and streaming
Embeddings
Image generation
n. Imagen model IDs use the dedicated Imagen API and
support n.
Provider-specific options
Provider options remain namespaced undergoogle, matching @core-ai/google-genai:
GoogleReasoningMetadata, and getGoogleModelCapabilities() are exported by @core-ai/google-vertex.
Error handling
Errors are wrapped asProviderError with provider ID google-vertex:
Related
Google GenAI Provider
Use Gemini through the Google AI API
Anthropic on Vertex AI
Use Claude through Vertex AI