Transformers now runs llama.cpp quants

AI-generated summary of reporting by Huggingface Blog. Read the original for the full story.

Why it matters

Developers can now run llama.cpp-quantized GGUF checkpoints directly through transformers' Python API at near-llama.cpp speeds on Apple Silicon, removing the need to switch runtimes for local inference or fine-tuning.

Read this as

Hugging Face's transformers software can now load GGUF files, the compressed model format used by tools like Ollama to run AI models on laptops. These files shrink models to fit a machine's memory by storing weights at lower precision, such as 4-bit. Previously you needed a separate program to run them; now the familiar Python tools handle it directly. Performance on a MacBook Pro M2 Max is close to llama.cpp's dedicated engine.

Hugging Face has closed a practical gap: GGUF checkpoints, the quantized format behind Ollama and LM Studio, now run in transformers with performance measured near llama.cpp on a MacBook Pro M2 Max (32 GB). Teams get one checkpoint usable for local serving via an OpenAI-compatible API, evaluation, and fine-tuning in PyTorch. Risk: the packed path is Metal-only and currently supports Qwen3.5 architectures, so cross-platform coverage is limited.

transformers now loads GGUF checkpoints by reusing ggml's Metal kernels via the kernels library: quantized matmul, fused zero-centered RMSNorm, flash attention, gated delta network acceleration, and a custom top-k MoE routing kernel. Generation-loop optimizations (#48814 mask removal, #47976 async stopping check) help all models. Benchmarks on an M2 Max show throughput close to llama-bench's tg128, though transformers includes prefill. Limitations: packed inference is MPS-only, currently covers Qwen3.5 dense and MoE, and padded batching is unsupported.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

transformers GGUF llama.cpp kernels library Qwen3.5 MacBook Pro M2 Max

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading