EN

Language

Our editions

Written for each audience, not translated word for word.

GGUF vs MLX vs Safetensors: model file formats explained

ComparisonBy Lucas Matías García TorresUpdated Data checked 6 min read

Reviewed on . How we work.

Leer en español

Exploded view of a graphics card: fans, heat pipes, heatsink fins and the circuit board with the GPU glowing orange

Short answer

GGUF, Safetensors and MLX are the three packages an open model usually comes in. GGUF is the single-file format, with tensors and metadata, that llama.cpp, Ollama and LM Studio run; Safetensors is the tensor-only container model makers publish original weights in, safer than pickle; MLX models are Safetensors files converted for Apple silicon. For Llama 3.2 3B Instruct, the original weights take 6.43 GB and the 4-bit GGUF and MLX files 2.02 GB and 1.81 GB.

Prices and limits change often: check the vendor's page before you pay. How we make money.

When you download an open model, the same weights usually come in three packages: GGUF, Safetensors and MLX. They are not three rival standards. GGUF is the single-file format that llama.cpp, Ollama and LM Studio run; Safetensors is the plain, safe container that model makers publish their original weights in; and MLX models are, in practice, Safetensors files converted for Apple's MLX framework on Apple silicon. So GGUF vs MLX vs Safetensors is less a contest than a question of which tool you use. This guide explains what each one contains, which tools run it, how big the files are for the same model, and which one to download for your setup.

The three formats at a glance

Table: GGUF, Safetensors and MLX compared (official documentation and Hugging Face repositories, checked October 28, 2026)

Item GGUF Safetensors MLX
What is inside Tensors plus a standard set of metadata, in one file Tensors only; settings and tokenizer live in separate files Safetensors weights plus config.json and tokenizer files
Typical file name Llama-3.2-3B-Instruct-Q4_K_M.gguf model-00001-of-00002.safetensors model.safetensors in an mlx-community repository
Runs in llama.cpp, Ollama, LM Studio Python frameworks such as PyTorch; Ollama can import it MLX LM; LM Studio on Apple silicon Macs
Quantization Built into the file, named in the file name (Q8_0, Q4_K_M...) Whatever precision the publisher saved Quantized when converted, for example to 4-bit
Platforms Any system llama.cpp supports Any system with a compatible framework Apple silicon only

The rest of this page explains each column. If quantization is new to you, read what quantization is first: it is the reason the same model can weigh 6 GB or 2 GB.

GGUF: one file for llama.cpp, Ollama and LM Studio

GGUF is the model file format for GGML and the engines built on it, and Hugging Face notes it was created by the developer of llama.cpp. Its specification describes it as a binary format designed for fast loading and saving, and as the successor to the older GGML, GGMF and GGJT files. Its design goals explain why local tools like it:

  • Single-file deployment. Everything needed to load the model, including metadata such as the architecture and the tokenizer, is in one file.
  • mmap compatibility. Engines can map the file into memory instead of copying it, which makes loading fast.
  • Extensible metadata. New information can be added without breaking older models.

Hugging Face points out the key difference with Safetensors: GGUF encodes the tensors and a standardized set of metadata, while Safetensors holds tensors only. You can find GGUF models on the Hub by filtering for the GGUF library.

The quantization scheme is part of the name. GGUF's naming convention ends with the weight encoding, so Llama-3.2-3B-Instruct-Q4_K_M.gguf is the Llama 3.2 3B Instruct model stored with the Q4_K_M scheme. The unsloth repository for that model offers 27 GGUF files at different precisions, and you only download the one you want.

Two details from Ollama's import guide save time. Ollama does not quantize GGUF models during import, so quantize them first with a tool such as llama.cpp's llama-quantize. And a model split into several GGUF files keeps its original file names and is imported with a wildcard that matches every part.

Safetensors: the safe container for original weights

Safetensors is a format from Hugging Face for storing tensors "safely (as opposed to pickle)" while staying fast, with zero-copy loading. The contrast with pickle is the point. Hugging Face's security documentation says pickle, the default format for PyTorch model weights, can run arbitrary code when you load a file, and recommends loading models only from users and organizations you trust.

A Safetensors file holds nothing but tensors, so a model repository also carries config.json, tokenizer files and, for large models, an index that lists which tensors are in which part. Meta's Llama 3.2 3B Instruct repository, for example, splits its weights into two Safetensors files.

You rarely run these files directly in a desktop app. They are the input for Python frameworks, for fine-tuning and for conversion. Ollama is the exception among local tools: its import guide builds a model from a directory of Safetensors weights with a Modelfile whose FROM line points to that directory.

MLX: Apple silicon models stored as Safetensors

