eac: Evals-as-Code
eac lets you write evals, then run them and judge the results with a single CLI.
eac provides SDKs for Python to write evals (more languages coming soon).
You create three things:
- A runner that runs your system you want to evaluate.
- Some cases to run it on.
- Judges that score the output of each case.
eac handles everything else: setting up fixtures, running cases, scoring the results and saving the run so you can look at it later.
Offline and online
Offline evals run your system on cases you wrote. Use them in development and CI to catch regressions or drive improvements.
Online evals score what your system did in production. eac collects recent production runs as cases and judges them.
Both offline and online evals in eac use the same judges, so scoring is consistent.
Why eac?
- Language-agnostic. You write your evals code in any SDK eac supports. eac handles the rest.
- Evals live with your code. A dataset is a
dataset.ymlplus some code, anywhere in your repo. - Your results stay yours. Each run is just a folder of JSON, process the results however you want.
- Phases are separate commands. Seed in one CI job and judge in another, or re-judge an old run without running it again.
Quick start
Set up a project and run a first eval. It takes about five minutes.
Install
Install the CLI on macOS or Linux:
curl -fsSL https://eac.sentry.dev/install | bashIt puts eac in ~/.local/bin. To pick another directory or a specific release:
curl -fsSL https://eac.sentry.dev/install | EAC_INSTALL_DIR=/usr/local/bin EAC_VERSION=0.1.0 bashTo build from source instead, run make install in the repo (needs Rust 1.87+).
Then install the SDK into the environment your evals run in:
pip install eac-sdk # needs Python 3.11+Add a dataset
Each dataset gets its own folder, anywhere in your repo. eac finds it on its own, so there's no project config to write:
evals/chat/
dataset.yml
dataset.pyThe dataset.yml tells eac where your code is:
name: chat
runtime: python
offline:
runner: ./dataset.py:ChatRunner
cases: ./dataset.py:CASESThen write the runner, a judge and the cases:
from eac import Case, Judge, OfflineRunner, Score
def reply(query: str) -> str:
return "hello there" # call your system here
class ChatRunner(OfflineRunner):
def run_case(
self,
case: Case,
*,
conversation_id: str,
) -> dict[str, Any]:
return {"response": reply(case.input["query"])}
class Greets(Judge):
name = "greets"
def judge(
self,
case: Case,
*,
agent_trace: Any = None,
) -> Score | None:
ok = "hello" in case.run_results.get("response", "")
return Score(name=self.name, score=1.0 if ok else 0.0)
CASES = [Case(name="greets", input={"query": "hi"}, judges=[Greets()])]Run it
From the root of your repo:
eac list # see what eac found
eac offline run # seed, execute and judgeThat's it. The results are saved in .eac/runs/<id>/.
Changed a judge? Run eac offline judge to re-score the last run without running your system again.
For a real agent with seeds, an LLM judge and online evals, see examples/sentry-assistant-python. Given an alert, its agent searches Sentry and the app's code, and reports which issue is behind it and what to fix. The samples in the rest of these docs come from it.
Next, read how eac works.