C✳CODEZ.WIN
🌐 English

Localized reading guide

hf-memPurpose, usage and source

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

Source retrieved:

Source repository
huggingface/skills
SKILL.md
skills/hf-mem/SKILL.md
Repository stars
11,241
Repository updated
2026-10-30
Categories
Other
Last collected

License: Apache-2.0

Workflow excerpts are reading aids, not executable instructions from Codez. No third-party Skill was run to produce this page.

The purpose and workflow passages below are upstream material, organized and translated for reading. They are distinct from the separately labeled Codez editorial analysis.

What this Skill does

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

How the upstream workflow works

How to run?

Run 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. If 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. Additionally, hf-mem comes with an --experimental flag that will also calculate the KV cache memory requirements too, useful for large-language models, meaning it applies to LLMs (...ForCausalLM), VLMs (...ForConditionalGeneration), and GGUF models. For Safetensors use as:

Upstream passage · L19 ↗

Overview

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.

Upstream passage · L6 ↗

When to use?

User asks how much VRAM or memory a model needs to run User wants to know if a model fits on their GPU or a given instance User references a Hugging Face model ID or URL and asks about inference requirements

Upstream passage · L8 ↗
Upstream passage · bash ↗
uvx hf-mem --model-id <model-id> --json-output

Requirements and setup

What are the requirements?

uv installed (for uvx) HF_TOKEN env var or --hf-token flag (for gated or private models only)

Upstream passage · L14 ↗

Limits and quality checks

No separate limits passage was selected from this file. This does not mean the Skill is safe for every input or environment. Review the complete source and validate your own result.

Start with a safe trial

  1. Check the supported host and the repository installation instructions. Keep the Skill directory and its referenced scripts, assets and documentation together; SKILL.md alone may omit dependencies.
  2. Give the agent your real input, desired output and acceptance criteria. Invocation syntax and available tools depend on the host; this site does not assume a universal install command.
  3. Try the source workflow in a disposable project or on a copy. Review operations that change files, remote services or billable resources before allowing them.
  4. Validate the output against the source quality checks and your own requirements. A successful trigger or a high repository Star count does not establish a correct result.

Skill format and directory specification ↗

Read further in the source

Translation and scope

This reading guide selects passages from the pinned upstream SKILL.md. Translation is assisted. It is not a complete manual or a claim of tested compatibility. Read the original and its referenced files before use.

This introduction refers to the pinned version below; current repository activity and collection time are shown separately.

Source retrieved
Source commit
fabc634a893f62ad5c2039830397efa35fa62715
Source SHA-256
ee99f9d97e084aa61a80eaec4e6de2265341e71256d918d48fb87a2ac01ce99f
Back to the full Skill catalog