MLX is Apple's array framework for machine learning on Apple silicon, and MLX LM is its Python package for running and fine-tuning language models. MLX is not really a file format. Its documentation lists the formats it saves and loads arrays in: NumPy files, Safetensors and GGUF. In practice, MLX models on Hugging Face are Safetensors files: the mlx-community repository for Llama 3.2 3B Instruct in 4-bit contains model.safetensors, config.json and tokenizer files.

What makes them "MLX models" is the conversion. MLX LM's convert command downloads a model from Hugging Face, quantizes it, for example to 4-bit, and saves the result for MLX; the mlx-community organization on Hugging Face hosts models prepared this way.

To run them, use MLX LM from the command line or Python, or LM Studio, which runs GGUF models through llama.cpp on Mac, Windows and Linux and, on Apple silicon Macs only, also runs MLX models. Our guide to running an LLM on a Mac walks through both.

Same model, three formats: file sizes

The clearest way to see the difference is one model in every package. These are the sizes Hugging Face lists for Llama 3.2 3B Instruct:

Table: Llama 3.2 3B Instruct by format and precision (Hugging Face repositories, October 28, 2026)

Package Repository Size
Original Safetensors, two files meta-llama/Llama-3.2-3B-Instruct 6.43 GB
GGUF BF16 unsloth/Llama-3.2-3B-Instruct-GGUF 6.43 GB
GGUF Q8_0 unsloth/Llama-3.2-3B-Instruct-GGUF 3.42 GB
GGUF Q4_K_M unsloth/Llama-3.2-3B-Instruct-GGUF 2.02 GB
MLX 4-bit (Safetensors) mlx-community/Llama-3.2-3B-Instruct-4bit 1.81 GB
GGUF Q2_K unsloth/Llama-3.2-3B-Instruct-GGUF 1.36 GB

Format barely changes the size: the original Safetensors and the BF16 GGUF weigh exactly the same. Precision does: the 4-bit versions are less than a third of the original. That is the number to compare with your graphics card or your Mac's memory, as explained in how much VRAM an LLM needs.

Which one should you download?

Decide by the tool first and by memory second:

  • Ollama or LM Studio on Windows or Linux: GGUF. With Ollama you usually pull from its own library and never see the file, but a GGUF from Hugging Face can be imported with a Modelfile.
  • LM Studio on an Apple silicon Mac: either GGUF or MLX, since it runs both. Try the same model in both and keep the one that runs better on your Mac.
  • MLX LM in Python: an mlx-community repository, or convert the original weights yourself.
  • Fine-tuning, research or conversion: the original Safetensors weights.

Then choose the precision. A 4-bit file such as Q4_K_M or an MLX 4-bit model is the usual starting point when memory is tight; Q8_0 is closer to the original if it fits. If you are choosing between local apps rather than files, compare Ollama and LM Studio first.

Converting between formats

The usual path starts from the original Safetensors weights:

  • To GGUF: Hugging Face's GGUF page points to the gguf-my-repo tool from ggml-org to convert and quantize a model, and llama.cpp provides llama-quantize for quantizing GGUF files.
  • To MLX: mlx_lm.convert with the -q option converts and quantizes in one step, and can upload the result to Hugging Face.

Going from a quantized file back to full precision does not recover what quantization removed, so keep or re-download the original weights if you may need them later.

How we checked

We read the GGUF specification in the ggml repository, Hugging Face's GGUF, Safetensors and pickle security documentation, MLX's saving and loading documentation, the MLX LM README, Ollama's model import guide and LM Studio's documentation on October 28, 2026. File names and sizes come from the file listings of the four Hugging Face repositories named in the table, read the same day. We did not measure speed or answer quality for any format.

