Expand description
Online evaluation: score a sample of production runs after they finish.
An evaluator config (graphrt serve --evaluators <file>; the workflow
format is frozen, so it cannot live in the workflow) maps served workflows
to evaluators. Each evaluator is one assertion of the offline harness
(judge, regex, json-schema, latency, tokens, trajectory:*…)
that needs no expected answer, plus a deterministic sample rate and
filters on the run’s status, tags and metadata:
concurrency: 2 # evaluations running at once (default 2)
queue: 256 # sampled runs waiting; more are dropped and counted (default 256)
evaluators:
- name: helpfulness # the score name
workflows: [chat] # served workflow names, `*` wildcards (default: all)
sample: 0.1 # fraction of matching runs (default 1)
status: [succeeded] # default: succeeded and failed
tags: [prod] # the run has at least one of these tags
metadata: { tier: gold } # and every one of these metadata values
assert: { type: judge, workflow: ../judges/helpfulness.yaml }
- name: no-apology
assert: { type: not-icontains, value: "as an ai" }Sampling hashes the run id with the evaluator name, so whether a run is scored is reproducible (the same run id always gives the same decision) and evaluators sample independently. Relative paths (judge workflows) are resolved against the config file’s directory.
Structs§
- Evaluator
- An evaluator with its assertion built.
- Evaluator
Spec - One evaluator as written.
- Online
Config - A parsed evaluator config.
- Online
Evaluators - Every evaluator of a config, ready to score runs.
- RunInfo
- What an evaluator filter looks at: the finished run’s record.
Constants§
- DEFAULT_
CONCURRENCY - Default evaluations running at once.
- DEFAULT_
QUEUE - Default sampled runs waiting for an evaluation slot.
- ONLINE_
TYPES - Assertion types that make sense on a production run (no
expectedanswer, no labelled documents).not-forms are allowed too.
Functions§
- sample_
point - A run’s deterministic position in
[0, 1)for evaluatorname: FNV-1a ofrun_id, a separator andname, mixed, scaled to 53 bits.