estimate_runtime: Estimate wall-clock time for a ranking run

View source: R/estimate.R

estimate_runtimeR Documentation

Estimate wall-clock time for a ranking run

Description

Rough back-of-the-envelope estimator to tell a user "this is going to take about X hours" before they hit Run. The estimate scales n_records * n_models * n_replicates by a per-call cost that depends on model size, and adds a small fixed overhead per model for weight loading.

Usage

estimate_runtime(
  n_records,
  ensemble,
  seconds_per_call = NULL,
  gpu = NULL,
  throttled = FALSE
)

Arguments

n_records

Number of records in the corpus.

ensemble

A screenllm_ensemble object.

seconds_per_call

Optional override for the per-call cost. When NULL (the default) a heuristic based on the largest model in the ensemble is used, adjusted for GPU / CPU / throttled hardware states.

gpu

Whether to assume GPU inference. NULL (the default) calls detect_gpu() to auto-detect. Pass TRUE or FALSE to override.

throttled

If TRUE, assume GPU cores are locked at low clock speed (see gpu_status()). Treated as CPU-equivalent for throughput. Defaults to FALSE; the Shiny app passes the live gpu_status() value.

Details

The estimate is intentionally coarse. Real wall-clock depends on hardware (GPU vs CPU), Ollama's model-swapping behaviour, prompt length, and other user-load on the machine. Treat the number as an order-of-magnitude estimate only.

Value

A screenllm_estimate object: a list with n_calls, seconds_per_call, seconds_total, human_readable, gpu, hardware (a string describing the assumed hardware profile), and a caveats character vector.

Examples

ens <- default_ensemble(backend = backend_mock())
estimate_runtime(n_records = 500, ensemble = ens, gpu = FALSE)
estimate_runtime(n_records = 500, ensemble = ens, gpu = TRUE)

screenllm documentation built on Sept. 24, 2026, 5:11 p.m.