Understanding and Resolving Function Timeout Errors
Last updated: April 11, 2025
When running scoring functions in experiments, you may encounter timeout errors with the message "Function timed out after 30000ms". This article explains what causes these errors and how to resolve them.
Timeout Limits
There are several important timeout limits to be aware of:
Scoring functions have a 30-second (30000ms) execution timeout
The proxy service has a 45-second timeout limit
The overall stack has a hard limit of 1 minute for function execution
Common Causes
The most common cause of timeout errors is rate limiting from downstream LLM (Language Model) providers being called within your scoring function. When the LLM provider throttles requests, it can cause your function to exceed the timeout limits.
How to Resolve
To resolve timeout errors, try these approaches:
Optimize your scoring function to complete execution more quickly
Implement retry logic with backoff for LLM API calls
Consider breaking up complex scoring operations into smaller functions
Check your LLM provider's rate limits and adjust your usage accordingly
Note: While it's technically possible to increase the timeout limit, this is not recommended as it may lead to issues with other parts of the system. Instead, focus on optimizing your scoring function's performance.