Hugging Face has added a transformers backend to SGLang, allowing models from the transformers library to run with SGLang’s high‑throughput, low‑latency inference engine. The integration automatically falls back to transformers when a model is not natively supported, and users can explicitly set impl="transformers". SGLang also offers an OpenAI‑compatible API and features such as RadixAttention for efficient attention. The team plans performance improvements and Vision‑Language Model support.
Hugging Face transformers library is the standard for working with state-of-the-art models — from experimenting with cutting-edge research to fine-tuning on custom data. Its simplicity, flexibility, and expansive model zoo make it a powerful tool for rapid development.
But once you're ready to move from notebooks to production, inference performance becomes mission-critical. That’s where SGLang comes in.
Designed for high-throughput, low-latency inference, SGLang now offers seamless integration with transformers as a backend. This means you can pair the flexibility of transformers with the raw performance of SGLang.
Note that specifying the impl parameter is optional. If the model is not natively supported by SGLang, it switches to transformers implementation on its own.
Performance Improvements: transformer models currently lag behind the native integration in terms of performance.Our primary objective is to optimize and narrow this gap.
VLM Integration: we are also working toward adding support for Vision-Language Models (VLM) to broaden the range of capabilities and use cases.
No native support needed — SGLang automatically falls back to Transformers when needed, or you can set impl="transformers" explicitly.
With the new transformers backend integration, SGLang can now automatically fall back to using transformers models it doesn’t natively support. This means in practice:
Kyutai Team’s Helium isn’t yet natively supported by SGLang. This is where transformers backend shines, enabling optimized inference without waiting for native support.
SGLang now supports Hugging Face transformers as a backend, letting you run any transformers-compatible model with high-performance inference out of the box.
Let’s walk through a simple text generation example with meta-llama/Llama-3.2-1B-Instruct to compare both approaches.
transformers library is great for experimentation, small-scale tasks and training, but it's not optimized for high-volume or low-latency scenarios.
The integration enables faster, resource‑efficient deployment of transformer models in production, bridging the gap between research flexibility and industrial performance.