hf-mem
Skill by sickn33
Estimates the memory needed to load Safetensors or GGUF model weights from the Hugging Face Hub for inference. Useful for checking whether a model fits a GPU or instance before running it.
Install hf-mem
Built from the published package, never by AI.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agentic-awesome-skills/skills/hf-mem ~/.claude/skills/hf-memRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/sickn33/agentic-awesome-skills /tmp/agentic-awesome-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/agentic-awesome-skills/skills/hf-mem ~/.gemini/antigravity-cli/skills/hf-memAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
hf-mem is a Hugging Face CLI skill that estimates the memory required for inference from model weights hosted on the Hugging Face Hub. It supports Safetensors and GGUF files. With the --experimental flag, it can also estimate KV cache memory for LLMs, VLMs and GGUF models.
The tool uses HTTP Range requests to read file metadata, so it does not download or load weights locally. The source says the skill is for users who ask how much VRAM or memory a model needs, whether it fits their GPU, or what a Hub model ID requires for inference. Estimates are not a guarantee that a model fits, so the source recommends confirming with the intended inference backend on target hardware.
Written from the project's SKILL.md and checked against it.
What it can do
- Safetensors memory estimateEstimates memory for model weights in Safetensors repositories using model.safetensors or sharded index files.
- GGUF memory estimateEstimates memory per GGUF file, with --gguf-file to target one precision or quantization.
- KV cache estimateWith --experimental, adds KV cache memory for LLMs, VLMs and GGUF models.
- Context and batch optionsAccepts --max-model-len and --batch-size to change the context length and batch size used in the estimate.
- KV cache dtype optionAccepts --kv-cache-dtype to set the KV cache precision, defaulting to the model precision.
- JSON outputPrints results in JSON with --json-output.
What you need
- uv installed, for running uvx
- HF_TOKEN for gated or private Hugging Face repositories
- A reviewed, pinned hf-mem package version
Try asking
- How much VRAM does this Hugging Face model need to run?
- Estimate memory for this GGUF file with KV cache at a 8192 context.
- Will this Safetensors model fit on my GPU? Check the Hub model ID.
Good to know
- Estimates from weights and headers are not a guarantee that a model fits.
- Experimental KV cache estimates depend on supported architectures.
- Metadata access contacts the Hub and can reveal private model identifiers.
- The skill does not bundle the hf-mem executable.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/hf-mem/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md5 KB
Alternatives to hf-mem
All alternatives →Set up and diagnose a local agentmemory installation. It covers MCP connections, environment variables, ports, auth and feature flags, and is for users getting started or checking a connection.
Analyzes a Karpathy-pattern LLM wiki and builds an interactive knowledge graph with entities, implicit links and topic clusters. Built for people who maintain LLM-generated markdown wikis.
Saves and loads timestamped reports for AI assistants, with keyword routing for fast lookup. It also runs an Actionability Gate that checks report links before delivery. Intended for morning briefings, meeting digests and research reports.
Removes a personal fact, preference, relationship detail, topic or past event from Muse's active memory. It also stops existing copies and automations from bringing it back.
Git Context Controller (GCC) is a skill that stores agent memory as a versioned file system under .GCC/. It suits multi-step projects that need milestone tracking, branching and context recovery across sessions.
Guides an evidence-first reading of a book, article, PDF or document set. Built for readers who want claims, evidence and recall rather than a short summary.
Compare with agentmemory-config, understand-knowledge or reports
hf-mem: common questions
Does hf-mem download the model weights?
No. The source says it uses HTTP Range requests, so it does not download or load any weights locally.
What does the --experimental flag add?
It calculates KV cache memory requirements in addition to model weights, for LLMs, VLMs and GGUF models.
Does the estimate guarantee a model will run on my hardware?
No. The source says runtime workspaces, activations, fragmentation and concurrent processes add memory, so confirm on target hardware.
How do I install hf-mem?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is hf-mem free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is hf-mem safe to use?
It scores 90 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to hf-mem?
Similar skills: agentmemory-config, understand-knowledge, reports, forget.
