LLM providers return rate-limit errors, APIs time out, and web scrapes hit transient failures. Tensorlake handles retries at the platform level — each retry is durable, meaning any nested function calls that already succeeded are served from checkpoints instead of re-executing. See Durable Execution for how the checkpoint mechanism works and Crash Recovery for the agent-loop walkthrough.Documentation Index
Fetch the complete documentation index at: https://docs.tensorlake.ai/llms.txt
Use this file to discover all available pages before exploring further.
Configuring Retries
Set theretries parameter on any @function() to automatically retry on failure. This is especially useful for LLM calls that return structured output — if the LLM returns malformed data, Pydantic validation fails and Tensorlake retries the entire call:
- Rate limit errors, timeouts, or exceptions trigger automatic retries
- Validation failures (e.g., Pydantic
ValidationError) also trigger retries - Tensorlake retries up to 3 times with exponential backoff
- Any nested function calls that already succeeded are served from checkpoints, not re-executed (see Durable Execution)
Disable client-level retries (e.g., OpenAI’s
max_retries=0) when using Tensorlake retries. Layering both creates unpredictable behavior and inflated retry counts.Rate Limiting External APIs
When calling external APIs with rate limits, you can control the total number of concurrent calls using the formula: Total concurrent calls =max_containers × concurrency
This allows you to respect API rate limits by capping the maximum number of parallel requests your function can make:
- Respect API quotas — If an API allows 100 requests/second, set
max_containers=50andconcurrency=2 - Control costs — Limit concurrent LLM calls to manage token spend
- Prevent overload — Cap requests to internal services that can’t handle high concurrency
max_containers and request queuing.
Related Guides
Durable Execution
How checkpointing makes every retry cheap.
Crash Recovery
Surviving mid-loop crashes when retries run out.
Timeouts
Per-function deadlines and progress-update heartbeats.
Error Handling
Try/except, futures, and graceful degradation patterns.