# How many judge calls one metric makes: DeepEval vs Ragas (3 Nov 2026, IST)

One test case, scored by each library's Faithfulness and Answer Relevancy metrics. The "judge" was a **local OpenAI-compatible stand-in** (`mock.py`, port 18765) that logs every request and returns JSON shaped to the schema the library asked for. No vendor account, dummy key `not-a-real-key`, no real model calls, no spend.
Box: Linux, Python 3.12 venv (uv). Run ~11:00-11:25 IST on 3 Nov 2026.

Versions: deepeval 4.3.2 (PyPI 27 Oct 2026), ragas 0.4.3 (PyPI 13 Jan 2026), openai 3.3.0, instructor 1.17.0, langchain-community 0.4.1.

Test case (`case.py`): question "What is the refund window for shoes?", answer "You can return shoes within 30 days for a full refund. Refunds go back to the original card.", 3 retrieval contexts (30-day refund policy, refunds to original payment method, stores open 9 am).

Setup:
- DeepEval: `OpenAIModel(model="gpt-4.1", base_url=<mock>)`, `async_mode=False`, run with `include_reason=True` (default) and `False`.
- Ragas: `llm_factory("gpt-4.1", client=AsyncOpenAI(<mock>))`, `ragas.metrics.collections` Faithfulness and AnswerRelevancy, `embedding_factory("openai", model="text-embedding-3-small")`, defaults otherwise (AnswerRelevancy strictness 3).

## Results (raw/*.jsonl: one line per request, prompt bodies not published)

| Metric | Chat requests | Characters sent (total) | Per request | Embedding requests |
|---|---|---|---|---|
| DeepEval Faithfulness, include_reason=True | 4 | 5,552 | 1,276 / 1,523 / 1,686 / 1,067 | 0 |
| DeepEval Faithfulness, include_reason=False | 3 | 4,485 | | 0 |
| DeepEval Answer Relevancy, include_reason=True | 3 | 4,025 | 1,376 / 1,561 / 1,088 | 0 |
| DeepEval Answer Relevancy, include_reason=False | 2 | 2,937 | | 0 |
| Ragas Faithfulness | 2 | 7,274 | 2,455 / 4,819 | 0 |
| Ragas Answer Relevancy | 3 | 7,842 | 2,614 each | 2 (4 inputs) |

What the calls are: DeepEval Faithfulness = extract truths from context, extract claims from answer, verdict per claim, reason. DeepEval Answer Relevancy = statements, verdicts, reason. Ragas Faithfulness = break answer into statements, then one NLI call judging them against the context. Ragas Answer Relevancy = generate a question from the answer 3 times (strictness 3), then embed the original and generated questions and compare.

## Caveats
- Characters, not tokens. Characters in follow-up calls depend on how many items the stand-in returned (2 per list); a real model with longer answers or more claims sends more.
- One short test case. Longer contexts grow every call that includes the context.
- Scores (all ~1.0) are meaningless here: the stand-in always answers "yes".
- Counts are for these versions and defaults; settings such as Ragas strictness or DeepEval include_reason change them.

Files: `mock.py`, `case.py`, `run_deepeval.py`, `run_ragas.py`, `runall.sh`, `raw/`.
