What we verified
4 SDK contract and pipeline fixture checks passed on October 13, 2026. Live connectivity and avatar output remain unverified.
What this example connects
LemonSliceTransport adds an avatar to a Daily room containing your Pipecat bot and user. Your existing STT, LLM, TTS, and context aggregators remain in the voice pipeline. The transport handles avatar audio routing and interruption messages.
This integration uses Daily WebRTC. Prepare an existing room and a room-scoped token on your backend. The adapter requires these explicitly so the room choice is under your control. An active LemonSlice subscription and a public HTTPS avatar image are also required for a live run.
Install the checked versions
First save the adapter, matching requirements file, offline test, and environment template from Example files into one folder. Run these commands from that folder on your backend. The local checks used Python 3.12.14, pipecat-ai 1.12.0, and daily-python 0.34.0 on macOS ARM64. This recipe uses the current PipelineWorker and WorkerRunner APIs.
python3.12 -m venv .venv
.venv/bin/python -m pip install -r requirements-pipecat.txtPrepare your existing voice pipeline
- Download pipecat_lemonslice.py beside your bot code.
- Set LEMONSLICE_API_KEY, AVATAR_IMAGE_URL, DAILY_ROOM_URL, and DAILY_ROOM_TOKEN on the backend. Use a short-lived Daily token with the permissions your bot needs.
- Pass your already configured stt, llm, tts, user_aggregator, and assistant_aggregator processors to the helper. No additional model provider is selected by this example.
- Keep the model unset for the normal LemonSlice model. The helper preserves a 60-second avatar idle timeout and uses 16 kHz pipeline audio.
- Keep the provider key on the server. The frontend receives only its room URL and its own short-lived room token.
Run the avatar pipeline from your backend
The helper creates the transport, assembles the stage order, registers disconnect cancellation, and runs a WorkerRunner. Invoke it inside your existing authenticated bot session. Running it starts the live boundary and can consume provider credits.
from pipecat_lemonslice import AvatarConfig, run_avatar_pipeline
# Inside your existing bot session, using configured processors:
await run_avatar_pipeline(
AvatarConfig.from_environment(),
stt=stt,
user_aggregator=user_aggregator,
llm=llm,
tts=tts,
assistant_aggregator=assistant_aggregator,
)Connect the frontend and handle departure
- Join the same Daily room from Daily Prebuilt or your custom Pipecat frontend. Render the avatar participant video track and show loading until the avatar connects.
- Filter the Pipecat bot participant from visible video tiles. It routes audio; the LemonSlice avatar supplies the video.
- Use on_client_connected and on_client_disconnected for human participant lifecycle. Avatar connections have separate events.
- The helper cancels its worker when the human or avatar disconnects. Pipecat transport cleanup owns provider session termination, and the HTTP session closes when the runner finishes.
- In a later live smoke check, test one reply, interruption, human departure, avatar loss, and provider usage after shutdown. Avatar generation, voice services, and Daily transport are separate cost components.
Recover from common failures
- HTTP authentication or quota failure: check the backend LemonSlice key, active plan, and allowance. Keep retries bounded and avoid starting repeated sessions blindly.
- Daily connection failure: verify the room URL, token expiry, and room permissions. Bot and frontend must join the same room.
- Import mismatch: use the pinned Pipecat version and its PipelineWorker/WorkerRunner imports from the downloadable example.
- Silent or unsynchronized output: confirm streaming TTS audio, the 16 kHz pipeline settings, avatar readiness, and the selected frontend audio/video tracks.
- Avatar disconnect: cancel the worker and return the UI to an actionable connection state. A fresh attempt should follow confirmed cleanup.
Reproduce the offline check
Four checks passed: installed SDK imports and request/method contracts, real LemonSlice transport and worker construction, voice-stage ordering with fixture processors, disconnect cancellation, and configuration/key redaction.
HTTP requests and Python socket connections are blocked during these checks. The worker is constructed but never run. No Daily room join, live microphone, STT/LLM/TTS response, avatar generation, or audio/video synchronization was tested.
# From the downloaded example directory:
.venv/bin/python -m unittest test_pipecat_offline.py -vExample files
Official sources
Plan the cost
Read LemonSlice pricing and model notes · Estimate avatar usage · Explore public demos