Skip to content

[Feature]: support HF_ENDPOINT environment variable #502

Closed

Description

@bowerth

What feature would you like to request?

It would be useful if the HF_ENDPOINT environment variable was supported for model download from Nexus repositories: https://help.sonatype.com/en/hugging-face-repositories.html

Is there any additional information you would like to provide?

No response

Activity

  1. pangwangshu commented on Aug 7, 2026

    @pangwangshu

    Opened #667 to add support for HF_ENDPOINT.

    The download path (ModelManagement.download_files_from_huggingface) now reads HF_ENDPOINT from the environment at call time and forwards it to the underlying Hugging Face Hub calls (snapshot_download, model_info, list_repo_tree), so it works even when the endpoint is set after huggingface_hub has already been imported (e.g. via Nexus-hosted HF repositories, as mentioned above).

    PR: #667

  2. pangwangshu commented on Aug 11, 2026

    @pangwangshu

    @NirantK Could you review #667? The implementation is complete, all CodeRabbit feedback is addressed, and tests pass. Ready for merge.

  3. joein commented on Sep 25, 2026

    @joein
    Member

    Quick update on this one, because the diagnosis turned out to be different from the title.

    huggingface_hub has read HF_ENDPOINT since v0.5.0 (April 2022), and it resolves
    every endpoint parameter against it, so fastembed has always routed to a custom
    endpoint as long as the variable is set before the library is imported. I verified
    this against fastembed's current download path: with HF_ENDPOINT set.

    What actually breaks is narrower. fastembed calls model_info() and
    list_repo_tree() to verify file metadata before downloading, so it needs three Hub
    API routes, where plain snapshot_download needs one. Sonatype Nexus, implements a fixed list of API paths and returns 400 for the
    rest. /api/models/{repo}/tree/{rev} was one of the unimplemented ones until Nexus
    3.95.0 (August 5, 2026), which added it specifically for snapshot_download and
    hf download. So on an older Nexus, fastembed failed while other Hugging Face
    clients worked, which looks exactly like fastembed ignoring the variable.

    I think we can close it for now, but please re-open or create another one if the issue persists!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions