Skip to main content

FastEmbed

FastEmbed is a lightweight, CPU-first Python library built for embedding generation.

This embedding function requires the fastembed package. To install it, run

pip install fastembed.

You can find a list of all the supported models here.

Example usage:

Using the default BAAI/bge-small-en-v1.5 model.

from chromadb.utils.embedding_functions import FastEmbedEmbeddingFunction
ef = FastEmbedEmbeddingFunction()

Additionally, you can also configure the cache directory, number of threads and other FastEmbed options.

from chromadb.utils.embedding_functions import FastEmbedEmbeddingFunction
ef = FastEmbedEmbeddingFunction(model_name="nomic-ai/nomic-embed-text-v1.5", cache_dir="models_cache", threads=5)