Python harness for evaluating prompt variants against a labeled customer-support triage dataset.
It stays focused on the evaluation loop itself: a labeled task, prompt comparison, deterministic scoring, saved artifacts, and a regression check. The repo is runnable with the included mock provider, and there is also an optional OpenAI-backed path for live model calls.

Given a short customer message, the model must return JSON with:
category: one ofbilling,technical,account_access,sales,otherurgency: one oflow,medium,highshould_refuse: booleanreply_tone: one ofempathetic,neutral,firmresponse: short customer-facing reply
The harness evaluates two prompt variants on the same labeled dataset.
This version includes the harness, an offline labeled dataset, prompt files, saved run artifacts, and a regression workflow against a committed baseline artifact.
- A labeled dataset with 24 customer-support cases covering straightforward requests, ambiguous cases, adversarial attempts, and refusal-required requests
- Two prompt variants evaluated side by side
- Deterministic scoring for category, urgency, format, tone, and refusal behavior
- Saved run artifacts with prompt-level summaries and case-level outputs
- A regression script that compares a selected artifact against a committed baseline artifact
- A web UI or dashboard
- A database, hosted observability stack, or experiment tracker
- Judge-model scoring
- CI wiring for the regression script
- A large benchmark corpus
- Latency or token-cost analytics
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
copy .env.example .env
python scripts\run_eval.py --provider mock
python scripts\validate_dataset.py
python scripts\check_regression.py --artifact results\runs\20260707_101729\artifact.json --baseline data\baseline_artifact.json --prompt prompt_v2To run against an API-backed model, set OPENAI_API_KEY in .env and use:
python scripts\run_eval.py --provider openai --model gpt-4o-minidata/labeled dataset and committed baseline artifactprompts/prompt variantssrc/prompt_eval_harness/harness coderesults/local eval runsscripts/runnable entry points
- Check a specific saved artifact against the committed baseline with:
python scripts\check_regression.py --artifact results\runs\20260707_101729\artifact.json --baseline data\baseline_artifact.json --prompt prompt_v2- The regression script compares the selected prompt's aggregate metrics and the case-level
passed,format_correct,refusal_correct, andtone_correctfields.
- Validate dataset structure and coverage sanity with:
python scripts\validate_dataset.py- The dataset is intentionally small but covers a diverse set of cases.
- The included
mockprovider makes the project runnable without paid API access. - The committed baseline artifact provides a known-good prompt_v2 reference in the repo.