llm-testing

Installation
SKILL.md

LLM Testing

This machine already has MLflow tooling for parts of this

For trace instrumentation and scored evaluation runs, use an evaluation toolkit such as MLflow, promptfoo, DeepEval or LangSmith (see ai-agent-evaluation and rag-evaluation-testing). This skill covers the testing methodology; those tools cover the execution mechanics.

What's fundamentally different from classical software testing

Non-determinism (same input can produce different output) and no single "correct" output for open-ended generation — you're testing distributions and properties, not exact-match assertions, most of the time.

Evaluation approaches

  • Golden dataset with reference answers: for tasks with a knowable correct answer (extraction, classification via LLM, structured output), compare against references using exact match, semantic similarity (embedding cosine similarity), or a rubric.
  • LLM-as-judge: use a second LLM call to score the output against a rubric (relevance, correctness, tone) when no single reference answer exists — but validate the judge itself against human-labeled examples periodically, since a miscalibrated judge silently produces meaningless scores. See mlflow:build-a-scorer.
  • Human evaluation: still the ground truth for subjective quality — sample a subset for human review even when automated scoring runs at scale, to catch judge drift.

Core properties to test

  • Faithfulness/groundedness (especially for RAG): does the answer only state what's actually supported by the retrieved/provided context, or does it add unsupported claims? Test by deliberately checking claims against source documents, not just "does it sound plausible."
  • Hallucination: probe with questions where the honest answer is "I don't know" or "not in the provided context" — a model that confidently fabricates rather than admitting uncertainty is a specific, testable failure mode.
  • Consistency: same/paraphrased input should produce semantically consistent output across repeated calls — flag if answers meaningfully contradict each other across runs on the same question.
  • Instruction adherence: does it actually follow format constraints (JSON schema, length limits, required fields)? Validate programmatically (schema validation), don't eyeball it.
  • Context handling / long-context: for long-context use cases, test "needle in a haystack" style — put a specific fact at various positions in a long context and confirm retrieval doesn't degrade in the middle (a documented failure mode across many models).
Installs
3
GitHub Stars
4
First Seen
Oct 24, 2026