--- id: faiss-gpu version: "1.15.0" license: MIT license_treatment: permissive maintenance: active --- # faiss-gpu — A library for efficient similarity search and clustering of dense vectors (GPU support). License: permissive · Maintenance: active · Downloads: 384.8K/mo ## What it is and what it does Faiss is a C++ library with Python bindings for efficient similarity search and vector clustering. It handles both exact and approximate nearest-neighbor queries on dense vectors, with GPU acceleration for speed-critical operations. The library trades off search quality, memory usage, training time, and query latency depending on the index type chosen—from simple baselines like flat L2 search to compressed quantization codes that scale to billions of vectors. The GPU implementation accepts input from CPU or GPU memory and handles transfers automatically, making GPU indexes drop-in replacements for CPU equivalents. It supports L2 distance, dot product, and cosine similarity comparisons. The package is production-stable, actively maintained by Meta's AI Research group, and widely used in machine learning and information retrieval pipelines. Use it for: - Build a semantic search engine over embeddings from a language model by indexing vectors and querying for nearest matches. - Cluster high-dimensional data (e.g., image embeddings) using Faiss's k-means or other clustering algorithms. - Implement approximate nearest-neighbor search for recommendation systems handling large candidate item sets. - Scale vector search to billions of items by using compressed quantization indexes that fit in GPU memory. - Benchmark and tune index parameters for production similarity search workloads. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Faiss provides GPU-accelerated similarity search and clustering for dense vectors, supporting exact and approximate nearest-neighbor queries on datasets from memory to billions of vectors. Yes, if you have an NVIDIA GPU and need fast similarity search or clustering on dense vectors. The library is production-stable, actively maintained, MIT-licensed, and has no known vulnerabilities. Install friction is moderate due to CUDA dependencies, but the performance gains for GPU-accelerated workloads justify the setup. Not suitable for CPU-only environments. ## Install pip install faiss-gpu uv add faiss-gpu poetry add faiss-gpu ## Installing faiss-gpu Before you install: Medium install friction due to GPU dependencies: requires nvidia-cuda-runtime-cu12, nvidia-cublas-cu12, and nvidia-curand-cu12. Actively maintained with a recent release and strong community engagement (40741 stars). License in practice: MIT license permits commercial and private use with minimal restrictions—you may use, modify, and distribute faiss-gpu freely as long as you include the license notice. Quickstart: pip install faiss-gpu import faiss import numpy as np index = faiss.IndexFlatL2(d) index.add(vectors) distances, indices = index.search(query_vectors, k) Requires NVIDIA GPU with CUDA 12 support and nvidia-cuda-runtime-cu12, nvidia-cublas-cu12, nvidia-curand-cu12 installed; Linux x86_64 only. Verify before relying: - Whether the package supports AMD ROCm as an alternative to CUDA (mentioned in description but not in runtime deps). - Specific performance benchmarks or latency expectations for typical workloads. - Memory overhead per index vector for different index types. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 384.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags gpu vector similarity search, nearest neighbor search cuda, dense vector clustering, approximate nearest neighbors gpu, vector indexing faiss, similarity search library, high-dimensional vector search, gpu-accelerated, vector-search, nearest-neighbors [View on SkillFed](https://skillfed.io/packages/faiss-gpu) · [View on PyPI](https://pypi.org/project/faiss-gpu/)