Skip to content
KoishiAI
ไทย
← Contents

Chapter 7 of 9 · AI 101 — A Practical Guide for People Who Will Actually Deploy It

Where Models Come From, and Downloading Them Safely

The main model sources and what each one is, how to read a repository before you download it — the good signs and the dangerous ones, one by one — pinning a version by commit sha, and the limit of pinning that you need to understand.

7.1 The main sources, and what each one is

SourceWhat is thereWhat to know
Hugging FaceNearly every model in the world, plus datasets and SpacesThe largest, and everyone’s default — but an open platform anyone can upload to. Safety comes from how you use it, not from a property of the platform
The developer’s official repoThe original modelThe safest option: a verified organisational account belonging to whoever built the model. Always the first place to look
Ollama LibraryCurated popular modelsSome filtering, easy to use, good for beginners; fewer choices and slower to update
ModelScopeMainly models from ChinaSome models appear here first, or download faster from Asia. Apply the same checks as on Hugging Face
Kaggle ModelsCurated modelsLearning and competition oriented, with good accompanying datasets
NGC (NVIDIA)Models and containers tuned for NVIDIA cardsUseful with TensorRT-LLM, or when you want a pre-tested environment

A number worth knowing before your next download

Over one three-month survey, researchers found 91 models carrying malicious code on public platforms, most of them exploiting weaknesses in pickle deserialization. Impersonation repositories posing as major developers have been reported reaching roughly 240,000 downloads before removal. Meanwhile only about half of organisations scan models before use — while almost all of them use models from public sources. The gap between those two figures is where attackers work.

7.2 Reading a repository before you download

What to checkGood signDanger sign
UploaderA verified organisation with other models and a long historyA newly created account, one model, no history
Repository nameMatches the official blog post or paperA near-miss spelling, or a claim to be a major company under a personal account
File formatsafetensors availableOnly .bin / .pt / .pth
Model cardStates training method, data, limitations, evaluation resultsEmpty, or generic copied text
Accompanying filesconfig.json, tokenizer and licence all presentOdd .py scripts not needed to load the model
Downloads and likesHigh and steady over a long periodA sharp spike over a few days
Platform warningsNo warning badgeA badge saying unsafe files were detected — platforms label but do not block the download
Commit historyConsistent with announced updatesA quiet commit editing weight files after the model became popular

7.3 Downloading with the version pinned

Name the commit sha explicitly. Never point at main in a system that runs for real.

huggingface-cli download Qwen/Qwen3-8B \
  --revision a1b2c3d4e5f6... \
  --local-dir ./models/qwen3-8b

In code:

from transformers import AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained(
    "Qwen/Qwen3-8B",
    revision="a1b2c3d4e5f6...",   # pin the version
    use_safetensors=True,          # insist on the safe format
    trust_remote_code=False,       # do not run code from the repo (chapter 8)
)

Record file hashes so you can verify later:

sha256sum ./models/qwen3-8b/*.safetensors > models.sha256
sha256sum -c models.sha256      # re-check before every use in critical systems

# Use an internal mirror if you have several machines
export HF_ENDPOINT=https://your-internal-mirror.example.com

The limit of pinning

Pinning a commit stops a future malicious update from reaching you. It does not help if the commit you pinned was already poisoned — in that case you have pinned the poison. Pinning is necessary and insufficient: pair it with choosing trustworthy sources and scanning before use.

What this chapter settles

Start from the developer’s official repository. Read the repository against the checklist before downloading. Prefer safetensors when it is offered. Pin a commit sha rather than tracking main, and keep hashes to re-verify. And remember that pinning defends against what might arrive later, not against what was already placed there.

The next chapter goes into where the danger actually is — from pickle executing code at load time through to the risks that appear only in production.