# Application settings

This page lists environment variables that tune application behavior for each module. Infrastructure settings (ports, database hosts, credentials) are covered in the [Docker Compose](/deploy-syntho/deploy-syntho-using-docker.md) and [Kubernetes](/deploy-syntho/deploy-syntho-using-kubernetes.md) deployment guides.

## How to configure

### Docker Compose

Add variables to the `.env` file at the root of your deployment directory. Docker Compose picks them up automatically.

```bash
# .env
DATABRICKS_READ_STMT_MAX_ATTEMPTS=15
LOG_LEVEL=WARNING
```

### Kubernetes (Helm)

The Helm chart uses different schemas depending on the service.

**Core API and Backend** — set variables under the service's `env:` map in `values.yaml`:

```yaml
# values.yaml
core:
  env:
    MAX_RUNNING_JOBS: "8"
    CANCEL_TIMEOUT: "120"

backend:
  env:
    SESSION_AGE: "1800"
    DATA_ACCESS: "False"
```

**Core (Ray)** — Ray uses the KubeRay chart with a standard Kubernetes env list under `head.containerEnv:` and `worker.containerEnv:`:

```yaml
# ray values.yaml
head:
  containerEnv:
    - name: DATABRICKS_READ_STMT_MAX_ATTEMPTS
      value: "15"
    - name: LOG_LEVEL
      value: "WARNING"

worker:
  containerEnv:
    - name: DATABRICKS_READ_STMT_MAX_ATTEMPTS
      value: "15"
    - name: LOG_LEVEL
      value: "WARNING"
```

***

## Core

| Name                                | Default | Description                                                                                                                                                                                                                  |
| ----------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `LOG_LEVEL`                         | `INFO`  | Log verbosity. Accepted values: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`. Falls back to `INFO` if the value is invalid.                                                                                               |
| `DATABRICKS_READ_STMT_MAX_ATTEMPTS` | `10`    | Maximum number of polling attempts when waiting for a Databricks SQL statement to finish executing. If the statement has not succeeded after this many attempts, the read fails with an error. Must be a positive integer.   |
| `DATABRICKS_READ_STMT_INITIAL_WAIT` | `2`     | Base wait time in seconds used for the exponential backoff between polling attempts. The wait after attempt *n* is `initial_wait ** n` seconds (e.g. with the default of `2`: 2 s, 4 s, 8 s, …). Must be a positive integer. |

***

## Core API

| Name                        | Default     | Description                                                                                                                                                                              |
| --------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `MAX_RUNNING_JOBS`          | `6`         | Maximum number of data generation jobs that can run in parallel.                                                                                                                         |
| `CANCEL_TIMEOUT`            | `60`        | Default timeout in seconds for cancellable blocking operations (used as the fallback for `run_cancellable`). Affects any operation that wraps a blocking call with a cancellation guard. |
| `FILE_SYSTEM_MAX_SIZE`      | `104857600` | Maximum allowed size in bytes for a single file upload when using the filesystem connector (default: 100 MB).                                                                            |
| `FILE_SYSTEM_MAX_FILES`     | `2`         | Maximum number of files allowed per filesystem connector upload.                                                                                                                         |
| `STREAMING_MAX_BYTES`       | `524288`    | Maximum bytes per chunk when streaming data (default: \~512 KB).                                                                                                                         |
| `STREAMING_MAX_ROWS`        | `2000`      | Maximum rows per chunk when streaming data. Also controls database `yield_per` batch size.                                                                                               |
| `STREAMING_MAX_INTERVAL_MS` | `400`       | Flush cadence in milliseconds for streaming responses.                                                                                                                                   |
| `FEATURE_CHAT_ASSISTANT`    | `False`     | Enable the AI chat assistant feature.                                                                                                                                                    |

***

## Backend

| Name                              | Default             | Description                                                                     |
| --------------------------------- | ------------------- | ------------------------------------------------------------------------------- |
| `SESSION_AGE`                     | `900`               | Session lifetime in seconds (default: 15 minutes).                              |
| `SESSION_EXPIRE_AT_BROWSER_CLOSE` | `FALSE`             | When `TRUE`, the session ends when the browser is closed.                       |
| `DATA_ACCESS`                     | `TRUE`              | When `TRUE`, users have access to source data by default.                       |
| `EMAIL_LOGIN_ENABLED`             | `FALSE`             | Allow users to log in with email and password when SSO is also enabled.         |
| `EXTRA_ALLOWED_HOSTS`             | `backend localhost` | Space-separated list of additional hostnames the service accepts requests from. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.syntho.ai/deploy-syntho/application-settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
