.gguf

What is a .gguf file?

GGML Universal File · Data · llama.cpp / Georgi Gerganov · 2023

GGUF is the file format for running large language models locally with llama.cpp and its many front-ends. One .gguf file holds the whole model: its weights, the tokenizer and all the metadata needed to load it.

Category
Data
Type
Binary
Is a .gguf file safe to open? Generally safe. GGUF holds data (weights and metadata), not code, so loading a model does not execute it. Only download models from sources you trust.

What is a .gguf file used for?

GGUF replaced the older GGML format. It starts with the magic bytes GGUF, followed by a version and a key-value metadata block, then the quantized tensor data. Bundling everything in one self-describing file is what makes local models easy to share and run.

Weights are usually quantized (for example Q4_K_M) to shrink a multi-gigabyte model enough to run on consumer hardware. You do not open a .gguf directly; you load it in a runner like llama.cpp, Ollama, LM Studio or Jan.

What opens a .gguf file?

The .gguf format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.

Windows

  • LM Studio
  • Ollama
  • llama.cpp
  • Jan

macOS

  • LM Studio
  • Ollama
  • llama.cpp
  • Jan

Linux

  • llama.cpp
  • Ollama
  • text-generation-webui

Open a .gguf file step by step

  1. Confirm the file really is a .gguf. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
  2. On Windows, open it with LM Studio or Ollama.
  3. On Mac, use LM Studio or Ollama.
  4. On Linux, try llama.cpp or Ollama.
  5. Still stuck? Convert the .gguf to safetensors (via conversion), which opens more widely.

Why can't I open my .gguf file?

Almost always because no installed app understands GGUF. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.

The other possibility is that the file is not really a .gguf at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.

How to convert a .gguf file

You can convert a .gguf file to safetensors (via conversion) using a conversion tool or the export menu of an app that opens it.

What is the .gguf file signature (magic bytes)?

A .gguf file starts with the hex bytes 47 47 55 46, which read as GGUF in ASCII. Programs identify GGUF by those bytes, not by the filename, so a renamed file still gives itself away.

These are the documented signatures for GGUF. For a full breakdown, see the GGUF (local LLM) file signature page.

Documented magic-byte signatures for the .gguf format
Hex signatureOffsetASCIINote
47 47 55 460GGUF'GGUF'

See the full magic-numbers reference for every format.

Frequently asked questions

What is a .gguf file?

GGUF is the file format for running large language models locally with llama.cpp and its many front-ends. One .gguf file holds the whole model: its weights, the tokenizer and all the metadata needed to load it.

How do I open a GGUF file?

Load it in a local LLM runner such as LM Studio, Ollama or llama.cpp. It is a model file, not a document, so there is no viewer; you run it to chat with the model.

What does the quantization in a GGUF filename mean?

Tags like Q4_K_M describe how aggressively the weights are compressed. Lower numbers mean smaller files that run on less memory, with some loss of quality.

What is the difference between GGUF and safetensors?

GGUF is built for running models locally with llama.cpp and bundles tokenizer and metadata. Safetensors is a safe storage format used more in training and the Hugging Face ecosystem.

Related formats

Sources

Details on this page were checked against authoritative references. How sources are ranked and what is deliberately left out is set out in the methodology.