Answers for LLM inference engineers

ImportError: cannot import name 'cached_download' (or HfFolder, or any name) from 'huggingface_hub': which releases have it

cached_download was removed in huggingface_hub 0.26.0 (2024-10-18); the last release that has it is 0.25.2. HfFolder, Repository and InferenceApi were removed in 1.0.0 (2025-10-27); the last release that has them is 0.36.2. The error means a library written for an older hub is running against a newer one. Fix it by upgrading that library (diffusers 0.29.0 or later and sentence-transformers 2.3.0 or later no longer import cached_download; gradio 5.8.0 or later and datasets 2.16.0 or later no longer import HfFolder), or by pinning the hub below the release that dropped the name: pip install "huggingface_hub<0.26.0" or "huggingface_hub<1.0.0". For any other name, paste the error below.

Published 2026-11-17 · Data as of 2026-11-25 · huggingface_hub 0.0.1 to 2.4.0, the first release of each of 75 minor versions, with patch releases that differ noted · read from the source of each release tag, nothing was installed or run (how, limits) · Corrected 2026-12-05

Corrected on 2026-12-05: this page said is_offline_mode is in huggingface_hub from 1.3.0 (2026-01-09). It is there from 1.2.1 (2025-12-05); 1.2.0 does not have it. The page reads only the first release of each minor version, so a name added in a patch release was dated to the next minor. Reading every release once found 34 names whose presence in some patch release differs from the first release of the same minor (13 after the 0.0.x series); the lookup and the table now list those patch releases. The per-minor ranges themselves are unchanged.

Examples:

Runs in your browser on data.json (44 KB); nothing you paste is sent anywhere. Covers huggingface_hub, huggingface_hub.utils and huggingface_hub.errors: 568 top-level names, 519 of them in 2.4.0.

Which huggingface_hub does my diffusers, sentence-transformers, gradio, datasets or peft need?

Each library version imports a fixed set of hub names at module level, and those names fix the range of hub releases with which all of its files import. "At least" is the newest first-release among the names it imports; "below" is the first hub release that dropped one of them. The name in parentheses is the one that sets the limit. The range is about imports only: a library's own dependency declaration can be narrower, and pip follows that.

LibraryVersionshuggingface_hub at leasthuggingface_hub below
diffusers0.0.2≥ 0.1.0 (model_info)< 1.0.0 (HfFolder)
0.1.0 to 0.2.x≥ 0.1.0 (Repository)< 0.26.0 (cached_download)
0.3.0 to 0.11.x≥ 0.8.1 (EntryNotFoundError)< 0.26.0 (cached_download)
0.12.0 to 0.25.x≥ 0.10.0 (ModelCard)< 0.26.0 (cached_download)
0.26.0 to 0.28.x≥ 0.20.0 (OfflineModeIsEnabled)< 0.26.0 (cached_download)
0.29.0 to 0.32.x≥ 0.21.0 (split_torch_state_dict_into_shards)no upper limit from imports
0.33.0 to 0.39.x≥ 0.27.0 (DDUFEntry)no upper limit from imports
0.40.0≥ 1.23.0 (CachedRepoTreeNotFoundError)no upper limit from imports
0.41.0 to 0.43.x≥ 1.31.0 (httpx)no upper limit from imports
sentence-transformers0.1.0 to 1.2.xanyno upper limit from imports
2.0.0 to 2.2.x≥ 0.1.0 (Repository)< 0.26.0 (cached_download)
2.3.0 to 2.7.x≥ 0.1.0 (hf_hub_download)no upper limit from imports
3.0.0 to 6.3.x≥ 0.10.0 (CardData)no upper limit from imports
gradio3.0.25 to 3.20.xanyno upper limit from imports
3.21.0 to 3.23.x≥ 0.13.0 (send_telemetry)no upper limit from imports
3.24.0 to 4.8.x≥ 0.8.1 (CommitOperationAdd)no upper limit from imports
4.9.0 to 4.16.x≥ 0.8.1 (CommitOperationAdd)< 1.0.0 (HfFolder)
4.17.0 to 4.44.x≥ 0.15.0 (InferenceClient)< 1.0.0 (HfFolder)
5.0.0 to 5.7.x≥ 0.22.0 (ImageClassificationOutputElement)< 1.0.0 (HfFolder)
5.8.0 to 6.6.x≥ 0.22.0 (ImageClassificationOutputElement)no upper limit from imports
6.7.0 to 6.32.x≥ 0.23.0 (HFValidationError)no upper limit from imports
datasets1.0.0 to 1.12.xanyno upper limit from imports
1.13.0 to 2.13.xany< 1.0.0 (HfFolder)
2.14.0 to 2.15.x≥ 0.14.0 (HfFileSystem)< 1.0.0 (HfFolder)
2.16.0 to 3.0.x≥ 0.14.0 (HfFileSystem)no upper limit from imports
3.1.0 to 5.0.x≥ 0.20.0 (OfflineModeIsEnabled)no upper limit from imports
5.1.0 to 5.2.x≥ 1.31.0 (httpx)no upper limit from imports
peft0.0.1anyno upper limit from imports
0.1.0 to 0.3.x≥ 0.1.0 (hf_hub_download)no upper limit from imports
0.4.0 to 0.5.x≥ 0.10.0 (get_hf_file_metadata)no upper limit from imports
0.6.0≥ 0.10.0 (ModelCard)no upper limit from imports
0.7.0 to 0.12.x≥ 0.17.0 (file_exists)no upper limit from imports
0.13.0≥ 0.23.0 (HFValidationError)no upper limit from imports
0.14.0 to 0.22.x≥ 0.25.0 (EntryNotFoundError)no upper limit from imports

