Skip to main content

Run multiple LiveKit voice agents in a single shared worker process.

Project description

OpenRTC

OpenRTC is a Python framework for running multiple LiveKit voice agents in a single worker process with shared prewarmed models.

Decorator-based discovery with shared defaults

Use @agent_config(...) on a standard LiveKit Agent subclass to attach optional discovery metadata. Then set shared providers once on AgentPool and only override the values that differ per agent.

from pathlib import Path

from openrtc import AgentPool, agent_config
from livekit.agents import Agent


@agent_config(name="restaurant")
class RestaurantAgent(Agent):
    ...


pool = AgentPool(
    default_stt="deepgram/nova-3:multi",
    default_llm="openai/gpt-4.1-mini",
    default_tts="cartesia/sonic-3",
)
pool.discover(Path("./agents"))
pool.run()

The CLI also accepts shared defaults for discovered agents:

openrtc list \
  --agents-dir ./examples/agents \
  --default-stt deepgram/nova-3:multi \
  --default-llm openai/gpt-4.1-mini \
  --default-tts cartesia/sonic-3

For backward compatibility, discovery still supports legacy module-level AGENT_* variables, but the decorator is the preferred pattern.

Session routing and greetings

AgentPool resolves sessions in this order:

  1. ctx.job.metadata["agent"] or ctx.job.metadata["demo"]
  2. ctx.room.metadata["agent"] or ctx.room.metadata["demo"]
  3. room name prefix matching such as restaurant-call-123
  4. the first registered agent

Registered greetings are generated after ctx.connect(), and advanced AgentSession options can be passed either with session_kwargs or directly as keyword arguments to add(). Direct keyword arguments take precedence when the same option is provided both ways.

pool.add(
    "restaurant",
    RestaurantAgent,
    greeting="Welcome to reservations.",
    session_kwargs={"allow_interruptions": False},
    max_tool_steps=4,
    preemptive_generation=True,
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openrtc-0.0.6.tar.gz (74.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openrtc-0.0.6-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file openrtc-0.0.6.tar.gz.

File metadata

  • Download URL: openrtc-0.0.6.tar.gz
  • Upload date:
  • Size: 74.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openrtc-0.0.6.tar.gz
Algorithm Hash digest
SHA256 a153d1651ce0ffbe8ad235cadfdc630c70240ab6911c6fa7a2085b660ae8977e
MD5 1ca2ab4a14dc9e1770e46604aa869544
BLAKE2b-256 6982cab49181110a7c98d60c46ba63063a5b9dfbdd62d0f5121cbfa3a81ffdd5

See more details on using hashes here.

File details

Details for the file openrtc-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: openrtc-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for openrtc-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9844f90a32c70030c5cc57e04f0971b84a6f52495359cb252df76ea27ecae351
MD5 95185874db17aa36906127c5f3b0fe43
BLAKE2b-256 cf2ca666c62db7226a743acb378af86e30f5882ddd728a575aa2dbc68b91f181

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page