Embedding model choice significantly affects search quality and cost. This guide compares the leading models — OpenAI text-embedding-3, Cohere embed, BAAI/bge, and others — across quality, speed, cost, and language support.
The Massive Text Embedding Benchmark (MTEB) is the standard leaderboard for comparing embedding models across 58 tasks and 112 languages. Check mteb.leaderboard.xyz before choosing a model — rankings change as new models are released. Sort by your specific task type (retrieval, clustering, classification) and language.
Benchmark scores matter but are not the only factor. Also consider: vector dimension (higher = more memory), max sequence length (longer text → needs higher limit), inference speed (local models vary widely), and whether the model supports instruction-following (some require prepending a task instruction to the input).
`text-embedding-3-small` (1536 dimensions, $0.02/M tokens) is the best value cloud embedding model for most English use cases. It outperforms its predecessor `ada-002` at 5× lower cost. `text-embedding-3-large` (3072 dimensions) is the highest quality OpenAI embedding, worth the cost for applications where retrieval precision is critical.
A unique feature of text-embedding-3 models is dimension reduction: you can request fewer dimensions (e.g. 256) without significant quality loss. Halving the dimensions roughly halves storage and query cost with only ~5% quality reduction — useful for very large indices.
BAAI/bge-m3 is the best open-source multilingual embedding model, supporting 100+ languages with strong English performance that matches or exceeds OpenAI's models on most retrieval benchmarks. It produces 1024-dimensional vectors and supports up to 8192 tokens — ideal for embedding long documents.
BGE-M3 supports three retrieval modes in a single model: dense retrieval (standard cosine similarity), sparse retrieval (like BM25), and multi-vector retrieval (ColBERT-style late interaction). Using all three in a hybrid setup achieves state-of-the-art retrieval quality.
English-only, cloud deployment, tight budget: `text-embedding-3-small`. English-only, highest quality: `text-embedding-3-large` or Cohere embed-english-v3.0. Multilingual: `BAAI/bge-m3` (local) or Cohere embed-multilingual-v3.0 (cloud). Privacy-sensitive (no cloud): `BAAI/bge-m3` or `mixedbread-ai/mxbai-embed-large-v1`.
For code search (finding code by natural language description), use a code-specific embedding model: `Salesforce/SFR-Embedding-Code-2B` for highest quality, or `microsoft/codebert-base` for fast local inference. General text embedding models work poorly for cross-modal text-to-code retrieval.
Text embeddings convert text into dense vector representations that capture semantic meaning. This guide covers generating embeddings with OpenAI and local models, measuring similarity, and practical applications.
Semantic search finds relevant results based on meaning rather than keywords. This guide builds a complete semantic search system from document ingestion to ranked retrieval, using embeddings and a vector store.
Read guideVector databases are purpose-built for storing and querying embeddings at scale. This guide compares the leading options — Pinecone, Weaviate, Qdrant, pgvector, and Chroma — and helps you choose the right one for your use case.