Transformers Now Runs GGUF Quants on Apple Silicon
The local-inference corner of the AI world just got a small but meaningful upgrade. On September 22, 2026, Hugging Face announced that the transformers library can now load GGUF quantized checkpoints directly and run them with their weights still packed — reusing llama.cpp’s own ggml kernels instead of expanding the model back to full precision first. It is a deliberately narrow first step, and it matters most if you are the kind of person who tracks LLM benchmarks 2026 on local hardware rather than data-center GPUs.
The significance is not a new model or a new leaderboard. It is a format bridge. GGUF has long been the de facto distribution format for running models on laptops and phones — it powers Ollama, LM Studio, and Jan — but using a GGUF file inside transformers used to mean dequantizing it, which threw away the memory savings that made the format attractive in the first place. That gap is now closed, for a first slice of models, on one backend.
What actually shipped
The new capability is almost embarrassingly simple to use. You pass a Hub repository and a gguf_file filename to from_pretrained, and everything after that is the ordinary transformers API — chat templates, generate, logits processors, the rest.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "unsloth/Qwen3.5-4B-GGUF"
filename = "Qwen3.5-4B-Q4_K_M.gguf"
model = AutoModelForCausalLM.from_pretrained(model_id, gguf_file=filename)
tokenizer = AutoTokenizer.from_pretrained(model_id, gguf_file=filename)
Under the hood, the interesting part is that this is not a reimplementation. Hugging Face reused llama.cpp’s own ggml Metal kernels through its kernels library, so the packed inference path runs matrix multiplications directly on the quantized blocks. The kernels involved are specific and well-defined: ggml-quantization for reading packed weights, ggml-norm for fused normalization, ggml-attn for the flash-attention path llama.cpp uses for decode and prefill, and a custom topk kernel for routing in mixture-of-experts models.
The packed path defaults to MPS and forces float32, because Hugging Face measured that as faster on Metal. If the required kernel cannot be fetched, the loader quietly falls back — to sdpa for attention and to full dequantization at load, which costs memory. You get a working model either way; you just may not get the memory savings you came for.
Why open source AI models benefit from packed GGUF inference
The case for this feature is really a case for the whole open source AI models ecosystem. A Qwen3.5-4B checkpoint ships as an 8.42 GB file at BF16. Quantized down, that same model becomes 3.53 GB at Q6_K, 3.14 GB at Q5_K_M, and 2.74 GB at Q4_K_M. That is the difference between a model that fits in a laptop’s unified memory and one that does not, and it is the entire reason GGUF exists.
Until now, the tradeoff was all-or-nothing. If you wanted the memory efficiency of a GGUF file, you ran it in llama.cpp and gave up the Python tooling. If you wanted the transformers API, you loaded the full-precision weights and gave up the memory savings. Packed loading collapses that choice for the first supported slice of models, letting a single environment serve both local inference and the inspection, evaluation, and experimentation workflows that transformers was built for.
That last point is where the real value sits. llama.cpp remains, in Hugging Face’s own words, the recommended engine when efficient local inference is the priority. What transformers adds is everything llama.cpp was never built to do: inspecting intermediate activations with hooks, running an eval suite across quantization levels, validating that a GGUF conversion matches the original weights, prototyping a custom decoding strategy. For a researcher or an engineer working with open-weight models, that is a different job than “get tokens out as fast as possible,” and it is now doable without leaving Python.
The performance picture
Hugging Face did not claim to beat llama.cpp, and the benchmark methodology is transparent enough to trust. The comparison used three GGUF checkpoints — a small dense model, a larger dense model, and a mixture-of-experts model — measured on a MacBook Pro M2 Max with 32 GB of unified memory running macOS 26.6, PyTorch 2.12.1, and kernels 0.17.0. The llama.cpp side used llama-bench with the Metal backend from ggml 0.18.0, measuring tg128, the token-generation rate for 128 decoded tokens averaged over three runs.
The goal was parity, not victory, and the framing is honest about that. By reusing the same ggml kernels, transformers closes the gap instead of settling for a slow compatibility layer. Separately, two merged generate-loop changes — dropping the redundant padding mask and deferring the stopping check — sped up generation for every transformers model, not just GGUF ones, with a measured 1.10x to 1.20x gain on Apple Metal.
The sizing guidance is practical and matches what the local-inference community already knows. Start at Q4_K_M, the recommended default, and move up to Q5_K_M or Q6_K if you have memory to spare. The quality cost of heavier quantization depends on the model and the task, and the honest advice is to measure it on the work you actually want done rather than trusting a rule of thumb.
A quick tour of quantization levels
GGUF files come in a spectrum of quantization levels, and the naming is worth decoding if you are choosing a file. The K-quant methods are the current defaults. Q4_K_M uses mostly 4-bit weights while keeping a few sensitive tensors at higher precision, and it is the recommended starting point for a reason: it lands at the knee of the quality-to-size curve. Q5_K_M and Q6_K hold more precision for a larger file, and Q8_0 is essentially lossless for practical purposes. At the aggressive end, Q2_K and Q3_K squeeze models into very small footprints at a visible quality cost.
The “M” and “S” suffixes refer to medium and small variants within a K-quant family, and the difference is how many tensors are held at higher precision. For a 7-billion-parameter model, the spread is instructive: Q2_K is around 2.8 GB, Q4_K_M around 4.1 GB, Q6_K around 5.5 GB, and Q8_0 around 7.2 GB. That range is what lets a single open-weight model serve everything from a phone-class device to a desktop with memory to spare.
Two practical notes carry over from the llama.cpp world. First, for Q4 and below, quantizing with an importance matrix — a calibration pass that weights the most important weights more heavily — measurably improves low-bit quality, so prefer checkpoints that were quantized with imatrix. Second, the quality cost of quantization is model-dependent and task-dependent, which is the same caveat Hugging Face itself gives: measure on your own workload rather than trusting a general rule.
Serving and fine-tuning a GGUF model
The feature also touches two adjacent workflows. First, transformers serve now exposes a GGUF model through an OpenAI-compatible endpoint, addressed as repository:file.gguf, which is what lets a desktop client like Jan or Pi point at a model running on a local machine without a translation layer. Second, you can fine-tune from a GGUF file by dequantizing it explicitly.
from transformers import AutoModelForCausalLM, GgufConfig
import torch
model = AutoModelForCausalLM.from_pretrained(
"unsloth/Qwen3.5-4B-GGUF",
gguf_file="Qwen3.5-4B-Q4_K_M.gguf",
quantization_config=GgufConfig(dequantize=True),
dtype=torch.bfloat16,
)
That dequantization path is a separate option from the packed inference path. It trades the memory advantage for compatibility with the standard training loop, which is the right trade when you want to adapt a checkpoint that only ships as GGUF.
What still falls back, and what does not work yet
The scope is narrow on purpose, and it is worth being clear-eyed about the limits. The packed inference path is MPS-only for now, so Apple Silicon is the only hardware that gets the fast path; on other devices the loader expands the weights back to full precision. The supported architectures are Qwen3.5 dense and MoE, plus compatible Qwen3.8 checkpoints — every other architecture goes through the legacy loader that always dequantizes. There is no tagged release yet; the feature ships from transformers main, alongside a compatible kernels build and a recent PyTorch. Padded batch inference is not supported yet, and the fast path does not apply to generate_batch.
Those are real constraints, not footnotes. If your workflow runs a different architecture on a CUDA box, this announcement changes nothing for you today. The roadmap is explicit about the ambition being larger than the format — because a kernel operates on tensors and does not require the whole model to come from a GGUF file, Hugging Face wants to use ggml’s kernels to accelerate architectures llama.cpp has no implementation for, and eventually vision, audio, and multimodal models. That is a direction, not a shipped feature.
How to choose: llama.cpp versus transformers
The decision tree has not changed much, which is itself a useful signal. If your only goal is efficient local inference, llama.cpp is still the engine to reach for, with its years of Metal and CUDA tuning and its memory management built for that specific job. If your goal is to inspect, evaluate, fine-tune, or extend a model inside Python and PyTorch, transformers with packed GGUF loading is now a credible way to do that without abandoning the format’s memory savings.
For most individual users, the practical impact is indirect: the GGUF files they already use in Ollama or LM Studio are now easier to pull into a notebook, and the same checkpoint can be served locally and inspected in the same session. For the maintainers and researchers who build on open-weight models, the bridge removes a small but persistent source of friction between two tools that have long been treated as separate worlds.
There is also a subtle efficiency argument buried in the announcement. The generate-loop fixes — dropping the redundant padding mask and deferring the stopping check — apply to every transformers model, not just GGUF ones, and they are the kind of small, unglamorous change that quietly improves throughput across the whole library. That matters because, for the open source AI models community, performance work that lands in the shared library compounds across thousands of downstream users rather than living inside a single product.
The bottom line
Packed GGUF loading in transformers is a well-scoped first step, not a takeover of the local-inference space. It closes a real gap for one backend and one model family, reuses the kernels that made llama.cpp fast instead of reinventing them, and points toward a future where the ggml kernels accelerate architectures llama.cpp never implemented. For the open source AI models crowd, the takeaway is simple: the format you already trust for memory-efficient local inference now works inside the Python ecosystem you already know, and the two no longer force you to choose between speed and tooling for the models that fit in the overlap.
Sources: Transformers now runs GGUF quants packed on Apple Silicon (Promptea), Run GGUF Models Directly in Transformers with llama.cpp Support (Local Model Watch), Hugging Face Transformers Now Runs Llama.cpp’s GGUF Quants Natively (Smart Chunks), Transformers Adds Support for llama.cpp GGUF Quantized Models (xfinit).