Skip to main content
You can explain any answer, even after the documents it read have changed, because its evaluation keeps the exact text the engine read, a reference to each image it read, and what the engine returned. Each answer is the engine’s answer to exactly the inputs that its evaluation records. An evaluation is the permanent record of one time that Brussle judged a document. An answer is the current result, and it points to the evaluation that made it. An evaluation never changes, and it records:
  • the document revision;
  • the judgment version;
  • the engine and its version;
  • the context hash, a hash of the compiled context, the judgment version and the engine version;
  • the raw output;
  • the time;
  • the status.
For example, this evaluation made the settles answer for revision 12 of payment pay_881:
settles reads other documents, so its evaluation also records what it read. See what a judgment with relations records. Brussle keeps each evaluation, with its compiled context, until you delete its namespace, and storage pricing includes this history (except replays).

Read evaluations

  • For one document. GET /namespaces/{ns}/documents/{id}?include=history returns the evaluations of the document’s current incarnation, newest first. The SDKs take a flag for each part of include instead: ns.get(id, include_history=True, include_context=True, include_raw=True) in Python, and ns.get(id, { includeHistory: true, includeContext: true, includeRaw: true }) in TypeScript. Add all_incarnations=true to get the earlier lives of the same id too, and history_limit to limit the length of the list.
  • One evaluation by its id. GET /namespaces/{ns}/evaluations/{id} returns one evaluation, such as the one an answer’s evaluation_id names, and both SDKs call it with ns.evaluation(id). It finds the evaluation in any document, incarnation or judgment (shadow evaluations included). The response has context, raw and latency_ms:
    • A replay has no context of its own, because it shares the context of its replay_of.
    • A reuse has no raw and no context of its own; it shares the context of its engine_answer_from.
    • A failed evaluation has no raw, and a failure recorded after the retries ran out has no context either.
    • latency_ms is the time that the engine request took, without retries. It is absent on evaluations recorded before Brussle measured it.
  • Export. You can export evaluation history on Scale. The export holds each evaluation in a time range, with its context and the outcomes joined to it, as files you download.

Read the fields

  • model_id is the model the provider’s response named, exactly as the provider sent it. It is null when the response named no model, and on a failure that got no response. A reuse names the model of the evaluation it reuses.
  • output holds the engine’s raw numbers, and each has the same meaning as in the answer it made:
    • bool: p.
    • choice: value, dist and escape_p.
    • score: score and dist.
    • A composite judgment: parts, the p of each part. Brussle combines the parts into p when it reads the answer.
  • context is the exact compiled context that the engine saw. Add include=history,context to get it.
    • It is keyed by path (such as state.description), and values from state are JSON as you wrote them.
    • Images appear only at image paths: images.<name>, previous.images.<name>, images.<name> in a relation’s records, and a relation’s latest(images.<name>). A list stays a list. Each image is a reference and never the image’s bytes, which GET /namespaces/{ns}/images/{digest} returns. An image that the engine read is the reference that the document holds, such as {"digest": "sha256:...", "type": "image/jpeg", "width": 1440, "height": 960}. An image that the engine did not read is {"digest": "sha256:...", "omitted": "engine_reads_no_images"} or "omitted": "over_the_limit", or "omitted": "erased" when you erased the image before this judging.
    • The evaluations that name an image keep its reference after you erase it, and a read adds "erased": true to that reference. The image’s bytes are gone, so GET /namespaces/{ns}/images/{digest} returns image_erased.
  • raw is the engine’s answer to this judgment only, in the shape of output; add include=history,raw to get it. It never has the answers to other judgments or the engine’s token counts (the size that matters to you is context_tokens).
  • Brussle leaves out context and raw by default.
  • context_truncated is true when Brussle cut the context to fit max_tokens or the engine’s limit, or left out images with over_the_limit. An engine that reads no images, or an image that you erased, does not make it true.
  • relations_capped is true when a relation stopped before it checked each matching document, so the relation may be missing one. A blocking relation is also capped when more candidates qualified than its last_n, and the right candidate may be one that it did not read. capped in relations names the relation. The judgment’s stats give the share of the day’s evaluations that were capped as relations_capped_rate, beside truncation_rate.
  • shadow: true marks an evaluation from an activation’s shadow report. A shadow evaluation never makes an answer, and Brussle does not bill its judging, but it counts toward storage like other evaluations.
  • replay_of names the evaluation whose stored context a replay judged again. Brussle replays to fit the correction again after the engine’s behaviour changes, and after you activate a version on another engine. You cannot start a replay, and a replay never makes an answer. Brussle does not bill a replay after the engine’s behaviour changes, while a replay after you move to another engine is billed as judging. replay_of is null on all other evaluations.

