Component brief / Developer Tools
FastEmbed: lightweight local embedding generation.
What it is
Qdrant maintains FastEmbed for retrieval, the step that finds material relevant to a query. TextEmbedding accepts strings and yields dense vectors, lists of numbers stored as NumPy arrays. A sparse vector stores only the positions with non-zero weights. For example, a sparse search model might assign weight to terms associated with “password reset” and leave most other positions empty. FastEmbed also supports images. FastEmbed overview · Supported models
Late-interaction models can keep vectors for individual tokens, pieces of text such as “password”, then compare those vectors at search time. A cross-encoder reranker reads a question and a candidate passage together to give the passage a new score. For example, it can move a recovery guide above a sign-in alerts page in the final list. FastEmbed repository
On first use, FastEmbed downloads the model if it is missing from the local cache. ONNX Runtime runs models stored in the Open Neural Network Exchange (ONNX) format. For example, the standard package can run the model in the code sample on a machine's central processing unit (CPU) without installing PyTorch. FastEmbed also offers a package for a graphics processing unit (GPU). FastEmbed installation
Where it fits
Feed FastEmbed text or images prepared by your application, for example a passage taken from a manual. Store the resulting vectors in your search system.
Use a compatible model and follow its input conventions on both sides. A model may expect a question and a manual passage to be labelled differently. With Qdrant, generate embeddings and pass them to upsert to create or replace points and to query_points to find matches. Qdrant Python client releases
Update, 15 November 2026. Qdrant's older FastEmbed walkthrough uses add and query. The current Python client removed those helpers. FastEmbed with Qdrant · Qdrant Python client releases
When to use it
FastEmbed is a strong option when:
- a Python service needs local CPU-friendly embedding generation;
- PyTorch would be disproportionate for the deployment;
- the supported model catalogue contains an appropriate model and licence;
- dense, sparse or reranking experiments should share one lightweight toolkit; or
- Qdrant integration should be quick to prototype.
Use a hosted embedding API when model operation is unwanted, or a broader inference framework when the required model or custom architecture is outside FastEmbed's catalogue.
Trade-offs
Model files need disk space. Throughput is the amount of work finished in a given time, such as the number of passages embedded per second. It depends on the model, hardware and batch size, the number of inputs processed together. Download the model files in advance if the service starts without network access.
Search quality depends on the documents and questions. Models differ in the number of values in each vector, how many tokens they accept, which languages they cover and their licences. Record the model identifier and test it with questions whose expected results you already know.
FastEmbed is primarily a Python library. A .NET system will normally host it behind a small service, invoke a Python worker, use ONNX Runtime directly in .NET, or choose a remote embedding API.
Alternatives
- Sentence Transformers provides a wider Python ecosystem and flexible model workflows, with a heavier PyTorch stack.
- Hosted embedding APIs remove model distribution and runtime operation but add network, cost and data-processing dependencies.
- Direct ONNX Runtime integration gives a .NET or other runtime full control, while making tokenisation, batching and model metadata your responsibility.
- Database or search-platform inference can reduce moving parts when embeddings are already offered where vectors are stored.
Integration example
from fastembed import TextEmbedding
model = TextEmbedding(model_name="BAAI/bge-small-en-v1.5")
documents = [
"Docling preserves document structure.",
"Qdrant stores vectors and payloads.",
]
vectors = list(model.embed(documents))
print(len(vectors), vectors[0].shape)
embed returns a generator, which produces results as you iterate. Here list(...) collects both vectors so the sample can count them and print the first vector's shape, a one-element tuple containing its length. In production, keep the model loaded and process groups of documents together.
AI Disclosure
Researched and drafted with AI assistance, then reviewed by Søren Dalby. Sources are linked; errors may remain, and corrections are welcome.