Docs/Advanced Features

AI Configuration

Assrt uses language models for three things: resolving natural-language locators, running AI checks, and powering authoring helpers. This page covers how to pick models, route them, and control cost.

Configure a provider

assrt.config.yamlyaml
ai:
  provider: anthropic
  model: claude-sonnet-4-6
  apiKey: "{{ env.ANTHROPIC_API_KEY }}"

Per-step overrides

Expensive steps can route to a cheaper or faster model without changing the default for the whole suite.

yaml
- ai-check:
    ai:
      model: claude-haiku-4-5
    text: a success banner is visible
Cost control
Keep AI steps out of hot paths. For assertions with a clear DOM target, use element-check. For navigation, use concrete steps. AI should be reserved for the parts that are genuinely hard to express otherwise.