When an evaluation fails

An evaluation with status: "failed" has error: {class, message}, where the class is retryable or terminal. The answer reads failed and keeps its last good numbers.
  • Brussle retries a retryable failure with backoff, and then each hour.
  • Brussle does not retry a terminal failure. The next write to the document judges it again, and so can a backfill, a periodic run or a change to a related document.
Brussle stops retrying a document’s answer in two cases, and the answer then stays failed until you write the document again.
  • The failure is caused by the document. For example, the engine refused the document or could not read it (the output was not valid or could not be parsed, the document was too large, or the content was refused). This failure is terminal at once.
  • The engine kept failing. A server error, a timeout, a lost connection or a rate limit went on after the retries with backoff, so the evaluation has class retryable and Brussle retries the document each hour. Brussle makes the failure terminal if it is still failing on a retry made 24 hours or more after the document last changed.
A full outage is different. Brussle stops calls to an engine when a large share of them fail. While the calls are stopped, Brussle holds documents pending (never failed), however long the outage lasts. A held retry is not an attempt, so the 24-hour rule cannot make an answer terminal while Brussle holds it. Brussle judges all the held documents when the engine recovers.
  • Documents that failed before Brussle stopped the calls stay failed.
  • At low traffic, too few calls can fail for Brussle to stop the calls, so the usual retry rules above apply.
  • GET /engines shows the latest health check of each engine version, in probe.status.
Judge failed answers again. You do not have to write the documents again:
  • Run a backfill of the judgment. It skips the documents whose answer for the active version and current revision already succeeded, and judges the others.
  • A new write to a document also starts a new attempt.
A value that does not fit its column. These failures are terminal, and the answer keeps its last good value:
  • A json value that does not satisfy the column’s schema. error.message names the path and the reason (such as schema: /amount: expected number, got string), and raw holds the engine’s text.
  • A json value of more than 64 KiB, with a message that starts with too_large:.
  • An embedding of the wrong length, or with a number that is not finite.
A text longer than max_chars is not a failure: Brussle cuts it and the answer says truncated: true. Context too large. Brussle cuts a context once to 80% of the limit when the engine refuses it as too large. The limit is the lower of the recipe’s max_tokens and the engine’s limit. If the engine still does not take the context, the evaluation fails terminal with a message that starts with too_large:. Lower the recipe’s max_tokens, or send fewer fields.

What a judgment with relations records

A judgment with relations reads other documents too, and its evaluation records what it read, so an outcome or an audit can see exactly what the engine read after those documents have changed.
  • watermark says how far into the namespace’s writes Brussle had read when it read the context.
  • answers_generation, next to watermark, says how far the context had read the answers of other judgments and the changes to blocks.
  • related_documents lists each related document that the context read, rendered or aggregated, as {relation, document_id, revision}. The list is part of the context, so you get it with include=history,context and from GET /namespaces/{ns}/evaluations/{id}.
A related_documents entry can have these fields:
  • evaluations, when the context read the answers of that document, names the evaluation behind each answer by judgment, such as {"frustrated": "ev_…"}. Brussle keeps evaluations until you delete the namespace, so you can always follow a roll-up back to the answers that it read.
  • fits, when the context read a p through a fit of a judgment with features, names the fit of each such judgment, such as {"invoice_settlement": "fit_…"}. A fit change moves a child’s p with no new evaluation, so fits, with the child’s stored engine p and features, gives you the exact value that the reader read. It is absent when the context read each answer as the engine gave it.
  • outcomes, when the context read the outcomes of that document, names the outcome that the context read for each judgment, such as {"refunded": "oc_…"}, as of the evaluation’s watermark. Brussle keeps outcomes until you delete the namespace.
