> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Simli

> Real-time AI avatar video generation service using WebRTC streaming

## 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.

<CardGroup cols={2}>
  <Card title="Simli Video API Reference" icon="code" href="https://reference-server.pipecat.ai/en/latest/api/pipecat.services.simli.video.html">
    Pipecat's API methods for Simli video integration
  </Card>

  <Card title="Example Implementation" icon="play" href="https://github.com/pipecat-ai/pipecat/blob/main/examples/video-avatar/video-avatar-simli-video-service.py">
    Complete example with avatar streaming
  </Card>

  <Card title="Simli Documentation" icon="book" href="https://docs.simli.com/overview">
    Official Simli API documentation and guides
  </Card>

  <Card title="Simli Platform" icon="microphone" href="https://www.simli.com/">
    Access avatar faces and manage API keys
  </Card>
</CardGroup>

## Installation

To use Simli services, install the required dependency:

```bash theme={null}
uv add "pipecat-ai[simli]"
```

## Prerequisites

### Simli Account Setup

Before using Simli video services, you need:

1. **Simli Account**: Sign up at [Simli Platform](https://www.simli.com/)
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

<ParamField path="api_key" type="str" required>
  Simli API key for authentication.
</ParamField>

<ParamField path="face_id" type="str" required>
  Simli Face ID. For Trinity avatars, specify `"faceId/emotionId"` to use a
  different emotion than the default.
</ParamField>

<ParamField path="simli_url" type="str" default="https://api.simli.ai">
  URL of the Simli servers. Can be changed for custom deployments by enterprise
  users.
</ParamField>

<ParamField path="is_trinity_avatar" type="bool" default="False">
  Whether this is a Trinity avatar, which reduces latency when using Trinity.
</ParamField>

<ParamField path="max_session_length" type="int" default="None">
  Absolute maximum session duration in seconds. Avatar disconnects after this
  time even if speaking.
</ParamField>

<ParamField path="max_idle_time" type="int" default="None">
  Maximum duration in seconds the avatar can be idle (not speaking) before
  disconnecting.
</ParamField>

<ParamField path="enable_logging" type="bool" default="None">
  Whether to enable Simli logging.
</ParamField>

<ParamField path="settings" type="SimliVideoSettings" default="None">
  Service settings. Use `SimliVideoService.Settings(...)` for configuration.
</ParamField>

<ParamField path="params" type="InputParams" default="None">
  <Warning>
    **Deprecated since 0.0.106**: Use the direct constructor parameters
    (`max_session_length`, `max_idle_time`, `enable_logging`) or
    `settings=SimliVideoService.Settings(...)` instead.
  </Warning>

  Additional input parameters for session configuration. See [InputParams](#inputparams)
  below.
</ParamField>

### InputParams

<Warning>
  **Deprecated since 0.0.106**: Use the direct constructor parameters
  (`max_session_length`, `max_idle_time`, `enable_logging`) instead of
  `SimliVideoService.InputParams`.
</Warning>

| Parameter            | Type   | Default | Description                                                                                        |
| -------------------- | ------ | ------- | -------------------------------------------------------------------------------------------------- |
| `enable_logging`     | `bool` | `None`  | Whether to enable Simli logging.                                                                   |
| `max_session_length` | `int`  | `None`  | Absolute maximum session duration in seconds. Avatar disconnects after this time even if speaking. |
| `max_idle_time`      | `int`  | `None`  | Maximum duration in seconds the avatar can be idle (not speaking) before disconnecting.            |

## Usage

### Basic Setup

```python theme={null}
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

```python theme={null}
simli = SimliVideoService(
    api_key=os.getenv("SIMLI_API_KEY"),
    face_id=os.getenv("SIMLI_FACE_ID"),
    is_trinity_avatar=True,
    max_session_length=600,
    max_idle_time=120,
    enable_logging=True,
)
```

### Using Settings (Alternative)

```python theme={null}
simli = SimliVideoService(
    api_key=os.getenv("SIMLI_API_KEY"),
    face_id=os.getenv("SIMLI_FACE_ID"),
    settings=SimliVideoService.Settings(),
)
```

## Notes

* **Service architecture**: As of version 0.0.106, `SimliVideoService` extends `AIService` and supports `SimliVideoService.Settings(...)` for configuration, aligning it with other video services like HeyGen and Tavus.
* **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**:
  * `SimliVideoService.InputParams` is deprecated since 0.0.106. Use direct constructor parameters (`max_session_length`, `max_idle_time`, `enable_logging`) instead.
  * The `simli_config` and `use_turn_server` parameters have been removed. Use `api_key` and `face_id` directly as constructor parameters.
