BerriAI/litellm · error · AlephAlphaError

{json.dumps(completion_response)}

Error message

{json.dumps(completion_response)}

What it means

Error "{json.dumps(completion_response)}" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/deprecated_providers/aleph_alpha.py:273

                status_code=response.status_code,
            )
        else:
            try:
                choices_list: Final = []
                for idx, item in enumerate(completion_response["completions"]):
                    if len(item["completion"]) > 0:
                        message_obj = Message(content=item["completion"])
                    else:
                        message_obj = Message(content=None)
                    choice_obj = Choices(
                        finish_reason=item["finish_reason"],
                        index=idx + 1,
                        message=message_obj,
                    )
                    choices_list.append(choice_obj)
                model_response.choices = choices_list
            except Exception:
                raise AlephAlphaError(
                    message=json.dumps(completion_response),
                    status_code=response.status_code,
                )

        ## 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"]["content"],
                disallowed_special=(),
            )
        )

        model_response.created = int(time.time())
        model_response.model = model
        usage: Final = Usage(
            prompt_tokens=prompt_tokens,
            completion_tokens=completion_tokens,

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Inspect the Aleph Alpha completion response for details.

When it happens

Trigger: Thrown at litellm/llms/deprecated_providers/aleph_alpha.py:273 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/961924b819731353. Report an issue: GitHub.