Skip to content

Add mechanism to disable external version checks (PyPI API calls) for air-gapped environments #734

@adzeeman

Description

@adzeeman

Feature

Add a mechanism to prevent LitData from making external API calls (specifically, to PyPI for version checks) in environments where egress is not permitted, such as air-gapped or highly restricted systems.

Motivation

We are running LitData on an air-gapped system that blocks unexpected outbound network calls. Currently, LitData attempts to check the latest version by calling the PyPI API. Although the logic is safely wrapped in a try-except block, the call takes up to two minutes to time out before proceeding, which causes delays.

The first time we noticed an outbound call to pypi.org, it raised internal concerns. Upon reviewing the code, we confirmed the intent was benign, but it would be helpful to have control over whether these version checks are performed.

Pitch

Introduce a flag or environment variable (e.g., LITDATA_DISABLE_VERSION_CHECK=1) to allow users to disable these external version checks and avoid unnecessary API calls and wait times in restricted environments. I do not have strong opinions on the implementation details and would welcome input from the maintainers or community.

I am happy to contribute a PR with a proposed change, but I wanted to open an issue first in case others are working on this or have thoughts on the best approach.

Alternatives

  • Continue relying on the try-except timeout. This is not ideal, as it still introduces delays.

Additional context

The relevant code is in src/litdata/helpers.py, specifically the _get_newer_version and _check_version_and_prompt_upgrade functions.

Thank you for considering this suggestion!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions