hf-mem
Model memory estimator
Information
Inference memory planning

Know what fits.
Before it loads.

Turn a Hugging Face model ID into an inspectable memory estimate. Read model metadata with hf-mem, before downloading or loading the weights.

Capability film00:08 / Overview
Illustrative animation. The observed output and test evidence are identified separately.

One model. Three distinct memory questions.

The original Hugging Face Skill guides your assistant through weight estimates for Safetensors and GGUF models using HTTP Range requests.

The memory envelope
WeightsKV cacheHeadroom
Estimate firstSafetensors / GGUF
OptionalExperimental mode
Reserve separatelyRuntime overhead

Conceptual allocation, not measured proportions. A weight estimate alone is not a complete runtime memory budget.

Compare candidates

Inspect model IDs or a selected GGUF file before deciding what belongs in your deployment plan.

Ask a better fit question

Bring your hardware budget and context-length needs. Keep the returned estimate separate from actual GPU allocation.

A number with its scope attached.

Read structured JSON for weight memory and total memory. An experimental mode can also estimate KV cache for supported model types, with context length, batch-size and cache-dtype options.

Observed public-model smoke test
256.57MiB
HuggingFaceTB/SmolLM2-135M269,030,016 bytes

Weight-memory estimate from a real CLI run. Not measured GPU usage.

Your input
A Hub model repository; the intended GGUF file or precision when relevant; and your hardware or context-length question.
Delivery
Original SKILL.md, Apache-2.0 license and source provenance. Install the hf-mem executable separately with uvx.
Environment
A coding assistant with command execution, uv/uvx and internet access to the Hub. Gated or private models require your own permitted HF_TOKEN.
Verified
One live public Safetensors estimate for HuggingFaceTB/SmolLM2-135M.