What we checked

  • GGUF specification: a file format for storing models for inference with GGML and GGML-based executors; a binary format designed for fast loading and saving; successor to GGML, GGMF and GGJT; design goals include single-file deployment, extensibility, mmap compatibility and full information in the model file; metadata keys include general.architecture and tokenizer.ggml.model; the naming convention ends with the weight encoding scheme, such as Q4_K_M. (ggml-org, )
  • Hugging Face: GGUF is a binary format optimized for quick loading and saving; it was developed by the developer of llama.cpp; unlike tensor-only formats such as Safetensors, it encodes the tensors and a standardized set of metadata; GGUF models can be found with the GGUF library filter, and the ggml-org/gguf-my-repo tool converts and quantizes models. (Hugging Face, )
  • Safetensors is a simple format for storing tensors safely, as opposed to pickle, that is still fast (zero-copy). (Hugging Face, )
  • Hugging Face: pickle is the default format for PyTorch model weights, and loading a pickle file can enable arbitrary code execution attacks; it suggests loading models from users and organizations you trust. (Hugging Face, )
  • MLX saves and loads arrays as NumPy (.npy, .npz), Safetensors (.safetensors) and GGUF (.gguf). (Apple (ml-explore), )
  • MLX LM is a Python package for generating text and fine-tuning large language models on Apple silicon with MLX; convert with quantization generates a 4-bit model and can upload it to Hugging Face; mlx_lm.convert -q quantizes from the command line. (Apple (ml-explore), )
  • Ollama imports a model from a directory of Safetensors weights with a Modelfile FROM line and ollama create; it does not quantize GGUF models during import and suggests a GGUF tool such as llama.cpp's llama-quantize; split GGUF models are imported with a wildcard matching every shard. (Ollama, )
  • LM Studio runs LLMs on Mac, Windows and Linux using llama.cpp (GGUF), and on Apple Silicon Macs also using Apple's MLX. (LM Studio, )
  • File listings: meta-llama/Llama-3.2-3B-Instruct has two Safetensors files of 4.97 GB and 1.46 GB; unsloth/Llama-3.2-3B-Instruct-GGUF has 27 GGUF files, including BF16 at 6.43 GB, Q8_0 at 3.42 GB, Q4_K_M at 2.02 GB and Q2_K at 1.36 GB; mlx-community/Llama-3.2-3B-Instruct-4bit has config.json, tokenizer files and a model.safetensors of 1.81 GB. (Hugging Face, )

What may change

  • Repositories add and remove files, and tools add formats. This page is reviewed quarterly.

Frequently asked questions

What is the difference between GGUF and Safetensors?

Safetensors stores only tensors, so a model also needs separate configuration and tokenizer files, and it is mainly used by Python frameworks. GGUF packs the tensors and a standard set of metadata into one file and is what llama.cpp, Ollama and LM Studio run. Both can hold the same weights: the BF16 GGUF of Llama 3.2 3B Instruct weighs the same as the original Safetensors.

Is MLX a file format?

Not really. MLX is Apple's machine learning framework for Apple silicon. It can save and load arrays as NumPy files, Safetensors or GGUF, and the MLX models on Hugging Face are Safetensors files with a config and tokenizer, converted and usually quantized with MLX LM. They run in MLX LM and in LM Studio on Apple silicon Macs.

Which GGUF file should I download?

The one that fits your memory with room to spare. For Llama 3.2 3B Instruct, Q8_0 takes 3.42 GB and Q4_K_M 2.02 GB, against 6.43 GB in BF16. A 4-bit file such as Q4_K_M is the usual starting point when memory is tight; if a larger file fits, it stays closer to the original model.

Are Safetensors files safe to download?

They were designed to store tensors safely, as opposed to pickle, which Hugging Face warns can run arbitrary code when a file is loaded. That removes the main risk of the older format, but Hugging Face still recommends loading models from users and organizations you trust.

Can I use MLX models on Windows or Linux?

No. MLX targets Apple silicon, and LM Studio only runs MLX models on Apple silicon Macs. On Windows and Linux, download the GGUF version of the same model for LM Studio, Ollama or llama.cpp, or use the original Safetensors weights in a Python framework.

Sources

  1. GGUF specification (ggml repository): design goals, metadata keys and file naming convention, ggml-org. Accessed October 28, 2026.
  2. GGUF (Hugging Face Hub documentation): metadata, finding GGUF files and conversion, Hugging Face. Accessed October 28, 2026.
  3. Safetensors (Hugging Face documentation): a simple format for storing tensors safely, Hugging Face. Accessed October 28, 2026.
  4. Pickle scanning (Hugging Face Hub security documentation): arbitrary code execution risk, Hugging Face. Accessed October 28, 2026.
  5. Saving and loading arrays (MLX documentation): NumPy, Safetensors and GGUF, Apple (ml-explore). Accessed October 28, 2026.
  6. MLX LM README: generation, fine-tuning, quantization and conversion on Apple silicon, Apple (ml-explore). Accessed October 28, 2026.
  7. Importing a model (Ollama documentation): Safetensors weights and GGUF files, Ollama. Accessed October 28, 2026.
  8. LM Studio documentation: running llama.cpp (GGUF) and MLX models, LM Studio. Accessed October 28, 2026.
  9. Llama 3.2 3B Instruct on Hugging Face: file listings of the meta-llama, unsloth GGUF and mlx-community 4-bit repositories, Hugging Face. Accessed October 28, 2026.

Spotted an error or an outdated price? Tell us and we will fix it.

Change history

  • : First published. Checked against the GGUF specification, Hugging Face, MLX, Ollama and LM Studio documentation and three Hugging Face repositories on October 28, 2026.

Next review: .

Part of our Local Models & Hardware guide.

Other topics