Embedding Cost Optimization: Cut Vector Costs Without Cutting Recall
How to cut embedding costs: model choice, dimension reduction, caching, and batching — with real numbers for corpus and query spend.
Embedding spend sneaks up on teams. It is per-million-tokens, invisible in individual requests, and it multiplies every time you re-index the corpus. Yet most RAG stacks spend far more than they need to because nobody re-examined the choices made during the prototype. This guide walks through each lever — model, dimensions, caching, batching, and hosting — with the numbers that show where the money actually goes.
Where the spend actually accumulates
- Corpus embedding: one call per chunk, paid every time you re-index from scratch.
- Query embedding: one call per user search or RAG question — cheap per call, huge at volume.
- Re-embedding: embeddings stored in your vector DB are useless if you switch models, forcing a full re-run.
- Storage and search: dimensions multiply index size, memory, and query time — not billed per token, but not free either.
Model choice is the biggest lever
Embedding prices differ by an order of magnitude between providers, and open-source models cost only the GPU time to run. Before committing, benchmark three candidates on your actual queries and measure the recall delta. If a mid-priced model recovers 98% of the top model's retrieval quality, the 50% price cut is nearly free money — and many workloads never need the frontier embedding model at all.
Dimension reduction: shrink storage, keep most recall
Many modern embedding models support Matryoshka Representation Learning: you request a small output (say 256 dimensions) or take a larger vector and truncate it. Dropping from 1,536 to 256 dimensions can cut index memory and search time by 70-80% while losing only a few points of recall on typical corpora. Test with a holdout query set — the trade is rarely as painful as it sounds.
Cache the repeatable work
- Cache query embeddings by normalized query text so the same question never bills twice.
- Cache chunk embeddings keyed by content hash so re-indexing skips unchanged documents.
- Cache the embedding model version with every vector — a version mismatch silently corrupts similarity and forces a full rebuild.
- For frequently re-run jobs, keep embeddings for hot corpora in memory and only pay to embed the deltas.
Batch the corpus, don't dribble it
Embedding APIs accept arrays of inputs, and pricing is per token, not per call — but batching still matters. It cuts the number of API calls and keeps you under request rate limits so re-indexing finishes in minutes instead of hours. A common mistake is embedding the corpus in a loop one document at a time; batch it in groups of 64-256 chunks and you can re-index on every deploy if you want to.
Self-hosting: the break-even that arrives sooner than you think
Open-source embedding models on a single GPU (or even CPU for small models) eliminate per-token fees entirely. The break-even is usually a few million embedded tokens, which a mid-size corpus hits within weeks. You trade vendor convenience for ops: model serving, GPU sizing, and update management. If your query volume is high, self-hosting pays for itself and then keeps paying.
Example bill, fully optimized
FAQ
How much do embeddings cost?+
Managed APIs bill per million tokens, typically a fraction of chat-model prices. Total cost is corpus tokens plus query tokens, multiplied by how often you re-index. Open-source models cost GPU time instead.
Does reducing embedding dimensions hurt quality?+
It can, but usually by single-digit recall points on typical corpora. Measure on your own queries with a holdout set before accepting the trade.
What is the fastest win to cut embedding costs?+
Stop re-indexing the full corpus on every change. Cache embeddings by content hash, embed only the delta, and keep a hash of query text so repeated searches don't re-bill.
Related posts
Aug 10, 2026 · Model comparison
Embedding Models Compared: Picking the Right VectorizerEmbedding models compared: OpenAI, Cohere, open-source options. Dimensions, cost, retrieval quality, and how to choose for your RAG pipeline.
Aug 10, 2026 · AI gateway
Vector Databases Compared in 2026: Which to ChooseVector databases compared in 2026: pgvector, Pinecone, Weaviate, Qdrant, Milvus. Features, costs, and how to choose for RAG and semantic search.
Aug 18, 2026 · Cost control
The LLM Cost Optimization Playbook for 2026An LLM cost optimization playbook: caching, routing, batching, compression, token hygiene, and monitoring that cuts API spend by 50-80% without cutting quality.