eac is a command line tool & SDKs to write evals for AI systems. It handles fixtures, running and judging your AI system, all configurable through code.
Warning
eac is an early release, used internally at Sentry. There may be breaking changes in the future.
curl -fsSL https://eac.sentry.dev/install | bash # the CLI, on macOS or Linux
pip install eac-sdk # the SDK, needs Python 3.11+To build the CLI from source instead, run make install in the repo (needs Rust 1.87+).
Add a dataset.yml and the code it points to, anywhere in your repo.
# evals/chat/dataset.yml
name: chat
runtime: python
offline:
runner: ./dataset.py:ChatRunner
cases: ./dataset.py:CASES# evals/chat/dataset.py
from eac import Case, Judge, OfflineRunner, Score
def reply(query: str) -> str:
return "hello there" if query == "hi" else "see you later" # call your AI agent 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_judge"
def judge(
self,
case: Case,
*,
agent_trace: Any = None,
) -> Score | None:
response = case.run_results.get("response", "")
if "hello" in response:
return Score(name=self.name, score=1.0)
return Score(
name=self.name,
score=0.0,
explanation=f"no greeting in {response!r}",
)
CASES = [
Case(name="greeting", input={"query": "hi"}, judges=[Greets()]),
Case(name="goodbye", input={"query": "bye"}, judges=[Greets()]),
]eac seeds fixtures, runs each case, judges the output and prints the results.
eac offline run --dataset chatRESULTS
+------------------+----------------+----------+
| Case | Status / score | Duration |
+==================+================+==========+
| chat/greeting | PASSED | 0.00s |
| └ greets_judge | 1 | |
| chat/goodbye | FAILED | 0.00s |
| └ greets_judge | 0 | |
+------------------+----------------+----------+
Below 1
chat/goodbye › greets_judge: no greeting in 'see you later'
2 cases 1 passed 1 failed 0 errored
greeting passes, goodbye fails.
examples/ has full examples to start from. The docs cover everything about eac.
core/README.mdcovers the CLIcore/PROTOCOL.mdhow the CLI talks to an SDKCONTRIBUTING.mdcovers releasing.