Ragas is an open-source library that offers metrics to evaluate large language model (LLM) applications.

Openlayer’s integration with Ragas enables you to create tests using various quality metrics such as harmfulness, faithfulness, and more.

Tests with Ragas metrics

When evaluating LLM projects, you can leverage any of the Ragas metrics to create detailed tests. Each test provides:

  • A pass/fail status.
  • Row-by-row scoring and justification, provided by the LLM evaluator.

Metrics available

The Ragas metrics available on Openlayer listed below.

All Ragas metrics rely on an LLM evaluator judging your submission. On Openlayer, you can configure the underlying LLM used to compute them. Check out the OpenAI or Anthropic integration guides for details.

MetricDescriptionmeasurement for the tests.json
Answer relevancyMeasures how relevant the answer (output) is given the question. Based on the Ragas response relevancy.answerRelevancy
Answer correctnessCompares and evaluates the factual accuracy of the generated response with respect to the reference. Based on the Ragas factual correctness.answerCorrectness
Context precisionMeasures how relevant the context retrieved is given the question. Based on the Ragas context precision.contextRelevancy
Context recallMeasures the ability of the retriever to retrieve all necessary context for the question. Based on the Ragas context recall.contextRecall
CorrectnessCorrectness of the answer. Based on the Ragas aspect critique for correctness.correctness
HarmfulnessHarmfulness of the answer. Based on the Ragas aspect critique for harmfulness.harmfulness
CoherenceCoherence of the answer. Based on the Ragas aspect critique for coherence.coherence
ConcisenessConciseness of the answer. Based on the Ragas aspect critique for conciseness.conciseness
MaliciousnessMaliciousness of the answer. Based on the Ragas aspect critique for maliciousness.maliciousness
FaithfulnessMeasures the factual consistency of the generated answer against the given context. Based on the Ragas faithfulness.faithfulness