MLflow LLM evaluation is the process of testing and scoring a language model with MLflow, the open-source platform for managing machine learning work. It answers a question every team shipping a language model feature faces: how do you know whether this version is actually better than the last one? The central question is practical. When a prompt changes, a model is swapped or a retrieval step is retuned, MLflow runs the same test data through the new version and compares the metrics, so the decision to ship rests on recorded results rather than hand-picked examples.
MLflow is best known for tracking machine learning experiments, packaging models and managing the model lifecycle. Its language model evaluation extends that discipline to generative AI: model, metrics and evaluation data are all explicit, and every run is logged, so results can be compared across time and versions. For teams already using MLflow, that continuity is an advantage.
Key takeaways
- MLflow LLM evaluation uses mlflow.evaluate with a model, a set of metrics and evaluation data.
- Metrics fall into two kinds: heuristic scores computed by functions, and LLM-as-a-judge scores from a grading model.
- Default metric sets exist for tasks such as question answering, and custom metrics can be added.
- Results are logged as runs, with aggregate metrics and a per-row table for inspection.
- Evaluation works for single models, retrieval systems and whole pipelines, not only for chatbots.
What is MLflow?
MLflow is an open-source platform for managing the end-to-end machine learning lifecycle: experiment tracking, model packaging and deployment, and a model registry governing which versions are in use. Teams use it to record what was tried, the results, and which model serves traffic, so decisions are traceable rather than anecdotal. Evaluation is an experiment like any other: a run with parameters, metrics and artefacts, stored alongside the model it tested, so a later question about why a version shipped can be answered from the log, not from memory.
How MLflow LLM evaluation works
MLflow LLM evaluation has three components: the model to evaluate — an MLflow model, a registered model, or any Python callable, such as a text summarisation pipeline; the set of metrics to compute; and the evaluation data, which can be a data frame, a list, an array, or a dataset object.
The evaluation itself is a single call: mlflow.evaluate takes the model, the data and the metrics, runs the model over the data, and returns the results. Aggregated metrics summarise performance, and a per-row table shows each case’s score, so the team can inspect where the model failed rather than reading only the average.
Metrics can be selected in two ways: default metric sets for pre-defined tasks such as question answering, so a team can start without choosing each metric by hand, or a custom list mixing built-in metrics with ones the team writes itself. For a broader view, see our guide to building an LLM evaluation framework.
Heuristic metrics and LLM-as-a-judge metrics
MLflow provides two kinds of metric. Heuristic metrics calculate a score for each row using a function: ROUGE measures overlap between the generated text and a reference, BLEU measures a similar overlap for translation-like tasks, and readability measures include the Flesch-Kincaid grade level. These metrics are deterministic and cheap to compute.
Heuristic metrics have a clear weakness: they measure surface similarity, not meaning. An answer can be correct in different words yet score poorly on overlap, or wrong in the same words and score well. They catch obvious failures and track broad trends, but should not be the only evidence for a release decision. Our guide to LLM evaluation metrics explains where each kind of metric breaks down.
LLM-as-a-judge metrics use a language model to score output quality, judging meaning, context and nuance in a way that resembles human evaluation, while being more scalable and cost-effective than human grading. MLflow provides built-in judge metrics — answer similarity, correctness, relevance and faithfulness — and custom judge metrics can use a custom prompt, grading criteria and reference examples. For the limits of this approach, see our guide to LLM judge reliability.
Answer correctness and similarity
Answer correctness judges how factually correct an answer is, based on the ground truth provided; answer similarity judges how similar it is to a reference answer. Both need reference data, and both are most useful when the application has clear right answers. Best for: question answering and summarisation tasks where reference answers exist and factual accuracy matters.
Relevance and faithfulness
Answer relevance judges how relevant the answer is to the input question, while relevance also takes the retrieved context into account. Faithfulness judges how faithful the answer is to the context provided — the key check for retrieval-augmented applications, since an answer that goes beyond its sources is a hallucination, however fluent it sounds. Best for: retrieval-augmented generation, where answers must stay grounded in retrieved documents. Our guide to RAG groundedness evaluation covers the metrics that measure this in depth.
Toxicity, readability and other heuristic checks
MLflow also computes heuristic checks such as toxicity scores, token counts and readability grades. These are cheap, deterministic guardrails: a version that suddenly produces longer, more toxic or less readable output has changed in a way worth investigating, even if judge scores look fine. Best for: safety checks, cost tracking through token counts and spotting unexpected shifts in style.
MLflow LLM evaluation compared with other approaches
| Approach | What it does well | Main limitation | Best for |
|---|---|---|---|
| MLflow LLM evaluation | Metrics, runs and registry in one ML lifecycle platform | Less built-in tracing and prompt tooling than dedicated observability tools | Teams already using MLflow for machine learning |
| Manual spot checks | Fast and flexible for a few examples | Not repeatable or comparable | Early prototypes |
| Standalone benchmark suites | Standardised model comparisons | May not match real product tasks | Choosing a base model |
| Human review only | Trusted judgement on hard cases | Slow and costly at scale | High-stakes outputs |
| Dedicated observability platforms | Deep tracing, prompt management and online scoring | Another platform to run and learn | Teams that need full LLM observability |
The table shows where MLflow fits. Its strength is integration with the machine learning lifecycle: evaluation results sit alongside experiment runs, model versions and registry decisions, so a model’s history is in one place. Dedicated observability platforms offer deeper tracing and prompt management, suiting teams whose main need is debugging live applications — but for teams already running MLflow, its evaluation features are often enough.

