Harry Mellor
Claude Opus 5 (1M context)
Claude Opus 5.5
AI Engineer Paris 2026
a7e7a3a
|
Raw History Blame Contribute Delete
2.91 kB
metadata
title: How a Transformers Model Loads in vLLM
emoji: 🧠
colorFrom: indigo
colorTo: purple
sdk: static
app_file: index.html
pinned: false
license: apache-2.0
short_description: Animated walkthrough of vLLM's Transformers modeling backend

How a Transformers model loads (and runs) in vLLM

An animated, self-contained walkthrough β€” built to present at conferences β€” of what happens when you vllm serve Qwen/Qwen3-VL-30B-A3B-Instruct-FP8 --model-impl transformers using the Transformers modeling backend. It follows the control flow from the CLI, through backend-class resolution and the MRO, into Base.__init__ rebuilding the model, and then sends a batch through β€” watching execution hop back and forth across the vLLM ⇄ Transformers boundary at the attention and MoE seams.

Qwen3-VL-FP8 (a multimodal, FP8-quantized MoE) is used because it exercises more of the backend than a plain text model: the multimodal path (TransformersMultiModalMoEForCausalLM + vision tower + M-RoPE), FP8 quantization through SupportsQuant, pipeline-parallel deletions (the Base.__init__ walk-through is shown at PP=2), the fuser system (QKV / RMSNorm / MoE), and the fact that a native vLLM implementation exists, so the backend must be explicitly requested.

Running it

It's a single index.html with no CDN and no build step β€” the only other files live in assets/: the vendored brand logos (official vLLM media-kit and Hugging Face brand SVGs) and deck-qr.svg, a pre-rendered QR code for this Space shown on the title slide. Just open it:

open index.html          # macOS
# or serve it:
python3 -m http.server   # then visit http://localhost:8000

Controls

  • β†’ / Space β€” next beat Β· ← β€” previous Β· click right/left of screen
  • Every animation is manual: each β†’ advances one sub-step (assembling the MRO, walking Base.__init__, stepping the attention/MoE hops), then moves to the next beat
  • Home / End β€” jump to first / last Β· f β€” fullscreen
  • #N deep-links to beat N (e.g. …/#10); #N.M deep-links to sub-step M of beat N (e.g. …/#8.9)

Accuracy

Every class name and method is taken from the vLLM source (vllm/model_executor/models/transformers/, vllm/config/model.py, vllm/model_executor/models/registry.py), last checked against main on 2026-11-12. Captions name the file and symbol rather than a line number, deliberately β€” line numbers go stale within days and the symbol is what you'd actually grep for. Code panels show lightly trimmed excerpts (error handling and the Eagle3 / MLA branches are elided), so their gutter numbers are excerpt-relative, not file lines.

The Qwen3-VL-30B-A3B numbers reflect the real A3B text backbone (48 layers, 128 experts, top-8), not the placeholder config defaults.