Streaming LLM Tokens in LiveView, the 2026 Way
Token-by-token LLM streaming in Phoenix LiveView, no React — the 2026 async APIs, plus the production failure modes most tutorials skip.
We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
Writing · Tag
10 posts on Elixir. Or browse the full writing index →
Token-by-token LLM streaming in Phoenix LiveView, no React — the 2026 async APIs, plus the production failure modes most tutorials skip.
An MCP server lets Claude and other agents call your Phoenix app directly. How to ship one with Hermes — auth, transport, and safe tool boundaries.
Most AI agent frameworks reinvent a job queue badly. Oban already is one — durable, idempotent, retry-aware. Run an agent loop that survives a deploy mid-run.
The Hex packages I install on day one of a new Elixir project in 2026 — what each earns its place doing, and the ones I dropped along the way.
Every AI agent framework runs the same loop: observe, decide, act, repeat. Here it is in 50 lines of Elixir — no framework, just a GenServer.
You don't need a vector database — the Postgres you already run does RAG fine. The hand-rolled pgvector path in Phoenix, and when Arcana earns its place.
Go won the agent daemon and Python owns the reasoning — but the layer nobody claimed is the one that bites you: thousands of long-lived, stateful, crash-prone agents you must keep alive. That's the BEAM's home turf.
A Tencent benchmark across 20 languages found Elixir at the top of LLM code-completion rates — Claude Opus 4 hit 80.3% on Elixir vs 74.9% on C#. The reasons aren't an accident; they're the same boring properties that have always made Elixir pleasant, now compounded by AI.
async/await and goroutines solve scheduling. The BEAM solves failure. Why most concurrency pain is actually failure-isolation pain — and only the actor model plus supervision trees fix it.
We started with ten Ruby and Elixir services serving real-time messaging for 450K students across 900+ universities. Two years later we had six, fully Elixir, and on-call alerts had halved. The migration order, the patterns we leaned on, and what I'd do differently today.