Skip to main content

GGUF metadata/tensor editor with a built-in quantizer — browser GUI via `python -m gguf_editor`

Project description

gguf-editor

GGUF metadata/tensor editor with a built-in quantizer, packaged for Python. The editor GUI runs in your browser against a local server — files are opened straight from disk, so multi-GB models are never uploaded or fully loaded into memory. The quantization engine is the standalone C/C++ quantizer (no ggml dependency), compiled during pip install and bundled with the package.

Install

pip install gguf-editor

Building the bundled quantizer requires a C/C++ toolchain and CMake ≥ 3.15 (on Windows: MSVC Build Tools). GPU accelerators are opt-in at build time:

CMAKE_ARGS="-DQUANTIZER_CUDA=ON"  pip install gguf-editor   # NVIDIA (CUDA toolkit)
CMAKE_ARGS="-DQUANTIZER_HIP=ON"   pip install gguf-editor   # AMD (ROCm/HIP)
CMAKE_ARGS="-DQUANTIZER_METAL=ON" pip install gguf-editor   # Apple (macOS)

Usage

python -m gguf_editor                 # launch the editor GUI in the browser
python -m gguf_editor model.gguf      # …opening a file right away
python -m gguf_editor --port 8642 --no-browser

Editor features (as in the desktop editor / chrome extension):

  • inspect and edit metadata (all value types incl. arrays), add/delete keys
  • rename, delete, reorder (drag), merge tensors; add zero-filled tensors; import tensors from another GGUF
  • find & replace across tensor names (literal or regex)
  • per-tensor precision changes and/or a batch weight type — on save the file is rebuilt with your edits and then converted by the quantizer into a single output file
  • streams tensor data disk-to-disk on save with live progress

CLI quantizer (mirrors the standalone quantizer binary):

python -m gguf_editor quantize -m model-f16.gguf -o model-q4_k.gguf --type q4_k
python -m gguf_editor quantize -m model.safetensors -o model-q8_0.gguf --type q8_0
python -m gguf_editor quantize -m model.gguf -o out.gguf \
    --tensor-type-rules "attention.*weight=q4_k" --device auto
python -m gguf_editor devices

Supported types: f32 f16 bf16 q4_0 q4_1 q5_0 q5_1 q8_0 q1_0 q2_k q3_k q4_k q5_k q6_k iq1_s iq1_m iq2_xxs iq2_xs iq2_s iq3_xxs iq3_s iq4_nl iq4_xs tq1_0 tq2_0 mxfp4 nvfp4. Inputs may be GGUF or safetensors (auto-detected; multi-part safetensors are merged automatically).

Python API

from gguf_editor import gguf, quantizer

parsed = gguf.parse_file("model.gguf")           # header-only parse
print(parsed.version, len(parsed.tensor_infos))

quantizer.quantize("model-f16.gguf", "model-q4_k.gguf", default_type="q4_k")

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gguf_editor-0.0.3.tar.gz (135.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gguf_editor-0.0.3-py3-none-win_amd64.whl (949.4 kB view details)

Uploaded Python 3Windows x86-64

File details

Details for the file gguf_editor-0.0.3.tar.gz.

File metadata

  • Download URL: gguf_editor-0.0.3.tar.gz
  • Upload date:
  • Size: 135.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for gguf_editor-0.0.3.tar.gz
Algorithm Hash digest
SHA256 e8d19d5bc991b6eb9ef1fb243c02f6b11c60a2191a3976241c6ab0840e22225c
MD5 12401c82faca3f120c37d79e33459433
BLAKE2b-256 a5864220e733b26e10be7f66c8574da5f7458605b66012053cfbf37dadc8b620

See more details on using hashes here.

File details

Details for the file gguf_editor-0.0.3-py3-none-win_amd64.whl.

File metadata

  • Download URL: gguf_editor-0.0.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 949.4 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for gguf_editor-0.0.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 6160a92e83598aa83695797c854d5574f90dcd85897e951305c07071e30f3ad3
MD5 a05feb197cec581045ba407eb5414b37
BLAKE2b-256 b903e5f120eb017659097c056dea6837f6d6720eda36aa00091c655bd2a5159b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page