Starting next week (week of June 9, 2026), libtorch archive downloads from download.pytorch.org will be served from our R2-backed host, download-r2.pytorch.org, for faster and more reliable downloads.
Important: If you script libtorch downloads in CI or build systems, please add -L (or confirm your tool follows redirects) ahead of next week.
Your existing URLs do not change — download.pytorch.org/libtorch/… keeps working. Under the hood, a request for a libtorch .zip now issues a 301 redirect to the equivalent path on download-r2.pytorch.org.
What you need to do: make sure your downloader follows redirects. With curl, that means adding the -L flag:
# Follow the redirect to R2
curl -L -O https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-latest.zip
# Example with a pinned version
curl -L https://download.pytorch.org/libtorch/cu130/libtorch-shared-with-deps-2.12.0%2Bcu130.zip -o libtorch.zip
If you omit -L, curl will just print the 301 response instead of downloading the file. wget follows redirects by default, and CMake FetchContent / file(DOWNLOAD …) and most build tools handle this automatically.
Notes:
- Only the actual .zip download artifacts redirect. The /libtorch/ index and folder listing pages are unchanged.
- pip / whl installs of PyTorch are unaffected — this only concerns the libtorch C++ archives.
If you script libtorch downloads in CI or build systems, please add -L (or confirm your tool follows redirects) ahead of next week.