Lightweight LLM-as-judge evaluation CLI — score model outputs on 5 dimensions and compare runs (OpenAI / OpenRouter / Ollama)
Project description
OpenEval
A lightweight LLM-as-judge evaluation tool. It takes a dataset of question/answer pairs, has a strong "judge" model score each answer across 5 dimensions, and compares two runs to show the before/after delta. Works with OpenAI, OpenRouter, or a local Ollama model.
Install
pip install openeval-llm
The distribution name is
openeval-llm; the import and command name isopeneval.
Quickstart (CLI)
Score a JSONL dataset — one {"question", "answer", "context"} object per line:
# With a local Ollama judge (free, private)
openeval run cases.jsonl --judge-provider ollama --judge-model llama3.2
# ...or OpenAI / OpenRouter (put the API key in .env)
openeval run cases.jsonl --judge-provider openai --judge-model gpt-4o-mini
Output — per-dimension averages, token/cost/latency, and provenance (judge, dataset, timestamp):
Results — cases
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Dimension ┃ Avg Score ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ faithfulness │ 0.73 │
│ relevance │ 0.93 │
│ overall │ 0.85 │
└───────────────┴───────────────┘
Before / after comparison
Run the same system two ways (e.g. a feature on vs off), then compare:
openeval compare reports/report_before.json reports/report_after.json
Dimension before after Δ
faithfulness 0.71 0.88 +0.17
overall 0.70 0.85 +0.15
The 5 dimensions
| Dimension | Measures | Weight |
|---|---|---|
| faithfulness | Is the answer factually correct? | 0.30 |
| relevance | Does it address the question? | 0.30 |
| clarity | Is it clear and well-explained? | 0.20 |
| safety | Is it safe / non-harmful? | 0.10 |
| consistency | Is it internally consistent? | 0.10 |
overall is the weighted average — faithfulness and relevance dominate.
Python API
from openeval.connectors.ollama_connector import OllamaConnector
from openeval.dataset import load_cases
from openeval.eval.evaluator import Evaluator
cases = load_cases("cases.jsonl")
evaluator = Evaluator(judge_connector=OllamaConnector(model="llama3.2"))
report = evaluator.run(cases)
print(report.avg_overall)
Highlights
- Crash-proof judge: survives when the judge wraps its answer in
```jsonfences, adds preamble, or omits a dimension (JSON extraction + neutral defaults + retry on transient errors). - Judge ≠ subject: pick a judge stronger than the system that produced the answers; OpenEval scores pre-generated answers, so it never runs the subject.
- Provenance in every report: judge model, dataset, and timestamp are recorded for reproducibility.
- Local = free: Ollama models are billed at $0.
Ollama setup
brew install ollama # macOS
ollama pull llama3.2
ollama serve
Dashboard (optional)
streamlit run openeval/report/dashboard.py
Project layout
openeval/
├── connectors/ # model providers (OpenAI / OpenRouter / Ollama)
├── dataset.py # JSONL loader
├── eval/ # main evaluation flow (Evaluator)
├── judge/ # the scoring LLM-judge logic
├── compare.py # before/after comparison
├── cli.py # `openeval run` / `openeval compare`
├── observability/ # logging, token/cost/latency, optional Langfuse
└── report/ # report helpers + Streamlit dashboard
See docs/ARCHITECTURE.md for a deeper walkthrough.
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openeval_llm-0.1.0.tar.gz.
File metadata
- Download URL: openeval_llm-0.1.0.tar.gz
- Upload date:
- Size: 141.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
669607faf92551e11d88aed5aed3b1376adfb8eaa668da1a59a3cdaec3326785
|
|
| MD5 |
376f76cf23cfac287645548d1b2456d4
|
|
| BLAKE2b-256 |
08ce4263e9073f949fe4619b657854b62016f1d058dff17c20267400ecb7c38e
|
Provenance
The following attestation bundles were made for openeval_llm-0.1.0.tar.gz:
Publisher:
publish.yml on EceDalpolat/openeval
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openeval_llm-0.1.0.tar.gz -
Subject digest:
669607faf92551e11d88aed5aed3b1376adfb8eaa668da1a59a3cdaec3326785 - Sigstore transparency entry: 2136402903
- Sigstore integration time:
-
Permalink:
EceDalpolat/openeval@7ac33cbbb260a89e62b06bb53693ce71251375a7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/EceDalpolat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7ac33cbbb260a89e62b06bb53693ce71251375a7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file openeval_llm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openeval_llm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
154c919d00927fae7f2eeab270178233c64ba8dc6fbb4f7eeb936309b80fa95c
|
|
| MD5 |
a5f59b8299840d5ff1329fba784d049a
|
|
| BLAKE2b-256 |
7d0a1ccb44c46ba030fa03811d758a00bd27e4b02fb24042193e4348dfd8f382
|
Provenance
The following attestation bundles were made for openeval_llm-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on EceDalpolat/openeval
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openeval_llm-0.1.0-py3-none-any.whl -
Subject digest:
154c919d00927fae7f2eeab270178233c64ba8dc6fbb4f7eeb936309b80fa95c - Sigstore transparency entry: 2136402936
- Sigstore integration time:
-
Permalink:
EceDalpolat/openeval@7ac33cbbb260a89e62b06bb53693ce71251375a7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/EceDalpolat
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7ac33cbbb260a89e62b06bb53693ce71251375a7 -
Trigger Event:
release
-
Statement type: