Lion Cipher Lab

Pin a Hugging Face model to a commit and verify its file hashes before use

Why it matters

Teams pull models by name the way they used to pull libraries by name, and the name can point at different files tomorrow: the owner can push a new commit, or someone who gains access to the repository can. Pinning to a full commit hash and checking file hashes is the same discipline as a lockfile for code. It does not make a model trustworthy, but it makes a change visible, so that the question has this changed? has a definite answer.

What you'll learn

Steps in this lab

  1. A name is not a version
  2. Set up and resolve the repository to a commit
  3. Download one file at exactly that commit
  4. Check the file against the hash the Hub reports
  5. Prove the check can fail
  6. Decide when to bump the pin
  7. What this does and does not prove
  8. Clean up

Open the full interactive lab →

Keep learning