Skip to content

feat(downloader): add HF_MIRROR environment variable support#8847

Merged
mudler merged 1 commit intomudler:masterfrom
localai-bot:feat/hf-mirror-support-8414
Mar 8, 2026
Merged

feat(downloader): add HF_MIRROR environment variable support#8847
mudler merged 1 commit intomudler:masterfrom
localai-bot:feat/hf-mirror-support-8414

Conversation

@localai-bot
Copy link
Contributor

Description

This PR adds support for HuggingFace mirror URLs via the HF_MIRROR environment variable, addressing issue #8414.

Changes

  • Added HF_MIRROR environment variable to configure HuggingFace mirror URLs
  • HF_MIRROR takes precedence over HF_ENDPOINT for simpler mirror configuration
  • Supports both full URLs (https://hf-mirror.com) and simple hostnames (hf-mirror.com)
  • Auto-adds https:// if no scheme is provided
  • Also supports HF env var as an alias for HF_MIRROR

Usage

Users can now set either:

  • HF_MIRROR=hf-mirror.com (simple form)
  • HF_MIRROR=https://hf-mirror.com (full URL)
  • HF_ENDPOINT=https://huggingface.co (original method, still supported)

This is useful for users in regions where direct access to huggingface.co is restricted.

Closes #8414

- Added HF_MIRROR env var to configure HuggingFace mirror URLs
- HF_MIRROR takes precedence over HF_ENDPOINT for simpler mirror config
- Supports both full URLs (https://hf-mirror.com) and simple hostnames (hf-mirror.com)
- Auto-adds https:// if no scheme is provided
- Also supports HF env var as an alias for HF_MIRROR

Closes mudler#8414

Signed-off-by: localai-bot <localai-bot@users.noreply.github.com>
@netlify
Copy link

netlify bot commented Mar 8, 2026

Deploy Preview for localai ready!

Name Link
🔨 Latest commit c855fb5
🔍 Latest deploy log https://app.netlify.com/projects/localai/deploys/69acfca8d38c710008c4c880
😎 Deploy Preview https://deploy-preview-8847--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-project-automation github-project-automation bot moved this from In review to In Progress in LocalAI Agent team Mar 8, 2026
@mudler mudler merged commit 364ad30 into mudler:master Mar 8, 2026
33 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in LocalAI Agent team Mar 8, 2026
@localai-bot localai-bot moved this from Done to In review in LocalAI Agent team Mar 8, 2026
@mudler mudler added the enhancement New feature or request label Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Support huggingface mirror

2 participants