BerriAI/litellm · warning · ValueError

TranslationModuleConfig requires at least one of 'input' or

Error message

TranslationModuleConfig requires at least one of 'input' or 'output'.

What it means

TranslationModuleConfig (SAP document translation module) must configure at least one of 'input' or 'output' translation. Its model_validator raises this ValueError when both are None, rejecting empty translation modules at validation time.

Source

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


class TranslationModuleConfig(BaseModel):
    """
    Configuration for translation module

    Args:
        input: Configuration for input translation

        output: Configuration for output translation
    """

    input: SAPDocumentTranslationInput | None = None
    output: SAPDocumentTranslationOutput | None = None

    @model_validator(mode="after")
    def enforce_min_properties(self) -> "TranslationModuleConfig":
        if self.input is None and self.output is None:
            raise ValueError("TranslationModuleConfig requires at least one of 'input' or 'output'.")
        return self


class ModuleConfig(BaseModel):
    prompt_templating: PromptTemplatingModuleConfig
    filtering: FilteringModuleConfig | None = None
    masking: MaskingModuleConfig | None = None
    grounding: GroundingModuleConfig | None = None
    translation: TranslationModuleConfig | None = None


class GlobalStreamOptions(BaseModel):
    enabled: bool = False
    chunk_size: int | None = Field(default=None, ge=1)
    delimiters: list[str] | None = None


class OrchestrationConfig(BaseModel):

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Provide SAPDocumentTranslationInput and/or SAPDocumentTranslationOutput under the translation module.
  2. If translation is not needed, delete the 'translation' key from the modules dict.
  3. Sanitize config dicts to drop empty module objects before building the request.

Example fix

# before
modules={'translation': {}}
# after - either drop it or configure one side
modules={'translation': {'output': {'translate': [my_selector]}}}
Defensive patterns

Strategy: validation

Validate before calling

def build_translation(input_cfg=None, output_cfg=None) -> dict | None:
    if input_cfg is None and output_cfg is None:
        return None
    return {'translation': {'input': input_cfg, 'output': output_cfg}}

Prevention

When it happens

Trigger: Passing {'translation': {}} or TranslationModuleConfig() in the module config - the translation module is declared but neither input nor output translation settings are given.

Common situations: Config builders that always emit all module keys; feature-flag code that enables the translation module but leaves the sub-config empty when the flag is off; refactors that moved translation settings and left the empty parent behind.

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/231c92b085834501. Report an issue: GitHub.