Expand description
Which embedding model a store uses, and how to load it.
fastembed ships an enum of models it knows how to fetch and configure. The
default is not in that enum: granite-embedding-small-english-r2, quantized
to int8, has to be assembled by hand from its ONNX graph, its separate
weights file, and its tokenizer. Model is the union of “something
fastembed knows” and “the one we assemble ourselves”, so a store can record
either and read it back.
Enums§
- Model
- A model a store can be built with.
Constants§
- AIRGAP_
ENV - How many threads ONNX Runtime should use inside one operator.
- GRANITE_
FILES - Every file semlith fetches from [
GRANITE_REPO], with its SHA-256. - GRANITE_
NAME - What a store writes into its
modelmeta row for granite. Changing this string orphans every store that recorded the old one. - GRANITE_
REVISION - The commit each model repository is fetched at.
- THREADS_
ENV - Cap on ONNX Runtime’s intra-op thread pool, overriding the derived value.
Functions§
- airgap
- check_
cache_ dir - Refuse a model cache that somebody else on this machine can write to.
- digest
- The SHA-256 of some bytes, as lowercase hex.
- embed_
threads - is_
cached - Whether the default model is cached, with the right bytes.
- link_
runtime - Point ONNX Runtime at the library shipped beside this binary.
- model_
is_ cached - Whether one model’s weights are already in the cache.
- refuse_
if_ airgapped - Whether the cache already holds something to load.
- verify
- Check bytes against the digest recorded for them, or say which file failed.
- verify_
cached - Verify every pinned file of a repository that fastembed fetched itself.