Skip to content

Configuration

All settings live in one Pydantic model, MAGEConfig. Defaults below are from the 0.2.0 candidate (mmar_mage/schemas.py on prep/mage-0.2.0); most also hold for 0.1.3 and the revisions MAESTRO pins. The big exception is generation_strategy: v3 in 0.2.0, legacy before.

from mmar_mage import MAGEConfig
MAGEConfig(api_key="sk-...", model="gpt-4o") # 0.2.0: v3
MAGEConfig(generation_strategy="legacy", mode="fast", api_key="sk-...", model="gpt-4o")
MAGEConfig.from_toml("configs/deep_local.toml") # every field under [mage]; 0.2.0 presets set "legacy"
MAGEConfig.from_env() # MAGE_* variables, see below
MAGEConfig.for_openrouter(api_key="sk-or-...", model="anthropic/claude-3.5-sonnet")
MAGEConfig.for_local(base_url="http://localhost:8000/v1") # api_key "EMPTY", model "__auto__"
FieldDefaultNotes
generation_strategyv30.2.0 candidate default: v3 runs the v3 generator, see below. legacy runs the fast/deep pipeline, the default in the revisions MAESTRO pins. semantic (0.2) routes generate() through compile(). A benchmark_profile selects legacy unless a strategy is given. 0.1.3 has no such field.
modedeepfast or deep. Legacy strategy only; v3 ignores it.
provideropenaiopenai, openrouter, local, custom.
base_url, api_key, modelunset, unset, gpt-4omodel="__auto__" takes the first model the server lists at /v1/models.
temperature0.2
max_retries2Per model call.
http_timeout, ssl_verify60.0, true
stage_llm_overrides{}Per-stage model or temperature, keyed by stage name.
allowed_step_typesall MAGE typesRestrict what the chain may contain. With v3 it is enforced at admission (0.2.0 candidate).
enable_domain_analysis, enable_step_planning, enable_dag_optimization, enable_step_descriptionstrueThe four deep stages (legacy only).
enable_contract_compilertrue0.2: deterministic single-tool chains.
enable_memory, memory_base_urltrue, http://localhost:8002Implicit save, see Memory and reuse.
enable_memory_research, memory_search_modefalse, hybridRecall before planning.
enable_web_research, web_search_provider, web_search_api_keyfalse, tavily, unsetProviders: tavily, serper, exa, serpapi, brave, duckduckgo (no key, web extra).
enable_suggested_naming_llmtrueOne extra call for a display name in deep mode.
max_llm_calls, max_input_tokens, max_output_tokens, max_total_tokens, max_wall_time_seconds, max_cost_usdunset0.2: hard per-generation budgets.

Every optional stage has its own enable_* switch, all off by default; the list is in Generation pipeline.

0.2.0 candidate. Read only by the v3 strategy, which is the default there. The defaults are the measured v3.4 configuration.

FieldDefaultNotes
v3_max_repairs3Admission repair rounds after the first authoring attempt (0 to 10).
v3_dry_run_rounds1Dry-run rounds (0 to 3); 0 turns the dry run off.
v3_dry_run_fixtures2Synthesized test inputs per round (1 to 4).
v3_dry_run_repairs2Authoring attempts allowed to repair one failed dry run (1 to 3).
v3_dry_run_timeout_seconds240.0Wall-clock limit of one test input’s CARL run.
v3_dry_run_judgefalseFresh-context model review of each dry-run answer. Off in v3.4: only the deterministic review runs.
v3_dry_run_max_output_tokens6144Per-call cap for the chain’s own model steps in the dry run; None means no extra cap.
v3_temperature0.0Sampling temperature of every v3 call; None uses temperature.
v3_normalize_bindingsfalseRewrite typed or bare tool arguments as CARL string bindings. Off in v3.4.

The dry run never calls host tools, but it costs model calls: test inputs, the chain’s own model steps and the simulated tools. The max_* budgets count them. None of the v3_* fields has an environment variable.

MAGEConfig.from_env() reads only these variables. Booleans accept true, 1, yes. If MAGE_API_KEY is unset, OPENAI_API_KEY is used.

