BerriAI/litellm · error · InternalServerError

this is a mock internal server error

Error message

this is a mock internal server error

What it means

Error "this is a mock internal server error" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/anthropic/experimental_pass_through/messages/utils.py:74

def mock_response(
    model: str,
    messages: list[dict],
    max_tokens: int,
    mock_response: str = "Hi! My name is Claude.",
    **kwargs,
) -> AnthropicMessagesResponse:
    """
    Mock response for Anthropic messages
    """
    from litellm.exceptions import (
        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(
        **{

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. 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:74 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/af9fb00775b59e5c. Report an issue: GitHub.