Configuration
Bareun's configuration is very simple. It runs as a server, so it is enough to put in the settings related to the server.
Configuration file
The configuration file is in the $BAREUN_ROOT/config directory. There is only one configuration file.
Below is the content of that file. The file format is JSON. The server application reads this file directly, so the format and variables must stay the same as in the distribution. If you make a typo when editing, the system will not run.
{
"version": 3000000,
"address": {
"ipAddr": "0.0.0.0",
"port": 5656
},
"libPath": "${BAREUN_ROOT}/lib",
"tracePath": "${BAREUN_ROOT}/var/trace",
"modelPath": "${BAREUN_ROOT}/var/models",
"customDictPath": "${BAREUN_ROOT}/var/custom-dict",
"licenseFile" : "${BAREUN_ROOT}/var/license.pem",
"logPath" : "${BAREUN_ROOT}/var/logs",
"varPath" : "${BAREUN_ROOT}/var",
"staticAddress": {
"ipAddr": "0.0.0.0",
"port": 5656
},
"manualPath": "${BAREUN_ROOT}/docs",
"webPath": "${BAREUN_ROOT}/webroot",
"hasTestWeb": true,
"executionProvider": {
"provider": "cpu"
}
}
| Variable | Sub-variable | Description |
|---|---|---|
| address | ipAddr | The address on which the server accepts input. The default value of ipAddr is 0.0.0.0.If the installed host has several network interfaces and you want to support only a specific network interface, you can change this value to that host's address. |
| port | The default is 5656. You can change it. After changing it, you must restart the server. | |
| libPath | The location of the ONNX Runtime libraries used for model inference. You do not need to change it. | |
| tracePath | The path where trace information is saved. It is calculated automatically. | |
| modelPath | The model path. It is also where the server downloads and keeps the models when it first runs. You do not need to change it. | |
| customDictPath | The custom dictionary path, calculated automatically. Deprecated. You can register custom dictionaries in various ways. | |
| licenseFile | The license file path. This file is required when you use Bareun in an air-gapped network. It is calculated automatically. Deprecated. | |
| logPath | The log path. The path where log files are saved. | |
| staticAddress | Built-in web server address: the built-in web server provides basic information such as help. | |
| manualPath | Manual path: points to the help path that the built-in web server refers to. It is the path that contains this document you are reading. | |
| webPath | Web application path: the built-in web server provides a web page where you can try out Bareun. Since 3.0.rc4, there is no difference between the Docker version and the regular version. | |
| hasTestWeb | Whether to include the test web application: do not change this setting. The built-in web server will malfunction. | |
| executionProvider | provider | The device that runs model inference. The default is cpu. To use a GPU, see Using a GPU. |
| revisionSession | store | Where correction sessions (API) are kept. If empty they are kept in server memory (lost when the server restarts); choose an external Redis to let several instances share the same sessions. Added in 3.4.0. |
| redisUrlEnv, redisKeyPrefix, redisTimeoutMs | When using Redis: the name of the environment variable that holds the connection address, the key prefix, and the response timeout in milliseconds. | |
| maxSessionsPerKey, maxSessionsPerServer, maxWordsPerSession, maxWordsTotal | Upper limits on concurrent sessions and on the number of words a session remembers. 0 means the default. |
Changing the configuration
To change the configuration, open it in an editor, edit it, and save. If you are not confident, it is a good habit to back up the original configuration file.
Keeping changed settings
A good way to keep changed settings is to create .bareun under the user's home directory and put bareun.json under it.
This way, the values are safely preserved even after a reinstall.
When a new version is distributed, the configuration always ships with its original default values. If you want to keep using your existing configuration file while using the features of the new version, you may want to reuse a configuration file you edited once.
The first way is to copy the configuration file from the previous version.