Overview
The Google on Vertex AI provider gives you access to Gemini chat, embedding, and native image models 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
string
Google Cloud project ID. Required unless a preconfigured client is supplied.
string
Vertex AI location, such as
europe-west1, us-central1, global, or the
multi-region locations us and eu. Required unless a preconfigured client
is supplied.GoogleVertexServiceAccountCredentials
Parsed service-account JSON. When omitted, the Google SDK uses Application
Default Credentials.
GoogleGenAIClient
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:gemini-4-argon uses the same model id and capabilities as Google GenAI.
Vertex serves it at global and at the multi-region locations us and eu,
not at single regions such as us-central1 or europe-west1. The Google GenAI
SDK sends us and eu requests to https://aiplatform.us.rep.googleapis.com/
and https://aiplatform.eu.rep.googleapis.com/.
us or eu, create a second provider
for a single region that hosts it.
Model capabilities
Vertex-hosted Gemini models use the same capability definitions as Google GenAI. Inspect the model instance or use the exported helper:Strict tool schemas
Vertex-hosted Gemini models reportmodel.capabilities.tools.strictSchemas as
{ supported: false }, and strict: true throws ToolSchemaStrictnessError
locally. See
Strict tool schemas.
Examples
Chat and streaming
Embeddings
Image generation
n.
Provider-specific options
Provider options are namespaced undergoogle-vertex in providerOptions and accept the same fields as @core-ai/google-genai, for chat, embedding, and image models alike. Options under the google key are ignored:
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