{"id":2500,"library":"fastembed","title":"FastEmbed Library","description":"FastEmbed is a fast, light, and accurate Python library for generating retrieval embeddings, designed for efficiency with ONNX Runtime. It supports a variety of models including dense text embeddings, sparse embeddings, and rerankers. The current version is 0.8.0, and it maintains an active release cadence with frequent updates.","status":"active","version":"0.8.0","language":"en","source_language":"en","source_url":"https://github.com/qdrant/fastembed","tags":["embeddings","nlp","vector-search","onnx","ai","machine-learning","qdrant"],"install":[{"cmd":"pip install fastembed","lang":"bash","label":"Install core library"},{"cmd":"pip install fastembed[gpu]","lang":"bash","label":"Install with GPU support (CUDA)"}],"dependencies":[{"reason":"Core dependency for model inference, ensures high performance.","package":"onnxruntime","optional":false},{"reason":"Required for GPU acceleration, specified via `fastembed[gpu]`.","package":"onnxruntime-gpu","optional":true}],"imports":[{"symbol":"TextEmbedding","correct":"from fastembed import TextEmbedding"},{"symbol":"SparseEmbedding","correct":"from fastembed import SparseEmbedding"},{"symbol":"Reranker","correct":"from fastembed import Reranker"},{"note":"For late interaction models like ColBERT.","symbol":"LateInteractionTextEmbedding","correct":"from fastembed.late_interaction.late_interaction_text_embedding import LateInteractionTextEmbedding"}],"quickstart":{"code":"from fastembed import TextEmbedding\n\n# Initialize the embedding model. Model will be downloaded if not cached.\n# Pass specific_model_path for local models, or use local_files_only=True\nmodel = TextEmbedding(model_name=\"BAAI/bge-small-en-v1.5\")\n\ndocuments = [\n    \"This is a document about the weather in London. It's quite rainy.\",\n    \"The quick brown fox jumps over the lazy dog.\",\n    \"Python is a high-level, interpreted programming language.\"\n]\n\n# Embed the documents\nembeddings = model.embed(documents)\n\nprint(f\"Generated {len(embeddings)} embeddings.\")\nprint(f\"First embedding shape: {embeddings[0].shape}\")\nprint(f\"First embedding (first 5 values): {embeddings[0][:5]}\")","lang":"python","description":"This quickstart demonstrates how to initialize a `TextEmbedding` model, download it if necessary, and then generate embeddings for a list of documents. It uses the `BAAI/bge-small-en-v1.5` model as an example."},"warnings":[{"fix":"Upgrade your Python environment to 3.10, 3.11, or 3.12.","message":"Python 3.9 is no longer supported starting from v0.8.0. Previously, Python 3.8 was dropped in v0.5.0. Ensure your environment uses Python 3.10 or newer.","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Ensure `onnxruntime-gpu` is installed for GPU usage. Remove `cuda=True` from `TextEmbedding` initialization if it causes issues; auto-detection is now the default behavior.","message":"FastEmbed v0.8.0+ automatically utilizes CUDA if a compatible GPU is detected and `onnxruntime-gpu` is installed. Explicitly setting `cuda=True` is no longer required and may not be honored if the environment is not set up correctly.","severity":"gotcha","affected_versions":">=0.8.0"},{"fix":"Always install the latest `fastembed` version to get the most compatible `onnxruntime` and `pillow` versions. If installing on Python 3.14, ensure `fastembed >= 0.8.0`.","message":"Specific versions of `onnxruntime` and `pillow` were fixed in v0.8.0, especially for Python 3.14 compatibility and security. Users on Python 3.14 or those with older transitive dependencies might encounter installation or runtime issues.","severity":"gotcha","affected_versions":"All versions, especially older <0.8.0"},{"fix":"For strictly offline scenarios, ensure models are pre-cached and set `HF_HUB_OFFLINE=1` in your environment, in addition to using `local_files_only=True`.","message":"While `local_files_only=True` prevents downloads, earlier versions (before v0.7.4) might have still made network calls if the model wasn't cached. As of v0.8.0, the `HF_HUB_OFFLINE` environment variable is also respected, providing a more robust offline experience.","severity":"gotcha","affected_versions":"<0.8.0"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}