Skip to main content

Module model_cache

Module model_cache 

Source

Structs§

CachedModel
A Hugging Face model repo and the files, relative to a snapshot, that must all exist before the model can load.

Constants§

DEFAULT_RERANK_MODEL
The reranker the daemon loads when SECOND_BRAIN_RERANK_MODEL is unset.
MODEL_CACHE_DIR_ENV
TOKENIZER_FILES
Files fastembed’s tokenizer loader reads from a model snapshot, beside the model’s own ONNX files.

Functions§

cached_snapshot
The first snapshot, in name order, of model under cache_dir that holds every one of its files; None when no download finished.
default_reranker_model
main_ref_snapshot
The snapshot <repo>/refs/main names, when it holds every file of model. hf-hub, and so fastembed, finds cached files only through that ref, read untrimmed, and downloads again without it.
model_cache_dir
Directory the embedding and reranker models are downloaded to and loaded from: FASTEMBED_CACHE_DIR when set, otherwise second-brain/models under the OS user cache dir. Created if missing. Errors instead of resolving to a path relative to the working directory.
model_cache_dir_in
The model cache inside a user cache dir, where a daemon whose environment does not set FASTEMBED_CACHE_DIR keeps its models.
snapshots_dir
<cache_dir>/models--<org>--<repo>/snapshots, the Hugging Face hub cache layout fastembed and hf-hub download into.