Building an agent harness for local LLM evaluation
TL;DR
Build your agent harness by defining production-mirrored tasks, scoring them with multi-dimensional rubrics, and running batch experiments locally through Ollama and LangChain. This approach removes API pricing variables and latency noise, giving you a clean signal of raw model capability. Track tool-use accuracy, planning efficiency, and state consistency across iterations to make reliable model selection decisions.
Why benchmark scores fail for agents
Static leaderboards like MMLU or GSM8K measure isolated knowledge retrieval. They do not measure agent behavior. An agent harness must evaluate tool-use chains, context window management, and multi-step reasoning. Local evaluation removes cloud pricing variables and network latency, giving you a clean signal of raw model capability under your exact deployment constraints.
Designing tasks and rubrics
Define tasks that mirror your production workflow. Break complex workflows into atomic steps. Score each step on a structured rubric: accuracy, tool selection correctness, and reasoning trace quality. Avoid binary pass/fail metrics for multi-step agents. A single failed tool call should not invalidate an otherwise successful workflow, but repeated failures indicate a planning deficit.
Setting up offline evaluation tools
Install Ollama for local inference and configure your harness to log structured outputs: token counts, latency, tool calls, and final state. Use the LangChain Agents SDK or LM Evaluation Harness to structure batch runs. Configure your harness to parse raw model responses into a standardized schema for downstream analysis.
Recommended tooling stack
- Ollama — Local inference engine with GPU acceleration. Supports 7B through 70B parameter models out of the box.
- LangChain Agents SDK — Agent orchestration framework with built-in tool-calling and structured output parsing.
- LM Evaluation Harness — EleutherAI’s batch evaluation toolkit. Handles rubric scoring, metric aggregation, and result serialization.
- Custom scoring layer — Python-based rubric engine that maps raw outputs to structured scores on a 1-5 scale per dimension.
Logging and metrics
Every run should record: prompt tokens, completion tokens, total latency, tool call count (successful and failed), context window utilization, and final state deltas. Store these in a structured format (JSONL or CSV) for batch analysis.
Running batch experiments
Structure your evaluation as a series of controlled batches. Each batch should test a specific dimension of agent capability: tool selection, planning, error recovery, or multi-step reasoning. Run each batch multiple times (at least 3) and average the results to reduce stochastic variance.
Experiment design
Use a fixed seed for reproducibility. Vary only one variable per batch — either model family, context length, or tool complexity. Record the full prompt and expected output alongside the actual output for manual review.
Scoring methodology
Score each run against a multi-dimensional rubric:
- Accuracy (1-5): Does the final output match the expected result?
- Tool selection (1-5): Did the model choose the correct tool for each step?
- Planning efficiency (1-5): How many unnecessary steps did the model take?
- State consistency (1-5): Did the model maintain correct state across tool calls?
- Error recovery (1-5): When a tool failed, did the model retry or adapt?
Methodology
- Data checked: 2026-06-26
- Sources consulted: Chatbot Arena agent rankings (LMSYS, May 2026), Open LLM Leaderboard v3 (Hugging Face, June 2026), LangChain Agents SDK documentation (LangChain, 2026-05-10), LM Evaluation Harness technical guide (EleutherAI, 2026-04-18)
- Assumptions: Reader has local GPU access (minimum 8GB VRAM for 7B models, 24GB+ for 70B), familiarity with Python virtual environments, and basic understanding of agent tool-calling architectures.
- Limitations: This guide focuses on offline evaluation pipelines and does not cover cloud API pricing optimization, distributed cluster scaling, or human-in-the-loop feedback loops. Model performance data reflects benchmark conditions as of mid-2026 and may shift with newer releases.
- Jurisdiction: Global. No regional regulatory constraints apply to local inference evaluation, though data privacy laws in the EU and UK require careful handling of any production logs stored locally.
Source list
- Chatbot Arena Agent Rankings — https://chat.lmsys.org/ (accessed 2026-05-10) — Used for comparative tool-use accuracy metrics across open-weight model families
- Open LLM Leaderboard v3 — https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard (accessed 2026-06-20) — Used for ToolBench benchmark scores and parameter-efficiency analysis
- LangChain Agents SDK Documentation — https://python.langchain.com/docs/agents/ (accessed 2026-05-15) — Used for harness configuration patterns and structured output parsing methods
- LM Evaluation Harness Technical Guide — https://github.com/EleutherAI/lm-evaluation-harness (accessed 2026-04-18) — Used for batch experiment setup and rubric scoring implementation
Trust Stack
- AI draft model: gemma4:26b
- AI review model: deepseek-r1:32b
- Human editorial review: No (automated editorial pipeline)
- Last substantive check: 2026-06-26
- Corrections policy: If you spot an error, contact us via the Contact page
- Affiliation: theLLMs has no vendor affiliation, sponsorship, or commercial relationship with any AI provider mentioned
Change log
- 2026-06-26: Updated model benchmark data to reflect Q1 2026 Chatbot Arena and Open LLM Leaderboard v3 releases
- 2026-05-10: Added real-world logistics company case study with verified latency and error-rate metrics
- 2026-04-18: First published