Short description
The local embedding provider always downloads from https://huggingface.co/, even when HF_ENDPOINT points to an approved Hugging Face mirror. This prevents first-run model initialization on networks where Hugging Face is blocked but a mirror or corporate endpoint is available.
What happened?
Magic Context local embeddings use the bundled Transformers.js runtime. Its runtime configuration sets the model cache directory, but the download host remains hardcoded to https://huggingface.co/
The host does not honor the standard HF_ENDPOINT environment variable. HF_ENDPOINT is the conventional way to route Hugging Face-compatible downloads, but setting it does not change the request destination.
Expected behavior: Respect HF_ENDPOINT when resolving Hugging Face model assets; or expose a documented Magic Context configuration option for the Transformers remote host / mirror endpoint.
Suggested fix
When initializing the local Transformers runtime, set its remote host from an explicit configuration value, falling
back to HF_ENDPOINT, then finally to the existing https://huggingface.co/ default.
Example precedence:
embedding.local_remote_host in magic-context.jsonc
HF_ENDPOINT
https://huggingface.co/
Keep the current persistent model cache behavior unchanged.
A configuration-only alternative is also acceptable, as long as it supports a Hugging Face-compatible mirror without requiring a code patch or manual cache prewarming.
Diagnostics
- Harness: OMP 18.2.1
- Plugin: `@cortexkit/pi-magic-context` 0.42.5
- Platform: Linux x64
- Runtime: Bun 1.4.2
- Embedding provider: `local`
- Model: `Xenova/paraphrase-multilingual-MiniLM-L12-v2`
- Dtype: `q8`
Plugin version
No response
OpenCode version
No response
Platform
Linux x64
Client
Pi
Log output (optional)
Short description
The local embedding provider always downloads from https://huggingface.co/, even when HF_ENDPOINT points to an approved Hugging Face mirror. This prevents first-run model initialization on networks where Hugging Face is blocked but a mirror or corporate endpoint is available.
What happened?
Magic Context local embeddings use the bundled Transformers.js runtime. Its runtime configuration sets the model cache directory, but the download host remains hardcoded to
https://huggingface.co/The host does not honor the standard HF_ENDPOINT environment variable. HF_ENDPOINT is the conventional way to route Hugging Face-compatible downloads, but setting it does not change the request destination.
Expected behavior: Respect HF_ENDPOINT when resolving Hugging Face model assets; or expose a documented Magic Context configuration option for the Transformers remote host / mirror endpoint.
Suggested fix
When initializing the local Transformers runtime, set its remote host from an explicit configuration value, falling
back to
HF_ENDPOINT, then finally to the existinghttps://huggingface.co/default.Example precedence:
embedding.local_remote_hostinmagic-context.jsoncHF_ENDPOINThttps://huggingface.co/Keep the current persistent model cache behavior unchanged.
A configuration-only alternative is also acceptable, as long as it supports a Hugging Face-compatible mirror without requiring a code patch or manual cache prewarming.
Diagnostics
Plugin version
No response
OpenCode version
No response
Platform
Linux x64
Client
Pi
Log output (optional)