Read at the first release of each minor version of each library (331 releases; newest read: diffusers 0.43.0, sentence-transformers 6.3.0, gradio 6.32.0, datasets 5.2.0, peft 0.22.0). "0.28.x" means the 0.28 series. An import inside a try block, a function, if TYPE_CHECKING: or an if on the installed hub version (datasets 4.8.0 to 5.0.x) is not counted, because it does not stop the library from importing. All files of the package are counted, including ones a library loads only on demand (diffusers loads most pipeline files that way), so "at least" can be stricter than what a plain import of the library needs; "below" for cached_download and HfFolder is confirmed by the public error reports linked under Sources.

Which release has the names people ask about most?

The table gives the releases that export each name, the replacement named by the library's own deprecation message, and the libraries that import the name. "Through" is the last patch release before the name disappeared.

NameIn 2.4.0Releases that have it
cached_download
huggingface_hub
gone0.0.1 through 0.25.2; gone in 0.26.0 (2024-10-18)
Instead: hf_hub_download (its deprecation message: "Use `hf_hub_download` instead."). It takes a repo id and a file name, not a URL.
Imported at module level by: diffusers 0.1.0 to 0.28.x, not from 0.29.0; sentence-transformers 2.0.0 to 2.2.x, not from 2.3.0.
HfFolder
huggingface_hub
gone0.0.1 through 0.36.2; gone in 1.0.0 (2025-10-27)
Instead: login() to store a token (the note in its source: "Use `huggingface_hub.login` instead") and get_token() to read one.
Imported at module level by: datasets 1.13.0 to 2.15.x, not from 2.16.0; diffusers 0.0.2 to 0.24.x, not from 0.25.0; gradio 4.9.0 to 5.7.x, not from 5.8.0; sentence-transformers 2.0.0 to 2.2.x, not from 2.3.0.
Repository
huggingface_hub
gone0.1.0 through 0.36.2; gone in 1.0.0 (2025-10-27)
Instead: the HTTP-based methods of HfApi, such as upload_file, upload_folder and snapshot_download (its docstring: "deprecated in favor of the http-based alternatives implemented in `HfApi`").
Imported at module level by: diffusers 0.1.0 to 0.9.x, not from 0.10.0; sentence-transformers 2.0.0 to 2.2.x, not from 2.3.0.
Patch releases: 0.0.5 to 0.0.19 (from 2021-03-02) have it; 0.0.1 does not.
InferenceApi
huggingface_hub
gone0.1.0 through 0.36.2; gone in 1.0.0 (2025-10-27)
Instead: InferenceClient (its deprecation message: "deprecated in favor of the more feature-complete `InferenceClient`").
Patch releases: 0.0.14 to 0.0.19 (from 2021-07-16) have it; 0.0.1 does not.
ModelFilter
huggingface_hub
gone0.4.0 through 0.23.5; gone in 0.24.0 (2024-07-18)
Instead: pass the filter parameters as keyword arguments directly to list_models (its deprecation message).
DatasetFilter
huggingface_hub
gone0.4.0 through 0.23.5; gone in 0.24.0 (2024-07-18)
Instead: pass the filter parameters as keyword arguments directly to list_datasets (its deprecation message).
ModelSearchArguments
huggingface_hub
gone0.4.0 through 0.18.0; gone in 0.19.0 (2023-11-08)
update_repo_visibility
huggingface_hub
gone0.1.0 through 0.36.2; gone in 1.0.0 (2025-10-27)
Instead: update_repo_settings (its deprecation message).
configure_http_backend
huggingface_hub
gone0.14.0 through 0.36.2; gone in 1.0.0 (2025-10-27)
list_files_info
huggingface_hub
gone0.14.0 through 0.22.2; gone in 0.23.0 (2024-05-02)
hf_hub_download
huggingface_hub
importsfrom 0.1.0 (2021-11-02), still in 2.4.0
Patch releases: 0.0.11 to 0.0.19 (from 2021-06-23) have it; 0.0.1 does not.
snapshot_download
huggingface_hub
importsfrom 0.1.0 (2021-11-02), still in 2.4.0
Patch releases: 0.0.8 to 0.0.19 (from 2021-04-07) have it; 0.0.1 does not.
InferenceClient
huggingface_hub
importsfrom 0.15.0 (2023-06-01), still in 2.4.0
get_token
huggingface_hub
importsfrom 0.20.0 (2023-12-20), still in 2.4.0
split_torch_state_dict_into_shards
huggingface_hub
importsfrom 0.21.0 (2024-02-27), still in 2.4.0
DDUFEntry
huggingface_hub
importsfrom 0.27.0 (2024-12-16), still in 2.4.0
HfFileSystem
huggingface_hub
importsfrom 0.14.0 (2023-04-24), still in 2.4.0
file_exists
huggingface_hub
importsfrom 0.17.0 (2023-09-11), still in 2.4.0
list_repo_tree
huggingface_hub
importsfrom 0.20.0 (2023-12-20), still in 2.4.0
is_offline_mode
huggingface_hub
importsfrom 1.3.0 (2026-01-09), still in 2.4.0
Patch releases: 1.2.1 to 1.2.4 (from 2025-12-05) have it; 1.2.0 does not.
hf_raise_for_status
huggingface_hub
importsfrom 1.0.0 (2025-10-27), still in 2.4.0
set_client_factory
huggingface_hub
importsfrom 1.0.0 (2025-10-27), still in 2.4.0
OfflineModeIsEnabled
huggingface_hub.utils
importsfrom 0.20.0 (2023-12-20), still in 2.4.0
HfHubHTTPError
huggingface_hub.utils
importsfrom 0.10.0 (2022-09-28), still in 2.4.0
EntryNotFoundError
huggingface_hub.utils
importsfrom 0.8.1 (2022-06-21), still in 2.4.0
HfFolder
huggingface_hub.utils
gone0.10.0 through 0.36.2; gone in 1.0.0 (2025-10-27)
Instead: huggingface_hub.login() to store a token and huggingface_hub.get_token() to read one.
is_hf_transfer_available
huggingface_hub.utils
gone0.12.0 through 0.36.2; gone in 1.0.0 (2025-10-27)
httpx
huggingface_hub.utils
importsfrom 1.31.0 (2026-09-10), still in 2.4.0
EntryNotFoundError
huggingface_hub.errors
importsfrom 0.25.0 (2024-09-17), still in 2.4.0
RepositoryNotFoundError
huggingface_hub.errors
importsfrom 0.25.0 (2024-09-17), still in 2.4.0
HfHubHTTPError
huggingface_hub.errors
importsfrom 0.25.0 (2024-09-17), still in 2.4.0
OfflineModeIsEnabled
huggingface_hub.errors
importsfrom 0.23.0 (2024-05-02), still in 2.4.0
HFValidationError
huggingface_hub.errors
importsfrom 0.23.0 (2024-05-02), still in 2.4.0

