mishig/xet-gguf-edit-test
01.5k
GGUF Header Edit Benchmark
Benchmark script for measuring how long it takes to edit GGUF headers in-place on Hugging Face with streaming blobs (xet) and create a pull request per file. It fetches metadata, rebuilds the header with a small change, commits an edit (header slice only), and records timings to a CSV.
Result from benchmark.ts
<div class="flex">
<div style="max-width: 600px"> <img src="https://huggingface.co/mishig/xet-gguf-edit-test/resolve/main/output.png">
[!note] Rule of thumb (linear fit): timeminutes ≈ 0.36 × sizeGB + 0.25
</div>
</div>
✨ What this does
For each *.gguf file in a model repo:
- Discover files via the Hugging Face model tree API.
- Fetch GGUF + typed metadata with
@huggingface/gguf. - Rebuild the header using
buildGgufHeader(preserving endianness, alignment, and tensor info range). - Commit a slice edit (header bytes only) using
commitIterwithuseXet: trueto avoid full re-uploads. - Create a PR titled
benchmark. - Record timing (wall-clock) to
benchmark-results.csv.
🧱 Requirements
- Node 18+
- A Hugging Face token with read + write on the target repo:
HF_TOKEN - NPM packages:
@huggingface/gguf@huggingface/hub- Network access to
huggingface.co
🔧 Setup
npm i
npm run benchmark