Favicon of FAISS

FAISS

An open-source vector search library for C++ and Python, with compressed indexes, CPU operation and optional NVIDIA or AMD GPU acceleration.

Screenshot of FAISS website

FAISS is a vector search and clustering library for developers building applications that compare embeddings or other vector data. It runs on your own machine or server and lets you balance search accuracy against speed and memory use.

  • Similarity search: Find nearest matches using Euclidean distance, dot products or cosine similarity with normalized vectors, with support for batch queries and searches within a given radius.
  • Index choices: Choose exact search or approximate indexes, including HNSW and NSG, according to the accuracy and response time your application needs.
  • Compressed storage: Search compact representations without keeping the original vectors, reducing memory use at the cost of less precise results; some methods scale to billions of vectors on a single server.
  • Clustering and evaluation: Use k-means clustering, binary vector search and evaluation tools to compare search quality and tune index parameters.

FAISS is open source under the MIT license. It's written in C++ with Python and NumPy wrappers, and supports datasets that exceed RAM as well as indexes stored on disk.

CPU operation doesn't require a GPU. Optional acceleration uses NVIDIA CUDA or AMD ROCm, and the GPU implementation supports single or multiple GPUs. It accepts data from CPU or GPU memory, with faster results when inputs and outputs remain on the GPU.

Similar to FAISS