Skip to main content

Overview

AnamVideoService generates real-time interactive video avatars for your Pipecat agents using Anam. It consumes TTS audio from your pipeline and produces synchronized audio and video frames (OutputImageRawFrame video and SpeechOutputAudioRawFrame audio) by wrapping Anam’s Python SDK. The package also ships an experimental AnamTransport — a drop-in replacement for Pipecat’s DailyTransport that publishes the avatar’s audio and video directly into a Daily room. See the source repository for details.

Source Repository

Source code, examples, and issues for the Anam integration

PyPI Package

The pipecat-anam package on PyPI

Anam Lab

Build and test your persona and get your avatar_id

API Keys

Create and manage your Anam API key

Installation

This is a community-maintained package distributed separately from pipecat-ai:
uv add pipecat-anam
You’ll also need Pipecat with the services you use (STT, TTS, LLM, transport).

Prerequisites

Anam Account Setup

Before using the Anam video service, you need:
  1. Anam API Key: Get one from Anam Lab
  2. Avatar ID: Build and test your persona in Anam Lab to obtain your avatar_id
You’ll also need API keys for the STT, TTS, and LLM services used in your pipeline (e.g., Deepgram, Cartesia, Google).

Required Environment Variables

  • ANAM_API_KEY: Your Anam API key for authentication

Configuration

Constructor parameters for AnamVideoService:
api_key
str
required
Anam API key for authentication.
persona_config
anam.PersonaConfig
required
Full persona configuration (e.g., avatar_id, enable_audio_passthrough). Set enable_audio_passthrough=True to render the avatar directly from your TTS audio.
ice_servers
list[dict]
default:"None"
Custom ICE servers for WebRTC (optional).
api_base_url
str
default:"https://api.anam.ai"
Base URL for the Anam API. Falls back to https://api.anam.ai when not set.
api_version
str
default:"None"
Anam API version to use.
enable_session_replay
bool
default:"True"
Whether to enable session recording on Anam’s backend.
See the source repository for the authoritative, up-to-date list of parameters and the experimental AnamTransport options.

Usage

import os

from anam import PersonaConfig
from pipecat_anam import AnamVideoService
from pipecat.frames.frames import LLMRunFrame
from pipecat.pipeline.pipeline import Pipeline

persona_config = PersonaConfig(
    avatar_id="your-avatar-id",
    enable_audio_passthrough=True,
)

anam = AnamVideoService(
    api_key=os.environ["ANAM_API_KEY"],
    persona_config=persona_config,
    api_base_url="https://api.anam.ai",
    api_version="v1",
    enable_session_replay=False,
)

pipeline = Pipeline([
    transport.input(),
    stt,
    context_aggregator.user(),
    llm,
    tts,
    anam,  # Video avatar (returns synchronized audio/video)
    transport.output(),
    context_aggregator.assistant(),
])
See the example in the source repository for a complete working pipeline.

Compatibility

Tested with Pipecat v0.0.100+ (Python 3.10+). Check the source repository for the latest tested version and changelog.