What Is an LLM Eval Pipeline? Why You Need One and How to Build It on Your Laptop A guide published on building LLM eval pipelines recommends starting with 20 to 50 real test cases drawn from bug trackers and support messages, then running them after every change to catch regressions that public benchmarks miss. The guide cites Anthropic's finding that CPU and memory limits on the test machine alone shifted scores on the coding benchmark Terminal-Bench 2.0 by about 6 points, and notes that on the ARC Prize leaderboard GPT-6.2 Astra scored 70.3% with a basic setup versus 99.8% with a tuned one at the same reasoning level. It describes a four-part pipeline — test cases, a runner script, code-first graders with an AI model as judge when code can't decide, and a report comparing against the last run — buildable locally with Ollama and llama.cpp. An eval pipeline is a set of test questions, a script that sends them to an AI model, and a way to score the answers. It works like unit tests for code, but for an AI feature. You can build a small one on your own laptop with Ollama and llama.cpp, and this story shows how. What an eval pipeline is Anthropic describes an eval as a test for an AI system, where you give it an input and check its output. A pipeline has four parts. Test cases are questions or tasks, each with a note on what a good answer looks like. A runner is a script that sends every case to the model and saves the answers. Graders score each answer. Simple code checks come first. Does the answer match exactly, contain the right number, or parse as valid JSON? If code can’t decide, a second AI model can act as the judge. A report shows the overall score and how it compares with the last run. A benchmark such as GSM8K is a public test set that everyone uses. A pipeline points the same idea at your own task, and you run it every time something changes. Why you need one Without tests, you hear about problems from your users. Anthropic describes the usual pattern. People say the AI feels worse after a change, and the team can only guess and check. Fixing one bug can break something else. A public benchmark does not tell you how your task will go. Hamel Husain, who writes about building AI products, says tests built around your users’ tasks measure something different from general benchmarks. Setup matters too. On the ARC Prize leaderboard, GPT-6.2 Astra scored 70.3% with a basic setup and 99.8% with a tuned one, at the same reasoning level. A new model is a change too. In Husain’s case study of a real estate assistant, progress stalled because fixing one problem created others, so the team built a proper way to test it. Anthropic says that when a new model comes out, an eval suite shows quickly what got better. You need to know whether a score is real. Anthropic found that CPU and memory limits on the test machine alone moved scores on a coding benchmark, Terminal-Bench 2.0, by about 6 points. A score without a margin of error can’t tell you if a gain is real. How to use it Collect 20 to 50 real cases. Use things that went wrong, such as your bug tracker, support messages and the checks you already do by hand. Anthropic says a small set is enough at the start, because early changes tend to have big effects. Decide how each case is scored. A good case is one where two experts would agree on pass or fail. Use a code check where you can. Run it once and save the result. That is your baseline. Change one thing. It can be the model, the prompt, a setting or the size of the model file. Run it again and compare. Look at the margin of error before you believe a difference. Keep the cases. Add a new case for every new failure, and run the set after every change. Where this helps in practice These situations are made up, but most people who build with AI run into one of them. You fix one prompt problem and break another. Say a support bot sorts messages into bug, billing and feature request. Someone edits the prompt so billing questions are handled better, and bug reports start landing in the wrong group. Nobody notices until customers complain. With a saved set of cases, the next run shows which ones flipped. A new model comes out and the headlines say it is better. Better at what? Run your own cases on the old and the new model and compare them case by case. A leaderboard can’t tell you how a model does on your messages. You want a cheaper or smaller model, maybe one that runs on your laptop so your data stays with you. Run the same cases on both. The Q4 and Q8 comparison further down is an example of this check. The demo worked, and then real users broke it. They phrase things in ways you never tried. Each time it happens, add that message as a new case, so the same failure can’t come back unnoticed. Build it on your laptop Running tests locally costs only electricity, keeps your data on your machine and lets you test something that hosted APIs hide, such as which compressed version of a model you use. Quantization shrinks a model by storing its numbers with fewer bits. A Q4 file is smaller than a Q8 file and can be a little less accurate. Ollama and llama.cpp are two popular programs that run models on your computer. Both can answer in the same format as the OpenAI API, so one script can test either. Step 1. Start the servers These commands are for a Mac with Homebrew. On Linux and Windows, install both from their websites. brew install ollama llama.cppollama serve leave it running, port 11434ollama pull qwen3.5:4b Q4 K M, 3.3 GBollama pull qwen3.5:4b-q8 0 the same model at Q8 0, 5.2 GB llama.cpp is optional. Its server, llama-server, can download a model file from Hugging Face with -hf the default size is Q4 K M , and --alias sets the model name you use in requests: llama-server -hf unsloth/Qwen3.5-4B-GGUF:Q4 K M --alias qwen3.5-4b-q4 --port 8080 On a 16 GB laptop, stay at 9B parameters or smaller. Ollama lists qwen3.5:9b at about 7 GB and gpt-oss:20b at 14 GB, which leaves little room for everything else. Step 2. Write the test cases Each case is one line of JSON, a plain text format for data. It has four parts. prompt is what the model sees, check is how to score the answer, expect is a correct answer and tag is a group name for the report. Two lines from the demo set, with the prompts shortened: {"id": "label-04", "tag": "label", "prompt": "Classify the customer message ... Message: The app crashes every time I open the settings page.", "check": "exact", "expect": "bug"}{"id": "json-01", "tag": "json", "prompt": "Extract the person, city and year ... Sentence: Grace Hopper joined the Navy Reserve in New York in 1943.", "check": "json", "expect": {"name": "Grace Hopper", "city": "New York", "year": 1943}} The check depends on the task. Four examples: Sorting support messages into groups. The expected answer is one word, such as bug, so the exact check works. It wants a word for word match. Pulling facts out of text, such as a name, a city and a year. The expected answer is a small JSON object, so the json check parses the reply and compares the fields. A math or counting question. The answer is a number, so a regex check a text pattern looks for it in the reply. Writing a summary or setting a tone. There is no single right answer, so the judge check lets a second model decide against one clear rule, such as "mentions the refund deadline". Here is what happens to one case. Take label-04, where the message says the app crashes every time the settings page opens and the prompt asks for only the label. The runner sends it to the model. Say the model replies Bug. The exact check drops the final period, ignores capital letters, gets bug and finds it equal to the expected answer, so the case passes. If the model had replied This looks like a bug report, the case would fail, even though a person would accept it. The check is strict on purpose, which is why the prompt demands a single word. The demo set has 40 cases 10 each of arithmetic word problems, JSON extraction, support ticket labels and short exact answers . It only shows how the pipeline works, and you can download all 40 cases and the script from this gist. Write your own cases from failures you have seen. Step 3. The script Save this as evals.py. It is 95 lines of standard Python, so there is nothing to install, and it works on Python 3.9 and newer checked on 3.9 and 3.12 . You can copy it as is. bash /usr/bin/env python3"""evals.py: a tiny eval runner for any OpenAI-compatible local server Ollama, llama-server ."""import argparse, json, math, re, statistics, sys, time, urllib.request python def chat base, model, prompt, temperature=0.0, seed=0, max tokens=1024, effort=None : body = {"model": model, "messages": {"role": "user", "content": prompt} , "temperature": temperature, "seed": seed, "max tokens": max tokens} if effort: body "reasoning effort" = effort "none" turns thinking off on Ollama models that allow it req = urllib.request.Request base + "/v1/chat/completions", json.dumps body .encode , {"Content-Type": "application/json"} t0 = time.time with urllib.request.urlopen req, timeout=900 as r: d = json.load r text = d "choices" 0 "message" .get "content" or "" text = re.sub r"