BerriAI/litellm · error · RateLimitError
this is a mock rate limit error
Error message
this is a mock rate limit error
What it means
Error "this is a mock rate limit error" thrown in BerriAI/litellm.
Source
Thrown at litellm/llms/anthropic/experimental_pass_through/messages/utils.py:86
ContextWindowExceededError,
InternalServerError,
RateLimitError,
)
if mock_response == "litellm.InternalServerError":
raise InternalServerError(
message="this is a mock internal server error",
llm_provider="anthropic",
model=model,
)
elif mock_response == "litellm.ContextWindowExceededError":
raise ContextWindowExceededError(
message="this is a mock context window exceeded error",
llm_provider="anthropic",
model=model,
)
elif mock_response == "litellm.RateLimitError":
raise RateLimitError(
message="this is a mock rate limit error",
llm_provider="anthropic",
model=model,
)
return AnthropicMessagesResponse(
**{
"content": [{"text": mock_response, "type": "text"}],
"id": "msg_013Zva2CMHLNnXjNJJKqJ2EF",
"model": "claude-sonnet-4-20250514",
"role": "assistant",
"stop_reason": "end_turn",
"stop_sequence": None,
"type": "message",
"usage": {"input_tokens": 2095, "output_tokens": 503},
}
)
View on GitHub (pinned to 77b7c6c40c)
Solutions
- This is a test/mock error raised intentionally; remove the mock trigger from your request or test setup.
When it happens
Trigger: Thrown at litellm/llms/anthropic/experimental_pass_through/messages/utils.py:86 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/0c5e7d4a24bdc114.
Report an issue: GitHub.