RTVI Web provides a browser client for real-time voice and video inference.
The entry point for creating a client can be found via:
- RTVI JS
realtime-ai
React context, hooks and components:
- RTVI React
realtime-ai-react
Transport packages:
RTVI requires a media transport for sending and receiving audio and video data over the internet. RTVI Web does not include any transport capabilities out of the box, so you will need to install the package for your chosen provider.
Transport packages extend the core VoiceClient
class, binding provider-specific functionality to the abstract interface.
Currently available transport packages:
- Daily.co: RTVI Daily
realtime-ai-daily
(WebRTC)
# Install latest package from NPM
npm install realtime-ai realtime-ai-daily
# or
yarn add realtime-ai realtime-ai-daily
-
Demo web client (Next.JS): https://github.com/rtvi-ai/rtvi-web-demo
-
Demo infrastructure: https://github.com/rtvi-ai/rtvi-infra-examples
Creating and starting a session with RTVI Web (using Daily as transport):
import {DailyVoiceClient} from "realtime-ai-daily";
const voiceClient = new DailyVoiceClient({
baseUrl: "https://..." // POST endpoint to request a new bot
enableMic: true,
enableCam: false,
services: {
llm: "openai",
tts: "cartesia"
},
config: [
{
service: "tts",
options: [{ name: "voice", value: "79a125e8-cd45-4c13-8a67-188112f4dd22" }],
},
{
service: "llm",
options: [
{ name: "model", value: "GPT-4o" }
{
name: "initial_messages",
value: [{
role: "system",
content: "You are a assistant called ExampleBot. You can ask me anything. Keep responses brief and legible. Introduce yourself first."
}]
}
]
}
]
});
await voiceClient.start();
Docs and API reference can be found at https://docs.rtvi.ai
Install a provider transport
yarn
yarn workspace realtime-ai build
Watch for file changes:
yarn workspace realtime-ai run dev