LiveKit docs › Partner spotlight › Google › Overview

---

# Google AI and LiveKit

> Build world-class realtime AI apps with Google AI and LiveKit Agents.

- **[Gemini playground](https://gemini.livekit.io/)**: Play with the Gemini Live API in this LiveKit-powered playground

## Overview

This guide walks you through building a voice AI assistant with Google Gemini and LiveKit Agents. In less than 10 minutes, you have a voice assistant that you can speak to in your terminal, browser, or on the phone.

## LiveKit Agents overview

LiveKit Agents is an open source framework for building realtime AI apps in Python and Node.js. It supports complex voice AI [workflows](https://docs.livekit.io/agents/logic/workflows.md) with multiple agents and discrete processing steps, and includes built-in load balancing.

LiveKit provides SIP support for [telephony integration](https://docs.livekit.io/agents/start/telephony.md) and full-featured [frontend SDKs](https://docs.livekit.io/agents/start/frontend.md) in multiple languages. It uses [WebRTC](https://docs.livekit.io/intro.md#what-is-webrtc) transport for end-user devices, enabling high-quality, low-latency realtime experiences. To learn more, see [LiveKit Agents](https://docs.livekit.io/agents.md).

## Google AI ecosystem support

[Google AI](https://ai.google.dev/) provides some of the most powerful AI models and services today, which integrate into LiveKit Agents in the following ways:

- **Gemini Live API**: A speech-to-speech realtime model with live video input.
- **Gemini**: A family of general purpose high-performance LLMs.
- **Gemini TTS**: A speech synthesis model that generates customizable speech from text.
- **Google Cloud STT and TTS**: Affordable, production-grade models for transcription and speech synthesis.

LiveKit Agents supports Google AI through the [Gemini API](https://ai.google.dev/gemini-api) and [Vertex AI](https://cloud.google.com/vertex-ai).

> ℹ️ **Google Cloud STT and TTS require separate credentials**
> 
> Gemini does not provide an STT model. Speech-to-text uses [Google Cloud STT](https://docs.livekit.io/agents/models/stt/google.md) (Chirp), while the standard TTS uses [Google Cloud TTS](https://docs.livekit.io/agents/models/tts/google.md). These are separate Google Cloud services and require `GOOGLE_APPLICATION_CREDENTIALS` (a service account JSON file), not the `GOOGLE_API_KEY` used by Gemini LLM, [Gemini TTS](https://docs.livekit.io/agents/models/tts/gemini.md), or the Live API.

### Coding agent support

LiveKit is built for coding agents like [Gemini CLI](https://geminicli.com/), [Google Antigravity](https://antigravity.google/), and [Claude Code](https://claude.com/product/claude-code). These agents can build agents and frontends with the LiveKit SDKs and manage resources with the LiveKit CLI. Give your agent LiveKit expertise using the LiveKit CLI or Docs MCP server. For more information, see the [coding agents guide](https://docs.livekit.io/intro/coding-agents.md).

## Requirements

The following sections describe the minimum requirements to get started:

- LiveKit Agents requires Python >= 3.10.
- This guide uses the [uv](https://docs.astral.sh/uv/getting-started/installation/) package manager.

### LiveKit Cloud

This guide assumes you have signed up for a free [LiveKit Cloud](https://cloud.livekit.io/) account. LiveKit Cloud includes agent deployment, model inference, and realtime media transport. Create a free project and use the API keys in the following steps to get started.

While this guide assumes LiveKit Cloud, the instructions can be adapted for [self-hosting](https://docs.livekit.io/home/self-hosting/local.md) the open-source LiveKit server instead. For self-hosting in production, set up a [custom deployment](https://docs.livekit.io/agents/ops/deployment/custom.md) environment.

### LiveKit CLI

Use the LiveKit CLI to manage LiveKit API keys and deploy your agent to LiveKit Cloud.

1. Install the LiveKit CLI:

**macOS**:

Install the LiveKit CLI with [Homebrew](https://brew.sh/):

```text
brew install livekit-cli

```

---

**Linux**:

```text
curl -sSL https://get.livekit.io/cli | bash

```

> 💡 **Tip**
> 
> You can also download the latest precompiled binaries [here](https://github.com/livekit/livekit-cli/releases/latest).

---

**Windows**:

```text
winget install LiveKit.LiveKitCLI

```

> 💡 **Tip**
> 
> You can also download the latest precompiled binaries [here](https://github.com/livekit/livekit-cli/releases/latest).

---

**From Source**:

This repo uses [Git LFS](https://git-lfs.github.com/) for embedded video resources. Please ensure git-lfs is installed on your machine before proceeding.

```text
git clone github.com/livekit/livekit-cli
make install

```
2. Link your LiveKit Cloud project to the CLI:

```shell
lk cloud auth

```

This opens a browser window to authenticate and link your project to the CLI.

## AI models

Voice agents require one or more [AI models](https://docs.livekit.io/agents/models.md) to provide understanding, intelligence, and speech. LiveKit Agents supports both high-performance STT-LLM-TTS voice pipelines constructed from multiple specialized models, as well as realtime models with direct speech-to-speech capabilities.

The rest of this guide presents two options for getting started with Gemini:

**Gemini Live API**:

Use the Gemini Live API for an expressive and lifelike voice experience with a single realtime model. This is the simplest way to get started with Gemini.

![Diagram showing realtime model.](/images/agents/realtime-model.svg)

| Model | Required Key |
| [Gemini Live API](https://ai.google.dev/gemini-api/docs/live) | `GOOGLE_API_KEY` |

---

**STT-LLM-TTS pipeline**:

String together three specialized Google services into a high-performance voice pipeline.

![Diagram showing STT-LLM-TTS pipeline.](/images/agents/stt-llm-tts-pipeline.svg)

| Component | Model | Required Key |
| STT | Google Cloud STT (Chirp) | `GOOGLE_APPLICATION_CREDENTIALS` |
| LLM | Gemini 2.0 Flash | `GOOGLE_API_KEY` |
| TTS | Google Cloud TTS | `GOOGLE_APPLICATION_CREDENTIALS` |

## Setup

Use the instructions in the following sections to set up your new project.

### Project initialization

Create a new project for the voice agent.

Run the following commands to use uv to create a new project ready to use for your new voice agent:

```shell
uv init livekit-gemini-agent --bare
cd livekit-gemini-agent

```

### Install packages

**Gemini Live API**:

Install the following packages to build a voice AI agent with the Gemini Live API, noise cancellation, and [turn detection](https://docs.livekit.io/agents/logic/turns.md):

```shell
uv add \
  "livekit-agents[silero,google]~=1.5" \
  "livekit-plugins-ai-coustics" \
  "python-dotenv"

```

---

**STT-LLM-TTS pipeline**:

Install the following packages to build a complete voice AI agent with Gemini, noise cancellation, and [turn detection](https://docs.livekit.io/agents/logic/turns.md):

```shell
uv add \
  "livekit-agents[silero,turn-detector,google]~=1.5" \
  "livekit-plugins-ai-coustics" \
  "python-dotenv"

```

### Environment variables

Run the following command to load your LiveKit Cloud API keys into a `.env.local` file:

```shell
lk app env -w

```

**Gemini Live API**:

Add your Google API key from the [Google AI Studio](https://aistudio.google.com/apikey):

```shell
LIVEKIT_API_KEY=<YOUR_API_KEY>
LIVEKIT_API_SECRET=<YOUR_API_SECRET>
LIVEKIT_URL=%{wsURL}%
GOOGLE_API_KEY=<Your Google API Key>

```

---

**STT-LLM-TTS pipeline**:

Add your Google API key from the [Google AI Studio](https://aistudio.google.com/apikey). For Google Cloud STT, you also need to set up Google Cloud credentials:

```shell
LIVEKIT_API_KEY=<YOUR_API_KEY>
LIVEKIT_API_SECRET=<YOUR_API_SECRET>
LIVEKIT_URL=%{wsURL}%
GOOGLE_API_KEY=<Your Google API Key>
GOOGLE_APPLICATION_CREDENTIALS=<Path to your Google Cloud service account JSON file>

```

> ℹ️ **Google Cloud credentials**
> 
> Google Cloud STT requires a Google Cloud project with the Speech-to-Text API enabled. Create a service account key and download the JSON file. To learn more, see [Google Cloud authentication](https://cloud.google.com/docs/authentication/application-default-credentials).

### Agent code

Create a file with your agent code.

**Gemini Live API**:

** Filename: `agent.py`**

```python
from dotenv import load_dotenv

from livekit import agents
from livekit.agents import AgentServer, AgentSession, Agent, room_io
from livekit.plugins import (
    ai_coustics,
    google,
    silero,
)

load_dotenv(".env.local")


class Assistant(Agent):
    def __init__(self) -> None:
        super().__init__(instructions="You are a helpful voice AI assistant powered by Gemini.")


server = AgentServer()


@server.rtc_session(agent_name="my-agent")
async def my_agent(ctx: agents.JobContext):
    session = AgentSession(
        llm=google.realtime.RealtimeModel(
            voice="Puck",
        ),
        vad=silero.VAD.load(),
    )

    await session.start(
        room=ctx.room,
        agent=Assistant(),
        room_options=room_io.RoomOptions(
            audio_input=room_io.AudioInputOptions(
                noise_cancellation=ai_coustics.audio_enhancement(model=ai_coustics.EnhancerModel.QUAIL_VF_S),
            ),
        ),
    )

    await session.generate_reply(
        instructions="Greet the user and offer your assistance."
    )


if __name__ == "__main__":
    agents.cli.run_app(server)


```

---

**STT-LLM-TTS pipeline**:

** Filename: `agent.py`**

```python
from dotenv import load_dotenv

from livekit import agents
from livekit.agents import AgentServer, AgentSession, Agent, room_io, TurnHandlingOptions
from livekit.plugins import ai_coustics, google, silero
from livekit.plugins.turn_detector.multilingual import MultilingualModel

load_dotenv(".env.local")


class Assistant(Agent):
    def __init__(self) -> None:
        super().__init__(
            instructions="""You are a helpful voice AI assistant powered by Google.
            You eagerly assist users with their questions by providing information from your extensive knowledge.
            Your responses are concise, to the point, and without any complex formatting or punctuation including emojis, asterisks, or other symbols.
            You are curious, friendly, and have a sense of humor.""",
        )


server = AgentServer()


@server.rtc_session(agent_name="my-agent")
async def my_agent(ctx: agents.JobContext):
    session = AgentSession(
        stt=google.STT(
            model="chirp",
        ),
        llm=google.LLM(
            model="gemini-2.5-flash",
        ),
        tts=google.TTS(
            gender="female",
            voice_name="en-US-Standard-H",
        ),
        vad=silero.VAD.load(),
        turn_handling=TurnHandlingOptions(
            turn_detection=MultilingualModel(),
        ),
    )

    await session.start(
        room=ctx.room,
        agent=Assistant(),
        room_options=room_io.RoomOptions(
            audio_input=room_io.AudioInputOptions(
                noise_cancellation=ai_coustics.audio_enhancement(model=ai_coustics.EnhancerModel.QUAIL_VF_S),
            ),
        ),
    )

    await session.generate_reply(
        instructions="Greet the user and offer your assistance.",
    )


if __name__ == "__main__":
    agents.cli.run_app(server)


```

## Download model files

If you're using the `turn-detector` plugin, you first need to download the model files:

```shell
uv run --module livekit.agents download-files

```

For more information, see [Download plugin assets](https://docs.livekit.io/deploy/agents/builds.md#download-plugin-assets) on the Builds and Dockerfiles page.

## Speak to your agent

Start your agent in `console` mode to run inside your terminal:

```shell
uv run agent.py console

```

Your agent speaks to you in the terminal, and you can speak to it as well.

![Screenshot of the CLI console mode.](/images/agents/start/cli-console.png)

## Connect to Agent Console

Start your agent in `dev` mode to connect it to LiveKit and make it available from anywhere on the internet:

```shell
uv run agent.py dev

```

Use the [Agent Console](https://docs.livekit.io/agents/start/console.md) to interact with and debug your agent in real-time. Note that you'll need to set the **Agent name**, which should be `my-agent` for this quickstart.

## Deploy to LiveKit Cloud

From the root of your project, run the following command with the LiveKit CLI. Ensure you have linked your LiveKit Cloud project.

```shell
lk agent create

```

The CLI creates `Dockerfile`, `.dockerignore`, and `livekit.toml` files in your current directory, then registers your agent with your LiveKit Cloud project and deploys it.

After the deployment completes, you can access your agent in the [Agent Console](https://docs.livekit.io/agents/start/console.md), or continue to use the terminal `console` mode as you build and test your agent locally.

## Additional resources

The following links provide more information on each available Google component in LiveKit Agents.

- **[Gemini Vision Assistant](https://docs.livekit.io/reference/recipes/gemini_live_vision.md)**: Build a vision-aware voice assistant with Gemini Live.

- **[Gemini LLM](https://docs.livekit.io/agents/models/llm/gemini.md)**: LiveKit Agents plugin for Google Gemini models.

- **[Gemini TTS](https://docs.livekit.io/agents/models/tts/gemini.md)**: LiveKit Agents plugin for Gemini TTS.

- **[Gemini Live API](https://docs.livekit.io/agents/models/realtime/plugins/gemini.md)**: LiveKit Agents plugin for the Gemini Live API.

- **[Google Cloud STT](https://docs.livekit.io/agents/models/stt/google.md)**: LiveKit Agents plugin for Google Cloud STT.

- **[Google Cloud TTS](https://docs.livekit.io/agents/models/tts/google.md)**: LiveKit Agents plugin for Google Cloud TTS.

---

This document was rendered at 2026-06-07T11:32:57.587Z.
For the latest version of this document, see [https://docs.livekit.io/agents/integrations/google.md](https://docs.livekit.io/agents/integrations/google.md).

To explore all LiveKit documentation, see [llms.txt](https://docs.livekit.io/llms.txt).