Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.dhal.rokad.co/llms.txt

Use this file to discover all available pages before exploring further.

AI autosetup

Dhal can scan your project and propose a dhal.json policy. It supports two paths:
  • deterministic heuristic autosetup;
  • optional AI SDK-assisted autosetup.
Generated config should be reviewed before enforcement.

Heuristic mode

npx dhal autosetup . --no-ai --json
npx dhal autosetup . --no-ai --write

AI-assisted mode

Install optional AI dependencies:
npm install ai @ai-sdk/openai
Run:
npx dhal autosetup . --provider openai --model gpt-4.1-mini --json
Gateway-style model string:
npx dhal autosetup . --provider gateway --model openai/gpt-4.1-mini --write

Custom provider module

npx dhal autosetup . \
  --provider custom \
  --provider-module ./my-ai-provider.js \
  --provider-export default \
  --model my-model \
  --json

Safe workflow

  1. Generate config to JSON.
  2. Review route profiles and rules.
  3. Save to a proposed file.
  4. Run dhal test-config, dhal doctor, and dhal replay.
  5. Commit only reviewed policy.