Skip to main content

Overview

SimliVideoService integrates with Simli to create real-time AI avatar video experiences using WebRTC streaming. The service processes audio input to generate synchronized avatar video and audio output, handling real-time streaming, audio resampling, and conversation interruptions for engaging conversational AI applications.

Installation

To use Simli services, install the required dependency:
pip install "pipecat-ai[simli]"

Prerequisites

Simli Account Setup

Before using Simli video services, you need:
  1. Simli Account: Sign up at Simli Platform
  2. API Key: Generate an API key from your account dashboard
  3. Face Selection: Choose or create avatar faces for video generation
  4. WebRTC Setup: Configure real-time streaming capabilities

Required Environment Variables

  • SIMLI_API_KEY: Your Simli API key for authentication
  • SIMLI_FACE_ID: ID of your avatar face

Configuration

api_key
str
required
Simli API key for authentication.
face_id
str
required
Simli Face ID. For Trinity avatars, specify "faceId/emotionId" to use a different emotion than the default.
latency_interval
int
default:"0"
Latency interval setting for sending health checks to check the latency to Simli servers.
simli_url
str
default:"https://api.simli.ai"
URL of the Simli servers. Can be changed for custom deployments by enterprise users.
is_trinity_avatar
bool
default:"False"
Whether this is a Trinity avatar, which reduces latency when using Trinity.
params
InputParams
default:"None"
Additional input parameters for session configuration. See InputParams below.

InputParams

ParameterTypeDefaultDescription
enable_loggingboolNoneWhether to enable Simli logging.
max_session_lengthintNoneAbsolute maximum session duration in seconds. Avatar disconnects after this time even if speaking.
max_idle_timeintNoneMaximum duration in seconds the avatar can be idle (not speaking) before disconnecting.

Usage

Basic Setup

from pipecat.services.simli import SimliVideoService

simli = SimliVideoService(
    api_key=os.getenv("SIMLI_API_KEY"),
    face_id=os.getenv("SIMLI_FACE_ID"),
)

With Session Configuration

simli = SimliVideoService(
    api_key=os.getenv("SIMLI_API_KEY"),
    face_id=os.getenv("SIMLI_FACE_ID"),
    is_trinity_avatar=True,
    params=SimliVideoService.InputParams(
        max_session_length=600,
        max_idle_time=120,
    ),
)

Notes

  • Audio resampling: The service resamples audio to 16kHz internally for the Simli API and resamples received audio back to the pipeline’s sample rate.
  • Trinity avatars: When is_trinity_avatar=True, the service uses playImmediate for the first audio chunk after an interruption to reduce latency.
  • Deprecated parameters: The simli_config and use_turn_server parameters are deprecated. Use api_key and face_id instead of simli_config.