Skip to main content
Use the @deepslate-labs/livekit package to add a RealtimeModel implementation to the LiveKit Agents Node.js / TypeScript framework, so you can integrate with the Deepslate unified voice AI infrastructure.
Using the Python LiveKit framework instead? See the LiveKit Plugin (Python) page for the deepslate-livekit package. The two plugins share the same configuration model and feature set; this page is written against the Node framework’s API (the realtime classes live under the llm namespace, and audio frames come from @livekit/rtc-node).
This plugin lives in the deepslate-sdks monorepo. We welcome contributions — feel free to open issues or pull requests there.

Prerequisites

  • A Deepslate account with API credentials
  • Node.js 18+
  • LiveKit server and API credentials
  • (Optional) ElevenLabs API key for server-side TTS

Installation

The plugin declares the LiveKit framework packages as peer dependencies — install them alongside it:
You don’t need to install @deepslate-labs/core separately. It’s pulled in automatically.

Environment Variables

Set up your credentials as environment variables:
Never expose your Deepslate or ElevenLabs API keys to clients. This plugin is for server-side use with LiveKit Agents.

Quick Start

Configuration Reference

The RealtimeModel constructor takes a single options object (RealtimeModelOptions):
Voice Activity Detection is handled server-side by Deepslate. You tune it via the vad object on RealtimeModel — no client-side VAD pipeline is needed.
Tuning tips:
  • Noisy environments: increase confidenceThreshold (0.6–0.8) and minVolume (0.02–0.05)
  • Lower latency: decrease startDurationMs (100–150) and stopDurationMs (200–300)
  • Natural pacing: slightly increase stopDurationMs (600–800)
Use a voice cloned and hosted within Deepslate — no external TTS provider credentials required. Pass it as ttsConfig to enable audio output.HostedTtsMode values:
Configure server-side text-to-speech with ElevenLabs. Pass it as ttsConfig to enable audio output and automatic interruption handling.Use elevenLabsConfigFromEnv() to build a config from environment variables.ElevenLabsVoiceSettings — fine-grained control over the synthesized voice:
When using server-side TTS (ElevenLabs or hosted), automatic interruption handling (context truncation) is enabled. The server tracks exactly what was spoken before the interruption, keeping the model’s context accurate. Without server-side TTS you can use LiveKit’s standard TTS integration, but this interruption context tracking will not be available.

Features

Real-time Voice Streaming

Low-latency bidirectional audio streaming for natural conversations

Server-side VAD

Voice activity detection handled server-side for reliable, configurable speech detection

Function Tools

Define and use function tools with LiveKit’s llm.tool() helper

Flexible TTS

Server-side TTS via Deepslate-hosted (cloned) voices or ElevenLabs

Low Latency Mode

Hosted voice TTS supports a low latency mode for fastest possible response at the cost of some output quality

Direct Speech

Speak text directly via TTS without routing through the LLM

Conversation Queries

Run one-shot side-channel inference without affecting the main conversation

Chat History Export

Export the full conversation history on demand

Live Configuration

Update the system prompt mid-session without reconnecting

Function Tools

Use LiveKit’s llm.tool() helper to expose tools to the model. Tool parameters are described with a zod schema:

The Deepslate Session

For Deepslate-specific capabilities (welcome messages, direct speech, conversation queries, history export, live configuration), obtain the underlying DeepslateRealtimeSession from the model with model.session():
The session is an event emitter — subscribe with session.on(...).

Session Initialized Event

DeepslateRealtimeSession emits a "session_initialized" event once the WebSocket session is fully set up and ready to accept messages. Combine it with speakDirect() to send a welcome message instead of relying on a fixed delay:
Register the listener before the session connects to avoid missing the event.

Direct Speech

speakDirect() synthesizes and plays audio directly — bypassing the LLM entirely. This is useful for scripted prompts, confirmations, or fallback messages.
Passing false speaks the text without adding it to the conversation context — ideal for system-level announcements.

Conversation Queries

queryConversation() runs a one-shot inference call on a side channel, separate from the main conversational turn. The result is returned as a string and does not affect the conversation history or trigger any audio.
You can also pass a second instructions argument to further constrain the model’s output format.

Chat History Export

Export the full conversation history at any point during a session. The result is delivered via the "chat_history_exported" event:

Live Configuration

Update the system prompt mid-session without reconnecting:
Changes take effect on the next model turn.

Contributing

This plugin is open source. Visit the deepslate-sdks monorepo to:
  • Report issues
  • Submit pull requests
  • Request features

Next Steps

LiveKit Plugin (Python)

The Python edition of this plugin

WebSocket API

Low-level WebSocket access for custom integrations

API Reference

Full message schemas and configuration options

LiveKit Agents Docs

LiveKit Agents framework documentation

GitHub Repository

Source code, issues, and contributions