Transformers now natively supports GGUF, beating llama.cpp on one M2 Max benchmark

Disastrous-Work-1632 · reddit · 2026-09-23

Aritra from Hugging Face announced that transformers now natively supports GGUF (llama.cpp-style quants). After loading, you get the normal Transformers APIs, making debugging, evaluation and custom generation much easier, and quantized models fit on laptops.

Usage:

python

from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.frompretrained("unsloth/Qwen3.5-4B-GGUF", gguffile="Qwen3.5-4B-Q4KM.gguf")

On supported Apple Silicon setups the library reuses ggml kernels and runs directly from packed quantized weights. Benchmarks on an M2 Max with Qwen checkpoints:

The team stresses this isn't meant to replace llama.cpp — for maximum local inference speed llama.cpp is still the better choice. The point is flexibility: use the same GGUF models inside the PyTorch ecosystem.

Related event: Hugging Face Transformers Now Runs GGUF at llama.cpp Speed via GGML Kernels(8 posts)→

Original post →

More from Infra

Infra channel →