Guide
Inspect AI integration
How to author an eval with Inspect AI, run it, and publish the result to Evaris. This is the primary authoring path today.
Mental model
An Inspect eval is a Task made of four parts:
| Part | Role | In Evaris terms |
|---|---|---|
dataset | The inputs + expected targets | The samples that end up in the artifact |
solver | Runs your agent and produces output | Where your agent plugs in |
scorer | Judges the output (e.g. LLM-as-judge) | Recorded per sample |
@task | Wires the above into a runnable unit | One .eval log → one Evaris run |
Inspect produces a .eval log file. Evaris treats that file as the run's
artifact. You do not change how Inspect runs; you only publish its output.
The reference example
The walkthrough below evaluates a LangChain support/refund agent with an LLM-as-judge scorer. The layout it uses:
agents/support_agent.py: the agent under test (LangChaincreate_agentwith order, refund, escalation tools).evals/evals.py: wraps that agent as an Inspect solver and defines the task.evals/samples.jsonl: the dataset (input + target).
Wrapping an external agent as a solver
The key pattern: your agent is wrapped in a @solver that calls it and writes
the result into Inspect's TaskState.output. From evals/evals.py:
from inspect_ai.model import ModelOutput
from inspect_ai.solver import TaskState, Generate, solver
from agents.support_agent import run_agent
@solver
def langchain_agent_solver():
async def solve(state: TaskState, generate: Generate) -> TaskState:
del generate
answer = run_agent(str(state.input))
state.output = ModelOutput.from_content(model="langchain-agent", content=answer)
return state
return solveThe solver is synchronous-ish glue: run_agent invokes the LangChain agent
and returns its final message. Inspect handles the rest: dataset iteration,
scoring, log writing.
For a fully async agent, make solve await your async call. The shape does
not change.
Defining the task
from inspect_ai import Task, task
from inspect_ai.dataset import json_dataset
from inspect_ai.scorer import model_graded_qa
SAMPLES_PATH = Path(__file__).with_name("samples.jsonl")
@task
def support_refund_smoke():
return Task(
dataset=json_dataset(str(SAMPLES_PATH)),
solver=langchain_agent_solver(),
scorer=model_graded_qa(),
)model_graded_qa() is Inspect's built-in LLM-as-judge scorer: it compares the
solver's output against the sample's target field and emits a score. Other
common scorers: pattern, includes, multi_scorer. See the
Inspect scorers docs.
The dataset
JSONL with input and target fields (what json_dataset expects by
default):
{"input":"Customer asks for a refund for order A100. What should we tell them?","target":"full refund"}
{"input":"Customer wants refund for order B200 after trying the product. What is the decision?","target":"escalate"}Running the eval
inspect eval evals/evals.py \
--model "$MODEL" \
--log-dir logs \
--limit 5--modelis the provider/model string (see OpenAI-compatible providers).--log-diris where the.evalfile is written. Publish from this dir.--limit 5caps samples for a smoke run.
Export your provider env vars before running (see the providers guide for the
common ZAI_* → OPENAI_* mapping).
Publishing
Once the .eval exists, publish it (see
Publish eval logs for details):
evaris publish logs --project <project-id>What ends up where
| Inspect concept | Evaris concept |
|---|---|
One inspect eval invocation | One run (execution_mode: external) |
The .eval log file | One artifact (type: inspect_eval_log) |
| The solver's model name | Recorded in the run's source |
| Inspect AI version | Recorded in source.version; backend may emit unsupported_inspect_version warnings |
Authoring your own eval
- Put your agent in
agents/(or import it). Expose a singlerun_agent(question) -> strfunction. - Write a
@solverthat calls it and setsstate.output. - Write a
@taskthat wiresdataset+ your solver + ascorer. - Put samples in
samples.jsonl. - Run with
inspect eval ... --log-dir <dir>. - Publish with
evaris publish <dir>.
For a deeper walkthrough, see Support agent example. For the pattern with no LangChain, see Custom solver.