Data & AnalyticsOfficial · huggingface

Hf Mem skill for Claude

Estimate the GPU memory needed to run a Hugging Face model (weights, KV cache and inference overhead) and whether it fits on given GPUs, without downloading it.

When Claude uses it

Use when asked how much VRAM a model needs, whether it fits on a GPU, the longest context that fits, or which GGUF quantization to pick.

Hf Mem SKILL.md

The full skill file from huggingface/skills (mit).

hf-mem

uvx hf-mem <model> -o json [options]

<model> is a Hub ID (org/name, org/name@revision), a Hub URL, a local path, or org/name-GGUF:Q4_K_M for one GGUF quantization.

Options:

  • --gpu-memory 24 (GiB per GPU) or 8x80 (8 GPUs): adds fit.
  • --max-model-len N: context length, defaults to the model's maximum, which can dominate the total.
  • --batch-size N: concurrent sequences, defaults to 1.
  • --kv-cache-dtype fp8 (vLLM names for Safetensors, llama.cpp cache types such as q8_0 for GGUF).
  • --file <file or variant> and --format safetensors|gguf|onnx to pick the weights.
  • --max-num-batched-tokens 2048 on A100s.
  • Gated or private models need HF_TOKEN or --hf-token.

JSON (sizes in bytes, divide by 2^30 for GiB):

  • total is the GPU memory for one copy of the model: weights + kv_cache + overhead (vLLM for Safetensors, llama.cpp for GGUF, none for ONNX).
  • offloaded are weights the engine keeps in CPU memory: excluded from weights and total, but needed as free system RAM.
  • fit (with --gpu-memory): fits, needed GPUs, max_model_len (the longest context that fits), and the required vs usable memory across the given GPUs. Use required / GPUs for the memory per GPU, not total / GPUs, as each GPU also holds its own overhead and replicated KV cache.
  • GGUF and ONNX repositories with several files return a files list to compare quantizations; pick one with :TAG or --file to get fit.
  • Report warnings to the user, and errors explain how to fix them.

How to install Hf Mem

Claude Code

Copy the skill into your personal skills folder (or into .claude/skills/ inside a project):

npx degit huggingface/skills/skills/hf-mem#main ~/.claude/skills/hf-mem

Codex

npx degit huggingface/skills/skills/hf-mem#main ~/.codex/skills/hf-mem

Claude.ai and Claude Desktop

Download the skill folder from GitHub, zip it, and upload it under Settings → Capabilities → Skills.

Frequently asked questions

+What does the Hf Mem skill do?

Estimate the GPU memory needed to run a Hugging Face model (weights, KV cache and inference overhead) and whether it fits on given GPUs, without downloading it. Use when asked how much VRAM a model needs, whether it fits on a GPU, the longest context that fits, or which GGUF quantization to pick.

+How do I install Hf Mem in Claude Code?

Copy the skill folder into ~/.claude/skills/hf-mem, for example with "npx degit huggingface/skills/skills/hf-mem#main ~/.claude/skills/hf-mem". Claude Code loads it automatically and uses it when a task matches.

+Does Hf Mem work with ChatGPT or Codex?

Yes. Hf Mem uses the open SKILL.md format. In Codex, put the folder in ~/.codex/skills/hf-mem. In Claude.ai, zip the folder and upload it under Settings → Capabilities → Skills.

+Is Hf Mem free?

Hf Mem is published on GitHub by huggingface under the mit license, which allows free use.

Related data & analytics skills

  1. Analytics

    When the user wants to set up or audit analytics, or asks whether a metric or number is calculated right, what to track, or how to name…

    coreyhaines31/marketingskills★ 61k
  2. Statistical Analysis

    Guided statistical analysis for research data - test selection, assumption checking, effect sizes, power analysis, Bayesian alternatives,…

    K-Dense-AI/scientific-agent-skills★ 58k
  3. Dashboard Chat Best Practices

    Apply dashboard-grade chat UX patterns in the Eve chat template.

    thedotmack/claude-mem★ 118k
  4. Huggingface Best

    Official

    Use when the user asks about finding the best, top, or recommended model for a task, wants to know what AI model to use, or wants to…

    huggingface/skills★ 11k
  5. Huggingface Community Evals

    Official

    Run evaluations for Hugging Face Hub models using inspect-ai and lighteval on local hardware.

    huggingface/skills★ 11k
  6. Huggingface Datasets

    Official

    Use this skill for Hugging Face Dataset Viewer API workflows that fetch subset/split metadata, paginate rows, search text, apply filters,…

    huggingface/skills★ 11k
  7. Huggingface Gradio

    Official

    Build Gradio web UIs and demos in Python. Use when creating or editing Gradio apps, components, event listeners, layouts, or chatbots.

    huggingface/skills★ 11k
  8. Huggingface Llm Trainer

    Official

    Train or fine-tune language and vision models using TRL (Transformer Reinforcement Learning) or Unsloth with Hugging Face Jobs…

    huggingface/skills★ 11k
  9. Huggingface Local Models

    Official

    Use to select models to run locally with llama.cpp and GGUF on CPU, Mac Metal, CUDA, or ROCm.

    huggingface/skills★ 11k

See all data & analytics skills →

Give your whole team an AI agent with skills

Cody runs managed AI agents your team can message in Slack, Teams, WhatsApp and the web, with 50+ business integrations, scheduled tasks and memory. No terminal required.