Skip to main content

Configuration

drep.toml defines one or more LLM backends. An optional machine-level site.toml can enforce policy above it. The repository's deterministic tools are discovered from their own native configuration files.

Semantic review rounds

max_review_rounds is a top-level setting that defaults to 3 and must be at least 1. It limits fresh, finding-producing semantic-remediation rounds for authoritative change-set checks; cached reviews and deterministic tools remain available after the limit.

toml
max_review_rounds = 3

Use drep check --max-review-rounds N for a one-run override or --unlimited-reviews to remove the limit explicitly. Review-cycle state is private to the current worktree's Git metadata, not the response cache.

Machine-level site policy

Administrators can install policy at /Library/Application Support/drep/site.toml on macOS or /etc/drep/site.toml elsewhere. DREP_SITE_CONFIG can name an alternate file only when the installed path is absent; it cannot replace an installed policy.

toml
max_concurrent_ceiling = 4
refuse_markers = [".drep-no-llm"]

max_concurrent_ceiling caps every enabled provider after repository configuration is loaded. A repository can lower its own concurrency but cannot raise it past the machine ceiling. Both site-only fields are rejected in drep.toml, and unknown policy keys are errors.

Each refuse_markers entry names one file at a repository root. When the marker is present, drep refuses to send that repository's source to an LLM, including cached review paths and checks launched from another directory. The marker is never opened; a directory or broken symlink with the name also counts. Deterministic tools still run, but semantic review becomes an unanalyzed result and exits 2.

Policy fails closed

A policy that exists but cannot be read, parsed, or safely evaluated exits 2 rather than running unenforced. drep doctor reports the active policy, applied concurrency caps, and repository refusal without probing credentials.

Basic HTTP provider

toml
max_review_rounds = 3

[[llm]]
endpoint = "https://openrouter.ai/api/v1"
model = "deepseek/deepseek-v4-pro-0813"
api_key = "${OPENROUTER_API_KEY}"
timeout_secs = 1800

HTTP is the default backend and protocol = "openai" is the default wire format. Use protocol = "anthropic" only for an endpoint that exposes the Anthropic messages API.

Codex backend

toml
[[llm]]
backend = "codex"
model = "gpt-5.6-sol"
reasoning_effort = "high"
timeout_secs = 1800
max_concurrent = 1

This backend invokes a separately installed Codex CLI authenticated through ChatGPT. It does not use an HTTP endpoint or an API key in drep.

Credentials

The interactive wizard stores HTTP API keys in a private per-machine store keyed by normalized endpoint. It does not write the pasted key to drep.toml.

bash
drep auth list
drep auth login --provider kimi
drep auth logout --endpoint https://api.kimi.com/coding/v1

drep auth list prints endpoints but never keys. Resolution is an explicit api_key = "${VAR}", then api_key_command, then a stored key, then no protocol key. The explicit variable is appropriate for CI. See short-lived credentials for gateways whose tokens expire quickly.

Request headers and exact origins

An HTTP provider can add or replace request headers with its own [llm.headers] table. Values support ${VAR} expansion and may contain credentials, so drep reports only header names and includes values only in the response-cache digest.

toml
[[llm]]
endpoint = "https://gateway.example/v1"
model = "m"

[llm.headers]
"User-Agent" = "acme-gate/3.1"
"X-Tenant-Token" = "${TENANT_TOKEN}"

A configured name replaces the protocol or drep default. Without a configured user agent, drep sends User-Agent: drep/<version>. Without a resolved api_key, it sends no protocol authentication header, allowing a custom header to be the complete scheme. The Codex backend rejects this HTTP-only table.

Every configured endpoint is an exact origin. Completion requests and the authenticated model-listing request do not follow redirects, including same-origin redirects, so a protocol key or custom credential header is never replayed to a destination selected by a response.

Ordered failover

Each [[llm]] table adds one provider to the failover chain. drep advances on endpoint failures such as timeouts, refused connections, rate limits, server errors, and empty responses. Authentication failures stop the chain so a broken key cannot be hidden by a fallback.

toml
# Prefer a local model; use cloud when it is unavailable.
[[llm]]
endpoint = "http://localhost:1234/v1"
model = "qwen3-30b-a3b"

[[llm]]
endpoint = "https://openrouter.ai/api/v1"
model = "deepseek/deepseek-v4-pro-0813"
api_key = "${OPENROUTER_API_KEY}"

Set enabled = false to park an entry without deleting it. Disabled entries do not resolve credentials or validate provider-specific fields.

Request controls

KeyMeaning
temperatureOptional. When absent, drep does not send the parameter.
max_tokensOptional except for endpoints that require it. The wizard can apply a model-specific output ceiling, and the value is part of response-cache identity.
timeout_secsPer-request timeout; must be greater than zero.
max_retriesRetries for the provider before the chain considers failover.
max_concurrentMaximum concurrent reviews for this provider; must be greater than zero.

Unknown top-level and [[llm]] keys are load errors. Header names and values that HTTP cannot encode are rejected, as are two case-insensitive spellings of the same name.

Do not invent request limits

Some current reasoning models reject temperature; an arbitrary max_tokens can truncate their answer. Prefer the wizard's model-aware values or omit optional fields.