BerriAI/litellm · error · OCIError

Invalid response format from OCI

Error message

Invalid response format from OCI

What it means

Error "Invalid response format from OCI" thrown in BerriAI/litellm.

Source

Thrown at litellm/llms/oci/chat/transformation.py:611

    def transform_response(
        self,
        model: str,
        raw_response: httpx.Response,
        model_response: ModelResponse,
        logging_obj: LiteLLMLoggingObj,
        request_data: dict,
        messages: list[AllMessageValues],
        optional_params: dict,
        litellm_params: dict,
        encoding: Any,
        api_key: str | None = None,
        json_mode: bool | None = None,
    ) -> ModelResponse:
        response_json: Final = raw_response.json()

        if not isinstance(response_json, dict):
            raise OCIError(
                message="Invalid response format from OCI",
                status_code=raw_response.status_code,
            )

        if response_json.get("error") is not None:
            raise OCIError(
                message=str(response_json["error"]),
                status_code=raw_response.status_code,
            )

        vendor: Final = get_vendor_from_model(model)
        if vendor == OCIVendors.COHERE:
            model_response = handle_cohere_response(response_json, model, model_response, raw_response)
        else:
            model_response = handle_generic_response(response_json, model, model_response, raw_response)

        model_response._hidden_params["additional_headers"] = raw_response.headers
        return model_response

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. The OCI response format was invalid; check the model and endpoint.

When it happens

Trigger: Thrown at litellm/llms/oci/chat/transformation.py:611 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/4dadca6aba4fe236. Report an issue: GitHub.