Skip to content

Configuration

saudademjj edited this page Dec 5, 2026 · 1 revision

Where settings come from

Later sources override earlier ones:

  1. Built-in defaults.
  2. config.toml: the file named by FAI_CONFIG, otherwise server/config.toml if it exists.
  3. FAI_* environment variables.
  4. Command-line options such as fai agent --model.

The server/ folder sits in the installation root, which is FAI_HOME if set, otherwise the nearest folder above the executables that contains mod/factorio_ai_bridge/info.json, otherwise the executables' folder. config.toml, rcon.pw and the per-save ledgers live there.

fai setup creates server/config.toml and server/rcon.pw. Every option is listed, with comments, in server/config.example.toml.

config.toml

Top level

Key Default Meaning
build_mode "ghost" ghost, character, character_free or instant; see Playing with the AI
instant_research false Let research finish instantly; only allowed in instant mode
surface "nauvis" Starting surface
state_file "base_state.json" Ledger file name; give each save its own, for example alpha.json
default_logistics "auto" auto, bus or bot
rail_fallback true Switch to a train supply line when belts or pipes get stuck or too long
rail_escalation_dist 500 Distance in tiles above which trains carry the supply
max_engineers_per_planet 8 Most virtual engineers per planet; players decide how many to add

[rcon]

Key Default Meaning
host, port 127.0.0.1, 27015 Where the game's RCON listens
password / password_file empty Empty reads rcon.pw next to the config
transport "fai-command" fai-command keeps achievements; silent-command disables them for that save the first time it runs
timeout_s 10.0 RCON timeout in seconds
max_command_bytes, chunk_bytes 8000, 6000 Size limits for long commands

[watch]

Key Default Meaning
poll_interval_s 0.2 How often game events are polled
coalesce_window_s 3.0 Window in which repeated events are merged

[agent]

Provider, model, token limits and allowed_players: see Model Providers.

Environment variables

Variable Overrides or sets
FAI_HOME Installation root that contains server/
FAI_CONFIG Path to config.toml
FAI_RCON_HOST, FAI_RCON_PORT [rcon] host, port
FAI_RCON_PASSWORD, FAI_RCON_PASSWORD_FILE The RCON password, or a file holding it
FAI_TRANSPORT [rcon] transport
FAI_BUILD_MODE build_mode
FAI_INSTANT_RESEARCH instant_research
FAI_STATE_FILE state_file
FAI_LOGISTICS default_logistics
FAI_RAIL_FALLBACK, FAI_RAIL_ESCALATION_DIST rail_fallback, rail_escalation_dist
FAI_MAX_ENGINEERS_PER_PLANET max_engineers_per_planet
FAI_LLM_PROVIDER, FAI_LLM_MODEL, FAI_LLM_BASE_URL, FAI_LLM_API_KEY [agent] provider, model, base_url, api_key
FAI_AGENT_CHAT_ONLY [agent] chat_only
FAI_AGENT_TRANSCRIPT Append the agent's conversation to this file
FAI_SOLVER copt or highs forces a recipe solver; see Troubleshooting
FAI_GAME_DATA Use a different Factorio prototype export instead of the bundled one

Provider keys such as DEEPSEEK_API_KEY are listed in Model Providers.

Clone this wiki locally