From d4d91684cf77df72d9d45bfd20d83ae3054c8796 Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Mon, 23 Mar 2026 12:44:55 +0530 Subject: [PATCH] address greptile review feedback (greploop iteration 3) - Remove redundant _ensure_training_type call from acreate_fine_tuning_job - Use explicit _AZURE_STATUS_MAP for status normalization Made-with: Cursor --- litellm/llms/azure/fine_tuning/handler.py | 1 - litellm/llms/openai/fine_tuning/handler.py | 11 ++++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/litellm/llms/azure/fine_tuning/handler.py b/litellm/llms/azure/fine_tuning/handler.py index 3d82172c58..2415c7d78e 100644 --- a/litellm/llms/azure/fine_tuning/handler.py +++ b/litellm/llms/azure/fine_tuning/handler.py @@ -37,7 +37,6 @@ class AzureOpenAIFineTuningAPI(OpenAIFineTuningAPI, BaseAzureLLM): create_fine_tuning_job_data: dict, openai_client: Union[AsyncOpenAI, AsyncAzureOpenAI], ) -> LiteLLMFineTuningJob: - self._ensure_training_type(create_fine_tuning_job_data) response = await openai_client.fine_tuning.jobs.create( **create_fine_tuning_job_data ) diff --git a/litellm/llms/openai/fine_tuning/handler.py b/litellm/llms/openai/fine_tuning/handler.py index 2bb39aeaea..a9fbd88d2a 100644 --- a/litellm/llms/openai/fine_tuning/handler.py +++ b/litellm/llms/openai/fine_tuning/handler.py @@ -6,6 +6,10 @@ from openai import AsyncAzureOpenAI, AsyncOpenAI, AzureOpenAI, OpenAI from litellm._logging import verbose_logger from litellm.types.utils import LiteLLMFineTuningJob +_AZURE_STATUS_MAP = { + "pending": "queued", +} + def _normalize_fine_tuning_job_dict( data: Dict[str, Any], is_azure: bool = False @@ -16,7 +20,7 @@ def _normalize_fine_tuning_job_dict( Azure differences: - organization_id: null → "" - result_files: null → [] - - status: "pending" → "queued" + - status: mapped via _AZURE_STATUS_MAP """ if not is_azure: return data @@ -29,8 +33,9 @@ def _normalize_fine_tuning_job_dict( if normalized.get("result_files") is None: normalized["result_files"] = [] - if normalized.get("status") == "pending": - normalized["status"] = "queued" + status = normalized.get("status") + if status in _AZURE_STATUS_MAP: + normalized["status"] = _AZURE_STATUS_MAP[status] return normalized