Ritenta

Measure a tool-using AI service from request to outcome

Use tool outcomes, traces, approval and latency measures to test an AI service under normal load and failures.

Published: 2 min read

A learning assistant proposes moving a workshop. It has permission to look up availability and draft a change. Publishing the revision requires a human decision. In testing, the assistant says that the workshop moved, but the authoritative calendar still shows the old date. Measure the state change independently of the generated text.

Verify each outcome at its boundary

Test tool discovery, input validation and business outcomes separately. An input schema describes allowed structure. The application must also establish which catalog and operation the caller is authorized to use. Record the validated proposal ID and the resulting calendar revision. In MCP, a tool result can describe an execution error separately from protocol-level errors. Preserve the distinction so callers can handle a failed business operation without assuming the connection is broken. MCP tool specification

Bind approval to the exact proposal and its preconditions. After an ambiguous timeout, read the authoritative outcome or retry with an operation identifier the receiver honors. An idempotency key only works when the receiver persists and enforces it for the operation. Test that replay neither publishes twice nor changes which proposal is approved.

Separate first response from delivery speed

Use time to first token to investigate startup and prefill delays. Use inter-token measurements or configured streaming metrics to investigate decode. Keep queue time distinct and document which timestamps your instrumentation actually observes. One stream event can deliver several tokens, so intervals between events cannot always measure per-token latency.

The attention key-value cache grows with active sequences and their cached tokens. Long requests can therefore affect memory and batching for their peers. Measure warm and cold runs separately, with comparable input and output distributions. Record throughput that satisfies both latency commitments, as well as the overall throughput. PagedAttention paper

Test failure with observable states

Review a fixed set of versioned cases. Include read-only answers, approval declined, stale preconditions, ambiguous timeouts, and partial results from independent readers. Attach the recorded tool outcomes and final state to each case. Traces can connect stages without storing full prompts or personal records. Restrict the retention and access of diagnostic data according to the service policy. OpenTelemetry traces · Evaluation best practices

The examples build on the course modules on tool protocols and production infrastructure.

Practise what you read

Answer questions based on this article in Ritenta.

Open practice