Metadata-Version: 2.4
Name: hf-mem
Version: 0.0.2
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-Python: >=3.10
Description-Content-Type: text/markdown

# `hf-mem`

> [!WARNING]
> `hf-mem` works, but is still experimental. Ideally there should be a minor release anytime soon making things a bit more stable (and aesthetic).

`hf-mem` is a CLI to estimate inference memory requirements for Hugging Face models, written in Python. `hf-mem` is lightweight and free for third-party dependencies. 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 HuggingFaceTB/SmolLM3-3B
```

## References

- [Safetensors Metadata parsing](https://huggingface.co/docs/safetensors/en/metadata_parsing)
