Skip to main content

Vertex AI

Use Google’s Gemini models through Vertex AI — Google Cloud’s enterprise ML platform. Same models as the Gemini API, but with Google Cloud IAM authentication, VPC support, and enterprise compliance.
Use vertex() when you need Google Cloud authentication (service accounts, ADC). Use google() when you have a simple API key.

Setup

Vertex AI uses the same SDK as Gemini:

Factory

string
required
The Gemini model identifier (same model IDs as the Gemini API).
object
Optional configuration. See Config below.

Supported Models

All Gemini models available in your Vertex AI region can be used.

Config

string
required
Google Cloud project ID. Falls back to GOOGLE_CLOUD_PROJECT env var.
string
default:"us-central1"
Google Cloud region. Falls back to GOOGLE_CLOUD_LOCATION env var.
string
Service account key JSON string or file path. If omitted, uses Application Default Credentials.

Example


Vertex AI vs Gemini API


Multi-Modal Support

Vertex AI supports the same multi-modal capabilities as the Gemini API — images, audio, and files (including XLSX). All content is processed via inlineData.

Images

Audio

Files & Documents

Vertex AI supports PDF, CSV, XLSX, and other formats natively:
All multi-modal features work identically to the google() provider. See the Google Gemini docs for the full supported file type list.

Reasoning

Vertex AI Gemini models support thinking/reasoning via the same reasoning config:

Full Example


Environment Variables