Skip to main content

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):
ADC is recommended for workloads running on Google Cloud. For local development, configure ADC with the Google Cloud CLI:

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:
Model availability varies by region. Since a provider instance targets one region, create separate providers for models hosted in different locations. 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/.
Multi-region locations serve fewer models than single regions. If a model such as an embedding model returns a 404 at 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:
These fields describe reasoning effort, whether thinking can be disabled, which request options remain valid, image input support, the output ceiling, and the Gemini 2.5 thinking budget range. See Google GenAI model capabilities and Output limits for details.

Strict tool schemas

Vertex-hosted Gemini models report model.capabilities.tools.strictSchemas as { supported: false }, and strict: true throws ToolSchemaStrictnessError locally. See Strict tool schemas.

Examples

Chat and streaming

Embeddings

Image generation

Gemini image models return base64 image data and do not support requesting multiple outputs with n.

Provider-specific options

Provider options are namespaced under google-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:
The Google provider-option schemas, GoogleReasoningMetadata, and getGoogleModelCapabilities() are exported by @core-ai/google-vertex.

Error handling

Errors are wrapped as ProviderError with provider ID google-vertex:

Google GenAI Provider

Use Gemini through the Google AI API

Anthropic on Vertex AI

Use Claude through Vertex AI