Skip to content

[Feature Request] Respect HF_ENDPOINT instead of using HUGGINGFACE_CO_URL_HOME #1967

@tp-nan

Description

@tp-nan

The code in


ignores the HF_ENDPOINT environment variable (e.g., HF_ENDPOINT=https://hf-mirror.com).

This breaks usage in regions where direct access to huggingface.co is unavailable, even when a valid mirror is configured.

Fix suggestion:
Use the official huggingface_hub API to get the effective endpoint:

from huggingface_hub import HfApi
hf_endpoint = HfApi().endpoint.rstrip("/")
model_id_url = f"{hf_endpoint}/{model_id}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueA good first issue for users wanting to contribute

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions