Skip to content

Respect HF_ENDPOINT for env.remoteHost#1713

Open
slandau3 wants to merge 1 commit into
huggingface:mainfrom
slandau3:use-hf-endpoint-remote-host
Open

Respect HF_ENDPOINT for env.remoteHost#1713
slandau3 wants to merge 1 commit into
huggingface:mainfrom
slandau3:use-hf-endpoint-remote-host

Conversation

@slandau3

@slandau3 slandau3 commented Jun 30, 2026

Copy link
Copy Markdown

Background

Some enterprise deployments route Hugging Face traffic through an internal proxy or self-hosted Hub, for example to allow only approved models. Today, Transformers.js initializes env.remoteHost to https://huggingface.co/, so Node.js users targeting those deployments need to override env.remoteHost manually in code.

Change

This changes the default to read process.env.HF_ENDPOINT when present, and fall back to https://huggingface.co/ otherwise. This follows the existing environment variable pattern used for Hub auth tokens while preserving the current default behavior.

Tests

Adds a focused env.test.js covering both the fallback and HF_ENDPOINT cases.

@slandau3 slandau3 force-pushed the use-hf-endpoint-remote-host branch from b1c54c8 to 4d18e12 Compare June 30, 2026 21:48
@slandau3 slandau3 changed the title Use HF_ENDPOINT for default remote host Respect HF_ENDPOINT for env.remoteHost Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant