def create_api_base_model(base_class, class_name):
    """
    Creates a new Pydantic model based on a given base class and class name,
    excluding specified fields.

    Args:
        base_class (Type): The base Pydantic model class to extend.
        class_name (str): The name of the new model class to create.

    Returns:
        Type: A new Pydantic model class with the specified modifications.

    Notes:
        - The function uses type hints from the base class to define the new model's fields.
        - Certain fields are excluded from the new model based on the class name.
        - The function supports different sets of hidden parameters for different class names.
        - The new model's configuration is set to have no protected namespaces.
    """
    annotations = get_type_hints(base_class)
    if class_name in ("LLMSFTTrainingParamsAPI", "LLMRewardTrainingParamsAPI"):
        more_hidden_params = [
            "model_ref",
            "dpo_beta",
            "add_eos_token",
            "max_prompt_length",
            "max_completion_length",
        ]
    elif class_name == "LLMORPOTrainingParamsAPI":
        more_hidden_params = [
            "model_ref",
            "dpo_beta",
            "add_eos_token",
        ]
    elif class_name == "LLMDPOTrainingParamsAPI":
        more_hidden_params = [
            "add_eos_token",
        ]
    elif class_name == "LLMGenericTrainingParamsAPI":
        more_hidden_params = [
            "model_ref",
            "dpo_beta",
            "max_prompt_length",
            "max_completion_length",
        ]
    else:
        more_hidden_params = []
    _excluded = FIELDS_TO_EXCLUDE + more_hidden_params
    new_fields: Dict[str, Tuple[Any, Any]] = {}
    for name, field in base_class.__fields__.items():
        if name not in _excluded:
            field_type = annotations[name]
            if field.default is not None:
                field_default = field.default
            elif field.default_factory is not None:
                field_default = field.default_factory
            else:
                field_default = None
            new_fields[name] = (field_type, field_default)
    return create_model(
        class_name,
        **{key: (value[0], value[1]) for key, value in new_fields.items()},
        __config__=type("Config", (), {"protected_namespaces": ()}),
    )

    Creates a new Pydantic model based on a given base class and class name,
    excluding specified fields.

    Args:
        base_class (Type): The base Pydantic model class to extend.
        class_name (str): The name of the new model class to create.

    Returns:
        Type: A new Pydantic model class with the specified modifications.

    Notes:
        - The function uses type hints from the base class to define the new model's fields.
        - Certain fields are excluded from the new model based on the class name.
        - The function supports different sets of hidden parameters for different class names.
        - The new model's configuration is set to have no protected namespaces.
    
src/autotrain/app/api_routes.py