Metadata-Version: 2.4
Name: hf-mem
Version: 0.1.0
Summary: A CLI to estimate inference memory requirements for Hugging Face models, written in Python
Author: Alvaro Bartolome
Author-email: Alvaro Bartolome <36760800+alvarobartt@users.noreply.github.com>
License-Expression: MIT
License-File: LICENSE
Requires-Dist: httpx[http2]>=0.28.1
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# `hf-mem`

`hf-mem` is an experimental CLI to estimate inference memory requirements for Hugging Face models, written in Python. `hf-mem` is lightweight, only depends on `httpx`. It's recommended to run with [`uv`](https://github.com/astral-sh/uv) for a better experience.

`hf-mem` lets you estimate the inference requirements to run any model from the Hugging Face Hub, including Transformers, Diffusers and Sentence Transformers models, as well as any model that contains [Safetensors](https://github.com/huggingface/safetensors) compatible weights.

## Usage

```bash
uvx hf-mem --model-id MiniMaxAI/MiniMax-M2
```

<img width="899" height="648" src="https://github.com/user-attachments/assets/530f8b14-a415-4fd6-9054-bcd81cafae09" />

```bash
uvx hf-mem --model-id Qwen/Qwen-Image
```

<img width="894" height="872" src="https://github.com/user-attachments/assets/cd4234ec-bdcc-4db4-8b01-0ac9b5cd390c" />

## References

- [Safetensors Metadata parsing](https://huggingface.co/docs/safetensors/en/metadata_parsing)
- [usgraphics - TR-100 Machine Report](https://github.com/usgraphics/usgc-machine-report)
