Native-speed vLLM transformers modeling backend
Summary
The "transformers" vLLM backend, updated on July 8, 2026, now achieves native-speed inference, matching or exceeding custom vLLM implementations for many Large Language Model architectures. This significant enhancement allows model authors to automatically utilize their existing "transformers" implementations for ultra-fast vLLM inference without requiring any code porting. Benchmarks against Qwen3 models—including a 4B dense model on a single GPU, a 32B dense model with tensor parallelism, and a 235B-parameter FP8 Mixture-of-Experts model on an 8×H100 node—demonstrated that the "transformers" backend consistently meets or surpasses native throughput. The improvement stems from dynamically applying inference-specific layer fusions at runtime, leveraging "torch.fx" for static graph analysis and "ast" for source code manipulation to optimize operations into highly efficient vLLM kernels, supporting features like expert and tensor parallelism.
Key takeaway
For MLOps Engineers deploying LLMs, this "transformers" vLLM backend update simplifies achieving native inference speeds. You can now deploy "transformers" models directly into vLLM with "--model-impl transformers", eliminating the need for custom vLLM ports and maintaining performance parity. This streamlines your deployment workflow, allowing you to use the same model code for both training and high-performance inference. Ensure your "vllm" pip package is upgraded to leverage these optimizations.
Key insights
"transformers" models now achieve native vLLM inference speeds through dynamic runtime optimizations, eliminating manual porting.
Principles
- "transformers" is the reference modeling library.
- Optimized inference requires specific layer fusions.
- Same model code for training and inference.
Method
The "transformers" vLLM backend uses "torch.fx" for static graph analysis to identify optimizable patterns. It then employs "ast" to manipulate source code, rewriting operations for fused vLLM kernels, including for expert and tensor parallelism.
In practice
- Use "--model-impl transformers" flag.
- Apply parallelism options like "--tensor-parallel-size".
- Upgrade "vllm" pip package.
Topics
- vLLM
- Hugging Face Transformers
- LLM Inference Optimization
- Model Deployment
- torch.fx
- Parallel Computing
Code references
Best for: AI Engineer, Machine Learning Engineer, MLOps Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Hugging Face - Blog.