Quail
User guide

Metrics

After running a query, result.report is a dict with timing, token counts, and per-stage metrics.

result = query.run()
report = result.report

Top-level fields

KeyDescription
wall_sQuery execution time in seconds, not counting model startup.
boot_sHow long it took to load the model and compile kernels.
boot_kind"cold" if this was the first query in the session (model loaded from disk), "warm" if the model was already in memory.
fresh_tokensTotal input tokens processed by the model. If a token's KV was evicted and the model had to reprocess it, it counts again.
worker_total_sWall time including tokenization and planning, but not report writes.
remarksNotes from the planner and tokenizer, for example which tokenizer was selected and why.

Per-stage metrics

report["stages"] is a list with one entry per filter or join:

FieldDescription
op"filter" or "join".
aliasWhich table alias this stage operates on.
written_posThe position of the predicate in the query text, counted from 0, so a stage can be matched to its explain() line whatever order the planner ran them in.
provided_selectivityThe selectivity you set in the query, or null if you did not provide one.
observed_selectivityThe actual fraction of rows or pairs that passed after execution.
evaluatedHow many rows (for a filter) or pairs (for a join) the model evaluated.

Per-node metrics

report["node_metrics"] is a dict keyed by physical node id (for example "ai_filter:r" or "ai_join:r"). These correspond to the nodes shown in explain() output.

FieldDescription
input_rowsHow many rows or pairs entered this node.
output_rowsHow many passed.
fresh_tokensInput tokens this node processed.
evaluated_documentsDocuments evaluated (filters only).

Boot details

When boot_kind is "cold", report["boot"] has a breakdown:

FieldDescription
load_model_sTime to load model weights onto the GPU.
arena_sTime to allocate the KV page pool in GPU memory.
warm_kernels_sTime to compile GPU kernels.
warm_tier"touch" on a first run (kernels compiled from scratch), "warm" when using cached kernels.

GPU cost

GPU cost is query time multiplied by the hourly GPU price. H100_USD_PER_HOUR uses Modal's published H100 price ($3.9492 per hour as of September 2026).

from quail.specs import H100_USD_PER_HOUR

cost_usd = (report["wall_s"] / 3600) * H100_USD_PER_HOUR

If you used multiple GPUs, multiply by the number of GPUs.

On this page