Repository navigation
Resilience
Sriinnu edited this page Oct 5, 2026
·
1 revision
Kosha is designed to degrade gracefully and auto-heal when providers are unavailable.
Each provider has an independent circuit breaker with three states:
- Closed (healthy) — requests pass through normally
- Open (failing) — after 3 consecutive failures, the provider is short-circuited for 60 seconds
- Half-Open (probing) — after cooldown, one probe request is allowed; success -> closed, failure -> open
When a provider fails during discovery, Kosha serves the last-known-good cached data (marked as stale) instead of returning nothing. This ensures your application always has model data, even during provider outages.
const kosha = await createKosha();
// Check provider health
const health = kosha.providerHealth();
// -> { anthropic: "closed", nvidia: "open", groq: "half-open", ... }
// Reset a provider's circuit breaker
kosha.resetHealth("nvidia");Reference pages are generated from the repository; changes go through a pull request there.