Overview
GoogleVertexLLMService provides access to Google’s language models through Vertex AI while maintaining an OpenAI-compatible interface. It inherits from OpenAILLMService and supports all OpenAI features while connecting to Google’s enterprise AI services with enhanced security and compliance.
Vertex AI LLM API Reference
Pipecat’s API methods for Google Vertex AI integration
Example Implementation
Browse examples using Vertex AI models
Vertex AI Documentation
Official Google Vertex AI documentation
Google Cloud Console
Access Vertex AI and manage credentials
Installation
To use Google Vertex AI services, install the required dependencies:Prerequisites
Google Cloud Setup
Before using Google Vertex AI LLM services, you need:- Google Cloud Account: Sign up at Google Cloud Console
- Project Setup: Create a project and enable the Vertex AI API
- Service Account: Create a service account with Vertex AI permissions
- Authentication: Set up credentials via service account key or Application Default Credentials
Required Environment Variables
GOOGLE_APPLICATION_CREDENTIALS: Path to your service account key file (recommended)- Or use Application Default Credentials for cloud deployments
Configuration
JSON string of Google service account credentials for authentication.
Path to the service account JSON key file. Alternative to providing credentials as a string.
Google Cloud project ID.
GCP region for the Vertex AI endpoint (e.g.,
"us-east4", "us-central1").Model identifier to use.
Runtime-configurable model settings. See Google Gemini for InputParams details.
System instruction/prompt for the model.
List of available tools/functions for the model.
Configuration for tool usage behavior.
HTTP options for the Google AI client.
Usage
Basic Setup
With Credentials JSON String
With Application Default Credentials
Notes
- This service does not accept an
api_keyparameter. Usecredentials,credentials_path, or Application Default Credentials instead. GoogleVertexLLMServiceextendsGoogleLLMService(notOpenAILLMServicedirectly) and uses the Google AI Python SDK with Vertex AI authentication.- Authentication supports three methods: direct JSON credentials string, path to a service account key file, or Application Default Credentials (ADC).
- The
project_idparameter is required. Iflocationis not provided, it defaults to"us-east4".