HOW-TO · INF

How to verify model integrity after downloading

intermediate5 minBy Eruo Fredoline
Target environment
Ubuntu 24.04 · Ollama 0.4.x
PREREQUISITES

A model downloaded via Ollama or manually placed in the model store

What this does

Computes the digest of a stored model and compares it against the reference value from the upstream manifest. A mismatch signals a corrupted or tampered blob, prompting a safe fall-back re-download before using the model in production inference.

Steps

  1. Retrieve the stored model digest. Reads the manifest digest that Ollama recorded during the pull operation.

    ollama show llama3.2 | grep -i digest
    

    Expected output: A line beginning with digest followed by a colon and a long hexadecimal string.

  2. Cross-check the per-blob shasum. Computes SHA-256 for each binary blob on disk and matches it against the manifest map.

    find ~/.ollama/models/blobs -type f -exec sha256sum {} \;
    

    Expected output: A list of hash-value paths, each matching an entry in the manifest file.

  3. Re-pull only the mismatched blob if needed. Ollama can selectively re-download a single corrupted file without restoring the entire model.

    ollama pull llama3.2
    

    Expected output: When the pull completes and all checksums now match, Ollama prints the success line and exits.

  • Record the local run evidence. Save the exact command, runtime or package version, model name if applicable, and observed output so the result can be reproduced later.

Verification

ollama show llama3.2 2>&1 | grep digest
# Expected: a single digest line with a stable hex string; re-running find + sha256sum confirms the same hash for each blob

Common failures

  • digest mismatch - Blob file is corrupted or incomplete; retry ollama pull modelname to re-fetch all layers.
  • blob not found - The blob file is missing from the store, often due to manual deletion; a full re-pull restores it.
  • sha256sum: command not found - Utility not installed on the host; install with the package manager and re-run.
  • manifest corrupted - The manifest JSON cannot be parsed; a full re-pull overwrites the broken manifest with a clean copy.
  • disk write error during validation - Filesystem mount is full or read-only; free space or remount before proceeding.

Related guides

RELATED GUIDES