Lattice
Skip to content

Grounded answers over my data

A rag application stack.

RAG application · 100,000 req/mo. At the default case — 100k requests a month, no further constraints — drawn from the 112 tools already in the index. Each pick is a tool whose own skip-when is stated, because a stack built on tools it does not know how to overcommit to is a guess. Describe your case to change it.

The picks

  • A high-throughput OpenAI-compatible proxy with a small footprint.

    Watch out: You need the breadth of a full routing stack.

    Consider Cloudflare AI Gateway instead when edge caching and latency dominate, on Cloudflare already

  • One index carrying BM25 and dense vectors, with ranking you can tune.

    Watch out: You need a permissive licence: the Elastic licence is not OSI-approved.

    Consider pgvector instead when under a few million vectors, or when retrieval joins rows you already have

  • Local generation with a UI tuned for interactive, long-form use.

    Watch out: You need headless serving at scale.

    Consider llama.cpp instead when the constraint is hardware, not throughput: no GPU, or an edge box

  • Open-source prompt management with a playground and versioning.

    Watch out: You need eval depth rather than prompt ergonomics.

    Consider DSPy instead when compiling prompts into optimised programs from labelled examples

  • OpenTelemetry-native evaluation you can run yourself.

    Watch out: You want a vendor support contract behind it.

    Consider Braintrust instead when making evaluation, rather than tracing, the primary workflow

The costs and the risks

Estimated cost
$40–$238
per month
A heuristic band from query volume, not a vendor quote.
Confidence
87%
Lower when constraints narrow the field, higher when the workload has a well-worn default.

Cost driversElasticsearch

Biggest risk at the default case: Retrieval quality decides the outcome: most failures are ranking or chunking failures, not model failures. Build the eval set before tuning anything.

Rules of thumb

  • Route on measured quality, not on price alone. A cheaper model that fails your eval set is not cheaper.
  • Most bad retrieval is a ranking or chunking problem, not a database problem. Fix the eval set and the chunks before you migrate stores.
  • Benchmark at your concurrency, not at batch size one. A runtime that wins a single-stream demo can lose badly at fifty concurrent users.
  • Prompt changes without evals are guesses. Version prompts and measure before you ship a wording change.

Quick answers

What should you run for the RAG application stack?
Routing: Bifrost. Retrieval: Elasticsearch. Inference: KoboldCpp. Prompts: Agenta. Evals: Arize Phoenix. Retrieval quality decides the outcome: most failures are ranking or chunking failures, not model failures. Build the eval set before tuning anything.
What should you use for routing in the RAG application stack?
Bifrost: a high-throughput OpenAI-compatible proxy with a small footprint. Watch out: you need the breadth of a full routing stack. Consider Cloudflare AI Gateway instead when edge caching and latency dominate, on Cloudflare already.
What should you use for retrieval in the RAG application stack?
Elasticsearch: one index carrying BM25 and dense vectors, with ranking you can tune. Watch out: you need a permissive licence: the Elastic licence is not OSI-approved. Consider pgvector instead when under a few million vectors, or when retrieval joins rows you already have.
What should you use for inference in the RAG application stack?
KoboldCpp: local generation with a UI tuned for interactive, long-form use. Watch out: you need headless serving at scale. Consider llama.cpp instead when the constraint is hardware, not throughput: no GPU, or an edge box.
What should you use for prompts in the RAG application stack?
Agenta: open-source prompt management with a playground and versioning. Watch out: you need eval depth rather than prompt ergonomics. Consider DSPy instead when compiling prompts into optimised programs from labelled examples.
What should you use for evals in the RAG application stack?
Arize Phoenix: openTelemetry-native evaluation you can run yourself. Watch out: you want a vendor support contract behind it. Consider Braintrust instead when making evaluation, rather than tracing, the primary workflow.
What does the RAG application stack cost per month?
$40–$238 a month at the default case: a heuristic band from query volume, not a vendor quote. Cost drivers: Elasticsearch.

Ask an AI about this page

Opens the assistant with this page’s link and a question already filled in.

A starting point, not a prescription. The recommendation at the default case is what the engine would tell a stranger with your workload; the recommendation at your case is what it tells you once it knows the constraints. The Stack Builder holds both — the builder link preselects this workload and starts with your volumes from here.