Sentence Transformers
by Hugging Face · Library · also known as SBERT, sentence-transformers (PyPI), UKPLab/sentence-transformers
Python library for computing and training embedding, cross-encoder reranker, sparse and multi-vector retrieval models, maintained by Hugging Face with thousands of pretrained models on the Hub
Overview
Sentence Transformers (SBERT) is an Apache-2.0 Python library for using and training embedding and reranking models. Created at UKP Lab (TU Darmstadt) and now maintained by Hugging Face, it covers four model types: Sentence Transformer encoders that map text, images, audio or video to dense vectors; Cross-Encoder rerankers that score query-document pairs; Sparse Encoders for learned sparse retrieval; and Multi-Vector Encoders for ColBERT-style late interaction. Tens of thousands of pretrained models are available on the Hugging Face Hub and load by name, and training or fine-tuning any of the four types is supported through a Trainer with many loss functions. Version 6.x added model merging, faster loading and distributed evaluation.
Inference runs on PyTorch by default, with ONNX and OpenVINO backends and quantization for faster CPU serving. The library is the usual local alternative to hosted embedding APIs: a research group can embed a corpus on a Mac or a single GPU without sending data out, choose a multilingual or domain-specific model and fine-tune it on in-domain pairs. Limits are that model quality depends on the chosen checkpoint, that throughput on CPU is modest for very large corpora, and that the vector store and retrieval orchestration must come from elsewhere.
Capabilities
- Dense embedding models for text, images, audio and video
- Cross-Encoder rerankers
- Sparse encoders and multi-vector (late-interaction) encoders
- Training and fine-tuning with a Trainer and many loss functions
- PyTorch, ONNX and OpenVINO inference backends with quantization
- Direct loading of Hub models by name
Typical workflows
- Embed a document corpus locally and index it in a vector database
- Fine-tune an embedding model on domain-specific query-document pairs
- Add a cross-encoder reranking stage after vector search
Strengths
- Runs fully locally with permissive license
- Largest open catalog of embedding models
- Covers dense, sparse and late-interaction retrieval in one API
Limitations
- Quality depends on checkpoint choice
- CPU throughput limited for very large corpora
- No built-in vector store
Prerequisites
- Python 3.10+ with PyTorch
- Hugging Face Hub access for models
Who it is for
- Researchers building retrieval systems
- Developers who need on-premises embeddings
- NLP students
Alternatives & comparison
- Cohere
Enterprise-focused model provider with Command generation, Embed and Rerank retrieval models, Aya multilingual research models, the North agent platform and private or dedicated deployment options
ProprietaryFreemium - OpenAI API
OpenAI's hosted developer platform: Responses and Chat Completions APIs, Realtime voice, embeddings, images, audio, fine-tuning, evals and managed agents
ProprietaryUsage-based - Transformers
Hugging Face's model-definition library for text, vision, audio, video and multimodal models, with Pipeline, Trainer and generate APIs used as the reference by training and inference engines
Open sourceOpen source - Voyage AI
Hosted embedding and reranking models for retrieval, including code, finance, law and multimodal variants, offered by MongoDB with a free token allowance and pay-as-you-go API
ProprietaryFreemium
Sources & verification
Primary sources consulted for this record. Claims are tied to the fields each source supports; the automated link checker re-verifies every URL on a schedule.
- Licensehttps://github.com/huggingface/sentence-transformers/blob/main/LICENSEchecked Nov 1, 2026
Supports: license_spdx, source_model
- Official sitechecked Nov 1, 2026
- Repositoryhttps://github.com/huggingface/sentence-transformerschecked Nov 1, 2026
Supports: license_spdx, languages
github.com/UKPLab/sentence-transformers redirects here
- Confidence
- High
- Reviewed
- Nov 1, 2026
- Links
- Verified · Nov 2, 2026
Spotted an error?
More in Embeddings, reranking & retrieval
pgvector
Andrew Kane (pgvector project) · Vector databases
PostgreSQL extension adding vector types, distance operators and HNSW/IVFFlat indexes for similarity search inside the database
Qdrant
Qdrant Solutions GmbH · Vector databases
Open-source vector search engine written in Rust with filterable HNSW indexes, sparse and multi-vector support, REST/gRPC APIs and a managed cloud
LlamaIndex
LlamaIndex, Inc. · Agent frameworks & orchestration
Open-source Python framework for retrieval-augmented agents over your data, with connectors, indexes, query engines and event-driven workflows, alongside the commercial LlamaParse document platform
Weaviate
Weaviate B.V. · Vector databases
Open-source vector database in Go with pluggable vectorizer modules, hybrid BM25 and vector search, multi-tenancy and a managed cloud
Chroma
Chroma · Vector databases
Open-source embedding database with a minimal Python and JavaScript API, usable in-process, as a server or through Chroma Cloud
Pinecone
Pinecone Systems, Inc. · Vector databases
Fully managed, proprietary vector database service with serverless indexes, namespaces, metadata filtering and integrated embedding and reranking