libgguf
libgguf is a standalone GGUF library with native row kernels, Python bindings, Torch and NumPy implementations, optional HIP/ROCm GPU kernels, and a native safetensors-to-GGUF converter.
The native REF CPU backend is the correctness reference. Optimized CPU
backends are selected at compile time.
Install
python -m pip install .
Editable development install:
python -m pip install --editable .
For a ROCm build with the Torch GPU wrapper:
$env:CMAKE_ARGS='-DLIBGGUF_BUILD_GPU=ON -DLIBGGUF_ENABLE_ROCM=ON -DLIBGGUF_BUILD_TORCH=ON'
python -m pip install --editable ".[gpu]" --no-build-isolation
See docs/installation.md for build requirements and CMake options.
Python row API
import numpy as np
import libgguf
rows = np.random.default_rng(0).normal(size=(4, 4096)).astype(np.float32)
qtype = libgguf.GGMLQuantizationType.Q4_K
encoded = libgguf.quantize_rows(rows, qtype)
decoded = libgguf.dequantize_rows(encoded, qtype, n_per_row=rows.shape[-1])
The top-level package also exposes qtype metadata, storage-row operations, imatrix loading, lightweight GGUF inspection, raw tensor-byte reads, and structural validation. See docs/python-api.md.
Backends
libgguf: native CPU row operations and GGUF metadata APIs.libgguf.libgguf_numpy: NumPy implementation.libgguf.libgguf_torch: Torch-native implementation.libgguf.libgguf_gpu: native Torch GPU operations.
GPU builds explicitly select either HIP/ROCm or CUDA. PyTorch exposes ROCm
devices through its cuda device namespace:
import torch
import libgguf
import libgguf.libgguf_gpu
rows = torch.randn(4, 4096, device="cuda", dtype=torch.float32)
qtype = libgguf.GGMLQuantizationType.Q4_K
encoded = libgguf.libgguf_gpu.quantize(rows, int(qtype))
Converter and commands
The native libgguf_quantize_gguf executable converts safetensors models to
GGUF and supports CPU, GPU, and automatic backend selection.
libgguf_quantize_gguf \
--src model.safetensors \
--qtype Q4_K_M \
--dst model-Q4_K_M.gguf \
--backend auto
The Python package also installs gguf-inspect, gguf-validate, and
gguf-compare. See docs/cli.md.
Documentation
License
Apache-2.0. Adapted source files retain their applicable provenance notices.
Metadata
Release files for libgguf 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| libgguf-0.2.2.tar.gz | 3.1 MB | With provenance | Details for libgguf-0.2.2.tar.gz |
Built distributions (wheels)
Total release size: 9.0 MB
Release files / libgguf-0.2.2.tar.gz
| Download URL | libgguf-0.2.2.tar.gz |
|---|---|
| Size | 3.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e44a0599ad0eee1da827a031a5209c14857f74d6b34d593d33285ba25bcda5ea
|
|
BLAKE2b-256 checksum How to use checksums |
aa38eee3e976125ba87333f5063603dcdd0ac1c32078ecfb369a57e93348bdfa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp313-cp313-win_amd64.whl
| Download URL | libgguf-0.2.2-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 378.2 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
dd72e3d1ad2fff64eecaf4e848a1709c147b6aae6d89304fbf0e5dc68c000d30
|
|
BLAKE2b-256 checksum How to use checksums |
3998880ef9746432e7de1fe4aa6934ff9e46eb8a54f0620999971007d87eed4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | libgguf-0.2.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 402.1 kB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
29eaea4345602a4040dcc9cfaa139903772b36e7ca1c528625b1d57192d87689
|
|
BLAKE2b-256 checksum How to use checksums |
b2dec746280fff456d9ab14a72bce94e0d50a8386478e10fca19e00176f23bcd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | libgguf-0.2.2-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 341.9 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1a5b50233844c41417cccc0c8c18edbce85fbd8a2951281565b1eb9f52508a5f
|
|
BLAKE2b-256 checksum How to use checksums |
6eafbe9f831aaf54b9b7eab1b25755079a977f23c99141b2617ccf5f2c154259
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp313-cp313-macosx_10_13_x86_64.whl
| Download URL | libgguf-0.2.2-cp313-cp313-macosx_10_13_x86_64.whl |
|---|---|
| Size | 356.9 kB |
| Tags | CPython 3.13 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
c515598fcdeec6ab6b9e027e2c6cd12a1ff3b58c92b0e91c72209e1f7f3ec0e3
|
|
BLAKE2b-256 checksum How to use checksums |
ecda58c65f2842a7752419f18052d08135dd7a614f1eb069bcfd3e9002ac17e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp312-cp312-win_amd64.whl
| Download URL | libgguf-0.2.2-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 378.2 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
47fcd66b0720f0b54adedb11f6863ffde16ca37eae141863cdf036a1cf8cde1b
|
|
BLAKE2b-256 checksum How to use checksums |
4c23bf057c85148f02d43edf2c9ae67d42e62459635b4e8839645b6fd73ca7cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | libgguf-0.2.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 402.1 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
712416d7e115783eb4b576cf401d7f3ffe14f15a09bca8ae1c94cb646a2b8af9
|
|
BLAKE2b-256 checksum How to use checksums |
825d9c17ae7aa1ce7ab5bdffde4c2b42fec4f3c414aa6b5b497b2ec123b22cf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | libgguf-0.2.2-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 341.9 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ad744b1a3b6da060890b01ba57c5e7037840e4b689f0e5de5078dda1edfd6769
|
|
BLAKE2b-256 checksum How to use checksums |
13348c673ba1db7ea9465d09e0eba49a793aba43ea85bb972fa05f5d91eab67f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp312-cp312-macosx_10_13_x86_64.whl
| Download URL | libgguf-0.2.2-cp312-cp312-macosx_10_13_x86_64.whl |
|---|---|
| Size | 356.9 kB |
| Tags | CPython 3.12 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
d592cc4c16bec4d96d17629ff29a97ee74a260ef521dcc09c61ead761f754030
|
|
BLAKE2b-256 checksum How to use checksums |
9f39acd6630c8eeba6a1196f8b68b847e92c157cb44099a715153f8cdb8db5e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp311-cp311-win_amd64.whl
| Download URL | libgguf-0.2.2-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 378.2 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
160d85764e8f1aa6bc082b9580bf7d37f7827b54d4946403dfed7e9622d9e007
|
|
BLAKE2b-256 checksum How to use checksums |
48013e014c064e84539447feb1566294431e17959ed06732cd5b9490519045fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | libgguf-0.2.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 402.1 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
a7dfe41c6f0e9c4fa861d7fa657537efaf3406c09cd16014d6069dbd89fd3bd2
|
|
BLAKE2b-256 checksum How to use checksums |
a062efd6e3aa9febdf8444b48239f5378d7bfb0de354c26763ba67967daf2ed9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | libgguf-0.2.2-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 341.9 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
0ee09740cb6278f105b4cd5276481d278f41b91a2e6a83433f26587b311a4076
|
|
BLAKE2b-256 checksum How to use checksums |
5f96d697d43d427134a5920aeeff0b4ce19bb7b5c77672ef19fd6c783e0ee48f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | libgguf-0.2.2-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 353.3 kB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
7dd478e466cb0c97ed720e845f27a8a9fc2cb161aa805517d6f9aa502b371e65
|
|
BLAKE2b-256 checksum How to use checksums |
ed1875fbcb79c619bc1ec0c0d7bf9edec9aa581e843112e587ab4ece9f5f1daf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp310-cp310-win_amd64.whl
| Download URL | libgguf-0.2.2-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 378.3 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
cfe02d8ad4bbbf8712f1aadb93a458386ad7244b0214c7fe79bbae0c75fec8a2
|
|
BLAKE2b-256 checksum How to use checksums |
3db66ec135f2288ce9b96944e915627bc94e16a7cc658ba02636577462ae7420
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | libgguf-0.2.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 402.1 kB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
3415bd8191102b865878507231da443738bc2929993fcac010a71c2f9c77283c
|
|
BLAKE2b-256 checksum How to use checksums |
8e49170ea8baf8261a885d25fb680bb5861e21e8f8f33d1e85fdcf235d2a7c0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | libgguf-0.2.2-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 341.8 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
aba420e68057bbc95932edf13a565c5b2fd160ab5755c4ca6d89c41325ca1ff5
|
|
BLAKE2b-256 checksum How to use checksums |
e3d35949adc56cab578c32b63b2cfe4f7fa420691b06bb1d50142e9a9ab00f0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logRelease files / libgguf-0.2.2-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | libgguf-0.2.2-cp310-cp310-macosx_10_9_x86_64.whl |
|---|---|
| Size | 353.3 kB |
| Tags | CPython 3.10 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
0e57032214fd38cd3025f484e9e00d3af66ad4b44f47e060eaa515a57aedd40b
|
|
BLAKE2b-256 checksum How to use checksums |
eaff5746fa89eb6242fdc7d38125043e34a056b9b4215667248bbd391fade44a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logSecurity for libgguf 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 17 files in this release have been uploaded with provenance metadata.
Attestation for libgguf-0.2.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.