BerriAI/litellm · error · Exception

Error creating fine tuning job. Status code: {response.statu

Error message

Error creating fine tuning job. Status code: {response.status_code}. Response: {response.text}

What it means

Raised after POSTing a fine-tuning job creation request to Vertex AI when the response status is not success; the status code and body are embedded. Fires on invalid tuning config, unsupported model, quota, or auth errors.

Source

Thrown at litellm/llms/vertex_ai/fine_tuning/handler.py:179

        headers: dict,
        request_data: FineTuneJobCreate,
    ):
        try:
            verbose_logger.debug(
                "about to create fine tuning job: %s, request_data: %s",
                fine_tuning_url,
                json.dumps(request_data, indent=4),
            )
            if self.async_handler is None:
                raise ValueError("VertexAI Fine Tuning - async_handler is not initialized")
            response: Final = await self.async_handler.post(
                headers=headers,
                url=fine_tuning_url,
                json=request_data,
            )

            if response.status_code != 200:
                raise Exception(
                    f"Error creating fine tuning job. Status code: {response.status_code}. Response: {response.text}"
                )

            verbose_logger.debug("got response from creating fine tuning job: %s", response.json())

            vertex_response: Final = ResponseTuningJob(
                **response.json(),
            )

            verbose_logger.debug("vertex_response %s", vertex_response)
            open_ai_response: Final = self.convert_vertex_response_to_open_ai_response(vertex_response)
            return open_ai_response

        except Exception as e:
            verbose_logger.error("asyncerror creating fine tuning job %s", e)
            trace_back_str: Final = traceback.format_exc()
            verbose_logger.error(trace_back_str)
            raise e

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Inspect the status code and response body for the fine-tuning job creation failure.
  2. Verify training/validation file URIs, model, and project permissions.

Example fix

# log response.text and fix per the Vertex AI error message.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Triggered when creating a Vertex AI fine tuning job returns a non-success status code.

Common situations: See trigger scenarios.


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