AI

IQ-Stream: Benchmarks, SSE Replay, and Cost Trade-Offs for LLM Token Streaming

An empirical breakdown of IQ-Stream, Neuron AI's stateless Server-Sent Events relay for LLM token streaming. We examine its HTTP-to-SSE architecture, AWS Graviton4 benchmarks against Mercure, Soketi, and Laravel Reverb, Pusher message-count cost math, and deployment trade-offs.

By 0xScorPionSon

9 min read

IQ-Stream: Benchmarks, SSE Replay, and Cost Trade-Offs for LLM Token Streaming

IQ-Stream 3D isometric architecture showing AI agent workers pushing HTTP JSON lines through a stateless SSE relay to browser clients with 46.5k events/s throughput, <250ms p99 latency, and 0/647 reconnect loss

Executive Summary

Long-running AI agents break standard request-response web infrastructure. When an agent executes multi-step tool calls, waits on external APIs, and streams thousands of reasoning and output tokens, keeping an HTTP request open hits PHP max_execution_time limits, Nginx's default 60-second proxy timeout, and load balancer connection ceilings (Neuron AI). Moving agent execution into background queue workers solves timeout failures, but it detaches the worker from the user's browser and forces teams to route every token through a general-purpose real-time server.

Released on November 27, 2026 by Neuron AI creator Valerio Barbera, IQ-Stream is a specialized, stateless streaming server built solely to relay LLM token streams from backend workers to browsers over Server-Sent Events (SSE) (Neuron AI). In vendor-published benchmarks on AWS Graviton4 hardware, IQ-Stream sustained 46,554 events/sec on 2 vCPUs at 40 µs CPU per event—3.6× Mercure's peak and 14× Laravel Reverb's—while delivering 0 missed events across 647 simulated browser reconnects (IQ-Stream Performance).

Confidence level: Medium-High. Architectural details, protocol behavior, and pricing comparisons are directly verified from Neuron AI's primary engineering write-up and IQ-Stream's published benchmark documentation. Performance figures carry a key caveat: they are vendor-measured using simulated AG-UI traffic rather than independent third-party audits.


Architecture & How It Works

General-purpose WebSocket and pub/sub servers—such as Pusher, Laravel Reverb, Soketi, and Mercure—were engineered for infrequent chat messages and UI notifications (IQ-Stream Performance). LLM agent traffic has the opposite profile: hundreds of tiny 1–2 word chunks spaced tens of milliseconds apart, punctuated by multi-second pauses during tool execution and occasional large payloads (such as 8 KB to 100 KB tool results) that exceed Pusher's and Laravel Reverb's 10 KB event ceiling (Neuron AI).

IQ-Stream strips out general-purpose pub/sub features—no topics, no presence channels, no Redis dependency, and no persistent database or disk storage (Neuron AI). It ships as a single Docker image for amd64 and arm64. Each active agent run is pinned to a single worker process behind a lightweight router, keeping tokens in memory only for the duration of the generation and discarding them immediately once the run finishes (IQ-Stream Performance).

flowchart LR
    W[Backend Queue Worker<br/>PHP / Python / Node / Go] -->|HTTP POST JSON Lines<br/>Signed Publish Ticket| R[IQ-Stream Router]
    R -->|Pins Run to Single Worker| S[IQ-Stream Worker<br/>In-Memory Ring Buffer]
    S -->|HTTP/2 SSE text/event-stream<br/>50ms Batching| B1[Browser EventSource]
    B1 -.->|Disconnect & Reconnect<br/>Last-Event-ID Header| S
    S -->|Gapless Replay<br/>0 Missed Events| B1

Protocol Mechanics: HTTP Publish and Browser-Native SSE

Backend workers do not maintain persistent WebSocket connections to IQ-Stream. Any backend language capable of issuing plain HTTP requests—including PHP, Python, Node.js, Go, Ruby, Java, and .NET—publishes JSON lines using a short-lived signed publish ticket (Neuron AI). IQ-Stream does not parse or rewrite the payload; it relays AG-UI events, Vercel AI SDK data streams, plain text, or custom JSON schemas verbatim.

