Where settings come from

MLStudio reads settings from four places. Pick the one that matches what you want to change.

  1. config/mlstudio_config.json, read at start. Used for secrets, database, folders and upload size.
  2. Environment variables, and a .env file in the project folder, which is loaded at start.
  3. The database Settings table, edited on the App Settings page or through the Settings API.
  4. Launcher flags.

Some older text in the Overview and the main documentation page shows a .env file with SECRET_KEY, DATABASE_URI, FLASK_ENV, FLASK_DEBUG, LOG_LEVEL, DATABASE_URL, MAX_UPLOAD_SIZE and UPLOAD_FOLDER. The application code does not read those variables. The launcher writes some of them to .env, but changing them has no effect. Use the file keys below instead.

Launcher flags

FlagMeaning
--industry <name>Lock to one industry mode.
--port <number>Port. Default 5001.
--host <address>Bind address.
--debugDebug mode.
--no-browserDo not open the browser.

The launchers check for Python 3.8 or later.

Environment variables

VariableDefaultMeaning
HOST127.0.0.1Bind address.
PORT5001Port.
DEBUGtrueDevelopment mode. The code default is on, so set DEBUG=false for real use.
OPEN_BROWSER, MLSTUDIO_NO_BROWSERControl whether a browser opens at start.
MLSTUDIO_FORCED_INDUSTRYLock to one industry mode.
MLSTUDIO_EMBEDDED_PYTHONSet to 1 to use an embedded Python.
DB_FILEmlstudio.dbName of the SQLite file.
AUTH_MODElocallocal or identity_server.
IDENTITY_SERVER_URL, IDENTITY_SERVER_CLIENT_ID, IDENTITY_SERVER_CLIENT_SECRETIdentity Server connection.
COMMUNITY_URLhttp://127.0.0.1:5002Community server.
COMMUNITY_API_KEYCommunity key.
KAGGLE_USERNAME, KAGGLE_API_KEYUsed when the administrator has not stored Kaggle credentials in the database.
ENCRYPTION_KEYA Fernet key for encrypted settings. See below.
*_ALLOW_PRIVATE_NETWORKoffSix switches listed on the Connecting to other systems page. Values 1, true, yes, on.

Encryption key

Encrypted values (Kaggle keys, credential vault, the Host Admin key) use a Fernet key. The application looks for it in this order: the Settings row encryption_key in category security, then ENCRYPTION_KEY, and otherwise it derives one from the application secret and saves it to Settings. Back it up. Losing it makes stored secrets unreadable. The dataset marketplace admin page can show the key status and generate a new key.

config/mlstudio_config.json

KeyDefaultMeaning
secret_keya built-in development valueFlask session secret. Set your own before real use.
jwt_secret_keyJWT signing secret.
jwt_access_token_expires3600Seconds.
database_uriwritten on first runSQLite file named mlstudio.db unless DB_FILE is set. Changed by the setup wizard.
upload_folderdataUpload folder.
projects_folderprojectsProject folder.
max_upload_size104857600Bytes (100 MB).

Settings table defaults

These rows are created with these values. View and edit them on App Settings, or through the Settings API.

KeyDefault
app_nameBeep ML Studio
company_nameTheTechIdea
app_version1.0.0
debug_modefalse
log_levelINFO
base_path.
projects_folderprojects
data_folderdata
models_foldermodels
providers_folderproviders
python_embedded_pathpython-embedded
environment_manager_typelocal
host_admin_urlhttp://127.0.0.1:5000
host_admin_api_keyempty, stored encrypted
default_python_version3.11
auto_create_environmentstrue
default_frameworkscikit-learn
max_upload_size_mb100
default_train_test_split0.2
default_random_state42
auto_save_modelstrue
items_per_page20
auto_refresh_interval30
show_advanced_optionsfalse

A search of the code found no reader for default_python_version, auto_create_environments, default_train_test_split, default_random_state, auto_save_models, items_per_page, auto_refresh_interval, show_advanced_options and app_version. They are stored and shown, but changing them does not change behaviour today.

Other keys read when present

KeyDefaultUsed for
ml_server_urlhttp://127.0.0.1:6000MLServer address.
ml_server_api_keyMLServer Bearer token.
community_url, community_api_key, community_connectedCommunity connection.
kaggle_username, kaggle_api_keyKaggle (category dataset_marketplace).

Security page values

The page at /admin/settings stores these starting values: smtp_port 587, smtp_use_tls true, from_name Beep ML Studio, mfa_code_expiry_minutes 10, captcha_on_register true, session_timeout_minutes 60, max_login_attempts 5, lockout_duration_minutes 15, password_min_length 8, password_require_uppercase true, password_require_number true, password_require_special false, and fields for Google, Microsoft, GitHub and Facebook sign in. As noted on the Setup and accounts page, nothing in the code reads them yet.

Settings API

RouteWhat it does
GET /api/v1/settingsList. Optional category.
GET /api/v1/settings/categoriesCategories.
GET, PUT, DELETE /api/v1/settings/<key>Read, change, delete.
POST /api/v1/settingsCreate. Body key (required), category, value_type, description, is_encrypted, value.
POST /api/v1/settings/resetReset to the defaults above.

The handlers for these routes do not check that the caller is signed in. Keep MLStudio off networks you do not trust.