Skip to content

Circuit Breakers

Each provider has an independent circuit breaker with three states:

CLOSED (healthy) ──3 failures──> OPEN (failing) ──30s──> HALF-OPEN (testing)
^ │
└─────────── 2 successes in half-open ────────────────────┘

Closed. Requests flow normally. Failure counter resets on success.

Open. All requests to this provider are blocked. After 30 seconds, the breaker transitions to half-open to test recovery.

Half-Open. One request is allowed through. If 2 successive successes occur, the breaker closes. If any failure occurs, it returns to open.

Configuration

VariableDefaultWhat It Controls
CB_FAILURE_THRESHOLD3Consecutive failures before tripping open
CB_SUCCESS_THRESHOLD2Successes needed in half-open to recover
CB_TIMEOUT_MS30000Wait time before testing an open breaker

Manual reset

Trip happened to a provider you know is back? Reset it via the API:

Terminal window
curl -X POST http://localhost:3000/v1/status/providers/groq/reset

Or click the Reset button on the provider card in the dashboard.