Skip to main content
Every sync and async model call is bounded by a default timeout and a couple of retries — tunable with one env var, overridable per call.

Quick Start

1

Raise the timeout for a slow provider

Set one env var — every call now waits up to 120 seconds before giving up.
2

Override per call

An explicit per-call timeout always wins over the env default.

How It Works

Each call seeds a default timeout and num_retries only if the caller didn’t already set them — explicit values win (setdefault semantics). The defaults apply to registry providers (OpenAI, Anthropic, Google, …) and gateway providers (OpenRouter, LiteLLM-Proxy, Custom).

Configuration Options

An invalid PRAISONAI_LLM_TIMEOUT (e.g. abc) safely falls back to 60 seconds and logs a warning — a bad value never breaks a run.

Best Practices

A large PRAISONAI_LLM_TIMEOUT still bounds a stuck provider. Prefer 120 or 180 for slow local models over an unbounded wait.
Keep a low global default and raise timeout only for the specific agent that needs it — the per-call value wins.
The default num_retries=2 recovers from transient blips without amplifying a real outage into a retry storm. Raise it only when a provider is known-flaky.

Models

Configure providers and model names

Tool Timeout

Bound tool execution the same way