The first GPU quote for a RAG product often prices the whole pipeline as one GPU job. Look at the four jobs separately instead. The GPU question is then almost entirely about the answer step, and the cheapest lever is how much retrieved text you send. Which parts of your RAG pipeline need GPUs, and which can run without a platform team?
Four workloads with four hardware profiles
A RAG pipeline is four separate workloads, and each one stresses different hardware. Take an internal support assistant as the running example. Its knowledge base holds 2 million passages (chunks) of 500 tokens each, so 1 billion tokens in all. It answers 50,000 questions a day, which is 1.5 million a month. Each question has about 25 tokens. Its prompt carries eight passages (4,000 tokens), a 500-token system prompt and the question: 4,525 tokens in all. These inputs are illustrative, not measurements from a customer.
| Job | What it does | What it needs | In the example |
|---|---|---|---|
| Embedding | Turns each passage and question into a vector, a list of numbers that captures meaning | A small model and high throughput | 1 billion tokens once, 37.5 million a month for questions |
| Vector search | Finds the passages whose vectors sit closest to the question's vector | Memory and CPU cores, a GPU only for large index builds | 2 million vectors |
| Re-ranking (optional) | A reranker, a small model, scores each hit against the question and reorders them | A small GPU, or none | The top hits per question |
| Generation | The language model reads the question plus the retrieved passages and writes the answer | GPU memory for the model and for every prompt in flight | 4,525 tokens in, 400 out per question |
Only the last row needs large GPUs. Prices below were read on 30 October 2026.
Embedding cost: per token or a GPU you keep running
Embedding is cheap per token, so a per-token API wins until your volume is enormous. We serve Qwen3 Embedding 8B as qwen/qwen3-embedding-8b at $0.02 per million input tokens, with a 32K-token context. Embedding the whole example knowledge base once costs $20:
knowledge base: 1,000,000,000 tokens / 1,000,000 × $0.02 = $20.00 once
questions: 1,500,000 a month × 25 tokens = 37,500,000 tokens → $0.75 a month
The alternative is a GPU virtual machine that runs an embedding server around the clock. An NVIDIA L40S is a data-centre GPU with 48 GB of memory. At today's on-demand rate on our GPU compute page, it costs about $1,453 for a 730-hour month. The break-even volume follows from one division:
break-even = monthly GPU cost / price per 1M tokens
= $1,452.70 / $0.02 ≈ 72,600 million tokens a month
That is about 72 times the whole example knowledge base, every month. Below that volume, the per-token price is cheaper, and nobody on your team runs the server. The GPU costs the same whether it works or waits. If you embed 2,000 million tokens a month, the GPU still costs $1,452.70, while the API charges $40 for the same work.
Vector search on CPU or GPU
Vector search runs well on CPUs for most knowledge bases, and GPUs earn their place when building the index takes too long. A vector index is the data structure that makes the closest-match search fast. The two indexes below are graphs: each vector is linked to its nearest neighbours, and a search walks those links. Building it compares every vector with many others, and that is where GPUs help.
HNSW is a graph index that runs on CPUs, and CAGRA is one designed for GPUs. The vector database Milvus measured CAGRA building indexes 12 to 15 times faster than HNSW on two test sets of a million vectors. Milvus 2.6.1 therefore offers a hybrid mode: the GPU builds the graph and CPUs answer the queries. NVIDIA's cuVS, a library for vector search on GPUs, supports the same split. A CAGRA graph built on a GPU can be converted to HNSW for search on CPUs.
Elastic tested cuVS in Elasticsearch and reports about 12 times the indexing throughput, meaning vectors indexed per second, against the same node without a GPU. Elastic then compared it with a larger CPU-only machine of about the same hourly price and still measured about 5 times. Plan with that second number. Elastic planned the feature as a Technical Preview, an early test release, for Elasticsearch 9.3.
For the example's 2 million vectors, a CPU index is the sensible start. Move the build to a GPU when a full rebuild no longer fits between two document updates. Our GPU virtual machines are billed per second, so you pay for the build and stop the machine afterwards. Spot machines cost about 50% less but can be reclaimed at any time. That suits a rebuild you can restart.
A reranker follows the same logic. Hugging Face's Text Embeddings Inference (TEI) server runs rerankers such as BAAI/bge-reranker-large alongside embedding models. It batches requests by token count to keep the GPU busy. Add a reranker only when search finds the right passage but ranks it too low.
Generation is where the memory and the money go
Answer generation needs the most GPU memory because RAG prompts are long. While a model reads a prompt, it keeps a record of every token it has read: the KV cache (key-value cache). NVIDIA's RAG deployment analysis gives an example: Llama-2-70B in 16-bit precision, two bytes per weight, has 140 GB of weights. Serving 32 requests of 4,096 tokens at once adds a KV cache of about 40 GB. That memory is why long RAG prompts cost more per request, on your GPUs or ours. Our KV cache sizing guide walks through the arithmetic for your own model and context length.
On our serverless API, we size that memory, and you pay per token instead. Prompt caching bills repeated text at a lower rate. When requests start with the same text, such as a fixed system prompt, the cached part is billed at the lower cached-input rate. Caching is automatic and best-effort, and the response reports how many tokens came from the cache.
Put the system prompt first and the retrieved passages after it. Passages change with every question, so they rarely repeat at the start of a prompt.
Cost per question for the example knowledge base
The example's answer step costs about $0.0028 per question on Qwen3.8 27B, which is $4,155 a month. The model costs $0.40 per million input tokens, $0.10 for cached input and $2.40 for output:
input: 4,525 tokens × $0.40 / 1M = $0.001810
output: 400 tokens × $2.40 / 1M = $0.000960
per question = $0.002770
per month: 1,500,000 × $0.002770 = $4,155.00
| Line | Per month | What changes |
|---|---|---|
| Embedding the questions | $0.75 | 37.5 million tokens at $0.02 per million |
| Answers with eight passages | $4,155.00 | The baseline above |
| System prompt served from the cache | Up to $225 less | 500 tokens at $0.10 instead of $0.40, when the cache hits |
| Answers with four passages | $2,955.00 | 2,525 input tokens, $1,200 less than eight passages |
Embedding the questions is about 0.02% of the answer bill. Every passage is paid for again with every question, so their number moves the bill most.
These are calculated examples. They leave out the vector search servers, retries and answers that miss. They also assume four passages still contain the answer, so test that on your own questions before you cut. Our cost-per-query guide breaks the same bill down step by step.
When your own GPUs start to pay
Dedicated GPUs start to pay when a job runs steadily at a volume the per-token price no longer covers. For embeddings, that is around 72,600 million tokens a month in the example's arithmetic. For answers, steady traffic around the clock is the signal. A dedicated endpoint then reserves GPU replicas for one model: copies of the model on GPUs kept for you alone. It pays when its monthly contract price is below your token bill for the same answers, $4,155 in the example. Commitment prices are agreed per contract, so ask for a quote with your token counts. Until then, the pipeline needs one API key and no GPU servers of its own.
Lyceum is a sovereign European AI inference provider for open-source models. Our serverless models run in Paris and Finland. Prompts and outputs are processed, not stored, and never used for training. One OpenAI-compatible base URL serves both the embedding and the answer:
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["LYCEUM_API_KEY"],
base_url="https://api.lyceum.technology/openai/v1",
)
question = "How long do refunds take?"
vector = client.embeddings.create(model="qwen/qwen3-embedding-8b", input=question)
answer = client.chat.completions.create(
model="qwen/qwen3.8-27b",
messages=[
{"role": "system", "content": "Answer only from the passages."},
{"role": "user", "content": "Passages: Refunds take five working days.\n\n" + question},
],
)
details = answer.usage.prompt_tokens_details
print(answer.choices[0].message.content, details.cached_tokens if details else 0)
Run this call with your own system prompt and five real questions, then read the token counts in each response. Multiply them by your monthly question volume, and you have your own version of the table above. Current prices for every model are on our models page.
Frequently asked questions
Does prompt caching keep a copy of my documents?
Only for a short time, in GPU memory. The opening part of a recent prompt stays there until newer requests push it out, and it is never written to disk or a database. That temporary copy is what makes cached input cheaper.
Is there an uptime SLA for serverless inference?
We don't publish a standard uptime SLA for serverless inference yet, and it's on our roadmap. For dedicated endpoints and reserved GPU capacity, we agree service levels with you as part of your contract. Live service status is on status.lyceum.technology.
Can I test a RAG pipeline on Lyceum before committing?
For serverless inference, you pay as you go with no commitment, so you can start small and scale when you're ready. For dedicated inference, we run time-boxed proofs of concept with success criteria we agree on before you commit.