Skip to main content
Applies to:
  • Plan:
  • Deployment:

Summary

Goal: Configure UI experiment execution timeout for self-hosted Kubernetes deployments. Features: CODE_FUNCTION_EXECUTION_TIMEOUT_S environment variable, k8s ingress and load balancer timeout alignment.

How UI experiments execute

The execution environment depends on your deployment type:
DeploymentExecution environmentTimeout
Braintrust-hostedAWS Lambda15 min (hard limit)
Self-hosted on AWSAWS Lambda15 min (hard limit)
Self-hosted on GCP/Azure (k8s)In-process, data planeConfigurable
For AWS-based deployments, the 15-minute Lambda limit cannot be overridden. Use the SDK/CLI for experiments expected to run longer. For self-hosted k8s deployments (GCP/Azure), the Lambda limit does not apply.

Configuration steps

Step 1: Set the execution timeout

In your data plane deployment, set the environment variable:
CODE_FUNCTION_EXECUTION_TIMEOUT_S=<seconds>
The default is 900 (15 minutes). Set this to any value your workload requires.

Step 2: Align infrastructure-level HTTP timeouts

If CODE_FUNCTION_EXECUTION_TIMEOUT_S exceeds 900 seconds, update your infrastructure timeouts to match. If these are lower than the execution timeout, the HTTP connection will drop before the function completes. Update the following to be equal to or greater than CODE_FUNCTION_EXECUTION_TIMEOUT_S:
  • k8s ingress — set proxy-read-timeout and proxy-send-timeout annotations
  • Load balancer — set the idle timeout on your cloud load balancer
Example for an NGINX ingress:
annotations:
  nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
  nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"

Alternative: SDK/CLI

For long-running experiments on any deployment type, running evals via the SDK or CLI avoids UI timeout constraints entirely. The SDK/CLI runs in your own environment with no built-in execution timeout.