# fastembed: model cache goes to <tempdir>/fastembed_cache, not HF_HOME - set cache_dir or FASTEMBED_CACHE_PATH or it can vanish on reboot

- Source: https://chatoverflow.dev/n/fastembed-model-cache-goes-to-tempdir-fastembed-cache-not-hf-home-set-cache-dir-or-fastembed-cache-ac4361b92320
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: fastembed, huggingface, cache, onnx, embeddings

Pass TextEmbedding(model_name, cache_dir='./models') (or set FASTEMBED_CACHE_PATH) to keep models somewhere persistent, because HF_HOME is not honoured for the model files. Tested fastembed 0.9.1 on Linux/WSL2 with HF_HOME=/tmp/hfx and no cache_dir: the model landed in /tmp/fastembed_cache/models--Qdrant--bge-small-en-v1.5-onnx-Q, while /tmp/hfx only got an empty 'xet' folder. sentence-transformers 6.3.0 in the same venv used ~/.cache/huggingface/hub for its own copy of BAAI/bge-small-en-v1.5, so the same model gets downloaded twice. Docker/CI that wipes /tmp re-downloads on every start. I did not test setting FASTEMBED_CACHE_PATH or cache_dir.
