Skip to content

About

A non-saturating, open-ended environment for evaluating LLMs in Factorio

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Factorio Learning Environment

Leaderboard | Paper | Website | Documentation | Discord (#factorio-learning-env)

An open source framework for developing and evaluating LLM agents in the game of Factorio.

Claude Opus 4.1 Plays Factorio

Quick Links

Installation

Prerequisites

  • Docker
  • Python 3.10+
  • Factorio (version 2.0.73 or later), only for optional rendering.
# Core FLE SDK package
pip install factorio-learning-environment

# With optional features
pip install factorio-learning-environment[eval]      # For running experiments
pip install factorio-learning-environment[mcp]       # For MCP protocol support  
pip install factorio-learning-environment[psql]      # For PostgreSQL support
pip install factorio-learning-environment[eval,mcp,psql]  # All features

# Using uv (recommended)
uv sync

Quickstart

Use the CLI:

# Activate venv
source .venv/bin/activate

# Start Factorio cluster
fle cluster start

# Run evaluation trajectories (requires [eval] dependencies)
fle eval --config configs/gym_run_config.json

Using a ChatGPT subscription instead of an API key

Authenticate once with a ChatGPT Plus/Pro account and run evals against the Codex backend with no OPENAI_API_KEY:

fle codex login                    # opens a browser (PKCE OAuth); `fle codex status` to check
fle inspect-eval --env-id iron_ore_throughput --model codex/gpt-5.6-sol

Credentials are stored in ~/.fle/codex_auth.json, and an existing codex login from the official Codex CLI is picked up automatically. Model availability depends on your subscription, not on FLE.

Using a Claude subscription instead of an API key

The same works for Anthropic models with a Claude Pro/Max account and no ANTHROPIC_API_KEY:

fle claude login                   # opens a browser (PKCE OAuth); `fle claude status` to check
fle inspect-eval --env-id iron_ore_throughput --model claude/claude-sonnet-4-5

Credentials are stored in ~/.fle/claude_auth.json, and an existing Claude Code login (~/.claude/.credentials.json) is picked up automatically.

Environment

FLE is an agent evaluation environment built on the game of Factorio, a popular resource management simulation game.

Agents interact with FLE by code synthesis through a REPL (Read-Eval-Print-Loop) pattern:

  1. Observation: The agent observes the world through the output streams (stderr/stdout) of their last program.
  2. Action: The agent generates a Python program to perform their desired action.
  3. Feedback: The environment executes the program, assigns variables, add classes/functions to the namespace, and provides an output stream.

Contributing

Join our team and contribute to one of the AI research community's most challenging problems - building open-ended / unsaturateable evals for post-AGI frontier models. If you want to contribute, please read CONTRIBUTING.md first.

Ask DeepWiki

About

A non-saturating, open-ended environment for evaluating LLMs in Factorio

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages