# Eval Dataset Forge

> Build LLM eval and fine-tune datasets your agent drafts and scripts prove. Validate against a schema, remove exact and near duplicates, split train/val/test with 0 leakage, catch benchmark questions in training data, find coverage gaps, export OpenAI chat JSONL. Python stdlib only.

Eval Dataset Forge is a paid AI agent skill on Agensi by Hale Sinclair, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $9.99 (one-time purchase)
- Creator: [Hale Sinclair](https://www.agensi.io/creators/hale-sinclair)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-12-01
- Security: scan passed (2026-12-01); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/eval-dataset-forge
- Tags: llm-ops, testing, database, evals, eval-dataset, fine-tuning, deduplication, data-leakage

## About this skill

### The problem
An eval set is only as good as its cases. Hand-written and generated sets share the same faults:
- the same question appears twice, once in lower case or slightly reworded;
- a reworded copy lands in both train and test, so the score is inflated;
- a public benchmark question sits inside a training prompt;
- one label has 40 cases while another has none;
- a field is missing or holds a value no one declared.
These faults are invisible when you read a JSONL file by eye.

### What it does
Your agent does the judgment work. It writes a taxonomy, sets difficulty levels and drafts cases, including the negative and edge cases teams skip: key-word traps, out-of-scope requests, unauthorised requests, instructions aimed at the system, and empty input.
Six standard-library Python scripts then measure the result and name every finding by its file line:
- **validate.py**: schema checks with 12 error codes and 4 warning codes (missing field, wrong type, enum, length, range, pattern, duplicate id, control characters, mojibake, BOM, and more), for JSONL, CSV or TSV.
- **dedup.py**: exact duplicates after normalisation (case, width, punctuation, whitespace) and near duplicates by character-shingle Jaccard, grouped into clusters, with `--out DIR` for the deduplicated file and a JSON report.
- **split.py**: a seeded, stratified train/val/test split. Duplicate clusters (exact, near, and a record quoted inside a longer one), and records that share a `--group-field` such as a source document, always land in one split.
- **leakage.py**: overlap between train and test, or against a benchmark file: exact, near, and contained (one text pasted inside a longer one, in either direction: a test question inside a longer prompt, or the reverse). `--out DIR` writes the training file without the leaked records, and a JSON report.
- **stats.py**: counts, cross tables and length percentiles, with GAP, IMBALANCE, RARE, UNDECLARED and MISSING warnings against your taxonomy.
- **export_openai.py**: OpenAI chat fine-tuning JSONL. `--check` validates any such file against 9 format errors.

Each script is one file that needs no other file of the package, so it runs alone as Agensi delivers it. Each prints its report and writes files only when given `--out`. No script overwrites a file it reads: an output path that is one of its inputs is refused (exit 2).

### What the check run proves
- **Automated de-duplication that is exact, not sampled.** The similarity join returned exactly the pairs an all-pairs brute force finds, over 3.0 million pairs on GSM8K and TruthfulQA (0 missed, 0 extra).
- **Measured recall on public data.**
  - 45 copies planted in GSM8K test (case, punctuation, full-width, reworded, reordered): all 20 exact and all 25 near copies found, 0 false pairs.
  - 12 GSM8K test questions planted in the training set, 3 of them inside a longer prompt: all 12 found with the right kind. Comparing 7485 x 1319 records took 4.2 s in the recorded run.
- **Findings in the published files themselves.**
  - GSM8K: 4 training questions overlap 3 test questions.
  - GSM8K test: 1 near-duplicate pair (lines 419 and 559).
  - TruthfulQA.csv: 2 rows with an empty Source.
- **Splits that cannot leak duplicates.** 0 groups straddled splits, every stratum was within 1 record of its target, and the same seed gave byte-identical files. leakage.py, with containment on and the split's own setting, found 0 exact, near or contained pairs between the splits.
- **The case-design method** in references/case-design.md: taxonomy first, difficulty defined in writing, at least one case of each negative type, and how to judge each kind of finding.

Its similarity is character-shingle Jaccard, not embeddings, and it is not a benchmark runner.

### How it works
1. The agent writes taxonomy.json and schema.json, then drafts cases.jsonl with positive, negative and edge cases per label.
2. validate.py, dedup.py and stats.py report errors, duplicate clusters and empty cells, each with its line number.
3. The agent decides per finding: fix it, drop it, keep it as a deliberate minimal pair, or fill the gap. Then it runs the checks again.
4. split.py splits the clean set with a fixed seed. leakage.py, run with the same setting, finds 0 overlap between the splits (exact, near or contained) and checks against any benchmark you name.
5. Optionally, export_openai.py writes chat fine-tuning JSONL and checks its format.
Everything runs locally on Python 3.9+ standard library. There is no network access, no model call, and nothing to install.

### Use cases
- Write a 40-200 case regression eval for a prompt, classifier, RAG system or agent.
- Clean a fine-tuning set before you pay for training.
- Check whether training data contains questions from GSM8K or another benchmark you report.
- Make a reproducible train/val/test split that keeps templates and source documents together.
- Find the labels and case types your test set never covers.

### Known limitations
- Similarity is character-shingle Jaccard (and containment), not embeddings. A paraphrase that shares little wording, or a translation, is not caught.
- With default settings on short questions, only 10 of 25 one-word rewrites were found. The short-text setting (`--k 3 --threshold 0.6`) found 25 of 25, but it also reports template siblings for you to judge.
- Near duplicates join into clusters by chains (A~B and B~C put A and C together). In a set built from templates, one cluster can hold many siblings that are not copies, so the skill reviews cluster sizes before anything is dropped.
- With the short-text setting, split.py also keeps contained pairs together, and short texts chain into large groups: on TruthfulQA the largest group held 98 of 790 questions (the split prints its largest group; strata still came within 1 record of target).
- It does not run your model or score outputs, and it has no tokenizer or cost estimate.

## Requires

- Python 3.9+

No accounts, API keys or services.

## Known limitations

Similarity is character-shingle Jaccard (and containment), not embeddings: a paraphrase with little shared wording, or a translation, is not caught. On short questions the default setting found 10 of 25 one-word rewrites; the documented short-text setting (--k 3 --threshold 0.6) found 25 of 25, and it also lists template siblings for review. Clusters join by chains, so in a templated set the skill reviews cluster sizes before dropping anything; with the short-text setting split.py keeps contained pairs together too, and on TruthfulQA its largest group held 98 of 790 questions. It does not run models or score outputs, and it has no tokenizer.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Eval Dataset Forge skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Does it use embeddings?

No. It uses character-shingle Jaccard, computed exactly: on 3.0 million pairs it returned exactly what an all-pairs brute force finds. That catches copies that differ in case, punctuation, width, a few words or word order. A paraphrase with little shared wording is not caught. references/similarity.md shows which cases it catches and which it misses.

### Will it write the test cases for me?

Your agent drafts them, following the workflow in SKILL.md and references/case-design.md: taxonomy first, three difficulty levels, and negative and edge cases for every label. The scripts then check what was drafted.

### What formats does it read?

JSONL, CSV and TSV, including nested JSON fields (`a.b`) and OpenAI chat `messages` files. Line numbers in every report are the physical lines of your file.

### Does it run my model or compute accuracy?

No. It builds and checks the dataset. You run it in your own harness or eval tool.

### Does any data leave my machine?

No. The scripts make no network calls and read only the files you name.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