Setting up an MLflow LLM evaluation workflow
Start by logging the model in MLflow, so the evaluation has a versioned artefact to test — a wrapped language model, a pipeline, or any callable that takes an input and returns an output. Record the prompt and parameters with the model or run, so results can be reproduced.
Next, build the evaluation data: a data frame with inputs and ground truth is the usual shape — questions and expected answers for question answering, documents and reference summaries for summarisation, or queries and retrieved context for retrieval systems. Twenty to fifty well-chosen rows are enough to start.
Then choose metrics: start with the default set for the task type, and add one or two judge metrics that match what matters for the product — answer correctness where facts matter, faithfulness where grounding matters, relevance where the question is often misunderstood. Run the current version first for a baseline, then run every change against the same data and compare. For a fuller treatment of this pipeline, see our guide to building an LLM evaluation pipeline.
Finally, review the per-row table, not only the averages: look at the lowest-scoring rows, decide whether each failure is real, and add genuine failures to the evaluation data as permanent test cases. Log every run, so score history shows whether the model is improving or drifting. When a version is ready, promote it through the model registry with the evaluation results attached, recording the ship decision with its evidence.
Common MLflow LLM evaluation mistakes
The most common mistake is evaluating without ground truth and then trusting the scores anyway. Judge metrics comparing against a reference need a good one; without it, they are guessing. If ground truth is hard to produce, use metrics that do not need it, and be honest about what scores can show.
The second mistake is relying on a single metric. A ROUGE score, a judge score or a toxicity score each measures one thing, and each can be misleading on its own. Use a mix of heuristic and judge metrics — when they disagree, the disagreement is often the most informative result.
The third mistake is evaluating a model in isolation from the system around it. A language model can score well on its own and still fail in production because retrieval returned poor context or a prompt was assembled wrong. Evaluate the whole pipeline end to end, and use the per-row results to find which step caused each failure.
The fourth mistake is letting evaluation data go stale. Products, users and retrieved documents all change, and a test set that is never updated gradually stops representing real usage. Refresh the data from production failures routinely.
MLflow LLM evaluation checklist
- The model is logged in MLflow with its prompt and parameters recorded.
- Evaluation data exists with twenty to fifty rows covering common requests, edge cases and past failures.
- Ground truth is provided where the chosen metrics need it.
- A baseline evaluation of the current version is recorded before any change is tested.
- At least one heuristic metric and one judge metric are used together.
- Judge metrics are validated against human judgement on a sample of cases.
- The per-row results table is reviewed, not only the aggregate metrics.
- Genuine failures are added to the evaluation data as permanent test cases.
- Every evaluation run is logged, with the model version attached.
- Model promotion in the registry cites the evaluation results as evidence.
Frequently asked questions
What is MLflow LLM evaluation?
MLflow LLM evaluation is the use of mlflow.evaluate to test and score a language model: it takes a model, a set of metrics and evaluation data, runs the model over the data, returning aggregate metrics plus a per-row table of results.
What are the two kinds of MLflow LLM evaluation metrics?
Heuristic metrics calculate scores with functions, such as ROUGE, BLEU and readability grades. LLM-as-a-judge metrics use a language model to score outputs for correctness, relevance and faithfulness, with custom prompts and criteria.
Does MLflow LLM evaluation need ground truth?
Some do and some do not. Answer correctness and answer similarity compare against reference answers, so they need ground truth. Relevance and faithfulness can be judged against the input and the retrieved context without one.
Can MLflow evaluate retrieval-augmented systems?
Yes. MLflow evaluation works for retrieval systems as well as single models, because the model evaluated can be a whole pipeline. Faithfulness and relevance metrics are particularly useful here, checking whether answers stay grounded in retrieved context.
How is MLflow LLM evaluation different from manual testing?
Manual testing tries a few examples by hand and relies on memory. MLflow evaluation runs a fixed dataset through each version, logs the metrics and per-row results as a run, and makes the comparison repeatable and reviewable by the whole team.
When is MLflow LLM evaluation the right choice?
It suits teams already using MLflow for machine learning, who want language model evaluation inside the same runs, metrics and registry workflow. Teams whose main need is live tracing and prompt management may prefer a dedicated observability platform instead.







