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

# Environment Variables

> Environment Variables provides a comprehensive list of supported environment variables that you can configure with Limina container.

The Limina container supports a number of environment variables. The environment variables can be set in the Docker run command as follows:

```shell Docker Command theme={"theme":"poimandres"}
docker run --rm -e <ENVIRONMENT_VARIABLE1>=<VALUE> -e <ENVIRONMENT_VARIABLE2>=<VALUE> -p 8080:8080 -it deid:<version number>
```

## Supported Environment Variables

<div className="table-nowrap-code">
  | Variable Name                      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |   |
  | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - |
  | `PAI_ACCURACY_MODES`               | Controls which entity detection models are loaded at container start. By default, the container loads all models. Setting this environment variable allows for faster container startup and a lower initial memory footprint. A request specifying an accuracy mode that wasn't loaded will return an error. Allowed values are `high`, `standard_high`, `standard`, `high_multilingual`, `standard_high_multilingual`, `standard_multilingual`. This variable also supports a comma-separated list of values to load multiple models, e.g., `PAI_ACCURACY_MODES=high,standard,standard_high`. The `automatic` accuracy settings are not supported in this variable. |   |
  | `PAI_ALLOW_LIST`                   | Allows for the allow list to be set globally, instead of passing into each `POST` request. An example could be `PAI_ALLOW_LIST='["John","Grace"]'`. Please see [Processing Text](/latest/process-text/)                                                                                                                                                                                                                                                                                                                                                                                                                                                              |   |
  | `PAI_DISABLE_GPU_CHECK`            | When defined and set to any value, the startup GPU check is disabled. This variable is only applicable to the GPU container and allows the GPU container to run in fallback CPU mode                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |   |
  | `PAI_DISABLE_RAM_CHECK`            | When defined and set to any value, the sufficient RAM check performed at container startup is disabled. Please note that Limina cannot guarantee container stability if this is switched off                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |   |
  | `PAI_ENABLED_ENTITIES`             | Allows for the enabled classes to be set globally, instead of passing it into each POST request. An example could be `PAI_ENABLED_ENTITIES="NAME"` or `PAI_ENABLED_ENTITIES="NAME,AGE,ORGANIZATION"`. A command sample is located at the bottom. Please see also [Processing Text](/latest/process-text/)                                                                                                                                                                                                                                                                                                                                                            |   |
  | `PAI_DISABLED_ENTITIES`            | Allows for the disabled classes to be set globally, instead of passing it into each POST request. An example could be `PAI_DISABLED_ENTITIES="ORGANIZATION"` or `PAI_DISABLED_ENTITIES="AGE,LOCATION,ORGANIZATION"`. A command sample is located at the bottom. Please see also [Processing Text](/latest/process-text/)                                                                                                                                                                                                                                                                                                                                             |   |
  | `PAI_ENABLE_AUDIO`                 | When defined and set to any value, the container loads the functionality to process audio files. This is off by default to save startup time and RAM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |   |
  | `PAI_ENABLE_PII_COUNT_METERING`    | When defined and set to any value, Aggregated entity detection counts are sent to logstash and the Limina community portal for reporting and visualization inside the dashboard. Note that feature is off by default                                                                                                                                                                                                                                                                                                                                                                                                                                                 |   |
  | `PAI_LOG_LEVEL`                    | Controls the verbosity of the container logging output. Allowed values are `info`, `warning` or `error`. Default is `info`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |   |
  | `PAI_MARKER_FORMAT`                | Allows for the redaction marker format to be set globally, instead of passing into each `POST` request. Please see [Processing Text](/latest/process-text/)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |   |
  | `PAI_OUTPUT_FILE_DIR`              | The directory where `/process/files/uri` will write processed files to. Note that this does not need to be specified for `/process/files/base64`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |   |
  | `PAI_PROJECT_ID`                   | Sets a default `project_id` that will be used if a request doesn't contain one. Please see [Processing Text](/latest/process-text/)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |   |
  | `PAI_SYNTHETIC_PII_ACCURACY_MODES` | Same as `PAI_ACCURACY_MODES`, except for synthetic entity generation models. This variable also supports a comma-separated list of values to load multiple models, e.g., `PAI_SYNTHETIC_PII_ACCURACY_MODES=standard,standard_multilingual`. Unlike `PAI_ACCURACY_MODES`, this environment variable can be set empty via `PAI_SYNTHETIC_PII_ACCURACY_MODES=` to disable synthetic entity generation                                                                                                                                                                                                                                                                   |   |
  | `PAI_ENABLE_REPORTING`             | Enables reporting to a Logstash server                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |   |
  | `LOGSTASH_HOST`                    | The Logstash server's host info                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |   |
  | `LOGSTASH_PORT`                    | The port of the Logstash server                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |   |
  | `LOGSTASH_MONITORING_PORT`         | The monitoring API port of the Logstash server                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |   |
  | `LOGSTASH_TTL`                     | Sets the time to live value (in seconds) of the data queued for Logstash. Data will be lost if the queued data is not sent successfully before the ttl value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |   |
  | `PAI_REPORT_ENTITY_COUNT`          | Enables entity counts (per piece of text deidentified) to be added to reporting                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |   |
  | `PAI_MAX_IMAGE_PIXELS`             | Configures the max allowed pixels in the images processed. Default value is `178956970`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |   |
  | `PAI_MAX_FILE_SIZE`                | Configures the max allowed file size in bytes. File size check occurs before redaction and produces an error message if it exceeds the value specified. i.e. `2000000`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |   |
  | `PAI_WS_LINK_BATCH`                | Enables context retention in the websocket endpoint. Default is `true`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |   |
  | `PAI_WS_CONTEXT_SIZE`              | Sets the context window size (number of previous messages retained in context). Default is `50`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |   |
  | `PAI_ENABLE_PDF_TEXT_LAYER`        | This environment variable sets the default behaviour for whether a text layer is included in generated PDF files. When set to `true`, the application will include a text layer in the PDFs, allowing for text selection, search, and accessibility features. When set to `false` the text layer will be disabled, resulting in marginally smaller file sizes and faster processing. Note that this option is ignored if the `pdf_options.enable_pdf_text_layer` POST parameter is set in requests to the `/process/files/uri` and `/process/files/base64` endpoints. Default value is `true`.                                                                       |   |
  | `PAI_OCR_SYSTEM`                   | Sets the Optical Character Recognition (OCR) system for processing documents and images. Default is `paddleocr`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |   |
