When Hugging Face ran the latest benchmark, the 4B Qwen3 model hit the same throughput as vLLM’s hand‑written implementation. That’s the headline that’s turning heads in the LLM ops community.
Key Takeaways
- The new vLLM transformers backend matches native speed for dense and MoE models.
- Integration works via torch.fx static analysis and AST rewrites.
- Benchmarks cover a 4B single‑GPU, a 32B tensor‑parallel, and a 235B FP8 MoE on an 8‑GPU H100 node.
- Developers can enable it with a single flag—
--model-impl transformers. - Future updates aim to support linear‑attention models.
Historical Context
The journey to this point began with early attempts to squeeze performance out of the ever‑growing family of large language models. In the first half of 2024, practitioners discovered that the default Transformers pipeline often fell short of the speeds required for production‑grade inference. That gap motivated a small but active community to craft custom kernels, typically written in CUDA and wrapped by the vLLM library. Those kernels delivered the raw throughput needed for chat‑scale services, yet they came with a hidden cost.
Every new model release meant a fresh round of hand‑rolled integration work. Teams had to map a model’s architecture onto vLLM’s expectations, rewrite attention patterns, and validate that the resulting binary behaved correctly. The process was error‑prone, and any mismatch between the model definition and the custom kernel could surface as subtle numerical drift. By late 2025, the maintenance burden was palpable across startups and research labs alike.
Enter the collaboration between Hugging Face and vLLM. Their joint effort aimed to eliminate the manual step by letting the Transformers library speak directly to vLLM’s optimized kernels. The July 13, 2026 blog post announced the first public milestone: a smooth, flag‑driven switch that delivers native‑level speed without any source‑level modifications. That announcement marked the culmination of months of incremental work on torch.fx graph analysis, AST‑based rewriting, and kernel compatibility testing.
vLLM transformers backend hits native speed
That’s the claim the Hugging Face team made in their July 13, 2026 post. By plugging vLLM’s custom attention kernels into the transformers code path, they’ve removed the performance gap that used to force model authors into writing bespoke vLLM ports. You don’t have to rewrite anything; just upgrade the vllm pip package with uv pip install --upgrade vllm --torch-backend auto and you’re good to go.
It’s not just a marginal win. The 4B dense model on a single GPU runs at the exact same tokens‑per‑second as the native implementation. The 32B variant, spread across two GPUs with tensor parallelism, also lines up perfectly. And the massive 235‑parameter‑billion FP8 MoE, split across eight H100 GPUs, shows no measurable slowdown. Those numbers prove the backend isn’t a compromise—it’s a full‑fledged alternative.
How the integration works under the hood
Static analysis with torch.fx
First, the backend feeds the model graph into torch.fx. That tool walks the graph, hunting for patterns that vLLM knows how to accelerate. When it spots a pattern—say, a series of linear layers that can be fused—it flags it for rewrite.
AST‑based source rewriting
Next comes the abstract syntax tree step. Using Python’s ast module, the backend rewrites the flagged operations directly in the model’s source. The result is a model where several ops collapse into a single call to a vLLM‑optimized kernel, like MergedColumnParallelLinear or QKVParallelLinear. Those kernels are the same ones used in hand‑crafted vLLM implementations, so performance lines up.
Because the transformed model stays fully torch‑compatible, you can still run torch.compile and CUDA Graphs on it. That means the same model can be used for training, evaluation, or RL rollouts without any extra work.
Benchmarks across model sizes
Hugging Face ran three distinct configurations. Below is a quick rundown of the commands they used and the hardware involved.
- Qwen3‑4B dense:
vllm serve Qwen/Qwen3-4B --model-impl transformerson a single GPU. - Qwen3‑32B dense:
vllm serve Qwen/Qwen3-32B --model-impl transformers --tensor-parallel-size 2across two GPUs. - Qwen3‑235B‑A22B‑FP8 MoE:
vllm serve Qwen/Qwen3-235B-A22B-FP8 --model-impl transformers --data-parallel-size 8 --enable-expert-parallelon an 8‑GPU H100 node.
All three ran with the --max-model-len 8192 flag when memory was tight. Models that rely on linear attention weren’t supported yet, but the team says that support is coming soon.
What’s striking is that the only variable between the native and transformers runs was the --model-impl flag. The hardware, parallelism settings, and even the dataset stayed identical. That isolates the code path as the sole factor, and the results show zero loss.
Concrete Scenarios for Developers
Imagine a startup that powers a real‑time customer‑support chatbot. The service needs to handle hundreds of concurrent requests while keeping latency sub‑second. Previously, the engineering team maintained two pipelines: one built on Transformers for research, another hand‑tuned vLLM version for production. With the new backend, the same repository can serve both roles. A single deployment script, merely adding --model-impl transformers, yields the same throughput they achieved with the bespoke vLLM build.
Consider a research lab that fine‑tunes a 32B model on domain‑specific data. Their training loop uses PyTorch’s native optimizers and data loaders. After fine‑tuning, they want to evaluate the model in an inference‑only setting. By switching the flag, they avoid exporting the checkpoint to a separate format or rewriting the evaluation harness. The model runs at production speed straight from the training checkpoint.
A third example involves a reinforcement‑learning‑from‑human‑feedback (RLHF) pipeline that alternates between policy evaluation and reward model scoring. Both stages require the same underlying model but with different head configurations. The unified backend lets the team reuse the same compiled graph for both phases, cutting down on CI time and reducing the chance of version mismatches.
Why developers should care
From a developer’s perspective, the biggest win is simplicity. You can pull any Hugging Face model that follows the standard repository layout and serve it at native speed without touching a single line of code. That eliminates a whole class of bugs that creep in when you maintain parallel implementations.
And because the backend respects the existing parallelism flags, you can still scale from a laptop‑class GPU to an 8‑GPU H100 pod with the same command line. That’s a huge productivity boost—there’s no need to maintain separate scripts for each scale tier.
Another practical upside is that the same model can now be used for both inference and training pipelines. Teams that previously kept separate codebases for training (using transformers) and serving (using vLLM) can consolidate, cutting down on CI overhead and version drift.
Finally, the approach opens the door to future optimizations without breaking existing workflows. As new fused kernels land in vLLM, the torch.fx analysis can automatically pick them up, keeping performance on the cutting edge.
What This Means For You
If you’re deploying LLMs at scale, you can now point your deployment scripts at the Hugging Face hub, add --model-impl transformers, and expect the same throughput as a hand‑tuned vLLM model. That means less engineering time, fewer maintenance headaches, and a faster path from prototype to production.
For teams that also train models, you can reuse the exact same code for fine‑tuning, RLHF, or eval runs. The model stays torch‑compatible, so you won’t have to rewrite data loaders or optimizer logic just to get the inference speed you need.
In short, the new backend lets you focus on the problem you’re solving rather than the plumbing that makes the model run fast. That’s a real productivity win in an industry where time‑to‑value is measured in days, not weeks.
Will the next wave of LLMs—especially those that rely on linear attention—be smoothly integrated, or will we see another split between custom ports and generic backends? Only.
Key Questions Remaining
- When will linear‑attention models be fully supported, and will the same flag‑based approach apply?
- How will future kernel releases be validated against the existing torch.fx rewrite pipeline to avoid regressions?
- Will other major model hubs adopt a similar flag convention, or will compatibility remain a Hugging Face‑centric feature?
Sources: Hugging Face Blog, GitHub