What did each huggingface_hub release remove?

49 of the 568 top-level names are gone from 2.4.0; this is every one of them, by the release that dropped it. Most are generated inference types that were renamed; the ones that break other libraries are in 0.26.0 and 1.0.0.

ReleaseDate (PyPI)NamesGone from the top level
2.0.02026-09-245delete_space_storage, duplicate_space, repo_type_and_id_from_hf_id, request_space_storage, upload_large_folder
1.3.02026-01-091offline_mode
1.0.02025-10-2712HfFolder, InferenceApi, KerasModelHubMixin, Repository, configure_http_backend, from_pretrained_keras, get_tf_storage_size, get_token_permission, push_to_hub_keras, save_pretrained_keras, split_tf_state_dict_into_shards, update_repo_visibility
the git-based Repository, the legacy InferenceApi, HfFolder, the Keras and TensorFlow helpers, and the requests-based configure_http_backend
0.32.02025-05-231ChatCompletionInputGrammarTypeType
0.29.02025-02-191TextToImageTargetSize
0.28.02025-01-281like
0.27.02024-12-169ChatCompletionInputToolType, MultiCommitException, ToolElement, ZeroShotClassificationInputData, ZeroShotImageClassificationInputData, ZeroShotObjectDetectionInputData, create_commits_on_pr, list_metrics, plan_multi_commits
0.26.02024-10-185ChatCompletionInputTool, ChatCompletionInputToolTypeClass, SummarizationGenerationParameters, TranslationGenerationParameters, cached_download
cached_download and four generated inference types
0.24.02024-07-184ChatCompletionInputToolCall, DatasetFilter, ModelFilter, split_numpy_state_dict_into_shards
0.23.02024-05-027ChatCompletionOutputChoice, ChatCompletionOutputChoiceMessage, TextGenerationOutputSequenceDetails, TextGenerationParameters, TextGenerationPrefillToken, TextGenerationStreamDetails, list_files_info
0.19.02023-11-082DatasetSearchArguments, ModelSearchArguments
0.14.02023-04-242set_access_token, unset_access_token
0.10.02022-09-282login, logout
0.5.02022-04-051list_repos_objs