On the client side, browsers connect using the native EventSource API with a signed watch ticket. Because SSE runs over standard HTTP/2, it traverses corporate proxies and load balancers without WebSocket upgrade handshakes and automatically sends a Last-Event-ID header whenever a mobile client switches between Wi-Fi and cellular (Neuron AI). IQ-Stream's in-memory buffer replays every missed event from that cursor without touching disk.

// Browser client subscribing to an IQ-Stream run via native EventSource
const watchUrl = `https://stream.example.com/watch?ticket=${encodeURIComponent(watchTicket)}`;
const source = new EventSource(watchUrl);

source.onmessage = (event) => {
  const chunk = JSON.parse(event.data);
  if (chunk.type === "TEXT_MESSAGE_CONTENT") {
    appendTokenToUI(chunk.delta);
  } else if (chunk.type === "TOOL_CALL_RESULT") {
    renderToolOutput(chunk.payload);
  }
};

source.onerror = () => {
  // EventSource automatically reconnects and sends Last-Event-ID
  // IQ-Stream replays all buffered events missed during the drop
};

Official client packages (iq-stream-php, iq-stream-python, iq-stream-js, and @neuron-core/streaming) wrap ticket signing and HTTP publishing, while the underlying MIT-licensed client library weighs under 8 KB minified with zero external dependencies (Neuron AI; Emergent).


Benchmarks, Cost & Latency Analysis

AWS Graviton4 Benchmark Methodology

Neuron AI evaluated IQ-Stream against Mercure (in-memory and Bolt disk-backed transports), Soketi + Nginx, and Laravel Reverb + Nginx on AWS eu-central-1 Graviton4 instances (c8g.medium with 1 vCPU / 2 GiB RAM, and c8g.large with 2 vCPUs / 4 GiB RAM) (IQ-Stream Performance). The load generator ran on a c8g.4xlarge instance in the same availability zone.

Each simulated agent run consisted of 429 AG-UI events spread across roughly 10 seconds, including streamed text tokens, streamed tool-call arguments, a 1.5-second pause for tool execution, an 8 KB tool result, and a follow-up streamed answer (IQ-Stream Performance). Crucially, 1 in 10 browsers dropped its connection mid-answer and reconnected. A server "held" a concurrency level only if >= 99% of events arrived with p99 latency < 250 ms.

Single-vCPU & Two-vCPU Throughput Comparison

Server 1 vCPU Held Runs 1 vCPU Peak Events/s 2 vCPU Held Runs 2 vCPU Peak Events/s CPU / Event (2 vCPU) Reconnect Replay
IQ-Stream 700 runs ≈ 27,700 1,100 runs 46,554 40 µs Yes (0 lost)
Mercure (in-memory) 100 runs 6,976 200 runs 12,852 148–151 µs No
Soketi + Nginx 100 runs 4,505 < 200 runs 6,547 295–314 µs No
Laravel Reverb + Nginx < 100 runs 1,910 < 200 runs 3,381 569–597 µs No
Mercure (Bolt history) < 100 runs 463 < 200 runs 459 322–361 µs Yes

Source: IQ-Stream Performance. Note: IQ-Stream's 1 vCPU run used an r8g.medium (same core, higher memory) and tested its maximum sustained ceiling rather than fixed 100/300/1,000 steps.

Two architectural bottlenecks explain the gap:

  1. Cross-process Redis tax: When scaled across 2 vCPUs with Redis as documented, Soketi and Laravel Reverb actually spent more CPU per event (295–314 µs and 569–597 µs) than on 1 vCPU because every token crossed Redis to reach the right worker (IQ-Stream Performance). IQ-Stream pins each run to one worker, eliminating inter-process hops.
  2. Disk commit penalty for replay: Mercure's Bolt transport is the only tested competitor that supports reconnect replay, but committing every token to disk capped its throughput at 463 events/sec with p99 latency spiking past 57 seconds under load (IQ-Stream Performance). Because IQ-Stream buffers only in-flight runs in RAM, it held 2,300 concurrent runs on 4 vCPUs in under 1 GiB of memory, and a 2 GB container holds roughly 1,400 active 4,000-token answers (IQ-Stream Performance).

