Skip to main content

ChatFX Avatar for Pipecat

A real-time talking face for your Pipecat bot. Your bot's voice goes to the avatar, and its face and voice come back, drawn together so the lips match, as your bot's own video and audio. You keep your own listening, AI and voice; ChatFX adds the face, billed by the minute.

Tested with Pipecat v1.15.0, v1.16.0 and v1.17.0 (Python 3.12). Built and maintained by the ChatFX Avatar team: questions and issues go to this repository's issues or service@chatfx.com.

Install

pip install pipecat-chatfx

Requires Python 3.10+ and pipecat-ai 1.8 or newer (it brings pipecat-ai[daily]).

Add your keys

  • CHATFX_AVATAR_API_KEY: create one under API keys at avatar.chatfx.com.
  • DAILY_API_KEY: from your Daily dashboard. Running on Pipecat Cloud, you already have one. The avatar meets your bot in a private Daily room in your account, made for each call and removed when it ends, the way Pipecat's own Tavus service works.

Put both in your bot's environment (your .env, or your Pipecat Cloud secret set).

Use it

Put ChatFXVideoService right after your TTS service (or, with a speech-to-speech service such as OpenAILiveLLMService, right after that service), and turn on your transport's video out at the avatar's size:

from pipecat_chatfx import ChatFXVideoService

avatar = ChatFXVideoService(avatar_id="chatfx-lois")  # copy the id from the Avatars page

pipeline = Pipeline([
    transport.input(),
    stt,
    user_aggregator,
    llm,
    tts,
    avatar,
    transport.output(),
    assistant_aggregator,
])
DailyParams(  # Daily, for local testing and real calls
    audio_in_enabled=True,
    audio_out_enabled=True,
    video_out_enabled=True,
    video_out_is_live=True,
    video_out_width=912,     # 912 x 512 landscape, 512 x 512 square, 384 x 512 portrait
    video_out_height=512,
    video_out_framerate=25,
)

Use Daily as your transport, for local testing and real calls. Your Daily key is already set for the avatar. Over SmallWebRTC, the browser shows her lips about a third of a second behind her voice.

That's all the code. When your pipeline ends (or is cancelled when the visitor leaves), the avatar's session ends too, so billing stops. Your page shows the bot's video as before: the avatar is the bot.

Step by step: ChatFX Avatar for Pipecat.

Run the example

A complete bot (Deepgram listening, OpenAI, Cartesia voice, ChatFX Avatar face) is in examples/bot.py:

cd examples
cp .env.example .env   # add your keys
uv run bot.py -t daily

Then open http://localhost:7860/client, choose Daily at the top, click Connect and allow the microphone. The avatar appears and says the first message; talk over it to see it stop.

What it does for you

  • Shows a waiting picture. Until the live face is in, your bot's video is the avatar's picture with "Video starting..." on it.
  • Greets with the face. Your bot's first words wait up to 10 seconds for the face, so they come with it.
  • Never depends on the face. If the face can't come, or leaves mid-call, your bot carries on with its own voice.
  • Stops at once when talked over. An interruption stops the avatar mid-word.
  • Lets the last words finish. At the end of a call, the avatar finishes its goodbye before it leaves.

Options

ChatFXVideoService(
    avatar_id="chatfx-lois",
    api_key=None,                    # defaults to CHATFX_AVATAR_API_KEY
    daily_api_key=None,              # defaults to DAILY_API_KEY
    api_url=None,                    # defaults to https://api.chatfx.com
    face_first_seconds=10.0,         # how long the first words wait for the face
    start_timeout=120.0,             # how long to keep trying to start the avatar
    waiting_picture=True,            # show the avatar's picture until the live face is in
    waiting_text="Video starting...",  # the words on it, in your language (None: no words)
)

If the avatar can't start (a wrong key, no minutes left), avatar.failure says why, with the API's code.

Changelog

See CHANGELOG.md.

License

BSD 2-Clause, like Pipecat.

Metadata

Release files for pipecat-chatfx 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pipecat-chatfx 0.1.5
File Size Uploaded Provenance Actions
pipecat_chatfx-0.1.5.tar.gz 19.0 kB Without provenance Details for pipecat_chatfx-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pipecat-chatfx 0.1.5
File Interpreter ABI Platform Actions
pipecat_chatfx-0.1.5-py3-none-any.whl Python 3 none any Details for pipecat_chatfx-0.1.5-py3-none-any.whl

Total release size: 32.5 kB

Release files / pipecat_chatfx-0.1.5.tar.gz

Download URL pipecat_chatfx-0.1.5.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d805fa65dc19f11cd31f16deb11b9866375148ab0b26c354f8291e0218cc95ab
BLAKE2b-256 checksum
How to use checksums
ff67c46ac7fda06d8fce8f259345c391596133c981d26c681481ff8093e82a1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pipecat_chatfx-0.1.5-py3-none-any.whl

Download URL pipecat_chatfx-0.1.5-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
14e0a3e2a7c98b4f93cb02931e1c88914d81e118f20ff81067d8f2bca3d80f42
BLAKE2b-256 checksum
How to use checksums
7e4a417b9c44fc98b17973eaf4f44750142036661f1bed8b7cdfd154cb6238c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pipecat-chatfx 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page