gguf
Read and write ML models in GGUF for GGML
What it is and what it does
gguf is a Python library for reading and writing files in the GGUF binary format, which is the standard container for machine learning models used by GGML and llama.cpp. It provides both a programmatic API for working with GGUF files in code and command-line tools for inspecting, editing, and converting model metadata and tensors. The package depends on numpy for tensor operations, pyyaml for configuration, requests for network operations, and tqdm for progress reporting.
The library is part of the llama.cpp ecosystem and is actively maintained. It includes utilities to dump metadata, modify key-value pairs, convert file endianness, and optionally a Qt-based GUI editor for visual inspection and editing of GGUF files. It's designed for developers working with GGML-based inference engines who need to programmatically manipulate model files or integrate GGUF handling into their workflows.
Use it for:
- Convert Hugging Face models to GGUF format for use with llama.cpp and other GGML-based inference engines.
- Inspect and extract metadata, tensor names, and structure from existing GGUF model files.
- Modify model metadata (name, description, hyperparameters) in GGUF files without rebuilding them.
- Automate GGUF file generation and manipulation in model training or deployment pipelines.
- Debug or validate GGUF file integrity and endianness across different systems.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads and writes binary files in the GGUF (GGML Universal File) format, commonly used for storing machine learning models compatible with GGML-based tools like llama.cpp.
Yes. The package has low install friction, active maintenance, no known vulnerabilities, permissive licensing, and strong adoption in the GGML/llama.cpp ecosystem. Install it if you need to work with GGUF model files programmatically or via command-line tools.
Install
gguf on PyPI
pip
pip install ggufuv
uv add ggufpoetry
poetry add ggufInstalling gguf
Before you install
Installs cleanly with low friction—a pure Python wheel with four common dependencies (numpy, pyyaml, requests, tqdm). Maintained actively with recent releases and no known vulnerabilities.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute this package freely in both open and closed projects without restriction.
Quickstart
pip install gguf
from gguf import GGUFReader, GGUFWriter
import numpy as np
# Read a GGUF file
reader = GGUFReader('model.gguf')
metadata = reader.get_field('general.name')
# Write a GGUF file
writer = GGUFWriter('output.gguf')
writer.add_tensor('tensor_name', np.array([1.0, 2.0, 3.0]))
Requires Python 3.10 or later.
Verify before relying
- Whether the GUI extra dependency list and installation steps are current.
- Performance characteristics when handling large model files.
- Compatibility guarantees with specific GGML or llama.cpp versions.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — numpy, pyyaml, requests, tqdm |
| Maintenance | actively maintained — 100 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,907,816/month — #1,816 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gguf-0.19.0-py3-none-any.whl
Keywords: ggml, gguf, llama.cpp
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
llama-cpp-pythonPython bindings for llama.cpp that enable…
permissive · top 15,000 on PyPI
pygexfPygexf writes network graph data to GEXF (Graph…
unclear · top 15,000 on PyPI
tomlrtReads and writes TOML files while preserving…
permissive · top 15,000 on PyPI
safetensorsSerializes and deserializes tensors to and from…
permissive · top 1,000 on PyPI
litert-converterConverts machine learning models to LiteRT…
permissive · top 15,000 on PyPI
abstract-hugpy-devA self-hosted LLM console and OpenAI-compatible…
unclear · top 15,000 on PyPI
treeliteTreelite serializes and exchanges decision tree…
permissive · top 15,000 on PyPI
panda3d-gltfAdds glTF 2.0 file loading to Panda3D,…
permissive · top 15,000 on PyPI
garakGarak is a command-line tool that probes large…
unclear · top 15,000 on PyPI
unslothUnsloth accelerates training and fine-tuning of…
permissive · top 5,000 on PyPI