Overview
Google Gemini provides powerful language models with advanced reasoning and multimodal capabilities. With LiveKit's Google plugin and the Agents framework, you can build sophisticated voice AI applications using Vertex AI or Google Gemini API.
Quick reference
This section includes a basic usage example and some reference material. For links to more detailed documentation, see Additional resources.
Installation
Install the plugin from PyPI:
pip install "livekit-agents[google]~=1.0rc"
Authentication
The Google plugin requires authentication based on your chosen service:
- For Vertex AI, you must set the
GOOGLE_APPLICATION_CREDENTIALS
environment variable to the path of the service account key file. - For Google Gemini API, set the
GOOGLE_API_KEY
environment variable.
Usage
Use Gemini within an AgentSession
or as a standalone LLM service. For example, you can use this LLM in the Voice AI quickstart.
from livekit.plugins import googlesession = AgentSession(llm=google.LLM(model="gemini-2.0-flash-exp",temperature=0.8,),# ... tts, stt, vad, turn_detection, etc.)
Parameters
This section describes some of the available parameters. For a complete reference of all available parameters, see the plugin reference.
ID of the model to use. For a full list, see Gemini models.
API key for Google Gemini API.
Google Cloud project to use (only if using Vertex AI). Required if using Vertex AI and the environment variable isn't set.
Google Cloud location to use (only if using Vertex AI). Required if using Vertex AI and the environment variable isn't set.
A measure of randomness in output. A lower value results in more predictable output, while a higher value results in more creative output.
To learn more, see Model parameters.
Maximum number of tokens that can be generated in the response. To learn more, see Model parameters.
Specifies whether to use tools during response generation.
Additional resources
The following resources provide more information about using Google Gemini with LiveKit Agents.
Python package
The livekit-plugins-google
package on PyPI.
Plugin reference
Reference for the Google Gemini LLM plugin.
GitHub repo
View the source or contribute to the LiveKit Google Gemini LLM plugin.
Gemini docs
Google Gemini documentation.
Voice AI quickstart
Get started with LiveKit Agents and Google Gemini.
Google AI ecosystem guide
Overview of the entire Google AI and LiveKit Agents integration.