← back to blog

Why I chose Elixir over Python for a voice AI backend

Fault-tolerance wins. Here's the architectural decision and the tradeoffs.

Apr 2026
elixirpythonvoice-aiarchitecture

When I started building Intervues, the obvious choice was Python. FastAPI, asyncio, the entire AI/ML ecosystem — it's all Python-native. But I chose Elixir instead. Here's why.

The core problem with voice AI backends

Voice AI has a specific failure profile. You have:

Python's async model handles concurrency, but it doesn't handle failure isolation. If one session's audio processing throws an unhandled exception, it can corrupt shared state. In a voice interview platform, that means a candidate's session dying mid-interview.

Why Elixir's OTP model fits perfectly

Elixir's actor model (via OTP) gives you process isolation for free. Each interview session runs in its own GenServer process. If it crashes, the supervisor restarts it. Other sessions are completely unaffected.

defmodule Intervues.Session do
  use GenServer

  def start_link(session_id) do
    GenServer.start_link(__MODULE__, session_id, name: via(session_id))
  end

  def init(session_id) do
    {:ok, %{id: session_id, transcript: [], vad_state: :idle}}
  end
end

The supervisor tree handles restarts automatically. No try/catch. No manual cleanup.

The VAD problem

Voice Activity Detection for non-native speakers needs tunable silence thresholds. In Python, I'd be managing this state in a class with shared mutable state. In Elixir, each session's VAD state lives in its GenServer — completely isolated, no locks needed.

The tradeoffs

Elixir's AI/ML ecosystem is thin. I still use Python microservices for the heavy ML work (Deepgram, ElevenLabs, Claude API calls). Elixir handles the orchestration, session management, and real-time streaming. Python handles the model inference.

This split architecture is more complex to deploy, but the reliability improvement is worth it. We've had zero session corruption incidents since switching.

The verdict

If you're building a voice AI product where reliability matters more than ecosystem convenience, Elixir is worth the learning curve. The OTP supervision model is genuinely different from anything in Python — and for stateful, long-lived connections, it's the right tool.

← all posts

Ayoush Chourasia · Apr 2026