BerriAI/litellm · error · HTTPException

target_model_names on list fine-tuning jobs must be a list o

Error message

target_model_names on list fine-tuning jobs must be a list of one model name. Example: ['gpt-4o']

What it means

Validation of the list-fine-tuning-jobs filter: target_model_names must be a single-element list (one model name) because the provider filter accepts exactly one model; the example shows the expected shape.

Source

Thrown at litellm/proxy/fine_tuning_endpoints/endpoints.py:433

        base_llm_response_processor: Final = ProxyBaseLLMRequestProcessing(data=data)
        (
            data,
            litellm_logging_obj,
        ) = await base_llm_response_processor.common_processing_pre_call_logic(
            request=request,
            general_settings=general_settings,
            user_api_key_dict=user_api_key_dict,
            version=version,
            proxy_logging_obj=proxy_logging_obj,
            proxy_config=proxy_config,
            route_type=CallTypes.alist_fine_tuning_jobs.value,
        )

        response: Any | None = None
        if target_model_names and isinstance(target_model_names, str):
            target_model_names_list: Final = target_model_names.split(",")
            if len(target_model_names_list) != 1:
                raise HTTPException(
                    status_code=400,
                    detail="target_model_names on list fine-tuning jobs must be a list of one model name. Example: ['gpt-4o']",
                )
            ## Use router to list fine-tuning jobs for that model
            if llm_router is None:
                raise HTTPException(
                    status_code=500,
                    detail="LLM Router not initialized. Ensure models added to proxy.",
                )
            data["model"] = target_model_names_list[0]
            response = await llm_router.alist_fine_tuning_jobs(
                **data,
                after=after,
                limit=limit,
            )
            return response
        elif custom_llm_provider:
            # get configs for custom_llm_provider

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Pass target_model_names as a single-element list, e.g. ['gpt-4o'].

Example fix

target_model_names=["gpt-4o"]
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/fine_tuning_endpoints/endpoints.py:433 when the library encounters an invalid state.

Common situations: List fine-tuning jobs received zero or multiple target model names.


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