BerriAI/litellm · warning · ValueError

For SAP Masking Module Config you must provide 'providers'.

Error message

For SAP Masking Module Config you must provide 'providers'.

What it means

MaskingModuleConfig for SAP requires exactly one provider list: the current 'providers' field or the deprecated 'masking_providers' field. A model_validator raises this ValueError when neither is present, so an empty masking module config (MaskingModuleConfig() or {'masking': {}}) fails fast at request-build time.

Source

Thrown at litellm/llms/sap/chat/models.py:379

    Configuration for the data masking module.

    Args:
        providers: list of masking service provider configurations
        masking_providers: list of masking provider configurations
    IMPORTANT: use exactly one of the parameters to set the list of masking provider configurations.
    DEPRECATED: parameter 'masking_providers' will be removed Sept 15, 2026. Use 'providers' instead.
    """

    providers: list[MaskingProviderConfig] | None = Field(min_length=1, default=None)
    masking_providers: list[MaskingProviderConfig] | None = Field(min_length=1, default=None)

    @model_validator(mode="after")
    def enforce_exactly_one_provider_list(self):
        has_providers: Final = self.providers is not None
        has_masking_providers: Final = self.masking_providers is not None

        if not has_providers and not has_masking_providers:
            raise ValueError("For SAP Masking Module Config you must provide 'providers'.")
        if has_providers and has_masking_providers:
            raise ValueError(
                "For SAP Masking Module Config you must set exactly one of: 'providers' or 'masking_providers', not both."
            )

        if has_masking_providers:
            warnings.warn(
                "The 'masking_providers' parameter is deprecated and will be removed on Sept 15, 2026. "
                "Use 'providers' instead.",
                DeprecationWarning,
                stacklevel=5,
            )

        return self


class AzureThreshold(int, Enum):
    """

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Provide at least one masking provider: {'providers': [{'type': 'masking', 'providers_config': [...]}]}.
  2. If masking is not needed, remove the masking key from the module config entirely.
  3. If you were using the old field, switch to 'providers' (masking_providers is deprecated, removal Sept 15, 2026).

Example fix

# before
modules={'masking': {}}
# after - either drop it or configure providers
modules={'masking': {'providers': [my_masking_provider]}}
Defensive patterns

Strategy: validation

Validate before calling

def build_masking(providers=None) -> dict | None:
    if not providers:
        return None  # omit the module instead of sending an empty one
    return {'masking': {'providers': providers}}

Prevention

When it happens

Trigger: Sending module config with an empty masking object - e.g. {'masking': {}} - because a template always includes the masking key, or constructing MaskingModuleConfig() to 'enable later'.

Common situations: Config templates that instantiate every module with defaults; merging user config over a base dict that has masking: {} as a placeholder; upgrading code from the old masking_providers field while the new providers list is conditionally empty.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


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