Adding GGUF Support for hf-mem

hf-mem preview

hf-mem is an open source CLI that estimates the VRAM requirements of Hugging Face models before loading them. My contribution included:

  • Adding native support for GGUF model files.
  • Building a GGUF binary metadata parser following the original GGML C implementation.
  • Implementing model and KV cache memory estimation from GGUF metadata.
  • Optimizing metadata retrieval through asynchronous fetching.
  • Extending the estimator to support sharded GGUF models.

This was my first major open source contribution and set me as the 2nd highest contributor to the repository!

Check out the pull request for more details.