How this workload behaves
In a RAG workload, the LLM’s input cost is dominated by the retrieval context—often 80-90% of total tokens—while output cost scales with the length of generated responses. Here, the 10 M input tokens represent a mix of retrieved documents and user queries, and the 2 M output tokens reflect synthesized answers. Because RAG pipelines frequently process large context windows (e.g., 128 K tokens) and generate concise answers, the input cost is the primary driver of expense. Smaller models or context compression can yield outsized savings, while over-provisioning context or verbose outputs erodes cost efficiency.
Compare against 6 alternatives
| Model | Vendor | Monthly cost | vs primary | Δ |
|---|---|---|---|---|
| GPT-4o mini | OpenAI | $2.70 | 0.06× | $42.30 |
| GPT-4 Turbo | OpenAI | $160.00 | 3.56× | +$115.00 |
| GPT-3.5 Turbo | OpenAI | $8.00 | 0.18× | $37.00 |
| Mistral Small | Mistral | $3.20 | 0.07× | $41.80 |
| Claude Haiku 4.5 | Anthropic | $20.00 | 0.44× | $25.00 |
| Gemini 1.5 Flash | $1.35 | 0.03× | $43.65 |
Recommendation
Use **Gemini 1.5 Flash** as the primary model. It delivers the lowest total cost ($1.35 vs. $45.00 for GPT-4o) while maintaining strong RAG performance due to its efficient long-context handling. This saves $43.65 per month—97% of the primary model’s cost—with minimal intelligence trade-off for most retrieval tasks. Reserve GPT-4o for edge cases requiring higher reasoning, where its output quality justifies the 33× cost increase.
Cost-saving tactics for this workload
- Enable **prompt caching** for repeated retrieval contexts (e.g., static documents) to reduce input token costs by up to 90% after the first call.
- Use **Gemini 1.5 Flash** for routing: a small model (e.g., GPT-4o mini) can triage queries and forward only relevant ones to a higher-cost model, cutting unnecessary input/output.
- Implement **context compression** (e.g., reranking or summarization) to reduce the 128 K context window to the minimal relevant tokens before passing to the LLM.
- Batch API calls for batched retrieval and generation to amortize fixed costs across multiple queries, reducing per-token overhead.
- Cache frequent **output templates** (e.g., structured responses) to avoid regenerating identical answers, saving output tokens.