BerriAI/litellm · error · PalmError

No response received. Original response

Error message

No response received. Original response - {response}

What it means

Response guard in deprecated PaLM completion: the response object carries no usable candidates/output, so there is no content to map into ModelResponse. The original response is included verbatim so the caller can inspect what PaLM returned.

Solutions

  1. The palm API returned an empty response; check request parameters and the original response in the error.
  2. Migrate to the gemini provider, since palm is deprecated.
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at litellm/llms/deprecated_providers/palm.py:172 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/22846410dd2b788c. Report an issue: GitHub.

Appendix: source

Thrown at litellm/llms/deprecated_providers/palm.py:172

    ## RESPONSE OBJECT
    completion_response = response
    try:
        choices_list: Final = []
        for idx, item in enumerate(completion_response.candidates):
            if len(item["output"]) > 0:
                message_obj = Message(content=item["output"])
            else:
                message_obj = Message(content=None)
            choice_obj = Choices(index=idx + 1, message=message_obj)
            choices_list.append(choice_obj)
        model_response.choices = choices_list
    except Exception:
        raise PalmError(message=traceback.format_exc(), status_code=response.status_code)

    try:
        completion_response = model_response["choices"][0]["message"].get("content")
    except Exception:
        raise PalmError(
            status_code=400,
            message=f"No response received. Original response - {response}",
        )

    ## CALCULATING USAGE - baseten charges on time, not tokens - have some mapping of cost here.
    prompt_tokens: Final = len(encoding.encode(prompt))
    completion_tokens: Final = len(encoding.encode(model_response["choices"][0]["message"].get("content", "")))

    model_response.created = int(time.time())
    model_response.model = "palm/" + model
    usage: Final = Usage(
        prompt_tokens=prompt_tokens,
        completion_tokens=completion_tokens,
        total_tokens=prompt_tokens + completion_tokens,
    )
    setattr(model_response, "usage", usage)
    return model_response

View on GitHub (pinned to 77b7c6c40c)