The evaluation can also have these fields:
  • upstream has one entry for each judgment whose answers the context read when a document that it read was not up to date, in which case the context showed the last answer. An entry looks like {"judgment": "frustrated", "state": "child_pending"}.
    • child_pending means that the document had work waiting. This judgment judges again if the document’s new answer changes what a relation shows, so wait for it; you do not have to act.
    • child_out_of_scope means that the document had no work waiting and will not catch up without help, because it failed for a cause of its own or no answer is coming. Its next write, or a backfill of that judgment, makes it catch up.
    • The entries record what this evaluation saw (never the current status of that judgment), and they stay with the evaluation.
    • upstream is empty when each answer that the context read was fresh.
  • relations holds, for each relation by name, the counts at the time of the evaluation:
    • scanned: the related documents read.
    • qualified: of those, the documents inside window that a match on answers admitted. When capped is true for a blocking relation, more documents qualified than the relation read, so qualified is a lower bound.
    • selected: the documents left after last_n.
    • rendered: the records that the context held.
    • dropped: the records left out to fit the token limit.
    • clipped: the fields cut by a max_chars.
    • tokens: the relation’s own share of the context.
    • range_full: true when more documents matched than the newest 1,000 that the relation reads.
    • walk_exhausted: true when a match on answers or outcomes found fewer than last_n qualifying documents among the newest 1,000, and more documents matched. In older evaluations it meant that the match read its former limit of 4 × last_n.
    • capped: true when the relation may be missing a matching document. Its entry in the context shows capped or range_full. A blocking relation is capped when more candidates qualified than its last_n.
  • relation_shared_tokens counts the rest of the context (the document’s own fields, the previous rendering if there is one, and the JSON around them).
  • Brussle records no evaluation when a compile used the previous answer again, and adds the counts to the judgment’s daily totals instead.
  • features, for a bool with features, holds the raw value of each feature as this evaluation read it, in 64 bits, and leaves out a missing feature. Brussle never calculates these values again, so an age is the age at the judged revision and previous.p is the engine’s previous p when this evaluation was made. An older evaluation of a composite judgment has the features in output.features instead.
  • previous_revision, for a recipe with previous, is the revision that the previous rendering came from.
  • first_revision: true appears in place of previous_revision when nothing was shown under previous, for example on the first evaluation of a document, or of an id that was created again. The stored context holds both renderings.

Reuses

A reuse is the evaluation of a change that moved only a judgment’s features. What the engine reads stays the same, so a reuse keeps the engine’s answer in output, with the new features, and makes no engine call. A reuse follows one of these changes, on a judgment with or without relations:
  • a write to a value that is a feature, which the engine does not read;
  • with relations, a change that moves only an aggregate that the engine does not read;
  • with an age feature, a new revision of the judged document, even with the same content, because its ages are measured from the new revision’s updated_at.
  • engine_answer_from names the evaluation that made that engine answer, which is never another reuse. The reuse shares its context.
  • observed_at is the time of the newest write that the reuse read: the judged document’s own write or, for a judgment with relations, the newest write to it or to a related document.
  • A reuse keeps previous.p from the answer that it replaces and recalculates every other feature.
  • A reuse is a new answer, so outcomes join to it like to any other answer. It is not billed.
  • aborted: true marks a reuse whose answer never landed, and calibration leaves it out.
  • An export, and a replay by Brussle, read the context of a reuse through engine_answer_from.

The context hash

The context hash covers three things: the compiled context, the judgment version and the engine version that the judgment names. For a judgment on an engine version that is not pinned, such as jev current, that engine version is current, so a change in the engine’s behaviour does not change the hash.
  • Brussle uses the previous answer again, with no engine call and no new evaluation, when a change to a document leaves a judgment’s context the same. The answer’s evaluation_id and engine_version then still name the earlier evaluation, made for an earlier revision.
  • The answer is a reuse if the context stays the same but the judgment’s features moved, and Brussle records it as Reuses describes.