Docs
Configuration

Configuration

Jan Agent uses a layered configuration system: CLI flags take priority over config files, which take priority over defaults.

Agent config file

Jan Agent reads agent-config.json from the same directory as the binary. This file persists your preferred defaults so you don't have to pass flags every time.


{
"serve": {
"port": 6767,
"n_gpu_layers": -1,
"ctx_size": 32768,
"threads": 0,
"timeout": 120,
"fit": false,
"embedding": false,
"verbose": false,
"select_quant": false,
"model_path": null,
"bin": null,
"mmproj": null
}
}

Priority order

For any setting, the value is resolved in this order:

  1. CLI flag — explicitly passed on the command line
  2. Config file — value in agent-config.json
  3. Default — built-in default

Environment variables

VariableDescription
JAN_APP_NAMEApp name for locating config directory (default: Jan)
HF_TOKENHuggingFace token for downloading gated models
LLAMA_ARG_*Pass-through flags to the LlamaCPP server (e.g. LLAMA_ARG_HOST=0.0.0.0)

Data folder resolution

The Jan data folder is located by reading settings.json from your platform's app data directory:

PlatformConfig path
macOS~/Library/Application Support/Jan/settings.json
Linux~/.config/Jan/settings.json (or $XDG_CONFIG_HOME/Jan/)
Windows%APPDATA%\Jan\settings.json

The data_folder field in settings.json points to the actual data directory. If not set, it defaults to <platform_data_dir>/Jan/data.

This is the same settings.json used by Jan Desktop, so both applications share the same data folder automatically.

LlamaCPP server arguments

Any llama-server command-line flag can be set via environment variables with the LLAMA_ARG_ prefix:


export LLAMA_ARG_HOST=0.0.0.0
export LLAMA_ARG_N_GPU_LAYERS=32
export LLAMA_ARG_CTX_SIZE=8192
export LLAMA_ARG_THREADS=8
jan serve qwen3-4b

These are merged with CLI flags — explicit CLI flags always win.