> ## Documentation Index
> Fetch the complete documentation index at: https://braintrust.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# UI experiment timeout configuration for self-hosted k8s

export const plans_0 = "Enterprise"

export const deployments_0 = "Self-hosted"

export const data_plane_version_0 = undefined

export const use_case_0 = undefined

<Note>
  **Applies to:**

  * Plan - {plans_0}
  * Deployment - {deployments_0}
  * {data_plane_version_0}
  * {use_case_0}
</Note>

## 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:

| Deployment                     | Execution environment  | Timeout             |
| ------------------------------ | ---------------------- | ------------------- |
| Braintrust-hosted              | AWS Lambda             | 15 min (hard limit) |
| Self-hosted on AWS             | AWS Lambda             | 15 min (hard limit) |
| Self-hosted on GCP/Azure (k8s) | In-process, data plane | Configurable        |

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:

```yaml theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
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.
