Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ produced and auto-detects the shape. First-class adapters today:
- **Ragas** result export (one RAG pipeline per run - pass two files to compare)
- **OpenAI Evals** (`openai/evals`) `.jsonl` log (one model per run - pass two files to compare)
- **HELM** per-instance results (`per_instance_stats.json`) (one model per run - pass two files to compare)
- **Lighteval** (Hugging Face) JSON per-sample details export (convert Parquet first; one model per run - pass two files to compare)
- **MLflow evaluate** `eval_results_table` export (one model per run - pass two files to compare)
- **lm-eval** (`lm-evaluation-harness`) sample logs (`.jsonl`)
- **Nested JSON** - `{"models": [...], "examples": [{"id", "scores": {...}}]}`
Expand Down
36 changes: 36 additions & 0 deletions docs/adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,42 @@ The most valuable fixture is one derived from a genuine export of the tool. If y
have a real sample file, base the test on it - that is how we make sure the
adapter matches reality and not an assumption.

## Lighteval (Hugging Face)

Supports JSON representations of Lighteval per-sample details, with tolerance
for optional fields. Each record has:

- a document (`doc` or `__doc__`): `query`, `choices`, `gold_index`, and usually
`id` / `task_name`
- a metric dict (`metric` or `__metric__`): sample-level metric names to scores
- a model response (`model_response` or `__model_response__`, optional):
generations / logprobs

Both the column names observed in recent official reference Parquet exports
(`doc` / `metric` / `model_response`) and the underscore-prefixed names in the
current public Hugging Face documentation (`__doc__` / `__metric__` /
`__model_response__`) are accepted. Native Parquet files are not read directly;
convert them to this JSON shape first.

Normalization rules for this adapter:

- Invalid, null, or unparseable metric values are ignored (not raised).
- Standard-error fields such as `*_stderr` are ignored.
- Valid metrics preserve input order when fanning out into a suite.
- Conflicting aliases (for example unequal `doc` and `__doc__`) are treated as
malformed and skipped.
- `skipped_rows` counts skipped input rows, not individual metric fields.

Example IDs are preserved as `task_name:id` when `task_name` is present.
Multiple metrics fan out into a suite; the single-audit path prefers common
correctness metrics such as `acc` / `exact_match` / `em`.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

**Limitation:** the aggregate `results_{timestamp}.json` file
(`config_general`, `results`, `config_tasks`, …) contains only task-level
summaries. EvalTrust detects that shape and raises a clear error rather than
fabricating per-example rows. Convert details Parquet to the JSON detail shape
above (or export a details list) before auditing.

## Single-model tools

If a tool evaluates one model per run, you don't need anything special: parse it
Expand Down
37 changes: 35 additions & 2 deletions docs/input-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,39 @@ path picks a correctness metric (`exact_match`, `quasi_exact_match`, ...).
HELM's bookkeeping stats (`num_trials`, `num_prompt_tokens`, `finish_reason_*`,
...) are dropped so a suite audit only holds real quality metrics.

### Lighteval (Hugging Face)

EvalTrust accepts JSON representations of Lighteval per-sample details (a list
of records, or a task-keyed dict of those lists). Each record has a document
(`doc` or `__doc__`, with `query` / `choices` / `gold_index`, and usually `id` /
`task_name`), a metric dict (`metric` or `__metric__`), and optionally a model
response (`model_response` or `__model_response__`). Both the names observed in
recent official reference Parquet exports and the underscore-prefixed names in
the current public Hugging Face documentation are supported. Native Parquet is
not read; convert `details_*.parquet` to this JSON shape first. Detection is
structural, never by filename.

Normalization rules for this adapter:

- Invalid, null, or unparseable metric values are ignored (not raised).
- Standard-error fields such as `*_stderr` are ignored.
- Valid metrics preserve input order when fanning out into a suite.
- Conflicting aliases (for example unequal `doc` and `__doc__`) are treated as
malformed and skipped.
- `skipped_rows` counts skipped input rows, not individual metric fields.

A Lighteval run covers one model, so compare two details exports:

```bash
evaltrust audit lighteval_details_a.json lighteval_details_b.json
```

**Limitation:** the aggregate `results_{timestamp}.json`
(`config_general` / `results` / `config_tasks`) has only task-level summaries.
EvalTrust detects that shape and raises a clear error rather than inventing
per-example rows. Convert `details_*.parquet` to the JSON detail shape above
before auditing.

### Nested JSON

A structured object with a list of examples, each carrying per-model scores:
Expand Down Expand Up @@ -311,8 +344,8 @@ without a `metric` column is treated as a single metric, exactly as before. See
## Single-model tools (two-file comparison)

Some tools - DeepEval, Langfuse, LangSmith, Ragas, OpenEvals, Inspect, HELM,
OpenAI Evals - evaluate one model per run, so a single export contains only one
model. Run each model, then pass both files:
Lighteval, MLflow evaluate, OpenAI Evals - evaluate one model per run, so a
single export contains only one model. Run each model, then pass both files:

```bash
evaltrust audit gpt4_run.json claude_run.json
Expand Down
Loading