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

# Configuring Danswer

> How to customize your deployment environment.

## Common Environment Variables

All of the global configuration options that are not built into the UI are set via environment variables.
This page contains an exhaustive list of all the options.

There are defaults set in the code so changing/settings these values is **not required** to use Danswer.
A few notable settings that are more frequently changed however are the following:

* AUTH\_TYPE (default value is `disabled`)
* MULTILINGUAL\_QUERY\_EXPANSION (you can provide a comma separated list of languages for query rephrasing such as `English,French`)
* LOG\_LEVEL (default is `info`)
* WEB\_DOMAIN (your full url in production, including the protocol- e.g. `https://www.danswer.ai`)

## Docker Compose

There are several ways to configure environment variables for the containers. For Docker Compose, there are many ways
to pass environment variables to the container, any of the standard approaches will work. However
**the preferred approach** for Danswer is to use the `.env` file. To do this, create a file called `.env` at
`danswer/deployment/docker_compose/.env`. From there, populate it with the values you want to override:

```
# Configures basic email/password based login
AUTH_TYPE="basic"

# Rephrasing the query into different languages to improve search recall
MULTILINGUAL_QUERY_EXPANSION="English,Spanish,German"

# Set a cheaper/faster LLM for the flows that are easier (such as translating the query etc.)
FAST_GEN_AI_MODEL_VERSION="gpt-3.5-turbo"

# Setting more verbose logging
LOG_LEVEL="debug"
LOG_ALL_MODEL_INTERACTIONS="true"
```

## Kubernetes

