[GH-ISSUE #9271] Suggeestion: Add environment variable for configuring Hugging Face mirror endpoint #68100

Closed
opened 2026-05-04 12:32:42 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @Eleveven on GitHub (Feb 21, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9271

I would like to suggest adding support for environment variables to configure the Hugging Face mirror site URL. For example, the official Hugging Face Python download tool, huggingface_hub, already supports configuring the mirror site URL using the environment variable HF_ENDPOINT, which can be used to accelerate model downloads.

Adding a similar feature would benefit users in regions where accessing the default Hugging Face servers is slow.

https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/constants.py#L66

ENDPOINT = os.getenv("HF_ENDPOINT", _HF_DEFAULT_ENDPOINT).rstrip("/")
HUGGINGFACE_CO_URL_TEMPLATE = ENDPOINT + "/{repo_id}/resolve/{revision}/{filename}"

Originally created by @Eleveven on GitHub (Feb 21, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9271 I would like to suggest adding support for environment variables to configure the Hugging Face mirror site URL. For example, the official Hugging Face Python download tool, `huggingface_hub`, already supports configuring the mirror site URL using the environment variable `HF_ENDPOINT`, which can be used to accelerate model downloads. Adding a similar feature would benefit users in regions where accessing the default Hugging Face servers is slow. https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/constants.py#L66 ```python ENDPOINT = os.getenv("HF_ENDPOINT", _HF_DEFAULT_ENDPOINT).rstrip("/") HUGGINGFACE_CO_URL_TEMPLATE = ENDPOINT + "/{repo_id}/resolve/{revision}/{filename}" ```
GiteaMirror added the feature request label 2026-05-04 12:32:42 -05:00
Author
Owner

@rick-github commented on GitHub (Feb 21, 2025):

If you know the HF_ENDPOINT, you can just use that:

ollama pull hf-mirror.com/unsloth/DeepSeek-R1-Distill-Qwen-14B-GGUF:Q4_K_M

Or if pulling direct from HF has problems. use the DNS entry that has multiple resolutions:

ollama pull hf.co/unsloth/DeepSeek-R1-Distill-Qwen-14B-GGUF:Q4_K_M
<!-- gh-comment-id:2674105647 --> @rick-github commented on GitHub (Feb 21, 2025): If you know the HF_ENDPOINT, you can just use that: ``` ollama pull hf-mirror.com/unsloth/DeepSeek-R1-Distill-Qwen-14B-GGUF:Q4_K_M ``` Or if pulling direct from HF has problems. use the DNS entry that has multiple resolutions: ``` ollama pull hf.co/unsloth/DeepSeek-R1-Distill-Qwen-14B-GGUF:Q4_K_M ```
Author
Owner

@Eleveven commented on GitHub (Mar 3, 2025):

yes, it works.

but it doesn't fit me,
so i decide to import model from file

https://github.com/ollama/ollama/blob/main/docs/import.md#Importing-a-GGUF-based-model-or-adapter

thx

<!-- gh-comment-id:2693183996 --> @Eleveven commented on GitHub (Mar 3, 2025): yes, it works. but it doesn't fit me, so i decide to import model from file https://github.com/ollama/ollama/blob/main/docs/import.md#Importing-a-GGUF-based-model-or-adapter thx
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#68100