Skip to main content

NVIDIA Riva TTS plugin guide

How to use the NVIDIA Riva TTS plugin for LiveKit Agents.

Available in
Python

Overview

This plugin allows you to use NVIDIA Riva as a TTS provider for your voice agents.

Quick reference

This section provides a quick reference for the NVIDIA Riva TTS plugin. For more information, see Additional resources.

Installation

Install the plugin from PyPI:

uv add "livekit-agents[nvidia]~=1.2"

Authentication

The NVIDIA Riva plugin supports two authentication methods:

  1. NVIDIA API Key: Set NVIDIA_API_KEY in your .env file to use NVIDIA's cloud services.
  2. Self-Hosted NVIDIA Riva Server: Deploy your own NVIDIA Riva server and configure the plugin to communicate with it using the server parameter and setting use_ssl=False.

Usage

Use NVIDIA Riva TTS in an AgentSession or as a standalone speech generator. For example, you can use this TTS in the Voice AI quickstart.

from livekit.plugins import nvidia
session = AgentSession(
tts=nvidia.TTS(
voice="Magpie-Multilingual.EN-US.Leo",
language_code="en-US",
),
# ... llm, stt, etc.
)

Parameters

This section describes some of the available parameters. See the plugin reference for a complete list of all available parameters.

voicestringOptionalDefault: Magpie-Multilingual.EN-US.Leo

The NVIDIA Riva TTS voice to use. Use the list_voices() method to get available voices for your language. See NVIDIA Riva documentation for more information about available voices.

language_codestringOptionalDefault: en-US

BCP-47 language code for the speech synthesis language. Common values include en-US, es-ES, fr-FR, de-DE, zh-CN, ja-JP, and more. See NVIDIA Riva documentation for a complete list of supported languages.

serverstringOptionalDefault: grpc.nvcf.nvidia.com:443

The URI of your NVIDIA Riva server. If you're using NVIDIA's cloud services, leave this as the default. For self-hosted servers, provide your server URI.

function_idstringOptionalDefault: 877104f7-e885-42b9-8de8-f6e4c6303969

The NVIDIA Cloud Functions function ID for TTS. Only required when using NVIDIA's cloud services.

use_sslbooleanOptionalDefault: True

Whether to use SSL/TLS for the connection. Set to False when using a self-hosted NVIDIA Riva server without SSL.

Additional resources

The following resources provide more information about using NVIDIA Riva with LiveKit Agents.