</div>

To change the port used by the container, please set the host port as per the command below:

```shell Docker Command theme={"theme":"poimandres"}
docker run --rm -v "full path to license.json":/app/license/license.json \
-p <host port>:8080 -it crprivateaiprod.azurecr.io/deid:<version>
```

To use `PAI_ENABLED_ENTITIES` to redact only for `NAME` and `ORGANIZATION`, the command will look like:

```shell Docker Command theme={"theme":"poimandres"}
docker run --rm -v "full path to license.json":/app/license/license.json \
-e PAI_ENABLED_ENTITIES="NAME,ORGANIZATION"
-p <host port>:8080 -it crprivateaiprod.azurecr.io/deid:<version>
```

To use `PAI_DISABLED_ENTITIES` to redact all except `ORGANIZATION`, the command will look like:

```shell Docker Command theme={"theme":"poimandres"}
docker run --rm -v "full path to license.json":/app/license/license.json \
-e PAI_DISABLED_ENTITIES="ORGANIZATION"
-p <host port>:8080 -it crprivateaiprod.azurecr.io/deid:<version>
```

<Note>
  Note: If setting entities both in `ENABLE` and `DISABLE`, only `ENABLE` takes effect. If an entity is duplicated both in `ENABLE` and `DISABLE` and `ENABLE` has no other entity set, the request will fail as `400 Bad Request`.
</Note>
