Skip to main content

Overview

GeminiLiveLLMService enables natural, real-time conversations with Google’s Gemini model. It provides built-in audio transcription, voice activity detection, and context management for creating interactive AI experiences with multimodal capabilities including audio, video, and text processing.
Want to start building? Check out our Gemini Live Guide.

Gemini Live API Reference

Pipecat’s API methods for Gemini Live integration

Example Implementation

Complete Gemini Live async tool calling example

Gemini Documentation

Official Google Gemini Live API documentation

Gemini Live Model Card

Gemini Live available models

Installation

To use Gemini Live services, install the required dependencies:

Prerequisites

Google AI Setup

Before using Gemini Live services, you need:
  1. Google Account: Set up at Google AI Studio
  2. API Key: Generate a Gemini API key from AI Studio
  3. Model Access: Ensure access to Gemini Live models
  4. Multimodal Configuration: Set up audio, video, and text modalities

Required Environment Variables

  • GOOGLE_API_KEY: Your Google Gemini API key for authentication

Key Features

  • Multimodal Processing: Handle audio, video, and text inputs simultaneously
  • Real-time Streaming: Low-latency audio and video processing
  • Voice Activity Detection: Automatic speech detection and turn management
  • Function Calling: Advanced tool integration and API calling capabilities
  • Context Management: Intelligent conversation history and system instruction handling

Configuration

GeminiLiveLLMService

str
required
Google AI API key for authentication.
str
default:"models/gemini-3.8-live"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use settings=GeminiLiveLLMService.Settings(model=...) instead.
str
default:"Charon"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use settings=GeminiLiveLLMService.Settings(voice=...) instead.
str
default:"None"
System prompt for the model. Can also be provided via the LLM context.
ToolsSchema | List[FunctionSchema | DirectFunction] | List[dict]
default:"None"
Tools available to the model: a ToolsSchema, a plain list of direct functions and/or FunctionSchema objects, or a list of provider-native tool dicts. Can also be provided via the LLM context.
InputParams
default:"InputParams()"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use settings=GeminiLiveLLMService.Settings(...) instead.
GeminiLiveLLMService.Settings
default:"None"
Generation and session settings. See Settings below.
bool
default:"False"
Whether to start with audio input paused. Resume with set_audio_input_paused(False).
bool
default:"False"
Whether to start with video input paused. Resume with set_video_input_paused(False).
bool
default:"True"
Whether to generate a response when context is first set. Set to False to wait for user input before the model responds.
float | None
default:"None"
Seconds of recent audio replayed at the start of a user turn when server-side VAD is disabled, so the speech onset isn’t clipped. None sizes it to the upstream VAD’s start_secs plus 0.1 seconds, or 0.5 seconds with no VAD; set it explicitly if turns don’t start from VAD.
HttpOptions
default:"None"
HTTP options for the Google API client. Use this to set API version (e.g. HttpOptions(api_version="v1alpha")) or other request options.
str
Base URL for the Gemini File API.

Settings

Settings passed via the settings constructor argument using GeminiLiveLLMService.Settings(...). Changing them mid-conversation with LLMUpdateSettingsFrame is not supported: the service stores the change and logs a warning, but doesn’t apply it to the session in progress. See Service Settings for details.
None values are omitted, letting the service use its own defaults.

GeminiVADParams

Voice activity detection configuration passed via the vad Settings field:

ContextWindowCompressionParams

Usage

Basic Setup

With Settings

With Local VAD

Text-Only Mode

TEXT modality may not be supported by recent Gemini Live models. The service will log a warning if you configure modalities=GeminiModalities.TEXT.

With Thinking Enabled

Methods

set_audio_input_paused()

Stops (True) or resumes (False) sending input audio to the model.

set_video_input_paused()

Stops (True) or resumes (False) sending video frames to the model.

file_api

The client for the Gemini File API. Upload a file, then reference its uri in a file_data content part of a context message. Each method raises an Exception when the API returns an error.

Notes

  • Model support: The service supports Gemini 2.5, Gemini 3.x, and the 3.8 Live family (gemini-3.8-live, gemini-3.8-live-extended-thinking). The service automatically detects and handles model-specific behavior.
  • Function calling behavior: Functions registered with cancel_on_interruption=False use Gemini’s NON_BLOCKING tool mechanism, allowing the conversation to continue while the tool runs in the background. The 3.8 Live family defaults to NON_BLOCKING for all function calls; synchronous tools are explicitly declared BLOCKING on gemini-3.8-live to maintain blocking semantics. The thinking model gemini-3.8-live-extended-thinking accepts only NON_BLOCKING and logs a warning for synchronous tools. Earlier Gemini 3.x models (before 3.8) do not support NON_BLOCKING, and the service pushes an error when a function registered with cancel_on_interruption=False is used with them. Note: An intermittent 1008 error can occasionally occur on Gemini 2.5 during long-running tool calls; the service auto-reconnects when this happens.
  • Thinking level defaults: Live thinking models (e.g., gemini-3.8-live-extended-thinking) require a thinking_level in the thinking configuration. When none is set, the service applies LOW as the default to keep reply latency down.
  • Turn completion with interaction status: On thinking models from 3.8 onward, the service holds the bot turn open while Gemini reports interaction_status: IN_PROGRESS, ensuring that a reply spanning multiple turn_complete messages is recorded as a single assistant turn. This requires google-genai>=2.19.0; older SDKs log a warning.
  • Tool calls in conversation history: When seeding a session with conversation history that contains tool calls (e.g., after a multi-worker handoff or reconnect), the service automatically converts function calls and their results to text summaries. This is required because Gemini Live’s API only accepts text and media content. The conversion happens transparently and preserves the context for the model.
  • System instruction precedence: The system_instruction from service settings takes precedence over an initial system message in the LLM context. A warning is logged when both are set.
  • VAD modes: By default, Gemini Live uses server-side VAD for detecting when the user starts and stops speaking. To use local VAD (e.g., Silero), set vad=GeminiVADParams(disabled=True) and configure an external VAD analyzer in your LLMUserAggregatorParams. The service will automatically send activity signals to the Gemini API when local VAD detects speech. With server-side VAD, the service emits no UserStartedSpeakingFrame or UserStoppedSpeakingFrame, so processors that depend on them (RTVI user speaking events, user idle and mute handling, turn recording) do nothing unless LLMUserAggregatorParams has a vad_analyzer.
  • Tools precedence: Similarly, tools provided in the context override tools provided at init time. Tools can’t change mid-session: the service drops LLMSetToolsFrame.
  • Seed parameter: Gemini treats the seed parameter as best effort. Identical seeds usually but not always produce identical responses.
  • Transcription aggregation: Gemini Live sends user transcriptions in small chunks. The service aggregates them into complete sentences using end-of-sentence detection with a 0.5-second timeout fallback.
  • Session resumption: The service automatically handles session resumption on reconnection using session resumption handles. In the rare case where reconnection occurs before a resumption handle is received, conversation history is preserved by reseeding it into the new session.
  • Connection resilience: The service reconnects after a connection error. On the third consecutive error it reports an error and stops trying.
  • Video frame rate: Video frames are throttled to a maximum of one per second.
  • Affective dialog and proactivity: These features require both a supporting model and API version (v1alpha).