Skip to contents

Every single request llm() makes (one item, or one batch, depending on the caller) is bounded by this wall-clock limit. Without it, a stuck local model (most often Ollama under load, or a batch too large for the model to finish) blocks silently – no log output, no progress, nothing – for as long as the underlying HTTP client is willing to wait, which can be hours. A timeout turns that invisible stall into a fast, visible, per-row failure (recorded the same way a provider error already is – see llm()'s own error handling), so a large batch run fails fast and retries instead of hanging.

Usage

llm_timeout(seconds = NULL)

Arguments

seconds

the timeout in seconds, or NULL to read the current value without changing it

Value

the current timeout in seconds (invisibly when setting)

Examples

old <- llm_timeout()
llm_timeout(120)
llm_timeout(old)