Skip to main content

Eval harness

Sellable product

This capability is granted by an API key scoped to the `` product (product face). See the product reference below.

Evaluation & scoring as a shared capability. POST /v1/eval grades a single candidate synchronously (deterministic assertions and/or an LLM rubric — no store). /v1/datasets stores named org-scoped eval-case sets; /v1/runs batch-evaluates a dataset asynchronously (poll for the pass-rate). The deterministic assertion grader (contains/regex/equals/json-valid/json-path/json-schema/cosine-similarity/latency-cost budgets — the promptfoo assertion taxonomy, reimplemented in Python) is the authoritative gating verdict; the LLM-rubric judge is advisory (a live-LLM grader is never on a must-pass CI path — it flakes).

  • Group: Voice & AI
  • Contract: contracts/eval-harness/v1/openapi.yaml
  • Public base: https://api.vagarylabs.com (the consolidated API gateway — one host, per-brand sibling api.<zone>)
  • Auth: a product API key (vgk_…) issued from the console — Authorization: Bearer vgk_…
  • Product face (customer-keyed):
    • https://api.vagarylabs.com/product/v1/eval/run

Endpoints

MethodPathSummary
POST/v1/evalGrade a single candidate against deterministic assertions and/or an LLM rubric (synchronous, no store)
POST/v1/simulateRun a LoopTalk actor↔adversary conversation and score the transcript (synchronous, no store)
POST/v1/datasetsCreate/replace a named org-scoped set of eval cases
GET/v1/datasets/&#123;dataset_id&#125;Fetch a stored dataset (org-scoped)
POST/v1/runsStart an asynchronous batch eval over a dataset
GET/v1/runs/&#123;run_id&#125;Fetch a run's status, aggregate pass-rate, and per-case results (org-scoped)
POST/v1/qa/callsAutomated QA grading of a REAL production call — the pre-release→production extension
GET/v1/qa/records/&#123;record_id&#125;One graded QA record
POST/v1/qa/records/&#123;record_id&#125;/to-casePromote a graded PRODUCTION call into a permanent regression CASE — the closed loop
GET/v1/qa/trendPer-COHORT QA trend over a window — turns per-call scores into a signal
GET/healthliveness + store/judge readiness
GET/metricsPrometheus exposition (fleet observability SDK — fail-open)

Schemas

Assertion

A deterministic grading assertion (promptfoo-adapted taxonomy). type selects the check; value is its expected argument; optional weight (score weighting), threshold (cosine/latency/cost), path (json-path) and schema (json-schema) refine it.

FieldTypeDescription
typestring
valueobjectexpected argument (string
weightnumberweight of this assertion in the aggregate score
thresholdnumbercosine-similarity min / latency (ms) max / cost (usd) max
pathstringjson-path expression ($.a.b[0]) for the json-path assertion
schemaobjectJSON Schema for the json-schema assertion

EvalRequest

FieldTypeDescription
organization_idstringproduct-tier end-customer tenant (I6); optional in v1 (accounting/label — no store on /v1/eval).
candidatestringthe output under evaluation (an LLM response or a call transcript)
referencestringoptional known-good answer
assertionsarraydeterministic assertions — the authoritative gating verdict when present.
rubricstringoptional natural-language grading rubric; when set the LLM-rubric judge (via provider-gateway) is run and returned as judge (advisory when assertions are also present, authoritative when alone).
contextobjectoptional eval-call context for budget assertions (e.g. {latency_ms, cost_usd})
judge_modelstringoverride the provider-gateway model for the rubric judge

PerAssertion

FieldTypeDescription
typestring
passedboolean
weightnumber
scorenumber1.0/0.0 for boolean checks; the metric for cosine
messagestring

JudgeResult

FieldTypeDescription
scorenumberjudge confidence in [0,1]
verdictstring
rationalestring
modelstring
outcomestringerror = judge call/parse failed (fail-closed)

EvalResponse

FieldTypeDescription
scorenumberweighted pass-fraction of the deterministic assertions
verdictstring
passedinteger
totalinteger
per_assertionarray
judgeobjectpresent only when a rubric was supplied (advisory unless assertions were absent).

Participant

a LoopTalk conversation participant. The ACTOR (the customer flow under test) may be a SCRIPTED persona (deterministic script, no LLM) or a persona-driven LLM; the ADVERSARY is a persona-driven LLM. A participant needs at least a persona or a script.

FieldTypeDescription
personastringsystem prompt driving this participant's LLM turns
openingstringverbatim first utterance (skips the LLM for this party's turn 0)
scriptarraydeterministic utterances in order (the customer-flow-as-a-script actor); the sim ends when exhausted
modelstringoverride the provider-gateway model for this participant's turns

SimulateRequest

FieldTypeDescription
organization_idstringproduct-tier end-customer tenant (I6); optional in v1 (accounting/label — no store on /v1/simulate).
actorobject
adversaryobject
max_turnsintegertotal utterances to run; clamped to [1, EVAL_HARNESS_MAX_SIM_TURNS] (default cap 20) to bound spend.
firststringwho opens the conversation
assertionsarraydeterministic assertions over the rendered transcript — the gating verdict when present.
rubricstringoptional LLM-rubric grading the transcript (advisory unless assertions absent)
referencestringoptional known-good transcript passed to the rubric judge
contextobjectoptional context for budget assertions (e.g. {latency_ms, cost_usd})
judge_modelstringoverride the provider-gateway model for the rubric judge

TranscriptTurn

FieldTypeDescription
turninteger0-based utterance index
rolestring
contentstring

Generated by scripts/gen-capability-docs.py from contracts/eval-harness/v1/openapi.yaml — the contract IS the source of truth; edit the contract, not this page.