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.
cruel.ai.rateLimit()
Simulates AI API rate limiting.The function to wrap
Rate limit configuration. Can be a number (rate) or object with options
T - Function that throws CruelAIError("rate_limit") at the specified rate
Example
cruel.ai.overloaded()
Simulates AI model overload errors.The function to wrap
Overload error rate (0-1). Default is 0.05 (5%)
T - Function that throws CruelAIError("overloaded", "model is overloaded") at the specified rate
Example
cruel.ai.contextLength()
Simulates context length exceeded errors.The function to wrap
Context length error rate (0-1). Default is 0.02 (2%)
T - Function that throws CruelAIError("context_length", "context length exceeded") at the specified rate
Example
cruel.ai.contentFilter()
Simulates content filter/moderation triggers.The function to wrap
Content filter trigger rate (0-1). Default is 0.01 (1%)
T - Function that throws CruelAIError("content_filter", "content filter triggered") at the specified rate
Example
cruel.ai.modelUnavailable()
Simulates model unavailability errors.The function to wrap
Model unavailable rate (0-1). Default is 0.02 (2%)
T - Function that throws CruelAIError("model_unavailable", "model not available") at the specified rate
Example
cruel.ai.slowTokens()
Simulates slow token generation.The function to wrap
Delay per token in milliseconds, or range [min, max]. Default is 50-200ms
T - Function with token generation delay
Example
cruel.ai.streamCut()
Cuts AI streaming responses mid-generation.The function to wrap
Stream cut rate (0-1). Default is 0.1 (10%)
T - Function that throws CruelAIError("stream_cut", "stream terminated unexpectedly") after execution
Example
cruel.ai.partialResponse()
Returns partial/incomplete AI responses.The function to wrap (must return a string)
Partial response rate (0-1). Default is 0.1 (10%)
T - Function that may return truncated response (cuts at 10-70% of length)
Example
cruel.ai.invalidJson()
Corrupts JSON responses from AI models.The function to wrap (must return a string)
Invalid JSON rate (0-1). Default is 0.05 (5%)
T - Function that may append invalid JSON (\n{invalid) to the response
Example
cruel.ai.hallucinate()
Adds slight delay to simulate hallucination/generation time.The function to wrap
T - Function with hallucination-like delay
Behavior: Applies delay of [100, 500]ms
Example
cruel.ai.thinking()
Adds long delay to simulate extended thinking time.The function to wrap
T - Function with extended thinking delay
Behavior: Applies delay of [2000, 10000]ms (2-10 seconds)
Example
cruel.ai.realistic()
Combines realistic AI failures for production-like testing.The function to wrap
T - Function with realistic AI behavior
Behavior:
- 5% rate limiting
- 2% overloaded
- Slow tokens [30, 100]ms
Example
cruel.ai.nightmare()
Extreme AI chaos for stress testing.The function to wrap
T - Function with extreme AI chaos
Behavior:
- 20% rate limiting
- 10% overloaded
- 15% stream cuts
- Slow tokens [100, 500]ms