Skip to main content

Configuration

RLMX uses a layered configuration system. Configuration lives in the .rlmx/ directory at your project root.
Breaking change (v0.260331+): RLMX now requires the .rlmx/ directory layout. Projects using the old flat-file rlmx.yaml in the project root must re-run rlmx init to migrate.

.rlmx/ directory

Run rlmx init to scaffold the config directory. Choose a template with --template default (general-purpose) or --template code (code analysis).

rlmx.yaml

The primary config file inside .rlmx/. Run rlmx init to scaffold one with inline comments.

Config sections explained

model

Controls which LLM provider and model RLMX uses. Supports any provider available in pi/ai.

system

The system prompt sent to the LLM. Defaults to the exact RLM paper prompt, which includes research-backed guidance on decomposition, tool use, and iterative reasoning. Override only if you have a specific need. The system prompt supports a {custom_tools_section} placeholder that RLMX replaces with your custom tool definitions.

tools

Custom Python functions injected into the REPL namespace. Each key is the function name, and the value is the Python source code. Custom tools have access to:
  • context — the loaded context variable
  • llm_query() — make LLM sub-calls
  • All standard Python builtins

criteria

Quality and format criteria appended to the system prompt. Use this to control output style without touching the core system prompt.

context

Controls how files are loaded when --context points to a directory.

budget

Safety limits to prevent runaway costs.
Without budget limits, a complex query with recursive sub-calls can get expensive. Set max-cost for production use.

cache

Controls provider-level context caching (CAG mode). See Cache Mode for the end-to-end flow and Batch Mode for bulk usage patterns.

gemini

Gemini 3 native features. All are opt-in and silently ignored on non-Google providers.

output.schema

JSON Schema for structured output. On Google providers, this is enforced via the API. On other providers, RLMX falls back to FINAL() text parsing.

Global settings

Global settings are stored at ~/.rlmx/settings.json and managed with rlmx config commands.
See the CLI Reference for the full list of config commands and keys.

Priority order

Settings are resolved highest-priority first:

.rlmx/ companion files

The .rlmx/ directory includes companion Markdown files alongside rlmx.yaml. These files let you keep long-form content (prompts, tools, criteria) out of the YAML file. If both the Markdown file and the corresponding rlmx.yaml section are present, the Markdown file takes precedence.

TOOLS.md format

Custom tools defined as ## heading + Python code block:
You can inline tools directly in rlmx.yaml under the tools: section, or keep them in TOOLS.md for readability. Same applies to system: / SYSTEM.md and criteria: / CRITERIA.md.

Environment variables

API keys can also be set as environment variables instead of using rlmx config set: Keys set via rlmx config set are injected into process.env before any command runs, so they behave identically to environment variables.