BerriAI/litellm · error · FireworksAIException

Unable to get json response - {e}, Original Response: {raw_r

Error message

Unable to get json response - {e}, Original Response: {raw_response.text}

What it means

Error "Unable to get json response - {e}, Original Response: {raw_response.text}" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/fireworks_ai/chat/transformation.py:708

        litellm_params: dict,
        encoding: Any,
        api_key: str | None = None,
        json_mode: bool | None = None,
    ) -> ModelResponse:
        ## LOGGING
        logging_obj.post_call(
            input=messages,
            api_key=api_key,
            original_response=raw_response.text,
            additional_args={"complete_input_dict": request_data},
        )

        ## RESPONSE OBJECT
        try:
            completion_response: Final = raw_response.json()
        except Exception as e:
            response_headers: Final = getattr(raw_response, "headers", None)
            raise FireworksAIException(
                message=f"Unable to get json response - {e}, Original Response: {raw_response.text}",
                status_code=raw_response.status_code,
                headers=response_headers,
            )

        raw_response_headers: Final = dict(raw_response.headers)

        additional_headers: Final = get_response_headers(raw_response_headers)

        response: Final = ModelResponse(**completion_response)

        if response.model is not None:
            response.model = "fireworks_ai/" + response.model

        ## FIREWORKS AI sends tool calls in the content field instead of tool_calls
        for choice in response.choices:
            cast(Choices, choice).message = self._handle_message_content_with_tool_calls(
                message=cast(Choices, choice).message,

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. The Fireworks AI response was not valid JSON; check the API status and model id.

When it happens

Trigger: Thrown at litellm/llms/fireworks_ai/chat/transformation.py:708 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/08bf962893885a69. Report an issue: GitHub.