TomatoRTC

AI agents are service participants. They join the room the same way humans do.

Four architecture patterns. Honest latency numbers. BYO every AI provider.

Transcription pipelines Meeting assistants Moderation bots Real-time coaching

Core concepts

Three primitives power every AI integration.

Workers subscribe to room audio/video tracks, process frames, and publish results back — via the same signaling protocol as human participants.

WorkerRoomClient

Signaling-only room client for server-side AI workers. Available in Node.js (TypeScript) and Python. Subscribes to audio/video tracks, emits structured room events.

AiWorkerSupervisor

Server-side process managing worker lifecycle inside a room. Receives spawn requests from the Admin API, tracks health, enforces the per-license AI worker cap.

WorkerAdapter

Extensibility interface workers implement. Provided adapters: TranscriptionAdapter, ModerationAdapter, AssistantAdapter, AnalyticsAdapter.

Pattern 1

Real-Time Transcription

Live captions, transcript export, meeting notes. Latency: 200–400ms (Deepgram Streaming) · 600–1500ms (Whisper-large local).

1

Host grants AI worker permission

2

Admin API spawns worker

POST /api/rooms/:roomId/ai-workers → { type: "transcription", provider: "deepgram" }

3

Worker subscribes to all publisher audio tracks via WorkerRoomClient

4

Audio frames stream to STT provider

Deepgram, Whisper, Azure Speech, etc.

5

Word-level chunks published as structured chat messages

{ role: "transcript", speakerId, text, startMs, endMs }

6

Browser SDK receives events and renders captions

Pattern 2

Meeting Assistant (LLM-Backed)

AI assistant answering questions in chat, summarizing discussion, taking action items. Works best as assistive/async — not sub-second voice conversation.

1

Transcription worker feeds a rolling context window

2

AssistantAdapter worker subscribes to room chat messages

3

Participant directs question to assistant

Worker sends rolling transcript + question to LLM API (OpenAI, Anthropic, Ollama, etc.)

4

LLM response published to room chat

Response streaming supported — partial tokens published as chat updates

Pattern 3

Real-Time Moderation

Audio policy enforcement, visual frame analysis, automated content moderation. Sample video at 1–2 fps on GPU instances; calibrate false positive rates carefully.

1

ModerationAdapter worker subscribes to all publisher tracks

2

Audio/video frames sent to moderation API

AWS Comprehend, Azure Content Safety, or local inference

3

On policy violation, worker calls Admin API

Mute or kick participant via adminClient.muteParticipant()

4

Moderation event emitted to audit log

Pattern 4

Analytics & Quality Coaching

Talk-time tracking, sentiment analysis, sales call scoring, speaker coaching. The lowest-latency AI path — processing runs on a slight delay without impacting call quality.

1

AnalyticsAdapter worker subscribes to audio without publishing back to room

2

Tracks per-speaker talk time, interruption events, pause patterns

3

Optionally streams sentiment scores to side-channel analytics backend

4

End-of-call summary stored to database adapter

Optionally published as final room chat message

BYO Provider

TomatoRTC does not bundle, proxy, or bill for AI provider APIs.

Workers are your code, in your infrastructure, calling your provider accounts.

Provider Type
Integration Point
Cloud STT (Deepgram, Azure, AWS Transcribe)
Stream raw PCM from AudioChunk.data to provider WebSocket
Local STT (Whisper, whisper.cpp)
Buffer VAD-gated frames, submit to local inference endpoint
LLM (OpenAI, Anthropic, Ollama)
HTTP POST from worker with rolling context string
TTS (ElevenLabs, OpenAI TTS, Coqui)
POST text, receive audio bytes, publish as media track
Moderation (AWS Comprehend, Azure Content Safety)
Async HTTP POST with text/image payload

Browser-side

Client AI runs entirely in the browser.

@rtc-sdk/client-ai — UI-side AI features that don't require server processing. No audio or video leaves the client device.

VAD (Voice Activity Detection)

Detects local speech onset/offset without sending audio to a server. Used for UI indicators and local recording gating.

Ambient Noise Detection

Classifies background noise level to prompt users to mute or improve microphone placement.

WebGL Frame Preprocessing

GPU-backed frame downscaling before sending frames to MediaPipe or remote APIs.

Latency budget

Honest numbers from capture to voice response.

For sub-500ms voice AI, specialized real-time inference infrastructure (Groq, Cerebras, local GPU) is required for STT and LLM stages.

Stage
Typical Latency
Audio capture → PCM frame available
10–40ms
PCM frame → Cloud STT first token
200–800ms
PCM frame → Local Whisper first token
600–1500ms
STT result → LLM first token (cloud)
800–3000ms
LLM first token → TTS audio start
200–600ms
TTS audio → Published room media track
100–200ms
Full round trip (wake word → voice response)
1.5–6 seconds

Scaling

Multiple worker types can run simultaneously in one room.

Each transcription worker streaming to cloud STT consumes ~0.5 vCPU. Local Whisper inference requires 1–4 vCPU or GPU per concurrent stream.

2 Starter

Concurrent AI workers across all rooms

20 Business

Concurrent AI workers across all rooms

Enterprise

Unlimited (fair-use reviewed)

Division of responsibility

Clear boundaries between platform and your code.

TomatoRTC ships the primitives. You wire in the providers, business logic, and infrastructure.

Platform provides

WorkerRoomClient · AiWorkerSupervisor · WorkerAdapter interfaces (Transcription, Moderation, Assistant, Analytics) · Admin API for worker spawn/teardown · Chat message system for publishing results

You provide

STT, LLM, TTS provider accounts and API keys · Worker business logic (implementing WorkerAdapter) · Infrastructure to run workers (containerized Node.js or Python) · Any custom AI models or fine-tunes

TomatoRTC

Ready to build a voice AI pipeline?

  1. Review the architecture patterns

    Pick the one that matches your use case — transcription, assistant, moderation, or analytics.

  2. Read the worker development guide

    WorkerAdapter interface, supervisor API, and typed WorkerOutput — full guide in the monorepo.

  3. Run the kitchen-sink AI demo

    A working transcription worker ships as a runnable example in the monorepo.