Back to cheat sheet hub

LLM Evaluation Cheat Sheet

A testing-first reference for evaluating LLM behavior, including correctness, safety, groundedness, and regression tracking.

AI Module 6 Evaluation CI-ready checks

Main rule

Treat AI output like a product behavior that must be tested, measured, and regressed safely.

Use it for

Prompt validation, RAG quality, hallucination checks, and AI workflow regression in CI.

Default habit

Keep a small evaluation dataset before trusting improvements.

Pair it with

Use this with AI basics, RAG, and AI test generation.

What to Evaluate

Evaluation starts with explicit quality dimensions.

- correctness
- relevance
- completeness
- groundedness
- safety
- consistency

Hallucination Checks

Ask whether the model invented facts or exceeded the available evidence.

Good check:
Can this answer be supported by the source context?
If not, mark it as hallucinated or unsupported.

Structured Output Validation

Evaluate whether the response matches the expected schema as well as the meaning.

Check:
- required fields exist
- field types are correct
- enums are valid
- business rules still hold

RAG Evaluation

RAG systems need retrieval and answer quality checks, not just final-output review.

Key checks:
- context relevance
- groundedness
- answer relevance

DeepEval

Useful for test-style LLM evaluations embedded into code-based workflows.

Good for:
- metric-based evaluation
- regression suites
- code-driven checks
- CI integration

PromptFoo

Useful for prompt comparison, model comparison, and output quality benchmarking.

Good for:
- comparing prompts
- comparing models
- scoring answer quality
- config-driven runs

Trulens

Strong when you need observability and deeper RAG-specific introspection.

Good for:
- RAG tracing
- retrieval debugging
- groundedness analysis
- pipeline observability

Evaluation Dataset

Even a small curated set of examples is better than trusting vibes.

Include:
- representative happy paths
- edge cases
- known failure cases
- tricky ambiguous inputs
- unsafe prompts

CI Integration

Run evals like any regression suite and fail builds only on meaningful thresholds.

- nightly evaluation run
- prompt change checks
- score thresholds
- trend tracking
- artifact output for review