Ollama's own embedding docs compare three models on parameter count and stop there. No MTEB scores, no dimensions, no context limits, no download sizes. This page is the missing table: every major Ollama embedding model benchmarked in one place, verified against the Ollama library and each model's HuggingFace card as of June 2026, plus the exact API calls, the 1536-dimension workaround, and LangChain config.
All 7 Models: The Full Benchmark Table
Every model below is in the Ollama embedding library. Download size is what ollama pull fetches at the default tag; resident VRAM roughly tracks it plus activation overhead. MTEB tracks differ by model and are labeled per row.
| Model | Params | Dims | Max context | MTEB | Download |
|---|---|---|---|---|---|
| qwen3-embedding:8b | 8B | 4096 (MRL 32+) | 40K | 70.58 multilingual | 4.7GB |
| qwen3-embedding:4b | 4B | 2560 (MRL 32+) | 40K | 69.45 multilingual | 2.5GB |
| mxbai-embed-large | 335M | 1024 | 512 | 64.68 English v1 | 670MB |
| qwen3-embedding:0.6b | 0.6B | 1024 (MRL 32+) | 32K | 64.33 multilingual | 639MB |
| nomic-embed-text v1.5 | 137M | 768 (MRL 64-768) | 8192* | 62.28 English v1 | 274MB |
| embeddinggemma | 300M | 768 (MRL to 128) | 2K | 61.15 multilingual v2 | 622MB |
| snowflake-arctic-embed2 | 568M | 1024 (MRL to 256) | 8192 | 55.6 NDCG@10 BEIR | ~1.2GB |
| bge-m3 | 567M | 1024 + sparse + multi-vector | 8192 | n/a (multi-mode) | ~1.2GB |
| all-minilm | 22M | 384 | 256 word pieces | n/a | 46MB |
MRL = Matryoshka Representation Learning: embeddings can be truncated to smaller dimensions with graceful quality loss. MTEB tracks differ: qwen3 and embeddinggemma report the multilingual leaderboard, mxbai and nomic report MTEB English v1, arctic2 reports retrieval-only NDCG@10 on BEIR, and bge-m3 has no single comparable number because it mixes dense, sparse, and multi-vector retrieval. * nomic-embed-text's native context is 8,192 tokens but the Ollama card lists 2,048; set num_ctx to use the full window.
Popularity, for what it signals about ecosystem support: nomic-embed-text 73.8M pulls, mxbai-embed-large 11.4M, bge-m3 4.7M, all-minilm 3.1M, qwen3-embedding 2.1M, embeddinggemma 1.3M, snowflake-arctic-embed2 405K.
qwen3-embedding: Highest MTEB Score on Ollama
qwen3-embedding is the first local family that competes with commercial embedding APIs across the board. The 8B model scored 70.58 on the MTEB multilingual leaderboard, ranked #1 as of June 5, 2025. All three sizes support 100+ languages including programming languages, with output dimensions user-definable from 32 up to the native maximum.
| Tag | MTEB multilingual | Native dims | Context | Download |
|---|---|---|---|---|
| qwen3-embedding:0.6b | 64.33 | 1024 | 32K | 639MB |
| qwen3-embedding:4b | 69.45 | 2560 | 40K | 2.5GB |
| qwen3-embedding:8b (default) | 70.58 | 4096 | 40K | 4.7GB (Q4_K_M) |
| qwen3-embedding:8b-q8_0 | 70.58 | 4096 | 40K | 8.0GB |
| qwen3-embedding:8b-fp16 | 70.58 | 4096 | 40K | 15GB |
The 0.6B variant deserves more attention than it gets: at 639MB it outscores every other sub-1GB model on Ollama (64.33 vs mxbai's 64.68 on a harder multilingual track) while supporting a 32K context window, 64x longer than mxbai's 512 tokens.
Pull and run qwen3-embedding
# Default pull is the 8B at Q4_K_M (4.7GB)
ollama pull qwen3-embedding
# Smaller sizes
ollama pull qwen3-embedding:0.6b # 639MB
ollama pull qwen3-embedding:4b # 2.5GB
# Full-precision variants when VRAM allows
ollama pull qwen3-embedding:8b-fp16 # 15GB
# Embed
curl http://localhost:11434/api/embed -d '{
"model": "qwen3-embedding:0.6b",
"input": "Retrieve relevant passages for this query"
}'
# Check loaded models and memory
ollama psnomic-embed-text: The CPU Default
nomic-embed-text is the most pulled embedding model on Ollama (73.8M pulls). At 137M parameters and a 274MB download it runs on a laptop CPU. The latest tag is v1.5, Apache 2.0 licensed, requiring Ollama 0.1.26+.
v1.5's Matryoshka training gives an explicit quality ladder as you truncate dimensions, measured on MTEB:
| Dimensions | MTEB avg | Storage vs 768d |
|---|---|---|
| 768 (native) | 62.28 | 100% |
| 512 | 61.96 | 67% |
| 256 | 61.04 | 33% |
| 128 | 59.34 | 17% |
| 64 | 56.10 | 8% |
Two gotchas the Ollama card buries. First, the native context window is 8,192 tokens, but the Ollama model card lists 2,048; pass num_ctx in the request options to use the full window. Second, the model requires task prefixes: documents must start with search_document: and queries with search_query: (plus clustering: and classification: for those tasks). Skipping the prefixes degrades retrieval.
nomic-embed-text with prefixes and full context
ollama pull nomic-embed-text
# Embed a document chunk (note the prefix and num_ctx)
curl http://localhost:11434/api/embed -d '{
"model": "nomic-embed-text",
"input": "search_document: Ollama runs embedding models locally",
"options": {"num_ctx": 8192}
}'
# Embed the query side
curl http://localhost:11434/api/embed -d '{
"model": "nomic-embed-text",
"input": "search_query: how do I run embeddings locally"
}'Nomic also publishes nomic-embed-text-v2-moe: a Mixture-of-Experts variant with 475M total / 305M active parameters, 768 dimensions (Matryoshka to 256), and ~100 languages. Its 512-token max sequence is the tradeoff against v1.5's 8,192.
mxbai-embed-large: 64.68 MTEB in 670MB
mxbai-embed-large from Mixedbread AI has 335M parameters and produces 1024-dimensional embeddings. It averages 64.68 on MTEB across 56 datasets, claimed state of the art for BERT-large-size models and ahead of OpenAI text-embedding-3-large as of its March 2024 release. It supports Matryoshka truncation and binary quantization, and is Apache 2.0.
The limitation is the 512-token context window. Anything longer is truncated silently, so chunking discipline is mandatory. And like nomic, it has a prefix requirement that most tutorials skip: retrieval queries must be prefixed with Represent this sentence for searching relevant passages: while documents are embedded bare.
mxbai-embed-large with the required query prefix
ollama pull mxbai-embed-large
# Documents: embed as-is
curl http://localhost:11434/api/embed -d '{
"model": "mxbai-embed-large",
"input": "The webhook handler validates the Stripe signature first."
}'
# Queries: prefix required for retrieval quality
curl http://localhost:11434/api/embed -d '{
"model": "mxbai-embed-large",
"input": "Represent this sentence for searching relevant passages: where is the stripe signature checked"
}'bge-m3 and snowflake-arctic-embed2: The Multilingual Picks
bge-m3
bge-m3 from BAAI (567M parameters, 8,192-token context, 100+ languages) is the only Ollama embedding model that supports three retrieval modes at once: dense vectors, sparse lexical matching, and ColBERT-style multi-vector scoring. That makes it the strongest hybrid-search option for cross-lingual corpora, at the cost of having no single MTEB number that captures it.
Dense Retrieval
Standard 1024-dimensional vectors, compatible with any vector database. General semantic similarity.
Sparse Retrieval
BM25-like lexical matching from the same model. Catches exact keyword matches dense vectors miss.
Multi-Vector (ColBERT)
Token-level embeddings for fine-grained matching. Higher accuracy, more storage and compute.
snowflake-arctic-embed2
snowflake-arctic-embed2 wraps snowflake-arctic-embed-l-v2.0: 568M parameters, 1024 dimensions, 8,192-token context via RoPE, 74 languages, Apache 2.0. It is the only model in this list with published throughput numbers: over 100 documents per second on an NVIDIA A10 with sub-10ms query embedding latency. MRL compresses vectors to 256 dimensions with under 3% quality loss, and it scores 55.6 NDCG@10 on BEIR (55.8 on MIRACL multilingual). Snowflake's pitch is multilingual without sacrificing English retrieval, and the BEIR score backs it: that is retrieval-only territory most general models do not report.
embeddinggemma, all-minilm, granite-embedding
embeddinggemma
embeddinggemma (300M parameters, 622MB, built from Gemma 3, requires Ollama v0.11.10+) outputs 768 dimensions, Matryoshka-truncatable to 512/256/128. Its MTEB scores at full precision: 61.15 Multilingual v2, 69.67 English v2, and 68.76 Code v1. That code score is the best verified number among small Ollama models, which matters below in the code section. Context is 2K tokens.
all-minilm
all-minilm ships 22m (46MB) and 33m (67MB) variants producing 384-dimensional vectors. The underlying all-MiniLM-L6-v2 truncates input at 256 word pieces by default. It was state of the art in 2022; in 2026 it is for prototyping a pipeline or edge devices, not production retrieval.
granite-embedding
IBM granite-embedding ships 30m (English, 384 dims) and 278m (multilingual) variants. The draw is IBM's licensing and enterprise support posture rather than benchmark wins; for raw quality per megabyte, embeddinggemma and qwen3-embedding:0.6b are stronger picks.
| Scenario | Pick | Why |
|---|---|---|
| Best quality, GPU available | qwen3-embedding:8b | 70.58 MTEB multilingual, #1 at release |
| Best quality under 1GB | qwen3-embedding:0.6b | 64.33 multilingual, 32K context, 639MB |
| CPU-only default | nomic-embed-text | 274MB, 8192 native context, 73.8M pulls |
| English retrieval, short chunks | mxbai-embed-large | 64.68 MTEB English in 670MB |
| Multilingual / hybrid search | bge-m3 | Dense + sparse + multi-vector, 100+ languages |
| Multilingual + throughput | snowflake-arctic-embed2 | >100 docs/sec on an A10, sub-10ms queries |
| Code, small + local | embeddinggemma | 68.76 MTEB Code v1 in 622MB |
| Prototyping | all-minilm | 46MB, loads instantly |
Ollama Embedding Models With 1536 Dimensions
A common migration problem: your vector database schema was built for OpenAI text-embedding-3-small, which defaults to 1536 dimensions, and no Ollama model outputs 1536 natively. nomic-embed-text is 768, mxbai-embed-large is 1024, and qwen3-embedding is 1024, 2560, or 4096 depending on size.
The fix is Matryoshka truncation. qwen3-embedding supports user-definable output dimensions from 32 up to its native maximum, and Ollama's OpenAI-compatible /v1/embeddings endpoint accepts a dimensions parameter. Use the 4B (native 2560) or 8B (native 4096) and request 1536:
Get 1536-dimension vectors from Ollama
curl http://localhost:11434/v1/embeddings -d '{
"model": "qwen3-embedding:4b",
"input": "drop-in for a text-embedding-3-small schema",
"dimensions": 1536
}'
# Or with the OpenAI SDK
from openai import OpenAI
client = OpenAI(base_url="http://localhost:11434/v1/", api_key="ollama")
resp = client.embeddings.create(
model="qwen3-embedding:4b",
input="drop-in for a text-embedding-3-small schema",
dimensions=1536,
)
print(len(resp.data[0].embedding)) # 1536Matching 1536 columns lets you reuse the table schema, not the data. Vectors from different models live in different spaces, so you must re-embed the entire corpus with the new model. Do not query qwen3 vectors against stored OpenAI vectors. Also note qwen3-embedding:0.6b caps at 1024 native dimensions and cannot reach 1536. If you want hosted 1536-dimension embeddings instead, morph-embedding-v4 outputs 1536 dimensions at $0.18 per 1M tokens.
/api/embed vs /api/embeddings vs /v1/embeddings
Ollama has three embedding endpoints, and half the tutorials online use the deprecated one. Per the official API docs, the legacy /api/embeddings endpoint "has been superseded by /api/embed". The differences are not cosmetic: the request field, the response shape, and batching all change.
Current: POST /api/embed (batched)
curl http://localhost:11434/api/embed -d '{
"model": "all-minilm",
"input": "Why is the sky blue?"
}'
# Response: plural "embeddings", an array of vectors, plus timings
{
"model": "all-minilm",
"embeddings": [[0.010071, -0.001734, ...]],
"total_duration": 14143917,
"load_duration": 1019500,
"prompt_eval_count": 8
}
# Batch: pass an array of strings
curl http://localhost:11434/api/embed -d '{
"model": "all-minilm",
"input": ["Why is the sky blue?", "Why is grass green?"]
}'Legacy: POST /api/embeddings (superseded)
curl http://localhost:11434/api/embeddings -d '{
"model": "all-minilm",
"prompt": "Why is the sky blue?"
}'
# Response: singular "embedding", one vector, no batching
{
"embedding": [0.567032, 0.009109, ...]
}
# Note the field is "prompt", not "input". Code written against
# this endpoint breaks silently if you swap the URL but keep the body.OpenAI-compatible: POST /v1/embeddings
# Supports model, input (string or array), encoding_format, dimensions
curl http://localhost:11434/v1/embeddings -d '{
"model": "nomic-embed-text",
"input": ["chunk one", "chunk two"]
}'
# Works with any OpenAI SDK; the api_key is required but ignored
from openai import OpenAI
client = OpenAI(base_url="http://localhost:11434/v1/", api_key="ollama")
resp = client.embeddings.create(model="nomic-embed-text", input="hello")LangChain and LlamaIndex Config
Both frameworks have first-party Ollama embedding classes. The two parameters that matter are the model name (exactly as it appears in ollama list, including the tag) and base_url if Ollama is not on localhost.
LangChain: OllamaEmbeddings
pip install langchain-ollama
from langchain_ollama import OllamaEmbeddings
embeddings = OllamaEmbeddings(
model="nomic-embed-text",
base_url="http://localhost:11434", # default; change for remote Ollama
)
vector = embeddings.embed_query("search_query: how is auth handled")
vectors = embeddings.embed_documents([
"search_document: first chunk",
"search_document: second chunk",
])LlamaIndex: OllamaEmbedding
pip install llama-index-embeddings-ollama
from llama_index.embeddings.ollama import OllamaEmbedding
embed_model = OllamaEmbedding(
model_name="qwen3-embedding:0.6b",
base_url="http://localhost:11434",
)
vector = embed_model.get_query_embedding("how is auth handled")Neither framework injects nomic's search_document: / search_query: prefixes or mxbai's retrieval prefix automatically. If your retrieval quality looks 5-10 points worse than the MTEB score suggests, missing prefixes are the usual cause.
Ollama Embedding Models for Code
For embedding code locally, the verified numbers point to two models. embeddinggemma scores 68.76 on MTEB Code v1 at 622MB, the best measured code score among small Ollama models. qwen3-embedding supports 100+ languages including programming languages and brings the highest overall quality if you have the VRAM. Nomic's nomic-embed-code (7B) is a dedicated code embedder, but at 7B parameters it costs as much to run as a small chat model.
If you want hosted code embeddings instead of managing VRAM, morph-embedding-v4 returns 1536-dimensional vectors at $0.18 per 1M tokens through an OpenAI-compatible /v1/embeddings endpoint.
All of them share one structural problem: embeddings capture what code looks like, not what it does. Changing < to <= barely moves the vector but inverts program behavior at the boundary. Two functionally identical implementations with different naming sit far apart in vector space. And the index goes stale the moment a file changes.
For AI coding agents the cost compounds: agents spend over 60% of their first turn retrieving context, and every search result stays in the context window, feeding context rot. WarpGrep replaces the embedding index with an RL-trained search agent that greps and reads in its own context window, returning only the final results to the parent model. No index to build, no reindexing on file changes, no VRAM budgeting. Pricing: $0 for the first 100k requests, then $1 per 1M on Pro.
No Index to Maintain
WarpGrep searches the current state of the code. No stale embeddings, no reindexing when files change, no vector database.
Isolated Search Context
Search runs in a separate context window. The parent model sees the final results, not the 15 files explored and rejected.
RL-Trained Retrieval
Trained with reinforcement learning to decide when to grep, when to read, and when to stop. Not embedding similarity.
Local vs Cloud Embeddings
Local wins on latency and sovereignty. Localhost removes the network round trip on every call, which compounds when a RAG pipeline runs several retrieval calls per user query. The one published local throughput figure: snowflake-arctic-embed2 embeds over 100 docs per second on an NVIDIA A10 with sub-10ms query latency. And legal, healthcare, and government workloads often cannot send text to a third-party API at all.
Cloud wins on low volume and zero ops. Per-token API pricing at small scale costs less than keeping a GPU machine on, and there is no model to pull, quantize, or fit into VRAM. Cloud also wins when you need quality above what your hardware can serve: qwen3-embedding:8b at FP16 is a 15GB download before activations.
The honest breakeven is hardware you already own. If a GPU is already running for other workloads, local embeddings are marginal-cost zero. If you would buy hardware just to embed, price the API first.
Frequently Asked Questions
What is the best Ollama embedding model in 2026?
qwen3-embedding:8b: 70.58 on the MTEB multilingual leaderboard, #1 at release (June 5, 2025). It needs a GPU (4.7GB default download, 15GB at FP16). On CPU-only machines, nomic-embed-text (274MB, 62.28 MTEB) is the default, and qwen3-embedding:0.6b (639MB, 64.33 multilingual) is the strongest sub-1GB option.
What is the best Ollama embedding model for RAG?
nomic-embed-text v1.5 to start: 62.28 MTEB, 8,192-token native context, 274MB. Use the search_document: / search_query: prefixes and set num_ctx above the 2,048 Ollama default. With a GPU, qwen3-embedding:4b (69.45) or :8b (70.58) retrieve measurably better. Multilingual corpora: bge-m3 or snowflake-arctic-embed2.
Which Ollama embedding model outputs 1536 dimensions?
None natively. qwen3-embedding:4b (native 2560) or :8b (native 4096) can output exactly 1536 via the dimensions parameter on Ollama's OpenAI-compatible /v1/embeddings endpoint, since the family is Matryoshka-trained for user-defined dimensions from 32 up. That fills a schema built for OpenAI text-embedding-3-small, but you still have to re-embed the corpus: vectors from different models are not comparable. Hosted option: morph-embedding-v4, 1536 dims, $0.18/1M tokens.
What is the Ollama embedding API endpoint?
POST http://localhost:11434/api/embed with model and input (string or array); it returns a batched embeddings array plus total_duration, load_duration, and prompt_eval_count. The legacy /api/embeddings endpoint is superseded: it takes prompt instead of input and returns a single embedding array. There is also an OpenAI-compatible /v1/embeddings endpoint supporting dimensions and encoding_format.
How much VRAM do Ollama embedding models need?
Roughly the download size of the quantization you pull, plus activation overhead: all-minilm 46MB, nomic-embed-text 274MB, embeddinggemma 622MB, qwen3-embedding:0.6b 639MB, mxbai-embed-large 670MB, bge-m3 and snowflake-arctic-embed2 about 1.2GB, qwen3-embedding:4b 2.5GB, qwen3-embedding:8b 4.7GB at the default Q4_K_M and 15GB at FP16. A model that fits entirely in VRAM embeds far faster than one spilling to system RAM.
How do Ollama embeddings compare to OpenAI?
mxbai-embed-large's card claims it beats OpenAI text-embedding-3-large at BERT-large size (March 2024 claim), and qwen3-embedding:8b topped the MTEB multilingual leaderboard at 70.58. Ollama costs $0 per token but needs always-on hardware; cloud APIs bill per token with no ops. Localhost also removes per-call network latency, which matters when a pipeline makes several retrieval calls per query.
Can I use Ollama embedding models for code search?
Yes: embeddinggemma (68.76 MTEB Code v1, 622MB) for small local, qwen3-embedding for quality, nomic-embed-code (7B) for a dedicated code embedder. The structural limit remains: embeddings encode syntax, not behavior. For coding agents, WarpGrep uses an RL-trained search agent instead of a vector index, $0 for the first 100k requests.
Which Ollama embedding model supports the longest context?
qwen3-embedding: 32K tokens (0.6B) and 40K (4B/8B). Then nomic-embed-text v1.5, bge-m3, and snowflake-arctic-embed2 at 8,192. embeddinggemma is 2K, mxbai-embed-large 512, all-minilm 256 word pieces. Chunks beyond the limit are silently truncated.
Code Search Without Managing Embeddings
WarpGrep uses RL-trained search agents instead of vector embeddings. No index to maintain, no stale vectors, no VRAM budgeting. $0 for the first 100k requests.
