Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.spatius.ai/llms.txt

Use this file to discover all available pages before exploring further.

This page describes the Backend Mode + RTC transport pattern. Your backend owns the conversation pipeline (ASR, LLM, TTS, and the Spatius Server SDK that talks to Motion Server). A LiveKit room transports the avatar’s audio and motion data to the browser. The Web client uses the RTC Adapter (@spatius/avatarkit-rtc) to join the room and render the avatar. It is not the same as LiveKit Agents Integration, which is a Platform Integration built around the LiveKit Agents framework.

Compare the two LiveKit shapes

LiveKit Agents IntegrationBackend Mode with LiveKit
CategoryPlatform IntegrationStandalone Integration
Your backend runsA LiveKit Agents worker using livekit-plugins-spatiusYour own service using the Spatius Server SDK
Role of LiveKitBoth the agent framework and the room transportOnly the downstream room transport between your backend and your clients
Web clientRTC Adapter with LiveKitProviderRTC Adapter with LiveKitProvider
Choose whenYou already build voice agents in LiveKit AgentsYou want full control of the audio pipeline with the Spatius Server SDK, but reuse LiveKit as the downstream transport
GuideLiveKit Agents IntegrationThis page

How this pattern works

  1. Your backend runs ASR, LLM, TTS, and uses the Spatius Server SDK to receive encoded audio and motion messages from Motion Server.
  2. Your backend publishes those encoded audio and motion messages into a LiveKit room (Spatius Server SDK supports a LiveKit egress mode that does this for you).
  3. The Web client joins the same LiveKit room with @spatius/avatarkit-rtc and renders the avatar locally. The client does not call yieldAudioData() or yieldFramesData() manually — the RTC Adapter owns the data flow.

Demos

  • Backend Mode demo — the backend half (ASR/LLM/TTS + Spatius Server SDK). It ships with its own WebSocket transport; swap in LiveKit egress to match this pattern.
  • platform-integrations/livekit-room-demo — validates the RTC Adapter’s LiveKit wiring (token, room connect, adapter init, avatar load, mic publish). Remote audio playback and motion rendering only happen when a publisher (e.g. a Backend Mode service or LiveKit Agents worker) is in the room — this example alone has no producer. Not the full Backend Mode + RTC transport voice-agent demo.
The full end-to-end demo of this pattern — a service that, given a character / avatar identifier, both mints LiveKit tokens and drives the corresponding ASR / LLM / TTS pipeline through the Spatius Server SDK into the same LiveKit room — is not packaged in this repository yet. The two halves above are runnable today; assemble them by switching the Backend Mode backend to LiveKit egress and pointing the Web client at the same room.If you want an end-to-end voice-agent experience you can run locally without writing that glue, use the LiveKit Agents Integration Quickstart. It delivers the same on-screen behavior (mic in → avatar speaks back) by hosting the pipeline inside a LiveKit Agents worker instead of a standalone backend.

Next steps

Backend Mode overview

Architecture and the full transport options table.

RTC Adapter reference

The Web client adapter used to render the avatar from the LiveKit room.