Pidoku

Omni Models and Mixed Pipelines

Module 26 Lesson 26.h 1h 10m Difficulty 4/5

Prerequisites 26.b, 26.e, 26.f, 14.j, 24.h


Before you start: words you need#

WordPlain meaning
Omni modelA model that takes several modalities in (text, images, audio, video) and produces more than one out (text and speech, or text and images).
Thinker–TalkerAn omni design: a “Thinker” LLM understands the input and writes text; a “Talker” model turns the Thinker’s output into speech tokens as it goes.
Full duplexBoth sides can speak at the same time, like a phone call; the model listens while it talks.
Any-to-anyA model that can mix autoregressive text generation with diffusion image or video generation.
StageOne model (or model part) in a pipeline, served by its own engine with its own batching.
Stage graphThe pipeline drawn as stages connected by data flows: encoder → thinker → talker → codec.
ConnectorThe mechanism that moves data (hidden states, tokens, KV cache, embeddings) between stages, possibly across GPUs or nodes.
Handoff granularityHow much one stage produces before passing it on: one token, a chunk, or the whole output.

1. What is it?#

The earlier lessons in this module treated each workload alone. Real products chain them: a voice agent is VAD, ASR, an LLM and TTS (26.f); a RAG answer is an embedder, a vector index, a reranker and an LLM (26.g); a “make me a picture” chat is an LLM that writes a prompt for a diffusion model (26.c). Omni models pull several of these into one trained system, for example Qwen3-Omni, which hears, sees and speaks.

Either way the serving problem is the same: a graph of stages with different shapes, where the user experience depends on the slowest stage, the handoffs between stages, and how GPUs are split among them. This lesson is about designing and serving those graphs. Facts checked on 13 November 2026.


2. Why does it matter?#

  • A pipeline is as fast as its handoffs. Waiting for a whole stage’s output before starting the next adds latency that no kernel can win back (section 6).
  • Stages have different shapes. An audio encoder is one-pass and compute-bound, a thinker is an LLM with a KV cache, a talker is a real-time decode loop, a diffusion head runs dozens of full passes. One engine configuration cannot suit them all.
  • GPU allocation becomes a ratio problem. Too few talker GPUs and speech stutters while thinker GPUs idle; too many and money burns.
  • Omni serving frameworks matured in 2026. vLLM-Omni went from first release (November 2025) to v0.32.0 (October 2026) with full-duplex sessions and multi-node stages; knowing its model is becoming as useful as knowing vLLM’s.

3. Simple analogy#

A film production line: a writer (thinker), a voice actor (talker) and a sound engineer (codec). If the actor waits for the complete script, the first line is recorded late. If the actor starts on the first sentence while the writer works on the second, the first line comes quickly. And if the studio hires ten writers and one actor, the scripts pile up unread.


4. Tiny example: one spoken question to Qwen3-Omni#

user speaks 4 s     -> audio encoder: ~50 audio embeddings (one per 80 ms)
thinker             MoE LLM (30B total, 3B active) reads audio embeddings + history,
                    streams text tokens and hidden states
talker              starts after the first few thinker tokens; per 80 ms frame (12.5 Hz) it
                    predicts the first codebook, and a ~80M-parameter MTP module fills the rest
