How configuration works
Lerim loads configuration from multiple TOML files and merges them together. Each layer can override settings from the previous layer, giving you global defaults that can be customized per-project. All configuration is stored in TOML format, making it easy to read and edit by hand. API keys are never stored in config files — they come from environment variables only.Configuration precedence
Lower entries override higher ones:src/lerim/config/default.toml— Shipped with the package (all defaults)~/.lerim/config.toml— User global overrides<repo>/.lerim/config.toml— Project-specific overridesLERIM_CONFIGenv var — Explicit path override (for CI/tests)
Lerim creates
~/.lerim/config.toml automatically on first run with helpful comments. Project config files are created when you run commands in a repository.Why layers matter
The layered approach lets you:- Set global defaults in
~/.lerim/config.tomlthat apply to all projects - Override specific settings per-project in
<repo>/.lerim/config.toml - Test alternative configurations with
LERIM_CONFIGwithout touching your main files - Keep model preferences and timeouts separate from project-specific memory settings
Example: Switching models for one project
Example: Switching models for one project
You might use Grok globally but want to use GPT-4o for a specific high-stakes project:When you run
~/.lerim/config.toml (global):my-app/.lerim/config.toml (project override):lerim sync in my-app/, Lerim uses GPT-4o. Everywhere else, it uses Grok.When configuration is loaded
Lerim loads configuration at startup for every command. This means:- Changes to config files take effect immediately on the next command
- You don’t need to restart the daemon to pick up config changes
- Each command reads the latest merged configuration
The daemon (
lerim up or lerim serve) loads config once at startup and caches it. If you change config while the daemon is running, restart it with lerim down && lerim up to pick up the changes.File locations
User config
Path:~/.lerim/config.toml
Created automatically on first run. This is where you set your global preferences:
- Model providers and models for each role
- API base URLs for custom endpoints
- Server host and port
- Memory scope preferences
- Tracing settings
Project config
Path:<repo>/.lerim/config.toml
Created automatically when you run Lerim commands in a git repository. This is where you override settings for a specific project:
- Project-specific model choices
- Memory scope (project-only vs. global fallback)
- Custom sync/maintain intervals
Default config
Path:src/lerim/config/default.toml (inside the package)
Shipped with Lerim. You can view the full default config in the GitHub repository or by running:
Environment variables
API keys
API keys are set as environment variables, never in config files:You can also store these in a
.env file in your project root. Lerim loads .env automatically using python-dotenv.Configuration overrides
| Variable | Purpose |
|---|---|
LERIM_CONFIG | Path to an explicit config file (overrides all layers) |
LERIM_TRACING | Set to 1 to enable OpenTelemetry tracing (overrides [tracing].enabled) |
Using LERIM_CONFIG for testing
TheLERIM_CONFIG environment variable lets you test alternative configurations without modifying your main config files:
Configuration sections
Lerim’s config is organized into logical sections:| Section | Purpose |
|---|---|
[data] | Data directory location |
[memory] | Memory scope and decay settings |
[server] | Daemon host, port, and intervals |
[roles.*] | Model configuration for each role (lead, explorer, extract, summarize) |
[providers] | API base URLs per provider |
[tracing] | OpenTelemetry tracing settings |
[agents] | Connected coding agent platforms |
[projects] | Registered project paths |
Agents and projects
The[agents] and [projects] sections are special — they’re written automatically by Lerim commands:
[agents]— Written bylerim initorlerim connect[projects]— Written bylerim project add
lerim up), these paths determine the volume mounts. Adding or removing a project restarts the container to update mounts.
Next steps
Config.toml reference
Complete reference for all configuration options
Model roles
Configure LLM models for each role
Tracing setup
Enable OpenTelemetry tracing with Logfire