Using the Hub

The Hugging Face website is often the best place to start.

How to Search Well

Search by combining:

  • Task
  • Language
  • Modality
  • License
  • Popularity
  • Model size
  • Provider or organization

Example: If you need an embedding model for semantic search, do not search for “best AI model.” Filter for embedding models, inspect benchmark notes, and compare dimensions and inference cost.

How to Read a Model Card

A model card should answer five questions quickly:

  1. What does this model do?
  2. What data was it trained on?
  3. Where does it perform well or badly?
  4. How do I run it?
  5. What are the restrictions or risks?

Model Card Checklist

  • Intended task is explicit
  • Inputs and outputs are documented
  • Example code is present
  • Limitations are stated
  • License is visible
  • Hardware expectations are reasonable

If a card is vague, treat that as a warning.

How to Compare Models

Do not pick the first popular repo.

Compare models using:

FactorWhat to Ask
QualityDoes it perform well on your real examples?
LatencyIs it fast enough?
MemoryCan your hardware run it?
LicenseCan you use it commercially?
MaintenanceIs the repo active and documented?
SafetyDoes it mention known risks?

Example: A 7B chat model may be good enough for an internal assistant and much cheaper than a 70B model.

Downloading Files

You can download entire repos or specific files.

Common cases:

  • Pull model weights locally for offline use
  • Cache tokenizer/config files
  • Download dataset splits
  • Clone a Space repo to modify it

Using the CLI

Typical actions include:

hf auth login
hf repo create my-model
hf upload my-org/my-model ./local-folder
hf download distilbert/distilbert-base-uncased config.json

The exact commands may change over time, but the main ideas stay the same: authenticate, create repos, upload assets, and download files.

Using the Python Hub Client

from huggingface_hub import HfApi, hf_hub_download

api = HfApi()
info = api.model_info("distilbert/distilbert-base-uncased")
print(info.id)

path = hf_hub_download(
    repo_id="distilbert/distilbert-base-uncased",
    filename="config.json",
)
print(path)

This is useful when you want metadata or individual files without loading a full model.

Repositories and Versioning

Because repos are versioned, you can pin:

  • A branch
  • A tag
  • A commit hash

That matters for reproducibility.

Example: If you deploy a model in production, pin the exact revision so your behavior does not change unexpectedly.

Uploading Your Own Work

You can publish:

  • Model checkpoints
  • Tokenizers
  • Dataset files
  • README documentation
  • Demo apps

Good uploads include:

  • Clear naming
  • A complete README
  • Usage examples
  • License information
  • Limitations and known failure cases

Common Mistakes on the Hub

Mistake 1: Choosing by likes alone

A popular model may be unsuitable for your language, hardware, or license.

Mistake 2: Ignoring the license

You can waste days integrating a model you are not allowed to use commercially.

Mistake 3: Ignoring context length and memory use

A model may work in a demo but fail in your actual environment.

Mistake 4: Trusting benchmark claims without local testing

Always test on your own data.

Fast Evaluation Routine

When choosing a model, do this:

  1. Shortlist 3-5 candidates
  2. Read all model cards
  3. Run each model on 20-50 real examples
  4. Record quality, speed, memory, and failure modes
  5. Pick the smallest model that reliably meets the need