Vendor-Measured Caveats

Engineers evaluating these numbers should note three caveats:

  • Vendor-authored suite: All figures come from IQ-Stream's own benchmark suite; no independent third-party reproduction has been published yet.
  • 50 ms batching: IQ-Stream ran with 50 ms HTTP/2 batching enabled (IQ-Stream Performance). Batching dramatically cuts TLS/syscall overhead per event while remaining imperceptible to human readers, though raw unbatched micro-latency would be higher.
  • Omitted metrics: CPU share and per-run memory were omitted for IQ-Stream's 1 vCPU r8g.medium row, though its 2 vCPU CPU-per-event (40 µs) and 4 vCPU memory footprint (< 1 GiB for 2,300 runs) were reported.

Message-Count Pricing vs. Stream-Based Economics

Managed real-time platforms price by message count, where one published event delivered to one browser counts as two billable messages (Neuron AI). For a 4,000-token agent answer (4,000 published tokens + 4,000 deliveries = 8,000 messages):

  • Pusher Pro ($99/month, 4M messages/day) covers just 500 answers per day—50 users asking 10 questions. During a peak burst of 20 concurrent users at 100 tokens/sec (4,000 messages/sec), the daily 4M quota is exhausted in ~17 minutes (Neuron AI).
  • Pusher's largest self-serve plan ($1,199/month, 90M messages/day) covers roughly 11,000 answers per day (Neuron AI).

IQ-Stream's managed cloud avoids per-message billing, pricing instead on concurrent streams and monthly data transfer, with a free tier offering 5 concurrent streams and a 32 KiB per-event limit (up to 128 KiB on paid tiers), alongside a self-hostable Docker image (Neuron AI).


Production Deployment & Trade-Offs

When You Should Not Use IQ-Stream

IQ-Stream adds an extra infrastructure hop. If your application serves short, synchronous LLM completions that finish reliably in 2–10 seconds without long-running tool calls, streaming directly from your web controller over HTTP SSE is simpler and avoids deploying another service (Neuron AI). Similarly, if your product requires bidirectional WebSocket messaging (e.g., multiplayer collaborative canvases or sub-20 ms voice audio frames), a WebSocket server remains necessary.

Operational Guardrails: HTTP/2, Proxies, and Memory Limits

When deploying SSE in production—whether self-hosting IQ-Stream or running custom SSE endpoints—three operational rules apply:

  1. Enforce HTTP/2: Over HTTP/1.1, browsers cap concurrent connections at 6 per domain; a user with multiple tabs open can exhaust their connection pool and stall page loads (r/webdev). HTTP/2 multiplexes SSE streams over a single TCP/TLS connection.
  2. Disable reverse-proxy buffering: If Nginx or a CDN sits in front of your stream endpoint, disable response buffering (proxy_buffering off), or tokens will arrive in delayed clumps rather than smoothly (r/webdev).
  3. Plan for stale-cursor fallbacks: IQ-Stream sizes its in-memory ring buffer from the container's memory limit and rejects new streams before OOM-crashing (IQ-Stream Performance). Because completed runs are evicted immediately after finishing, your primary database must remain the source of truth for historical chat transcripts if a client reconnects after the stream has closed.

Cross-Source Note on Transport Protocol

A November 27, 2026 secondary news summary from Emergent inaccurately describes IQ-Stream as streaming tokens "without server-sent events". Both Neuron AI's primary engineering post (Neuron AI) and IQ-Stream's official documentation (IQ-Stream) explicitly specify Server-Sent Events (SSE) via browser-native EventSource and Last-Event-ID headers as the core delivery mechanism. Engineers evaluating IQ-Stream should rely on the primary documentation rather than that secondary characterization.


