BerriAI/litellm · error · ValueError

fine_tuning_config is not set, set it on your config.yaml fi

Error message

fine_tuning_config is not set, set it on your config.yaml file.

What it means

Raised by get_fine_tuning_provider_config when fine-tuning is requested but set_fine_tuning_config was never given a fine_tuning_settings block (or received None). The proxy has no per-provider fine-tuning credentials/base URLs, so it cannot build the provider client; the fix is adding the fine_tuning_settings list to config.yaml.

Source

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

    if not isinstance(config, list):
        raise ValueError("invalid fine_tuning config, expected a list is not a list")

    for element in config:
        if isinstance(element, dict):
            for key, value in element.items():
                if isinstance(value, str) and value.startswith("os.environ/"):
                    element[key] = litellm.get_secret(value)

    fine_tuning_config = config


# Function to search for specific custom_llm_provider and return its configuration
def get_fine_tuning_provider_config(
    custom_llm_provider: str,
):
    global fine_tuning_config
    if fine_tuning_config is None:
        raise ValueError("fine_tuning_config is not set, set it on your config.yaml file.")
    for setting in fine_tuning_config:
        if setting.get("custom_llm_provider") == custom_llm_provider:
            return setting
    return None


@router.post(
    "/v1/fine_tuning/jobs",
    dependencies=[Depends(user_api_key_auth)],
    tags=["fine-tuning"],
    summary="✨ (Enterprise) Create Fine-Tuning Job",
)
@router.post(
    "/fine_tuning/jobs",
    dependencies=[Depends(user_api_key_auth)],
    tags=["fine-tuning"],
    summary="✨ (Enterprise) Create Fine-Tuning Job",
)

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Add fine_tuning_config to your config.yaml before using fine-tuning endpoints.

Example fix

fine_tuning_config:
  - finetune_settings:
      custom_llm_provider: openai
Defensive patterns

Strategy: validation

When it happens

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

Common situations: A fine-tuning endpoint was called but fine_tuning_config is absent from the proxy config.


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