login and logout are listed at 0.10.0 because that release did not export them; they are back from 0.11.0 and are in 2.4.0.

How do I read the error?

How was this read, and how was it checked?

From the source of each release tag, with Python's ast module; no release was installed or imported.

Checks, all by a second reading: (1) every lazy release carries a generated static copy of its table for type checkers; in all 66 lazy releases that have one, the copy and our reading are identical (66 of 66). (2) For each of the 8 "library imports a removed name" ranges, a plain-text search of the library's files finds the import at both ends of the range and no module-level import in the version after it. (3) 16 facts from deprecation messages and release notes hold (for example cached_download carries @_deprecate_method(version="0.26") in 0.25.0 and is gone in 0.26.0).

Limits

Questions

Which huggingface_hub version removed cached_download?

huggingface_hub 0.26.0 (2024-10-18). cached_download is importable through 0.25.2. Its deprecation message names the replacement: hf_hub_download, which takes a repo id and a file name where cached_download took a URL.

How do I fix "cannot import name 'cached_download' from 'huggingface_hub'" with diffusers or sentence-transformers?

Upgrade the library that asks for it: diffusers imports cached_download at module level from 0.1.0 to 0.28.x and stops in 0.29.0, sentence-transformers from 2.0.0 to 2.2.x and stops in 2.3.0. If you cannot upgrade it, pin the hub instead: pip install "huggingface_hub<0.26.0" (0.25.2 is the last release that has the name).

Why can't I import HfFolder from huggingface_hub?

huggingface_hub 1.0.0 (2025-10-27) removed HfFolder; 0.36.2 is the last release that has it. Use login() to store a token and get_token() to read one. gradio imports HfFolder at module level from 4.9.0 to 5.7.x and stops in 5.8.0; datasets from 1.13.0 to 2.15.x and stops in 2.16.0.

How do I fix "cannot import name 'BucketNotFoundError' from 'huggingface_hub.errors'"?

BucketNotFoundError first appears in huggingface_hub 1.5.0 (2026-02-26). datasets 5.1.0 and later import it at module level and declare huggingface-hub>=1.31.0, so the error means the hub was kept older than 1.5.0, often below 1.0 for transformers 4.x. Upgrade the hub (pip install -U "huggingface_hub>=1.31.0"), or, if it has to stay on 0.x, use datasets 5.0.1: 4.8.0 to 5.0.1 import the name only when the installed hub is 1.6.0 or newer.

Does pinning huggingface_hub break anything else?

It can. Newer releases of the same libraries import names that old hub releases do not have: for example diffusers 0.33.0 and later need huggingface_hub 0.27.0 or newer for DDUFEntry. Pick a hub release inside the range of every library you have installed; the table on this page gives that range per library version.

The name in my error is not cached_download or HfFolder. Does this page cover it?

Yes. The lookup covers every name that huggingface_hub, huggingface_hub.utils and huggingface_hub.errors have exported from 0.0.1 to 2.4.0: 568 top-level names, of which 49 are gone from the newest release.

Sources

The same data as JSON: data.json, licensed CC BY 4.0.

Related: "cannot import name ... from 'transformers'": the releases that have each name · "got an unexpected keyword argument": PEFT, TRL and TrainingArguments by version · "does not recognize this architecture": the version each model needs.