Frequently Asked Questions

1. Does IQ-Stream require PHP or the Neuron AI framework?

No. While Valerio Barbera built IQ-Stream to solve streaming bottlenecks in Neuron AI v4, the server is language-agnostic. Any backend capable of sending HTTP POST requests—including Python, Node.js, Go, Ruby, Java, and .NET—can publish events to IQ-Stream (Neuron AI).

2. How does IQ-Stream handle dropped mobile connections without losing tokens?

IQ-Stream buffers every event of an active agent run in memory until the run completes. When a browser reconnects, EventSource automatically sends the Last-Event-ID header, and IQ-Stream replays all missed events in order—achieving 0 missed events across 647 reconnects in vendor tests (IQ-Stream Performance).

3. Does IQ-Stream replace my chat history database?

No. IQ-Stream is an ephemeral live-delivery layer. It keeps events in RAM only while the model is generating and discards them once the answer finishes. Your application database remains the permanent source of truth for conversation history (Neuron AI).

4. What payload formats and size limits does IQ-Stream support?

IQ-Stream relays payloads unchanged, supporting AG-UI, Vercel AI SDK data streams, plain text, or custom JSON. The free tier caps individual events at 32 KiB (up to 128 KiB on paid plans), compared to 10 KiB on Pusher and Laravel Reverb (Neuron AI).

5. Why did Mercure with Bolt history plateau at 463 events/sec in the benchmark?

Mercure's Bolt transport persists every event to disk before relaying it to enable history replay. That disk commit overhead capped throughput at 463 events/sec on 1 vCPU and 459 events/sec on 2 vCPUs under simulated AG-UI agent load (IQ-Stream Performance).


Sources

More on AI

AI

llama.cpp v1.1.0: DFlash Speculative Decoding, BPW Quant & API Trade-Offs

Released November 26, 2026 (with continuous pre-releases through b12854 on November 29), llama.cpp v1.1.0 upgrades ggml to v1.1.1, automates per-tensor quantization via --target-bpw and --target-size, splits DFlash speculative decoding into four draft drivers, and deprecates the legacy llama_batch C API in favor of llama_batch_ext.

8 min read

AI

llama.cpp Launches Public AMD Benchmark Dashboard on Hugging Face: PP512, TG128, and Context Scaling

On November 26, 2026, ggml-org launched a public llama.cpp benchmark dashboard on Hugging Face for AMD Radeon 8060S (gfx1151) and Radeon AI Pro R9700S (gfx1201) systems. Running weekly llama-bench suites on prebuilt llama-install.sh binaries with 10 repetitions and Flash Attention toggled, the explorer exposes PP512 prompt processing, TG128 token generation, and context-scaling curves backed by raw JSONL telemetry.

10 min read

AI

Trainium3 & TPU on SemiAnalysis InferenceX: Unpacking the 2.28x Perf-per-Dollar AgentX Preview

SemiAnalysis's November 25-27, 2026 InferenceX AgentX preview shows AWS Trainium3 UltraServers delivering 2.28x the tokens per modeled dollar of NVIDIA GB300 NVL72 on a 744B MoE coding-agent trace, alongside Google TPU v7 Ironwood results. A closer look at the underlying API rows reveals that 96% of Trainium3's 2.28x advantage comes from modeled TCO ($1.05 vs $2.31/chip-hr) rather than raw per-chip throughput, with higher time-to-first-token (4.5s vs 1.8s) and an unverified preview status.

10 min read

Tell us what is not working

A thirty-minute call, no deck and no obligation. You will leave with a straight answer about whether this is worth building - including if that answer is no.

Start a project

Direct line

hello@codebumble.net
Dhaka, Bangladesh  :   local timeCalls in English or Bangla