Prerequisites
- A Zero Runtime address and auth token from the dashboard
- API keys for the providers you use (Deepgram, Google, and Cartesia here)
- Python 3.11+ or Node.js 20.11+
1
Install the SDK
2
Set your environment
3
Write your agent
4
Run it
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Install a Zero Runtime SDK, set your environment, write an agent, and run it. A working real-time voice assistant in Python or JavaScript.
Install the SDK
pip install zeroruntime
npm install @zeroruntime/js-sdk
Set your environment
export ZERORUNTIME_TARGET=us2.zeroruntime.ai:443 # your Zero Runtime address
export ZERORUNTIME_AUTH_TOKEN=<your-token>
export DEEPGRAM_API_KEY=<key> # speech-to-text
export GOOGLE_API_KEY=<key> # the LLM (Gemini)
export CARTESIA_API_KEY=<key> # text-to-speech
Write your agent
import zeroruntime
from zeroruntime import Agent, Pipeline, EOUConfig, InterruptConfig
from zeroruntime.plugins import DeepgramSTT, GoogleLLM, CartesiaTTS, SileroVAD, RNNoise
from zeroruntime.inference import TurnDetector
AGENT_ID = "assistant"
pipeline = Pipeline(
stt=DeepgramSTT(),
llm=GoogleLLM(model="gemini-2.5-flash", max_output_tokens=8192),
tts=CartesiaTTS(),
vad=SileroVAD(threshold=0.4),
turn_detector=TurnDetector(model="echo-large"),
denoise=RNNoise(),
eou_config=EOUConfig(mode="ADAPTIVE", min_max_speech_wait_timeout=[0.1, 0.3]),
interrupt_config=InterruptConfig(
interrupt_min_duration=0.5,
interrupt_min_words=2,
resume_on_false_interrupt=True,
),
)
class Assistant(Agent):
def __init__(self):
super().__init__(
agent_id=AGENT_ID,
instructions="You are a friendly voice assistant. Keep replies short.",
pipeline=pipeline,
)
async def on_enter(self):
await self.session.say("Hi! How can I help?")
async def on_exit(self):
pass
if __name__ == "__main__":
# Pass the class itself (not an instance): serve() builds a fresh Assistant +
# pipeline per call, which is required for correct per-call state under concurrent calls.
zeroruntime.serve(Assistant, on_ready=lambda: zeroruntime.invoke(AGENT_ID, room=zeroruntime.Room(playground=True)))
import * as zeroruntime from '@zeroruntime/js-sdk';
import { Agent, EOUConfig, InterruptConfig, Pipeline, Room } from '@zeroruntime/js-sdk';
import { DeepgramSTT, GoogleLLM, CartesiaTTS, SileroVAD, RNNoise } from '@zeroruntime/js-sdk/plugins';
import { TurnDetector } from '@zeroruntime/js-sdk/inference';
const AGENT_ID = 'assistant';
const pipeline = Pipeline({
stt: DeepgramSTT(),
llm: GoogleLLM({ model: 'gemini-2.5-flash', max_output_tokens: 8192 }),
tts: CartesiaTTS(),
vad: SileroVAD({ threshold: 0.4 }),
turn_detector: TurnDetector({ model: 'echo-large' }),
denoise: RNNoise(),
eou_config: EOUConfig({ mode: 'ADAPTIVE', min_max_speech_wait_timeout: [0.1, 0.3] }),
interrupt_config: InterruptConfig({
interrupt_min_duration: 0.5,
interrupt_min_words: 2,
resume_on_false_interrupt: true,
}),
});
class Assistant extends Agent {
constructor() {
super({
agent_id: AGENT_ID,
instructions: 'You are a friendly voice assistant. Keep replies short.',
pipeline,
});
}
async on_enter() {
await this.session!.say('Hi! How can I help?');
}
}
// Pass the class itself (not an instance): serve() builds a fresh Assistant +
// pipeline per call, which is required for correct per-call state under concurrent calls.
await zeroruntime.serve(Assistant, {
on_ready: () => zeroruntime.invoke(AGENT_ID, { room: Room({ playground: true }) }),
});
Run it
python agent.py
npx tsx agent.ts # or compile with tsc and run node agent.js