Overview
GoogleVertexLLMService provides access to Google’s language models through Vertex AI. It extends GoogleLLMService with Vertex AI authentication, 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
str
default:"None"
JSON string of Google service account credentials for authentication.
str
default:"None"
Path to the service account JSON key file. Alternative to providing
credentials as a string.
str
required
Google Cloud project ID.
str
default:"us-east4"
GCP region for the Vertex AI endpoint (e.g.,
"us-east4", "us-central1").str
default:"None"
deprecated
Deprecated in v0.0.105. Use
settings=GoogleVertexLLMService.Settings(model=...) instead.GoogleLLMService.InputParams
default:"None"
deprecated
Deprecated in v0.0.105. Use
settings=GoogleVertexLLMService.Settings(...)
instead.GoogleVertexLLMService.Settings
default:"None"
Runtime-configurable settings. See Google Gemini
Settings for the full
parameter reference.
str
default:"None"
deprecated
Deprecated in v0.0.105. Use
settings=GoogleVertexLLMService.Settings(system_instruction=...) instead.list
default:"None"
List of available tools/functions for the model.
dict
default:"None"
Configuration for tool usage behavior.
HttpOptions
default:"None"
HTTP options for the Google AI client.
float | None
default:"20.0"
How long to wait for the next chunk of a streamed response before giving up on
it. Bounds the wait when the API accepts a request and then stops producing
without closing the stream. This is a gap between chunks, not a limit on how
long a response may take overall. The first chunk is the slowest, since its
wait spans the whole round trip including any thinking the model does before
it emits anything; raise this for models configured to think at length. Set to
None to wait indefinitely. Inherited from GoogleLLMService.float | None
default:"5.0"
How long to wait for the first chunk before giving up on the request and
re-issuing it, when
retry_on_timeout is set. Like the first-chunk wait
above, this window spans the whole round trip including any thinking, so it is
only a good fit for models that start emitting quickly. Inherited from
GoogleLLMService.bool | None
default:"False"
Whether to re-issue the request once if the first chunk doesn’t arrive within
retry_timeout_secs. Only the first chunk is retried: once a chunk has been
pushed downstream, re-issuing would duplicate the response. Inherited from
GoogleLLMService.Usage
Basic Setup
With Credentials JSON String
With Application Default Credentials
With Safety Settings
Notes
- This service does not accept an
api_keyparameter. Usecredentials,credentials_path, or Application Default Credentials instead. GoogleVertexLLMServiceextendsGoogleLLMServiceand 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".