You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Your application as the target. A model id of python:module.path:function runs your
own code, so a suite evaluates a whole pipeline with the same tasks, graders, baselines
and gate as a bare model. The function gets the task's new input field (any YAML
value) or its prompt, may be async, and returns a string, a Completion, or anything
JSON can hold. Modules resolve from the working directory. A target that raises, or
calls sys.exit(), is one failed task. Async targets share one event loop for the whole
run. The completion cache is never used for a target.
--record FILE and --replay FILE on run, baseline and gate. Recording saves
every httpx call the run makes to one Kinescope bundle. Replaying answers them from the
file: no key, no network, and no tokens or cost reported. A replay that no longer matches
its recording lists the divergences and fails. Recorded and replayed runs go one task at
a time and don't use the completion cache. Needs the new optional extra, pip install "gatecheck[record]" (Python 3.11+).
What a target costs. While recording, a target is priced from the calls its function
made: plain chat calls to OpenAI, Anthropic and Gemini, for models in the pricing table.
Without a recording a target reports $0, unless it returns the Completion from gatecheck.complete(), which is priced by its model.
gatecheck.recording has the same thing for Python: record(path), replay(path).
Built-in providers don't ask for an API key during a replay. Nothing is sent, so a
gate has to work where there are no secrets.
A judge grader on a python: target needs its own judge model (judge_model, or --judge-model), since a function can't judge its own output.
Suite files are read as UTF-8, and structured output keeps non-ASCII text as it is.
Completion gains an optional cost_usd, for a provider that knows what a call cost.