Skip to content

Config

alloy.config

configure

configure(**kwargs)

Set global defaults for Alloy execution.

Example

configure(model="gpt-5-mini", temperature=0.7)

use_config

use_config(temp_config)

Context manager to apply a config within a scope.

get_config

get_config(overrides=None)

Return the effective config with precedence:

per-call overrides > context > global (configure) > env > built-in defaults

Usage

from alloy import configure

# Global defaults
configure(model="gpt-5-mini", temperature=0.2, max_tokens=512)

# Per-call overrides take precedence
# ask("...", model="gpt-5-mini", temperature=0.0)

Precedence - 1. Per-call overrides (e.g., ask(..., model=...)) - 2. configure(...) and context scopes - 3. Environment (ALLOY_*) - 4. Built-ins (e.g., model="gpt-5-mini")

See also

  • Guide → Configuration: guide/configuration.md