ZRT: Zero Runtime Python SDK
Serverless voice AI agents for Python. Write the agent in real Python with your own STT, LLM, and TTS providers. Zero Runtime runs the live speech‑to‑speech pipeline (turn detection, denoising, interruptions) at low latency in the cloud.
You write the agent. We run the runtime. No media servers, no GPUs, no autoscaling.
| Self‑hosted frameworks | No‑code platforms | Zero Runtime | |
|---|---|---|---|
| Real Python + custom tools | ✅ | ❌ (dashboard) | ✅ |
| Run media servers / GPUs / scaling | ❌ you operate it | ✅ managed | ✅ serverless |
| Bring any provider + your own keys | ✅ | limited | ✅ |
Install
pip install zrt
Requires Python 3.10+.
Quickstart
Get your auth token from app.zeroruntime.ai.
export ZRT_AUTH_TOKEN=<your-token>
export DEEPGRAM_API_KEY=<key> # speech-to-text
export GOOGLE_API_KEY=<key> # LLM (Gemini)
export CARTESIA_API_KEY=<key> # text-to-speech
# agent.py
import zrt
from zrt import Agent, Pipeline, Room, function_tool
from zrt.plugins import CartesiaTTS, DeepgramSTT, GoogleLLM, SileroVAD, TurnDetector
AGENT_ID = "assistant"
class Assistant(Agent):
def __init__(self) -> None:
super().__init__(
name="Assistant",
agent_id=AGENT_ID,
instructions=(
"You are a friendly voice assistant. Keep replies short and natural. "
"When asked about the weather, call the get_weather tool."
),
pipeline=Pipeline(
stt=DeepgramSTT(model="nova-2-conversationalai"),
llm=GoogleLLM(model="gemini-3-flash-preview", thinking_budget=0),
tts=CartesiaTTS(model="sonic-3.5"),
vad=SileroVAD(),
turn_detector=TurnDetector(model="echo-large"),
),
)
async def on_enter(self) -> None:
await self.session.say("Hi! I'm your assistant. Ask me about the weather in any city.")
async def on_exit(self) -> None:
await self.session.say("Thanks for calling. Goodbye!")
@function_tool
async def get_weather(self, city: str) -> dict:
"""Get the current weather for a city.
Args:
city: Name of the city to look up.
"""
return {"city": city, "temperature_c": 28, "condition": "Sunny", "humidity": 55}
def invoke_agent() -> None:
"""Start a session once the agent is registered (fired by serve's on_ready)."""
zrt.invoke(AGENT_ID, room=Room(playground=True))
if __name__ == "__main__":
zrt.serve(Assistant, on_ready=invoke_agent)
python agent.py
serve() registers the agent under its agent_id and serves a session to each caller;
once it's ready, on_ready fires invoke() to start a playground session and print a
link you can open to talk to it.
Pass your Agent class (or any callable that returns a fresh agent) — recommended.
serve() then builds a new agent + pipeline .
Concepts
| Building block | What it is |
|---|---|
Agent |
Your behavior: instructions, tools, and what it says on enter/exit. |
Pipeline |
STT (hear) → LLM (think) → TTS (speak), plus optional VAD, turn detection, denoising. |
serve(Agent) |
Register your agent (pass the class) and serve a session to each caller. |
invoke(agent_id, …) |
Start a session on demand (e.g. an outbound call). |
Add a @function_tool method to your agent and the LLM calls it (with your typed
args) whenever it needs to. Methods are auto-registered; for tools defined outside
the agent, pass them via tools=[...].
Providers
Mix and match. Swap any stage in a line:
- STT: Deepgram, AssemblyAI, Google, Azure, Sarvam, and more.
- LLM: OpenAI, Google Gemini, Anthropic Claude, Groq, Cerebras, xAI Grok, Sarvam, and more.
- TTS: Cartesia, ElevenLabs, Google, Azure, Deepgram, and more.
- Realtime (speech‑to‑speech): OpenAI Realtime, Gemini Live, and more.
- Turn detection: Namo · VAD: Silero · Denoise: RNNoise
Resources
- Docs: https://docs.zeroruntime.ai/
- Examples: https://github.com/ZeroRuntimeAI/zrt-python-sdk-examples
- Dashboard & tokens: https://app.zeroruntime.ai
- Support: support@zeroruntime.ai
© 2026 Zujo Tech Pvt Ltd. All rights reserved.
Metadata
Release files for zrt 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| zrt-0.1.2.tar.gz | 216.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| zrt-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 484.5 kB
Release files / zrt-0.1.2.tar.gz
| Download URL | zrt-0.1.2.tar.gz |
|---|---|
| Size | 216.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e2b4968ca62cfb843441465e091953c0116a26578ece8d9cc8498aa5303131c
|
|
BLAKE2b-256 checksum How to use checksums |
bf2dbfd80fa6f55d7fa9b3309ea25aa81dd7fd92256fddf17e7f6cf3d23551fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / zrt-0.1.2-py3-none-any.whl
| Download URL | zrt-0.1.2-py3-none-any.whl |
|---|---|
| Size | 268.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c8d557b16bbb1fe66d2031e35e1a5b098d7ad4b4bb454b94140f3ae19f570348
|
|
BLAKE2b-256 checksum How to use checksums |
8d6b54adc41254113298268fcb3214faba6c7f21fa390845e81a0d31d66cfa60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|