hf-mem

द्वारा huggingface

हगिंग फेस कमांड लाइन इंटरफेस जो हगिंग फेस हब से अनुमान के लिए सेफटेंसर या जीजीयूएफ मॉडल वेट लोड करने के लिए आवश्यक मेमोरी का अनुमान लगाता है

npx skills add https://github.com/huggingface/skills --skill hf-mem

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.

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

What are the requirements?

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

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.

uvx hf-mem --model-id <model-id> --json-output

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.

uvx hf-mem --model-id <model-id> --gguf-file <file-or-path> --json-output

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.

As per the context window, it will be read from the default or overridden with --max-model-len a la vLLM. And, same goes for the KV cache precision, which will default to the model precision unless manually set via --kv-cache-dtype a la vLLM too.

For Safetensors use as:

uvx hf-mem --model-id <model-id> --experimental [--max-model-len N] [--batch-size N] [--kv-cache-dtype auto|bfloat16|fp8|fp8_ds_mla|fp8_e4m3|fp8_e5m2|fp8_inc] --json-output

And, for GGUF use as:

uvx hf-mem --model-id <model-id> --gguf-file <file-or-path> --experimental [--max-model-len N] [--batch-size N] [--kv-cache-dtype auto|F32|F16|Q4_0|Q4_1|Q5_0|Q5_1|Q8_0|Q8_1|Q2_K|Q3_K|Q4_K|Q5_K|Q6_K|Q8_K|IQ2_XXS|IQ2_XS|IQ3_XXS|IQ1_S|IQ4_NL|IQ3_S|IQ2_S|IQ4_XS|I8|I16|I32|I64|F64|IQ1_M|BF16|TQ1_0|TQ2_0|MXFP4] --json-output

Examples

For Transformers with Safetensors weights:

uvx hf-mem --model-id MiniMaxAI/MiniMax-M2 --json-output

For Diffusers with Safetensors weights:

uvx hf-mem --model-id Qwen/Qwen-Image --json-output

For Sentence Transformers with Safetensors weights:

uvx hf-mem --model-id google/embeddinggemma-300m --json-output

With --experimental to include the KV cache estimation for LLMs and VLMs:

uvx hf-mem --model-id mistralai/Mistral-7B-v0.1 --experimental --json-output

And, for LLMs or VLMs with GGUF weights:

uvx hf-mem --model-id unsloth/Qwen3.5-397B-A17B-GGUF --gguf-file Q4_K_M --experimental --json-output

huggingface की और Skills

sync-models
huggingface
chat-ui के मॉडल कॉन्फ़िग को HuggingFace राउटर के साथ सिंक करें — नए मॉडलों के लिए विवरण जोड़ें, reasoning-क्षमता वाले मॉडलों को फ़्लैग करें, 32B+ वाले मॉडलों के लिए आर्टिफैक्ट सक्षम करें…
custom-blocks
huggingface
Use when the user has written (or wants to write) a `ModularPipelineBlocks` subclass in a local Python file and needs to package it into a Hub-uploadable…
self-review
huggingface
Use before opening a PR, or whenever asked to self-review a diffusers contribution. Applies the same rubric as the `@claude` CI (checks the diff against…
hf-cloud-sagemaker-production-defaults
huggingface
SageMaker एंडपॉइंट (रियल-टाइम या एसिंक्रोनस) को ऑटोस्केलिंग, CloudWatch अलार्म और टैगिंग के साथ डिफ़ॉल्ट रूप से सक्षम बनाएं। इस स्किल का उपयोग तब करें जब कोई एंडपॉइंट बनाने वाला हो…
hf-cloud-serving-image-selection
huggingface
SageMaker मॉडल तैनाती के लिए सही सर्विंग कंटेनर चुनें और उसका वर्तमान इमेज URI खोजें। इस कौशल का उपयोग तब करें जब किसी मॉडल को तैनात करने वाले हों...
Hugging Face Cli
huggingface
Execute Hugging Face Hub operations using the `hf` CLI. Use when the user needs to download models/datasets/spaces, upload files to Hub repositories, create repos, manage local cache, or run compute jobs on HF infrastructure. Covers authentication, file transfers, repository creation, cache operations, and cloud compute.
Hugging Face Datasets
huggingface
हगिंग फेस हब पर डेटासेट बनाएं और प्रबंधित करें। रिपॉजिटरी आरंभ करने, कॉन्फ़िग/सिस्टम प्रॉम्प्ट परिभाषित करने, पंक्ति अपडेट स्ट्रीम करने और SQL-आधारित डेटासेट क्वेरी/रूपांतरण का समर्थन करता है। व्यापक डेटासेट वर्कफ़्लो के लिए HF MCP सर्वर के साथ काम करने के लिए डिज़ाइन किया गया।
Hugging Face Evaluation
huggingface
Hugging Face मॉडल कार्ड में मूल्यांकन परिणाम जोड़ें और प्रबंधित करें। README सामग्री से eval तालिकाएँ निकालने, Artificial Analysis API से स्कोर आयात करने, और vLLM/lighteval के साथ कस्टम मॉडल मूल्यांकन चलाने का समर्थन करता है। model-index मेटाडेटा प्रारूप के साथ काम करता है।