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:
- CLI flag — explicitly passed on the command line
- Config file — value in
agent-config.json - Default — built-in default
Environment variables
| Variable | Description |
|---|---|
JAN_APP_NAME | App name for locating config directory (default: Jan) |
HF_TOKEN | HuggingFace 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:
| Platform | Config 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.0export LLAMA_ARG_N_GPU_LAYERS=32export LLAMA_ARG_CTX_SIZE=8192export LLAMA_ARG_THREADS=8jan serve qwen3-4b
These are merged with CLI flags — explicit CLI flags always win.