Evals-as-Code (eac)
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.
Get started
Offline evals run your AI system on cases you write, and judge what it does.
Install the CLI
On macOS or Linux.curl -fsSL https://eac.sentry.dev/install | bashInstall the Python SDK
Into the environment your evals run in.# needs Python 3.11+ pip install eac-sdkWrite an eval
Add adataset.ymlanywhere in your repo, with anofflinesection: the runner that calls your system, and the cases to run it on.evals/chat/dataset.ymlname: chat runtime: python offline: runner: ./dataset.py:ChatRunner cases: ./dataset.py:CASESevals/chat/dataset.pyfrom typing import Any from eac import Case, Judge, OfflineRunner, Score from openai import OpenAI class ChatRunner(OfflineRunner): def run_case( self, case: Case, *, seed_results: dict[str, dict[str, Any]], conversation_id: str, ) -> dict[str, Any]: response = OpenAI().responses.create( model="gpt-6-luna", instructions="You're a friendly assistant. Reply in one short sentence.", input=case.input["query"], ) return {"response": response.output_text} class GreetsJudge(Judge): name = "greets_judge" def judge( self, case: Case, *, seed_results: dict[str, dict[str, Any]], agent_trace: Any = None, ) -> Score | None: response = case.run_results.get("response", "") if response.lower().startswith(("hello", "hi", "hey")): 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=[GreetsJudge()]), Case(name="goodbye", input={"query": "bye"}, judges=[GreetsJudge()]), ]Run it
eac seeds fixtures, runs each case, judges the output and prints the results.It prints the run at the top of this page:eac offline run --dataset chatgreetingpasses,goodbyefails.