Configuration: runa.toml and environment keys

From docs/config.md at 947399f View on GitHub

Search order (later files win): ~/.config/runa/config.toml, then ./runa.toml. CLI flags beat RUNA_* env vars, which beat the files. Inline API keys in TOML are rejected (P3.8).

Top level

KeyValuesEnvCLI
on_unfiterror (default) | cpu | cloud:<backend>:<model>RUNA_ON_UNFIT--on-unfit

[models.<alias>]

KeyValues
sourceLocal path or hf:org/repo:quant (resolved by runa pull, never fetched by run)
loraString or array of path[:scale] LoRA adapters for this alias (P8.5; appended after [model] lora)

[model]

Defaults for whichever model is being run (P8.5).

KeyValuesCLI
loraString or array of path[:scale] LoRA adapters--lora
[model]
lora = ["adapter.gguf:0.5", "other.gguf"]

[defaults]

Run-wide defaults for inference commands (P10.2).

KeyValuesEnvCLI
threadsworker threads, integer >= 1 (default: P-cores on macOS, else all logical CPUs)RUNA_THREADS--threads
[defaults]
threads = 8

[system]

Cap on the share of total system resources this app may use, in percent of the total (default: 80). Applies to the RAM budget (model demand must fit total RAM × max_load_percent / 100) and the CPU thread share (--threads must fit CPUs × max_load_percent / 100). Every command that loads a model (run, chat, bench, serve, daemon, fit) checks the cap at startup and prints a warning: to stderr when system RAM is already over the cap or the model/threads do not fit — each warning names the value to set so the run fits. Warnings never fail the run; the user decides.

KeyValuesEnvCLI
max_load_percentinteger 1..=100 (default: 80)RUNA_MAX_LOAD_PERCENT--max-load-percent
[system]
max_load_percent = 80

[mcp.servers.<name>]

Stdio MCP servers whose tools runa run / runa chat offer to the model (P8.3). --mcp '<command args>' adds more for one run. See docs/structured.md.

KeyValues
commandProgram to start (required)
argsArray of argument strings
envTable of extra environment variables
[mcp.servers.fs]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-filesystem", "."]

[think]

KeyValuesEnvCLI
modeon | off | budget | effortRUNA_THINK--think
budgetreasoning token cap (required when mode = "budget")RUNA_THINK_BUDGET--think-budget
graceextra tokens after the budget (default 0)RUNA_THINK_GRACE(slash /think grace)
effortlow | medium | high | maxRUNA_EFFORT--effort
showbool — print reasoningRUNA_SHOW_REASONING--show-reasoning / --no-show-reasoning

mode = "budget" needs budget. --think off cannot combine with budget/effort.

[audio]

KeyValuesEnvCLI
routeauto (default) | native | asrRUNA_AUDIO_ROUTE--audio-route

See docs/media.md.

[memory]

KeyValuesEnv
idle_timeout_sseconds before idle shrinkRUNA_MEMORY_IDLE_TIMEOUT_S
floor_mibidle floorRUNA_MEMORY_FLOOR_MIB
max_growth_mibcap on grow_forRUNA_MEMORY_MAX_GROWTH_MIB

See docs/memory.md.

Cloud env (not TOML)

EnvUse
OPENAI_API_KEYOpenAI
ANTHROPIC_API_KEYAnthropic
OPENAI_BASE_URLOpenAI-compatible base URL