How can I tell the size of a model before downloading it?

I’m using the ‘hf’ CLI tool to download models from HF.

Take Qwen/Qwen3.5-397B-A17B · Hugging Face for example.

How can I tell BEFORE downloading how large it is?

2 Likes

Maybe dry-run mode on the hf CLI is a reliable method. The dry-run output lists the files that would be downloaded and the total bytes they would require.

hf download Qwen/Qwen3.5-397B-A17B --dry-run

‘hf’ doesn’t have anything close to that argument. Bad bot.

1 Like

Maybe due to older version of huggingface_hub library. Try pip install -U huggingface_hub first…

hf download Qwen/Qwen3.5-397B-A17B --dry-run
[dry-run] Fetching 107 files: 100%|██████████████████████████████████████████████████| 107/107 [00:02<00:00, 35.91it/s]
Download complete: : 0.00B [00:02, ?B/s]              [dry-run] Will download 107 files (out of 107) totalling 806.8G.]
File                                         Bytes to download
-------------------------------------------- -----------------
.gitattributes                               1.6K
LICENSE                                      11.5K
README.md                                    94.8K
chat_template.jinja                          7.8K
config.json                                  4.2K
generation_config.json                       244.0
merges.txt                                   3.4M
model.safetensors-00001-of-00094.safetensors 8.6G
...

To check the size of a Hugging Face model like Qwen/Qwen3.5-397B-A17B

Python Script

Run this to get total size and per-file breakdown without downloading:

python

fromhuggingface_hubimport HfApi

def print_model_sizes(repo_id):
api = HfApi()
repo_info = api.model_info(repo_id=repo_id, files_metadata=True)
total_size_bytes = 0
print(f"File sizes for model '{repo_id}':")
forsiblingin repo_info.siblings:
filename = sibling.rfilename
size_bytes = sibling.sizeor 0
total_size_bytes += size_bytes
size_gb = size_bytes / (1024 ** 3)
print(f" {filename}: {size_gb:.2f} GB")
total_gb = total_size_bytes / (1024 ** 3)
print(f"\nTotal size: {total_gb:.2f} GB")

print_model_sizes("Qwen/Qwen3.5-397B-A17B")

This queries metadata only

HF CLI Dry-Run

bash

hf space status Qwen/Qwen3.5-397B-A17B # O model_info
#dry-run download:
huggingface-cli download Qwen/Qwen3.5-397B-A17B --dry-run

1 Like