Skip to content

feat: add callyour.ai avatar plugin - #8859

Open
JonasDaWi wants to merge 7 commits into
livekit:mainfrom
JonasDaWi:feat/callyourai-avatar-plugin
Open

JonasDaWi wants to merge 7 commits into
livekit:mainfrom
JonasDaWi:feat/callyourai-avatar-plugin

Conversation

@JonasDaWi

Copy link
Copy Markdown
Contributor

Adds livekit-plugins-callyourai, an avatar plugin for callyour.ai: a lip-synced, photo-real avatar made from one photo, rendered into the agent's room.

from livekit.plugins import callyourai

avatar = callyourai.AvatarSession(avatar_id="...")  # CALLYOURAI_API_KEY in the environment
await avatar.start(session, room=ctx.room)
await session.start(agent=..., room=ctx.room)

The usual avatar flow: the plugin mints a token for the avatar participant through JobContext.create_participant_token (so token mode works), with lk.publish_on_behalf set to the agent, and the agent's speech goes to the avatar through DataStreamAudioOutput. Beyond that:

  • Recovery: if the rendering server fails mid-call, the plugin asks the API to put the avatar back on another server under the same identity, and the agent keeps talking (avatar_lost / avatar_recovered / avatar_recovery_failed).
  • Queue: wait_seconds waits for a free avatar instead of failing. If the session already publishes its own audio, the agent talks voice-only until the avatar is live, then switches between two sentences.
  • Live HD: hd=True, or upgrade_to_hd=True to start right away on a normal avatar and switch to HD mid-call. Frontends can follow the agent's callyourai.avatar attribute.
  • Expression: set_mood() and set_action() (one-shot gestures such as wave).

The API client only retries session creation when the connection could not be opened, so a session is never started twice. Reads are retried on 5xx.

Sign-up works through the API too, so a coding agent can get a key on its own (https://api.callyour.ai/llms.txt). New accounts get free credit after confirming their email, and there is a ready-made avatar to try without a photo.

Testing

  • tests/test_plugin_callyourai.py: retry rules, error codes, the request body, the avatar token (identity, kind, publish-on-behalf), and ending the session on aclose().
  • ruff check, ruff format --check and mypy pass for the package.
  • A real call against the production API with an AgentSession (Soniox STT/TTS, an OpenRouter LLM): the avatar's audio and video arrived as callyourai-avatar on behalf of the agent after about 6 s, the greeting played, and the session was billed and ended when the room closed.

The plugin is also published from our own repo as livekit-plugins-callyourai on PyPI (0.4.x). Once this is merged, we'll move users to the version published from here.

@JonasDaWi
JonasDaWi requested a review from a team as a code owner November 30, 2026 14:33
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@Rehansanjay

Copy link
Copy Markdown
Contributor

A few things outside the code that block this, in case they're not on your radar:

  1. CLA: the check is still pending ("not signed yet").
  2. PyPI name: livekit-plugins-callyourai is already on PyPI (latest 0.4.2, author callyour.ai). LiveKit publishes in-repo plugins from .github/workflows/publish.yml with trusted publishing (environment pypi, no password). For a project that already exists, that upload needs the project's owner to add it as a trusted publisher on PyPI (repo livekit/agents, workflow publish.yml, environment pypi) or to hand the project over. Without that, I'd expect the first release after merge to fail for this package. Users on 0.4.x would also go to 1.9.0.
  3. The conflict: I tried the merge against today's main and only uv.lock conflicts, the two pyproject files merge cleanly. Merge main, then git checkout --theirs uv.lock && uv lock.

Also, the Devin thread on avatar.py about lost speech during recovery is the only one still open. The fresh output that _recover now attaches looks like it's meant to cover that, so a short reply there would save a reviewer working it out.

I didn't run the avatar itself.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants