Skip to main content

How to Check a Model's License on the Hugging Face Hub

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

Every model on the Hugging Face Hub comes with a license that says what you may do with it. Some allow almost anything, including selling a product built on them; others forbid commercial use or add conditions. Check it before you build on a model. This guide finds the license of google-bert/bert-base-uncased on its page and from the terminal.

The Example​

The model is google-bert/bert-base-uncased, one of the most downloaded models on the Hub. Its page is public, so you don't need an account.

Prerequisites​

  • uv, for the terminal check in Step 3. This guide uses uv 0.13.10 with Python 3.15.2.

Step 1: Find the License on the Model Page​

Open huggingface.co/google-bert/bert-base-uncased. Under the model's name is a row of tags: its task, the libraries it works with, its training data and its language. The license is the tag that starts with License:.

The top of the google-bert/bert-base-uncased model page: the model's name, then tags for Fill-Mask, Transformers, PyTorch, TensorFlow, JAX, Rust, Core ML, ONNX, Safetensors, bookcorpus, wikipedia, English, bert, exbert and arxiv:1810.04805, and a last tag that reads License: apache-2.0.

Here it's apache-2.0, the Apache License 2.0, which allows commercial use, with conditions such as keeping the license and copyright notices.

Step 2: Open the License Menu​

Click the license tag. A small menu opens:

The menu under the License: apache-2.0 tag: About this license, Apache license 2.0 with a link Read on choosealicense.com, then View LICENSE file and List models using this license.

ItemWhat it does
Read on choosealicense.comOpens a plain-language summary of the license: what it permits, what it requires and what it limits
View LICENSE fileOpens the license file stored in the model's own files
List models using this licenseSearches the Hub for models with the same license

Read the summary before you rely on a license you don't know.

Step 3: Read the License from the Terminal​

The tag comes from the model card's metadata, which you can also read with the hf command. Create a small project for it:

Terminal
uv init --python 3.15 license-check
cd license-check
uv add huggingface_hub

hf models info prints a model's details from the Hub. --expand cardData limits it to the card's metadata, where the license is:

Terminal
uv run hf models info google-bert/bert-base-uncased --expand cardData
Output
{
"id": "google-bert/bert-base-uncased",
"card_data": {
"datasets": [
"bookcorpus",
"wikipedia"
],
"language": "en",
"license": "apache-2.0",
"tags": [
"exbert"
]
}
}

The terminal after uv run hf models info google-bert/bert-base-uncased --expand cardData: JSON with the model's id and card_data holding datasets bookcorpus and wikipedia, language en, license apache-2.0 and the tag exbert.

"license": "apache-2.0" is the same license the page showed. The command works unchanged in PowerShell, and it's handy for checking many models from a script.

What to Look For​

  • The license name. Common ones on the Hub are apache-2.0 and mit, which allow commercial use, and Creative Commons variants, some of which, such as those with nc, forbid it.
  • A custom license. Some models use their own terms. Read the license file itself before using them.
  • The training data. The card also lists the datasets the model learned from; for some uses, their terms matter too.

Common Mistakes​

MistakeWhat happensDo this instead
Assuming every model on the Hub is free to use in a productSome licenses forbid commercial use or add conditionsCheck the license of every model you use
Checking only the base model of a fine-tuned modelThe fine-tuned model can have a different licenseCheck the license of the exact model you load

FAQ​

No. The license tag and summaries help you understand what a model allows; for anything important, read the license itself or ask a lawyer.

Does the license apply to what the model produces?​

It depends on the license. Some say nothing about outputs, others do. Read the license file.

Conclusion​

The tag under the model's name showed License: apache-2.0, its menu linked to a summary and the license file, and hf models info … --expand cardData returned the same apache-2.0 from the terminal.

Additional Resources​

  • Model cards — where a model's license and other details are written.
  • Licenses — the license identifiers the Hub recognizes.
  • choosealicense.com — plain-language summaries of open-source licenses.