codec decoder       lightweight causal ConvNet turns frames into a waveform, packet by packet
user hears          first audio; the paper reports a theoretical cold-start first-packet
                    latency of 234 ms (authors' figure)
text-only client    model.disable_talker(): no talker stage, about 10 GB less GPU memory
                    (model card)

5. Technical explanation#

Omni model designs#

DesignIdeaExamples
Thinker–TalkerA text LLM (thinker) plus a separate speech LM (talker) fed by the thinker’s hidden states; streaming handoffQwen2.5-Omni, Qwen3-Omni
Full-duplex speech LMModel listens and speaks at once, with parallel streams for the user’s audio, its own audio and inner textMoshi (authors report 160 ms theoretical, 200 ms practical latency), MiniCPM-o 4.5 full-duplex
AR + diffusion (any-to-any)An autoregressive transformer for understanding and text, a diffusion head or DiT for images or videoBAGEL, HunyuanImage-3
Cascade of separate modelsIndependent ASR, LLM, TTS, image models, glued by an orchestratorMost production voice and RAG systems

Unified models remove handoff latency and keep tone and context across modalities; cascades let you swap, scale and debug each part, and use the best model per job. Many production systems are cascades with one or two unified parts.

Serving as a stage graph: vLLM-Omni#

vLLM-Omni, a vLLM project (paper arXiv 2602.02204; technical report October 2026), is the reference open design:

  • Stages. The model is decomposed into stages in a graph; each stage runs on an engine suited to it: vLLM’s autoregressive engine with its KV cache for thinker and talker, a diffusion engine for DiT stages.
  • Per-stage batching and GPU allocation. Each stage batches its own requests and gets its own GPUs.
  • Connectors. OmniConnector moves data between stages; 2026 releases added cross-stage KV and multimodal payload transfer through Mooncake and NIXL (the same transports used for prefill/decode KV transfer, 14.j).
  • Pipelined execution. Stages overlap: the talker works on request A’s first sentence while the thinker generates the second.
  • Interfaces. An OpenAI-compatible server with chat, /v1/audio/speech, image and video generation endpoints, a turn-based /v1/realtime (with server-side VAD since v0.32.0), and full-duplex realtime sessions owned by the engine.
  • Scale-out. v0.32.0 added optional Ray-based multi-node inference and session-aware replica placement.

The paper reports up to 91.4% lower job completion time than baselines; treat that as a best case measured by the authors. SGLang serves omni and diffusion models too (SGLang Diffusion, 26.c), and NVIDIA Dynamo can wrap SGLang’s diffusion generator as workers.

Designing any mixed pipeline#

  1. Draw the stage graph with per-stage shape (one-pass, AR, diffusion), state, and latency SLO.
  2. Choose handoff granularity per edge. Stream tokens or small chunks on the latency path; pass whole outputs where the next stage needs them anyway (a diffusion model needs the whole prompt).
  3. Measure GPU-seconds per request per stage at a realistic batch size; this sets the replica ratio.
  4. Decide co-location versus disaggregation. Co-located stages share GPUs and avoid transfers but interfere (a talker’s 80 ms real-time deadline next to a long thinker prefill). Disaggregated stages scale and tune independently but pay transfers and whole-GPU rounding. The break-even argument is the same as for prefill/decode and encoder disaggregation (24.h).
  5. Add backpressure on every edge. If the talker falls behind, the thinker must slow or the queue between them grows without bound.
  6. Plan cancellation. One user interrupt or disconnect must cancel work in every stage.

6. Under the hood: handoffs and replica ratios#

The program estimates first-packet latency of a thinker–talker pipeline as a function of how many thinker tokens the talker waits for and how many codec frames the decoder waits for, then sizes GPUs per stage. All timings are assumptions chosen to be plausible for a small MoE thinker on current GPUs.

Go
package main

import (
	"fmt"
	"math"
)

// A thinker-talker omni pipeline: audio encoder -> thinker (text LLM) -> talker
// (speech-token LM) -> codec decoder. All timings are assumptions.

// Part 1: first audio packet vs how much each stage waits for before handing off.
func firstPacket(thinkerToks, talkerFrames float64) float64 {
	const (
		encoder   = 30.0 // ms, audio encoder over the user's turn
		thinkTTFT = 120.0
		thinkTok  = 12.0 // ms per thinker token
		talkTTFT  = 40.0 // ms, talker prefill on the handed-over hidden states
		talkFrame = 10.0 // ms per talker step (one 80 ms codec frame, all codebooks)
		codec     = 15.0 // ms to decode the first chunk of frames to audio
	)
	return encoder + thinkTTFT + (thinkerToks-1)*thinkTok + talkTTFT + (talkerFrames-1)*talkFrame + codec
}

type stage struct {
	name   string
	gpuSec float64 // GPU-seconds of work per request at a healthy batch size
}

func main() {
	fmt.Println("first audio packet (ms) by handoff granularity")
	fmt.Printf("%28s %8s %8s %8s\n", "thinker tokens \\ talker frames", "1", "4", "25")
	for _, tt := range []float64{1, 8, 40} {
		fmt.Printf("%28.0f", tt)
		for _, tf := range []float64{1, 4, 25} {
			fmt.Printf(" %8.0f", firstPacket(tt, tf))
		}
		fmt.Println()
	}

	// Part 2: whole GPUs per stage when each stage gets its own replicas.
	stages := []stage{
		{"audio encoder", 0.010},
		{"thinker (MoE LLM)", 0.300},
		{"talker", 0.120},
		{"codec decoder", 0.015},
	}
	sum := 0.0
	for _, s := range stages {
		sum += s.gpuSec
	}
	const util = 0.6
	for _, rate := range []float64{5, 40} {
		fmt.Printf("\n%.0f requests/s at %.0f%% target utilisation\n", rate, util*100)
		fmt.Printf("  %-20s %10s %6s %7s\n", "stage", "GPU-s/req", "GPUs", "share")
		total := 0.0
		for _, s := range stages {
			gpus := math.Ceil(rate * s.gpuSec / util)
			total += gpus
			fmt.Printf("  %-20s %10.3f %6.0f %6.0f%%\n", s.name, s.gpuSec, gpus, 100*s.gpuSec/sum)
		}
		fmt.Printf("  disaggregated: %.0f GPUs, ideal if packed together: %.1f GPUs\n", total, rate*sum/util)
	}
}

Output:

first audio packet (ms) by handoff granularity
thinker tokens \ talker frames        1        4       25
                           1      205      235      445
                           8      289      319      529
                          40      673      703      913

5 requests/s at 60% target utilisation
  stage                 GPU-s/req   GPUs   share
  audio encoder             0.010      1      2%
  thinker (MoE LLM)         0.300      3     67%
  talker                    0.120      1     27%
  codec decoder             0.015      1      3%
  disaggregated: 6 GPUs, ideal if packed together: 3.7 GPUs

40 requests/s at 60% target utilisation
  stage                 GPU-s/req   GPUs   share
  audio encoder             0.010      1      2%
  thinker (MoE LLM)         0.300     20     67%
  talker                    0.120      8     27%
  codec decoder             0.015      1      3%
  disaggregated: 30 GPUs, ideal if packed together: 29.7 GPUs

How to read it:

  • Fine-grained handoffs are the latency lever. Handing over after every thinker token and every codec frame gives 205 ms; waiting for a 40-token sentence and two seconds of audio frames gives 913 ms. This is why omni models are designed with streaming talkers and causal codecs, and why a cascade that waits for whole sentences is slower than a unified model with the same parts.
  • Small pipelines waste GPUs when split. At 5 requests per second, giving every stage its own whole GPU costs 6 GPUs for 3.7 GPUs of work. At 40 per second the rounding vanishes (30 vs 29.7). Co-locate small stages (encoder and codec on the talker’s GPU) at low traffic; disaggregate when traffic is high and stages interfere. It is the same break-even as in 24.h.
  • The ratio follows the work. Here the thinker needs 2.5 GPUs for every talker GPU. Measure the real ratio on your traffic: longer answers shift work to the talker; long audio inputs and video shift it to the encoder and the thinker’s prefill.

7. Performance implications#

  • The slowest stage sets throughput; the longest critical path sets latency. Optimise them separately.
  • Real-time stages need protected capacity. A talker or codec stage with an 80 ms deadline should not share a GPU with long prefills unless the scheduler can guarantee its steps (chunked prefill, priorities).
  • Transfers are cheap if small, expensive if not. Handing over token IDs or a few hidden states per step is trivial; shipping KV caches or video latents between nodes needs RDMA-class networking (9.e).
  • Full-duplex sessions cost compute while silent. A model that listens continuously runs every frame, even when nobody speaks; capacity is per connected session, not per request.
  • Memory per replica adds up. Every stage holds its weights. Dropping a stage you do not need (text out only: no talker) frees real memory.

8. Production implications#

  • Per-stage observability. Queue depth, batch size, step time and latency per stage, plus end-to-end traces that follow one request through every stage (23.h).
  • Per-stage autoscaling keyed to each stage’s own signal: thinker on queue and TTFT, talker on step time against its deadline, diffusion on queue wait.
  • Failure isolation. A crash in one stage should fail or retry the affected requests, not take the whole graph down; vLLM-Omni v0.32.0 lists request failure isolation and repeated-stage-failure handling among its changes.
  • Version the graph, not just the models. A talker trained against a specific thinker cannot be swapped independently; a cascade’s parts can. Track compatible sets.
  • Cost attribution. Charge per modality out (text tokens, audio seconds, images), mapped back to the GPU-seconds of each stage.

9. Common mistakes#

  1. Waiting for whole outputs between stages on the latency path.
  2. Giving every stage its own GPUs at low traffic.
  3. Sizing all stages from one throughput number. Each stage has its own GPU-seconds per request.
  4. No backpressure between stages. Queues grow until memory runs out.
  5. Choosing a unified omni model for a product that needs per-part control (a custom voice, a domain ASR, a specific LLM), or a cascade where latency must be lowest.

10. Hands-on exercise#

  1. Run the program. Make the talker twice as slow per frame. Which handoff setting suffers most?
  2. Find the request rate where disaggregation costs no more than 10% over the ideal packed total.
  3. Draw the stage graph for “user uploads a photo and asks, by voice, for an edited version described back to them in speech”. Mark each stage’s shape, state and SLO.
  4. Serve Qwen3-Omni with vLLM-Omni on a GPU. Measure first-audio latency and GPU memory with the talker enabled, then with text output only.

11. Interview questions#

  1. Explain the Thinker–Talker design. Why does it stream hidden states rather than finished text?
  2. When should stages of a multimodal pipeline be co-located, and when disaggregated?
  3. How do you size the ratio of thinker to talker GPUs?
  4. What must happen in every stage when a user interrupts a full-duplex conversation?
  5. Compare a cascaded voice agent with a speech-to-speech omni model for a bank’s support line.

12. Further reading#

Checked on 13 November 2026.

↑↓ navigate↵ openesc close

100% drag to pan · scroll or pinch to zoom · double-click to zoom in