Don't put model weights in Git
A 4 GB model checkpoint in Git is bad: clones take forever, push limits will reject single files >100 MB, and Git stores binaries inefficiently. Use one of the alternatives.
Options
- Git LFS — files are kept in a separate LFS store, the repo tracks pointers. Free for the first GB; storage tier costs after.
- Hugging Face Hub — purpose-built for model weights, free for public, paid for large private. Native to most ML pipelines.
- Cloud object storage (S3, R2, GCS) — write your own download step in CI; cheapest at scale.
- DVC — Git-like CLI on top of object storage; tracks data versions alongside code.
CI implications
- Cache model weights aggressively. Pulling a 4 GB file each run is wasteful.
- Use
actions/cachewith a key based on the model version, not the Git SHA. - If the model lives in HF Hub, use
huggingface_hub.snapshot_downloadwith a local cache path inside~/.cache/huggingface— that path is whatactions/cachetargets.