Skip to content

Commit 01a6b37

Browse files
Update documentation for ENV Variables (#11667)
Co-authored-by: martyna-mindsdb <109554435+martyna-mindsdb@users.noreply.github.com>
1 parent dba3869 commit 01a6b37

1 file changed

Lines changed: 175 additions & 18 deletions

File tree

docs/setup/environment-vars.mdx

Lines changed: 175 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ title: Environment Variables
33
sidebarTitle: Environment Variables
44
---
55

6-
Most of the MindsDB functionality can be modified by extending the default configuration, but some of the configuration options
6+
Most of the MindsDB functionality can be modified by extending the default configuration, but some of the configuration options
77
can be added as environment variables on the server where MindsDB is deployed.
8+
[Here is the list](/setup/full-list-environment-vars) of all the available environment variables.
89

910
## MindsDB Authentication
1011

@@ -21,6 +22,7 @@ MindsDB does not require authentication by default. If you want to enable authen
2122
export MINDSDB_USERNAME='mindsdb_user'
2223
export MINDSDB_PASSWORD='mindsdb_password'
2324
```
25+
2426
</CodeGroup>
2527

2628
## MindsDB Configuration File
@@ -37,18 +39,19 @@ In order to start MindsDB with a [custom configuration file](/setup/custom-confi
3739
```bash Shell
3840
export MINDSDB_CONFIG_PATH=/Users/username/path/config.json
3941
```
42+
4043
</CodeGroup>
4144

42-
## MindsDB Storage
45+
## MindsDB Storage
4346

44-
By default, MindsDB stores the configuration files by determining appropriate platform-specific directories, e.g. a "user data dir":
47+
By default, MindsDB stores the configuration files by determining appropriate platform-specific directories, e.g. a "user data dir":
4548

46-
* On Linux `~/.local/share/mindsdb/var`
47-
* On MacOS `~/Library/Application Support/mindsdb/var`
48-
* On Windows `C:\Documents and Settings\<User>\Application Data\Local Settings\<AppAuthor>\mindsdb\var`
49+
- On Linux `~/.local/share/mindsdb/var`
50+
- On MacOS `~/Library/Application Support/mindsdb/var`
51+
- On Windows `C:\Documents and Settings\<User>\Application Data\Local Settings\<AppAuthor>\mindsdb\var`
4952

50-
In the `MINDSDB_STORAGE_DIR` location, MindsDB stores users' data, models and uploaded data files, the static assets for the frontend application and the
51-
`sqlite.db` file.
53+
In the `MINDSDB_STORAGE_DIR` location, MindsDB stores users' data, models and uploaded data files, the static assets for the frontend application and the
54+
`sqlite.db` file.
5255
You can change the default storage location using `MINDSDB_STORAGE_DIR` variable.
5356

5457
### Example
@@ -61,26 +64,31 @@ You can change the default storage location using `MINDSDB_STORAGE_DIR` variable
6164
```bash Shell
6265
export MINDSDB_STORAGE_DIR='~/home/mindsdb/var'
6366
```
67+
6468
</CodeGroup>
6569

66-
## MindsDB Configuration Storage
70+
## MindsDB Configuration Storage
6771

68-
MindsDB uses `sqlite` database by default to store the required configuration as models, projects, files metadata etc.
69-
The full list of the above schemas can be found [here](https://github.com/mindsdb/mindsdb/blob/main/mindsdb/interfaces/storage/db.py#L69). You can change the
72+
MindsDB uses `sqlite` database by default to store the required configuration as models, projects, files metadata etc.
73+
The full list of the above schemas can be found [here](https://github.com/mindsdb/mindsdb/blob/main/mindsdb/interfaces/storage/db.py#L69). You can change the
7074
default storage option and use different database by adding the new connection string using `MINDSDB_DB_CON` variable.
7175

7276
### Example
7377

7478
<CodeGroup>
75-
```bash Docker
76-
docker run --name mindsdb_container -e MINDSDB_DB_CON='postgresql://user:secret@localhost' -e MINDSDB_APIS=http,mysql -p 47334:47334 -p 47335:47335 mindsdb/mindsdb
77-
```
78-
79-
```bash Shell
80-
export MINDSDB_DB_CON='postgresql://user:secret@localhost'
81-
```
79+
```bash Docker docker run --name mindsdb_container -e
80+
MINDSDB_DB_CON='postgresql://user:secret@localhost' -e MINDSDB_APIS=http,mysql
81+
-p 47334:47334 -p 47335:47335 mindsdb/mindsdb ``` ```bash Shell export
82+
MINDSDB_DB_CON='postgresql://user:secret@localhost' ```
8283
</CodeGroup>
8384
85+
#### `MINDSDB_STORAGE_BACKUP_DISABLED`
86+
87+
- **Type:** Boolean (`1`, `true`, `True`)
88+
- **Description:** Disables permanent storage backup
89+
- **Default:** `false`
90+
- **Example:** `MINDSDB_STORAGE_BACKUP_DISABLED=1`
91+
8492
## MindsDB APIs
8593
8694
The `MINDSDB_APIS` environment variable lets users define which APIs to start. Learn more about the [available APIs here](/setup/mindsdb-apis).
@@ -95,6 +103,7 @@ The `MINDSDB_APIS` environment variable lets users define which APIs to start. L
95103
```bash Shell
96104
export MINDSDB_APIS='http,mysql'
97105
```
106+
98107
</CodeGroup>
99108

100109
## MindsDB Logs
@@ -111,8 +120,23 @@ This environment variable defines the level of logging generated by MindsDB. You
111120
```bash Shell
112121
export MINDSDB_LOG_LEVEL='DEBUG'
113122
```
123+
114124
</CodeGroup>
115125

126+
#### `MINDSDB_CONSOLE_LOG_LEVEL`
127+
128+
- **Type:** String (`DEBUG`, `INFO`, `WARNING`, `ERROR`)
129+
- **Description:** Sets console log level
130+
- **Default:** `INFO`
131+
- **Example:** `MINDSDB_CONSOLE_LOG_LEVEL=DEBUG`
132+
133+
#### `MINDSDB_FILE_LOG_LEVEL`
134+
135+
- **Type:** String (`DEBUG`, `INFO`, `WARNING`, `ERROR`)
136+
- **Description:** Sets file log level and enables file logging
137+
- **Default:** `INFO` (disabled by default)
138+
- **Example:** `MINDSDB_FILE_LOG_LEVEL=DEBUG`
139+
116140
## MindsDB Default Project
117141

118142
By default, MindsDB creates a project named `mindsdb` where all the models and other objects are stored. You can change the default project name by setting the `MINDSDB_DEFAULT_PROJECT` environment variable.
@@ -129,8 +153,30 @@ If this environment variable is set or modified after MindsDB has started, the d
129153
```bash Shell
130154
export MINDSDB_DEFAULT_PROJECT='my_project'
131155
```
156+
132157
</CodeGroup>
133158

159+
#### `MINDSDB_DEFAULT_LLM_API_KEY`
160+
161+
- **Type:** String
162+
- **Description:** API key for default LLM (Large Language Model)
163+
- **Default:** None
164+
- **Example:** `MINDSDB_DEFAULT_LLM_API_KEY=sk-...`
165+
166+
#### `MINDSDB_DEFAULT_EMBEDDING_MODEL_API_KEY`
167+
168+
- **Type:** String
169+
- **Description:** API key for default embedding model
170+
- **Default:** None
171+
- **Example:** `MINDSDB_DEFAULT_EMBEDDING_MODEL_API_KEY=sk-...`
172+
173+
#### `MINDSDB_DEFAULT_RERANKING_MODEL_API_KEY`
174+
175+
- **Type:** String
176+
- **Description:** API key for default reranking model
177+
- **Default:** None
178+
- **Example:** `MINDSDB_DEFAULT_RERANKING_MODEL_API_KEY=sk-...`
179+
134180
## MindsDB's PID File
135181

136182
When running MindsDB via [Docker](/setup/self-hosted/docker) or [Docker Extension](/setup/self-hosted/docker-desktop), the PID file is not used by default. Users can opt for enabling the PID file by defining the `USE_PIDFILE` environment variable.
@@ -147,6 +193,7 @@ If used, the PID file is stored in the temp directory (`$TMPDIR` on MacOS and Li
147193
```bash Shell
148194
export USE_PIDFILE=1
149195
```
196+
150197
</CodeGroup>
151198

152199
## MindsDB GUI Updates
@@ -165,6 +212,7 @@ By default, the automatic GUI updates are enabled and the `MINDSDB_GUI_AUTOUPDAT
165212
```bash Shell
166213
export MINDSDB_GUI_AUTOUPDATE=false
167214
```
215+
168216
</CodeGroup>
169217

170218
## MindsDB GUI Startup and Updates
@@ -185,4 +233,113 @@ Note that the `MINDSDB_NO_STUDIO` is not recommended for the MindsDB instance ru
185233
```bash Shell
186234
export MINDSDB_NO_STUDIO=true
187235
```
236+
188237
</CodeGroup>
238+
239+
### ML Task Queue
240+
241+
#### `MINDSDB_ML_QUEUE_TYPE`
242+
243+
- **Type:** String (`local`, `redis`)
244+
- **Description:** Type of ML task queue to use
245+
- **Default:** `local`
246+
- **Example:** `MINDSDB_ML_QUEUE_TYPE=redis`
247+
248+
#### `MINDSDB_ML_QUEUE_HOST`
249+
250+
- **Type:** String (hostname)
251+
- **Description:** Redis host for ML task queue (only when `MINDSDB_ML_QUEUE_TYPE=redis`)
252+
- **Default:** `localhost`
253+
- **Example:** `MINDSDB_ML_QUEUE_HOST=redis.example.com`
254+
255+
#### `MINDSDB_ML_QUEUE_PORT`
256+
257+
- **Type:** Integer
258+
- **Description:** Redis port for ML task queue
259+
- **Default:** `6379`
260+
- **Example:** `MINDSDB_ML_QUEUE_PORT=6380`
261+
262+
#### `MINDSDB_ML_QUEUE_DB`
263+
264+
- **Type:** Integer
265+
- **Description:** Redis database number for ML task queue
266+
- **Default:** `0`
267+
- **Example:** `MINDSDB_ML_QUEUE_DB=1`
268+
269+
#### `MINDSDB_ML_QUEUE_USERNAME`
270+
271+
- **Type:** String
272+
- **Description:** Redis username for ML task queue
273+
- **Default:** None
274+
- **Example:** `MINDSDB_ML_QUEUE_USERNAME=redis_user`
275+
276+
#### `MINDSDB_ML_QUEUE_PASSWORD`
277+
278+
- **Type:** String
279+
- **Description:** Redis password for ML task queue
280+
- **Default:** None
281+
- **Example:** `MINDSDB_ML_QUEUE_PASSWORD=redis_pass`
282+
283+
## Reranker Configuration
284+
285+
#### `MINDSDB_RERANKER_N`
286+
287+
- **Type:** Integer
288+
- **Description:** Number of results to rerank
289+
- **Default:** None
290+
- **Example:** `MINDSDB_RERANKER_N=10`
291+
292+
#### `MINDSDB_RERANKER_LOGPROBS`
293+
294+
- **Type:** Boolean (`true`, `false`, `1`, `0`, `yes`, `no`)
295+
- **Description:** Enable log probabilities in reranker
296+
- **Default:** None
297+
- **Example:** `MINDSDB_RERANKER_LOGPROBS=true`
298+
299+
#### `MINDSDB_RERANKER_TOP_LOGPROBS`
300+
301+
- **Type:** Integer
302+
- **Description:** Number of top log probabilities to return
303+
- **Default:** None
304+
- **Example:** `MINDSDB_RERANKER_TOP_LOGPROBS=5`
305+
306+
#### `MINDSDB_RERANKER_MAX_TOKENS`
307+
308+
- **Type:** Integer
309+
- **Description:** Maximum tokens for reranker
310+
- **Default:** None
311+
- **Example:** `MINDSDB_RERANKER_MAX_TOKENS=512`
312+
313+
#### `MINDSDB_RERANKER_VALID_CLASS_TOKENS`
314+
315+
- **Type:** String (comma-separated list)
316+
- **Description:** Valid class tokens for reranker
317+
- **Default:** None
318+
- **Example:** `MINDSDB_RERANKER_VALID_CLASS_TOKENS=token1,token2,token3`
319+
320+
## Features
321+
322+
#### `MINDSDB_DATA_CATALOG_ENABLED`
323+
324+
- **Type:** Boolean (`1`, `true`)
325+
- **Description:** Enables the data catalog feature
326+
- **Default:** `false`
327+
- **Example:** `MINDSDB_DATA_CATALOG_ENABLED=1`
328+
329+
## Runtime
330+
331+
#### `MINDSDB_DOCKER_ENV`
332+
333+
- **Type:** Any value (presence check)
334+
- **Description:** Indicates MindsDB is running in Docker environment (changes default API host to `0.0.0.0`)
335+
- **Default:** Not set
336+
- **Example:** `MINDSDB_DOCKER_ENV=1`
337+
338+
#### `MINDSDB_RUNTIME`
339+
340+
- **Type:** String (`1`)
341+
- **Description:** Indicates MindsDB runtime environment
342+
- **Default:** Not set
343+
- **Example:** `MINDSDB_RUNTIME=1`
344+
345+
---

0 commit comments

Comments
 (0)