LLM Evaluation for Production Workflows
An AI feature is not ready because the model gave one good answer. It is ready when the team can explain how it behaves across the tasks that matter.
That means evaluating the whole workflow, not only the model. Retrieval, prompts, tools, validation, retries, and handoff rules all change the result a user sees.
Start with a task contract
Every evaluation case should describe a real task and what “good” means. Keep the first version small enough for the team to read and change.
{
"name": "summarize_support_thread",
"input": "A customer reports that a payment failed twice.",
"must_include": ["the failure", "the next safe action"],
"must_not_include": ["an invented refund", "private account data"],
"expected_action": "ask for the transaction reference"
}
The contract does not need to predict the exact words the model will use. It needs to describe the useful outcome, the unsafe outcome, and the point where the system should ask a person for help.
This also makes the evaluation useful to people who do not work on prompts. A product manager can review the task. An engineer can automate the checks. An operator can understand why a case failed.
Build a small but difficult set
Ten good cases can reveal more than a large set of vague examples. Start with cases from real product work and include different failure shapes:
- a normal request with enough context;
- an incomplete request where the system should ask a question;
- a retrieval miss or stale document;
- a tool timeout or invalid tool response;
- a request that needs a safe refusal;
- a repeated request that must not create duplicate work;
- a long input that tests limits;
- a case where the correct result is a human handoff.
Do not hide hard cases because they make the score look worse. A difficult case is useful evidence. It shows where the workflow needs a better prompt, stronger validation, clearer product copy, or a human path.
Score the behavior, not just the words
Exact-match tests work for a few structured outputs. Most AI workflows need a rubric instead. Score the dimensions that matter for the task:
- Correctness: did the result answer the task using the available evidence?
- Completeness: did it include the facts and actions the user needs?
- Safety: did it avoid invented facts, unsafe actions, and private data?
- Structure: can the next part of the system parse and use the result?
- Tool choice: did it call the right tool, or correctly choose not to call one?
- Handoff: did it stop when the system could not safely decide?
A simple 0, 1, or 2 score is often enough to start. The important part is to write down why a case received its score. A score without an explanation is hard to improve.
Separate checks from judgment
Use automatic checks for things that are clear:
- required fields exist;
- JSON parses;
- links use an allowed host;
- a tool was called at most once;
- latency and cost stay below a known limit;
- a refusal or handoff marker is present when required.
Use human review for meaning, tone, and edge cases. A model-based judge can help sort a large set, but it should not become the only source of truth. Review a sample by hand and compare the judge with the human rubric before trusting it for release decisions.
Run regression checks when the system changes
AI behavior can change when the model, system prompt, retrieval query, documents, tool schema, orchestration, retry logic, output validation, or product instruction changes.
Store each evaluation result with the workflow version, model, prompt version, retrieval version, and timestamp. Then a release can answer a simple question: which cases improved, which cases regressed, and why?
Run a small fast set in development or continuous integration. Run the broader set before a meaningful release. Add a new case whenever a real failure teaches the team something that the old set could not see.
Trace the complete path
The model call is only one step in an AI request. A useful trace follows the whole path:
HTTP request -> queue job -> retrieval -> model call -> tool call -> database
Record the identifiers that connect those steps. With one trace, an engineer should be able to see whether the request failed because of a timeout, a retrieval miss, a bad tool response, a validation error, or an unsafe result.
My note on reliable AI systems covers workflow state, bounded retries, and visible failure paths in more detail.
A practical release checklist
- Do the cases represent real user tasks?
- Do they include incomplete input, tool failure, unsafe requests, and handoff?
- Can the system explain why a case passed or failed?
- Are deterministic checks separate from human judgment?
- Is every result tied to a workflow version?
- Will a repeated request avoid duplicate side effects?
- Can an operator follow the request from the API to the final result?
Useful LLM evaluation is not a one-time benchmark. It is a small, living safety net around the workflow people depend on.
I build and document applied AI, backend, and cloud systems from Lagos. See the selected work, GitHub projects, Hugging Face profile, LinkedIn profile, Upwork profile, and X profile, or return to oduonye.com.