Elixir · Phoenix · Cloudflare Realtime SFU

Build realtime AI voice agents in Elixir.

Run voice and vision agents directly inside your Elixir app—calling Ecto, PubSub, and LiveView tools natively, from 1-on-1 calls to multi-party rooms.

Zero media infra to operate. Cloudflare Realtime SFU carries the WebRTC packets—no TURN server, no open inbound ports, and live calls that survive deploys.

mix.exs{:octoroom, "~> 0.1.0"}, {:octoroom_agents, "~> 0.1.0"}
Agent Room · CallRoomHover a peer to inspect tracks
Cloudflare SFUWebRTC MediaAdaBrowserSamiOS · SwiftAssistantAI AgentRecorderWorker · PCMClients · Phoenix ChannelPhoenix BEAM · outbound WebRTC

What It Looks Like

Define agents and rooms in Elixir. Drop-in clients everywhere else.

defmodule MyApp.Assistant do
  use Octoroom.Agent
  alias Octoroom.Agent.Pipeline.Spec

  @impl true
  def instructions(ctx),
    do: "You are a voice assistant on a call for #{ctx.args.workspace}. Be brief."

  @impl true
  def tools(_ctx), do: [MyApp.Tools.set_theme()]

  @impl true
  def pipeline(_ctx) do
    Spec.default(
      stt: "soniox:stt-rt-v6",
      llm: "google:gemini-3.5-flash",
      tts: "tiny_voca:tiny-voca"
    )
    # Or speech-to-speech / audiovisual:
    # Spec.gemini_live(model: "gemini-3.8-live", voice: "Puck")
    # Spec.openai_live(model: "gpt-live-1.1", voice: "marin")
    # Spec.nuance_live(persona: "sam")
  end
end

Why Octoroom

Built for voice and multimodal AI agents inside your app.

Cloudflare SFU as a commodity pipe

Outbound UDP only—no SFU cluster to operate, no TURN server, no open inbound ports. Cloudflare bills egress only ($0.05/GB after 1,000 GB/month free).

App-owned multi-party routing

Pure Elixir callbacks decide who hears and sees whom—per-track gain, whisper tracks, data-only outputs, and dynamic server-side workers.

Survives restarts and deploys

Signed resume tokens adopt existing Cloudflare sessions with zero WebRTC renegotiation. Workers checkpoint state and restart cleanly.

Cascaded & live AI agents

Run Silero VAD, SmartTurn, Soniox/AssemblyAI/Reson8 STT, ReqLLM, local TinyVoca ONNX TTS—or swap to Gemini Live, OpenAI Live, or Nuance Live avatars.

Zero-npm JS & native Swift SDK

Drop-in browser ES modules (octoroom.mjs) plus a native iOS 17+ and macOS 14+ SwiftPM SDK speaking the exact same Phoenix channel protocol.

Accurate barge-in & offline tests

Paced Opus outlets report exact dropped_ms on interruption so agent history matches what humans heard. Full Elixir, JS, and Swift suites run 100% offline.