For Kubernetes, the deployment yaml files includes an Environment ConfigMap. Simply update the values in the file
[here](https://github.com/danswer-ai/danswer/blob/main/deployment/kubernetes/env-configmap.yaml).

## All Environment Variables

This is an extensive list of the currently supported environment variables within Danswer. There are several classes of environment variables. All of the global configuration options that are not built into the UI are set via environment variables.

You can set these in your `.env` file.

### Auth Settings

These variables control authentication and user management in Danswer.

#### AUTH\_TYPE

Controls the authentication method used by Danswer.

<Note>
  `disabled`: No authentication is required.

  `google_oauth`: Users can log in using their Google accounts.

  `basic`: Standard username/password authentication.

  `oidc`: OpenID Connect, available in the enterprise edition.

  `saml`: Security Assertion Markup Language, available in the enterprise edition.
</Note>

#### SESSION\_EXPIRE\_TIME\_SECONDS

Defines the duration of a user's session in seconds. Default is 24 hours.

#### ENCRYPTION\_KEY\_SECRET

A strong, unique string used for encryption purposes. Keep this value secret.

#### VALID\_EMAIL\_DOMAINS

Comma-separated list of allowed email domains for authentication. Leave empty to allow all domains.

#### GOOGLE\_OAUTH\_CLIENT\_ID

Client ID for Google OAuth authentication, obtained from [Google Cloud Console](https://console.cloud.google.com).

#### GOOGLE\_OAUTH\_CLIENT\_SECRET

Client Secret for Google OAuth authentication, obtained from [Google Cloud Console](https://console.cloud.google.com). Keep this value secret.

#### REQUIRE\_EMAIL\_VERIFICATION

When set to `true`, users must verify their email before accessing Danswer.

#### SMTP\_SERVER

Hostname of the SMTP server for sending verification emails. Default is `smtp.gmail.com`.

#### SMTP\_PORT

Port used for SMTP communication. Common values are `587` (TLS) or `465` (SSL).

#### SMTP\_USER

Username for SMTP authentication, often an email address used to send verification emails.

#### SMTP\_PASS

Password for SMTP authentication. Keep this value secret.

#### EMAIL\_FROM

Email address used as the sender for verification emails.

### Gen AI Settings

These variables configure the generative AI capabilities of Danswer. These are covered in more depth at the [generative AI configs](/gen_ai_configs/overview).

#### GEN\_AI\_MODEL\_PROVIDER

Specifies the provider of the generative AI model (e.g., `openai`, `anthropic`, `huggingface`).

#### GEN\_AI\_MODEL\_VERSION

Defines the version of the generative AI model to use (e.g., `gpt-4` for OpenAI).

#### FAST\_GEN\_AI\_MODEL\_VERSION

Specifies a faster (usually smaller) model version for certain tasks.

#### GEN\_AI\_API\_KEY

API key for accessing the generative AI service. Keep this value secret.

#### GEN\_AI\_API\_ENDPOINT

Custom endpoint URL for the AI service, if applicable.

#### GEN\_AI\_API\_VERSION

Version of the AI provider's API to use.

#### GEN\_AI\_LLM\_PROVIDER\_TYPE

Specifies the type of LLM provider being used (e.g., `openai`, `anthropic`, `azure`).

#### GEN\_AI\_MAX\_TOKENS

Maximum number of tokens to generate in AI responses.

#### QA\_TIMEOUT

Timeout for question-answering operations in seconds.

#### MAX\_CHUNKS\_FED\_TO\_CHAT

Maximum number of document chunks fed into a single chat session.

#### DISABLE\_LLM\_FILTER\_EXTRACTION

Set to `true` to disable LLM-based filter extraction from queries.

#### DISABLE\_LLM\_CHUNK\_FILTER

Set to `true` to disable LLM-based filtering of document chunks.

#### DISABLE\_LLM\_CHOOSE\_SEARCH

Set to `true` to disable LLM-based selection of search method.

#### DISABLE\_LLM\_QUERY\_REPHRASE

Set to `true` to disable LLM-based query rephrasing.

#### DISABLE\_GENERATIVE\_AI

Set to `true` to disable all generative AI functionality.

#### DISABLE\_LITELLM\_STREAMING

Set to `true` to disable streaming responses when using LiteLLM.

#### LITELLM\_EXTRA\_HEADERS

JSON-formatted string of key-value pairs for additional headers in LiteLLM API requests.

#### TOKEN\_BUDGET\_GLOBALLY\_ENABLED

Set to `true` to enable the global token budget system.

### AWS Bedrock Settings

These variables are used for AWS Bedrock integration.

#### AWS\_ACCESS\_KEY\_ID

AWS access key ID for Bedrock access, obtained from AWS IAM.

#### AWS\_SECRET\_ACCESS\_KEY

AWS secret access key for Bedrock access, obtained from AWS IAM. Keep this value secret.

#### AWS\_REGION\_NAME

AWS region where Bedrock is deployed (e.g., `us-west-2`).

### Query Options

These variables control various aspects of query processing and search behavior.

#### DOC\_TIME\_DECAY

Controls the recency bias in search results. Higher values increase preference for newer documents.

#### HYBRID\_ALPHA

Balances keyword vs. vector search in hybrid search. Range 0-1 (0 for pure keyword, 1 for pure vector search).

#### EDIT\_KEYWORD\_QUERY

Set to `true` to enable query editing for keyword searches.

#### MULTILINGUAL\_QUERY\_EXPANSION

Set to `true` to enable multilingual query expansion.

#### QA\_PROMPT\_OVERRIDE

Custom prompt text to override the default prompt used for question-answering.

### Other Services

Configuration for external services used by Danswer.

#### POSTGRES\_HOST

Hostname or IP address of the Postgres server. Default is `relational_db`.

#### VESPA\_HOST

Hostname or IP address of the Vespa server. Default is `index`.

#### WEB\_DOMAIN

Fully qualified domain name used for the Danswer web interface. (e.g. [https://www.danswer.com](https://www.danswer.com))

### NLP Model Configurations

Advanced settings for NLP models. Modify with caution.

#### DOCUMENT\_ENCODER\_MODEL

Name or path of the encoder model used for document encoding.

#### DOC\_EMBEDDING\_DIM

Dimension of document embeddings, typically matching the chosen encoder model's output dimension.

#### NORMALIZE\_EMBEDDINGS

Set to `true` to enable normalization of embeddings.

#### ASYM\_QUERY\_PREFIX

Text prepended to queries in asymmetric semantic search.

#### ENABLE\_RERANKING\_REAL\_TIME\_FLOW

Set to `true` to enable reranking in real-time search flow.

#### ENABLE\_RERANKING\_ASYNC\_FLOW

Set to `true` to enable reranking in asynchronous search flow.

#### MODEL\_SERVER\_HOST

Hostname or IP address of the model server. Default is `inference_model_server`.

#### MODEL\_SERVER\_PORT

Port on which the model server is listening.

### Miscellaneous

\<
Various other configuration options.

#### DISABLE\_TELEMETRY

Set to `true` to opt out of telemetry. Telemetry helps improve Danswer; no sensitive data is collected.

#### LOG\_LEVEL

Sets the logging verbosity. Possible values: `debug`, `info`, `warning`, `error`, `critical`.

#### LOG\_ALL\_MODEL\_INTERACTIONS

Set to `true` to enable logging of all prompts sent to the LLM.

#### LOG\_VESPA\_TIMING\_INFORMATION

Set to `true` to enable additional logging of Vespa query performance.

#### LOG\_ENDPOINT\_LATENCY

Set to `true` to enable logging of endpoint latency information.

### ENV\_SEED\_CONFIGURATION

If you want to start your instance of Danswer with pre-configured options, you can use environment variables to seed it
with pre-specified options. These will persist across restarts, shut-down of volumes, etc.

* `llms`: a list of llm configurations
  * Each item in the list should contain: `name`, `provider`, `api_key`, `api_base`, `api_version`, `custom_config`, `default_model_name`, `fast_default_model_name`
* `admin_user_emails`: a list of email addresses which, upon signing up, should automatically be assigned admin roles.
* `seeded_name`: pre-set name for your company's Danswer instance (e.g. "Acme's Danswer").
* `seeded_logo_path`: pre-set path to your logo (as seen from the perspective of the `backend` repository). This should point to a path within `assets` (the folder within `/backend`) (e.g. `assets/logo.png`)

Example configuration: `export ENV_SEED_CONFIGURATION='{"admin_user_emails": ["email@gmail.com"], "seeded_name": "Acme Corp", "seeded_logo_path": "assets/logo.png"}'`
