Skip to main content

How to Turn Off Hugging Face Telemetry with HF_HUB_DISABLE_TELEMETRY

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

Hugging Face libraries such as Transformers and datasets send some usage information to Hugging Face by default. If you'd rather they didn't, one environment variable turns it off for all of them. This guide checks the setting before and after with huggingface_hub 2.5.0, in bash and PowerShell.

Syntax​

Syntax
export HF_HUB_DISABLE_TELEMETRY=1
PartWhat it means
HF_HUB_DISABLE_TELEMETRY=1Turns telemetry off for every Hugging Face library that runs in this terminal
DO_NOT_TRACK=1The general-purpose alternative, which Hugging Face honours too

The environment variable reference explains: "By default, some data is collected by HF libraries (transformers, datasets, gradio,..) to monitor usage, debug issues and help prioritize features. Each library defines its own policy (i.e. which usage to monitor) but the core implementation happens in huggingface_hub", and "You can set HF_HUB_DISABLE_TELEMETRY=1 as environment variable to globally disable telemetry." DO_NOT_TRACK is "Equivalent to HF_HUB_DISABLE_TELEMETRY".

The Example​

A small project reads the setting from Python before and after the variable is set. huggingface_hub exposes it as constants.HF_HUB_DISABLE_TELEMETRY.

Prerequisites​

  • uv. This guide uses uv 0.13.10 with Python 3.15.2.

Step 1: Create a Project​

Terminal
uv init --python 3.15 telemetry-demo
cd telemetry-demo
uv add huggingface_hub

Step 2: Check the Default​

Terminal
uv run python -c "from huggingface_hub import constants; print(constants.HF_HUB_DISABLE_TELEMETRY)"
Output
False

The terminal after reading constants.HF_HUB_DISABLE_TELEMETRY with no variable set: False.

False: telemetry isn't disabled, which is the default.

Step 3: Turn It Off​

Terminal
export HF_HUB_DISABLE_TELEMETRY=1
uv run python -c "from huggingface_hub import constants; print(constants.HF_HUB_DISABLE_TELEMETRY)"
Output
True

The terminal after setting HF_HUB_DISABLE_TELEMETRY to 1 and reading the setting again: True.

True: telemetry is now off for every Hugging Face library you run from this terminal. The PowerShell version printed True too. In a new terminal, set it again, or add the line to your shell's startup file, such as ~/.zshrc.

The Other Switches​

Two other ways lead to the same result:

  • DO_NOT_TRACK=1. In a fresh terminal, export DO_NOT_TRACK=1 followed by the same check printed True. Other tools honour this variable too.
  • Offline mode. The library's own documentation for send_telemetry says: "Telemetry is also disabled in offline mode (i.e. when setting HF_HUB_OFFLINE=1)." The constant doesn't show it: with only HF_HUB_OFFLINE=1 set, the check printed False. The sending function checks offline mode separately and sends nothing.

Common Mistakes​

MistakeWhat happensDo this instead
Setting the variable inside a Python program after importing TransformersThe library has already read it when it was importedSet it in the terminal before the program starts
Setting HF_HUB_DISABLE_TELEMETRY=0 to turn it off0 means "don't disable", so telemetry stays onUse 1
Expecting the setting to survive a new terminalexport and $env: last only for this terminalAdd it to your shell's startup file

FAQ​

Does turning telemetry off stop downloads from the Hub?​

No. Downloads still work: telemetry is a separate set of usage reports. To stop all contact with the Hub, use offline mode, HF_HUB_OFFLINE=1.

What exactly is sent?​

The documentation says each library "defines its own policy (i.e. which usage to monitor)". The shared function in huggingface_hub describes itself as one that "Sends telemetry that helps track usage of different HF libraries", and adds the library's name and version and information about installed packages to the request.

Conclusion​

The setting read False by default and True once HF_HUB_DISABLE_TELEMETRY=1 was set, in bash and in PowerShell. DO_NOT_TRACK=1 and offline mode stop it as well.

Additional Resources​