Tooluck logoTooluck
SKILL.md

hf-mem

Agent skill fromhuggingface/skills

Hugging Face CLI to estimate the required memory to load Safetensors or GGUF model weights for inference from the Hugging Face Hub

How to install hf-mem

install hf-mem
# install the skills pack with the skills CLI
npx skills add huggingface/skills

# or add only this skill to Claude Code: copy the folder

skills/hf-mem/

# into

~/.claude/skills/hf-mem/ (all projects)

.claude/skills/hf-mem/ (one project)

skills/hf-mem/SKILL.md

Apache-2.0Full file
1`hf_mem` estimates the required memory for inference, including model weights and an optional KV cache, for Safetensors and GGUF for models on the Hugging Face Hub using HTTP Range requests i.e., without downloading or loading any weights locally.
2
3## When to use?
4
5- User asks how much VRAM or memory a model needs to run
6- User wants to know if a model fits on their GPU or a given instance
7- User references a Hugging Face model ID or URL and asks about inference requirements
8
9## What are the requirements?
10
11- `uv` installed (for `uvx`)
12- `HF_TOKEN` env var or `--hf-token` flag (for gated or private models only)
13
14## How to run?
15
16Run with `--model-id` pointing to the Hugging Face Hub repository which will check that it either contains Safetensors (via `model.safetensors`, `model.safetensors.index.json` if sharded, or `model_index.json` for Diffusers) or GGUF model weights within.
17
18```bash
19uvx hf-mem --model-id <model-id> --json-output
20```
21
22If the repository contains GGUF model weights in multiple precisions / quantizations, the estimations will be on a per-file basis, whereas for inference you won't load all of those but rather only a single precision. This being said, for GGUF you might as well need to provide `--gguf-file` to target the specific file (or path if sharded) you want to run.
23
24```bash
25uvx hf-mem --model-id <model-id> --gguf-file <file-or-path> --json-output
26```
27…

Excerpt shown under the repository's Apache-2.0 license.

More skills in skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates