Cruel exports comprehensive TypeScript types for all configuration options and interfaces.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/visible/cruel/llms.txt
Use this file to discover all available pages before exploring further.
Core Options
ChaosOptions
Base chaos configuration options used throughout Cruel.Probability (0-1) of random failures
Fixed delay in ms or range
[min, max] for random delayProbability (0-1) of operations timing out (never completing)
Random jitter to add to delays (0 to
jitter ms)Probability (0-1) of corrupting string responses
Additional delay spike in ms or range
[min, max]Whether chaos is enabled (allows conditional chaos)
Network Options
NetworkOptions
ExtendsChaosOptions with network-specific chaos.
Network latency in ms or range
Probability (0-1) of packet loss
Simulated bandwidth limit in kbps
Probability (0-1) of connection disconnect
Probability (0-1) of DNS failures
HttpOptions
ExtendsChaosOptions with HTTP-specific chaos.
HTTP status code(s) to return
Rate limit probability or configuration object with
rate, status, and retryAfterDelay for response body in ms or range
Probability (0-1) of truncating response body
Probability (0-1) of returning malformed response
Custom headers to inject
StreamOptions
ExtendsChaosOptions with streaming-specific chaos.
Probability (0-1) of cutting stream mid-transfer
Pause duration in ms or range
Probability (0-1) of reordering chunks
Probability (0-1) of duplicating chunks
Probability (0-1) of dropping chunks
Probability (0-1) of corrupting chunks
AI SDK Options
AIOptions
ExtendsChaosOptions with AI-specific chaos for language models.
Rate limit probability or configuration with
rate and retryAfterProbability (0-1) of model being overloaded
Probability (0-1) of context length errors
Probability (0-1) of content filter triggering
Probability (0-1) of model being unavailable
Token limit for responses
Probability (0-1) of cutting token streams
Delay per token in ms or range
Probability (0-1) of returning partial responses
Probability (0-1) of returning invalid JSON
CruelModelOptions
Options forcruelModel() function.
Callback function invoked when chaos events occur
Probability (0-1) of tool execution failures
Probability (0-1) of tool execution timeouts
Override finish reason in responses
Override token usage counts with
inputTokens and outputTokensCruelProviderOptions
Options forcruelProvider() function.
Model-specific chaos configuration, keyed by model ID
CruelMiddlewareOptions
Options forcruelMiddleware() function.
Resilience Patterns
CircuitBreakerOptions
Configuration for circuit breaker pattern.Number of failures before opening circuit
Time in ms before attempting to close circuit
Callback when circuit opens
Callback when circuit closes
Callback when circuit enters half-open state
RetryOptions
Configuration for retry pattern.Maximum number of retry attempts
Delay between retries in ms or range
Backoff strategy for retry delays
Maximum delay in ms (caps backoff)
Callback invoked before each retry
Predicate to determine if error should trigger retry
BulkheadOptions
Configuration for bulkhead pattern (concurrency limiting).Maximum number of concurrent executions
Maximum queue size for waiting requests
Callback when request is rejected due to full queue
TimeoutOptions
Configuration for timeout pattern.Timeout duration in milliseconds
Callback invoked when timeout occurs
FallbackOptions
Configuration for fallback pattern.Fallback value or function to provide value on error
Callback invoked when fallback is used
HedgeOptions
Configuration for hedge (parallel request) pattern.Number of parallel requests to make
Delay in ms between launching each request
RateLimiterOptions
Configuration for rate limiter.Number of requests allowed per interval
Time interval in milliseconds
Callback when rate limit is exceeded
CacheOptions
Configuration for caching wrapper.Time-to-live for cache entries in milliseconds
Custom key generation function (defaults to JSON.stringify of args)
Callback on cache hit
Callback on cache miss
Configuration & State
CruelConfig
Global configuration for Cruel.Whether Cruel is globally enabled
Random seed for deterministic behavior
Enable logging of chaos events
Safe mode (reduces chaos intensity)
Stats
Statistics tracking interface.ScenarioConfig
Configuration for chaos scenarios.Scenario name
Scenario duration in milliseconds
Chaos configuration for scenario