Skip to main content

Module online

Module online 

Source
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.
EvaluatorSpec
One evaluator as written.
OnlineConfig
A parsed evaluator config.
OnlineEvaluators
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 expected answer, no labelled documents). not- forms are allowed too.

Functions§

sample_point
A run’s deterministic position in [0, 1) for evaluator name: FNV-1a of run_id, a separator and name, mixed, scaled to 53 bits.