GroupVariables
EndpointMAGE_API_KEY, MAGE_BASE_URL, MAGE_MODEL, MAGE_PROVIDER, MAGE_SSL_VERIFY, MAGE_HTTP_TIMEOUT, MAGE_OPENROUTER_SITE_URL, MAGE_OPENROUTER_APP_NAME
StrategyMAGE_GENERATION_STRATEGY
MemoryMAGE_ENABLE_MEMORY, MAGE_MEMORY_BASE_URL, MAGE_ENABLE_MEMORY_RESEARCH, MAGE_MEMORY_RELEVANCE_THRESHOLD, MAGE_MEMORY_RECALL_TOP_K, MAGE_MEMORY_SEARCH_MODE, MAGE_MEMORY_NAMESPACE, MAGE_MEMORY_APPLICABILITY_THRESHOLD, MAGE_MEMORY_MIN_APPLICABLE_HITS
Web researchMAGE_ENABLE_WEB_RESEARCH, MAGE_WEB_SEARCH_API_KEY, MAGE_WEB_SEARCH_PROVIDER, MAGE_WEB_MIN_SOURCED_CLAIMS, MAGE_WEB_EVIDENCE_RANKING_ENABLED, MAGE_WEB_CLAIM_ENTAILMENT_MODE
PlanningMAGE_ENABLE_NEEDS_ANALYSIS, MAGE_ENABLE_TOPOLOGY_SELECTION, MAGE_TOPOLOGY_MAX_CANDIDATES, MAGE_ENABLE_PARALLEL_TOPOLOGY_SAMPLING, MAGE_SIMPLICITY_BIAS, MAGE_SIMPLICITY_MAX_STEPS, MAGE_COLD_START_CANDIDATES, MAGE_ENABLE_TOOL_SYNTHESIS, MAGE_ENABLE_DEMO_BOOTSTRAP, MAGE_DEMO_BOOTSTRAP_CANDIDATES, MAGE_DEMO_BOOTSTRAP_TOP_K, MAGE_DEMO_BOOTSTRAP_MIN_PASS_RATE
Quality and feedbackMAGE_STEP_CRITIC_REVISION_THRESHOLD, MAGE_FEEDBACK_APPLICABILITY_THRESHOLD, MAGE_EXECUTION_FEEDBACK_THRESHOLD, MAGE_MAX_EXECUTION_FEEDBACK_ITERATIONS, MAGE_BENCHMARK_N_CASES, MAGE_MAX_DIGEST_CHARS
CapabilitiesMAGE_ENABLE_OFFICIAL_MCP_REGISTRY_DISCOVERY, MAGE_OFFICIAL_MCP_REGISTRY_URL, MAGE_CAPABILITY_DISCOVERY_MAX_RESULTS, MAGE_ENABLE_CAPABILITY_METADATA_VERIFICATION, MAGE_ENABLE_CAPABILITY_RUNTIME_PROBE, MAGE_CAPABILITY_VERIFICATION_CACHE_PATH, MAGE_CAPABILITY_HEALTH_TTL_SECONDS
BudgetsMAGE_MAX_LLM_CALLS, MAGE_MAX_INPUT_TOKENS, MAGE_MAX_OUTPUT_TOKENS, MAGE_MAX_TOTAL_TOKENS, MAGE_MAX_WALL_TIME_SECONDS, MAGE_MAX_COST_USD

The mage CLI does not call from_env() at all; it reads only MAGE_API_KEY, so MAGE_GENERATION_STRATEGY has no effect there. On 0.2.0 use mage generate --strategy. See CLI.

TOML files in configs/ of the repository, loaded with from_toml. In the 0.2.0 candidate every preset sets generation_strategy = "legacy", because its mode and stage switches drive the legacy pipeline:

FileWhat it sets
fast.tomlFast mode, no memory, no research.
deep_local.tomlDeep mode on a local Ollama-style server (http://localhost:11434/v1, model __auto__), memory and memory research on.
deep_local_airi.tomlThe same against a hosted OpenAI-compatible inference server.
deep_openrouter.tomlDeep mode through OpenRouter.
deep_research.tomlDeep mode with memory and web research.
care_default.tomlDeep mode with streaming, schema-constrained output, replan generation, step critique on tool and structured_output steps, step_describe_mode="auto".
care_local.toml, care_research.tomlLocal-server and full-research variants of the above.

MAESTRO’s [mage] section (CARE_MAGE__<FIELD>) is passed to MAGEConfig field by field; a field the installed MAGE does not declare is an error. MAESTRO then forces provider="custom" and its own Memory URL. In the desktop app the endpoint, model and key come from the chat session, not from [mage]. MAESTRO’s defaults differ from MAGE’s (for example memory research on, bm25 search, topology selection on): see MAESTRO configuration and MAESTRO as host.