MLflow 3's framework for measuring GenAI/agent quality with LLM-as-a-judge scorers, evaluation datasets, human labeling, and continuous production monitoring — all on top of MLflow Tracing.
GenAI Evaluation is mlflow.genai.evaluate() running scorers (LLM-as-a-judge plus code-based) over an evaluation dataset or live traces to score quality — the Mosaic AI Agent Evaluation SDK now folded into Databricks-managed MLflow 3.
GenAI outputs are non-deterministic, so you can't unit-test them — you need graded judgment. Evaluation gives a repeatable quality signal you can use to compare agent/prompt versions, catch regressions before release, and keep watching quality in production with the same scorers.
A judge LLM grades each output. Built-in: Correctness, Guidelines, RelevanceToQuery, Safety, RetrievalGroundedness, RetrievalRelevance — most need no ground truth.
make_judge() builds a custom LLM judge from natural-language instructions; the @scorer decorator wraps any deterministic Python check (regex, latency, exact match).
UC-backed (Delta) sets of records — each an inputs dict plus optional expectations ground truth. Built from humans, documents, or production traces.
The Review App lets domain experts (SMEs) attach feedback to traces via label schemas in labeling sessions; those labels seed eval datasets and align judges.
Every eval row produces an MLflow Trace; scorers read its spans (retriever, tool, LLM), so the same judges work offline and on captured production traces.
Register a scorer to an experiment and start() it with ScorerSamplingConfig(sample_rate=...) to grade a sample of live traces continuously.
inputs + optional expectations) or captured traces feed evaluate(); predict_fn generates outputs and a trace per row.Python · mlflow[databricks]>=3.1import mlflow
from mlflow.genai.scorers import Correctness, Guidelines, Safety
results = mlflow.genai.evaluate(
data=eval_dataset, # rows: {"inputs": {...}, "expectations": {...}}
predict_fn=my_agent, # receives **inputs, returns outputs; auto-traced
scorers=[
Correctness(), # LLM judge vs expectations.expected_facts
Guidelines(name="tone", guidelines="Response must be concise and polite"),
Safety(), # no ground truth needed
],
)
# results.metrics -> aggregate scores; per-row feedback attached to each trace
mlflow.genai.evaluate(), not the old mlflow.evaluate() — and data rows use the nested {"inputs": {...}} shape, not flat columns.Correctness/ExpectationsGuidelines require expectations; RetrievalGroundedness needs a RETRIEVER span in the trace.mlflow.genai.evaluate() with scorers — built-in LLM judges like Correctness, Safety, and RelevanceToQuery, plus custom judges via make_judge() and code scorers via @scorer."Verified against docs.databricks.com · June 2026