{"record":{"id":"9266ad9901a85ec0","repo":"BerriAI/litellm","slug":"template-does-not-support-llm-enrichment","errorCode":null,"errorMessage":"Template does not support LLM enrichment","messagePattern":"Template does not support LLM enrichment","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/policy_endpoints/endpoints.py","lineNumber":690,"sourceCode":"        default=None,\n        description=\"Refinement instruction for modifying the competitor list (e.g. 'add 10 more from Asia')\",\n    )\n\n\ndef _validate_enrichment_request(data: EnrichTemplateRequest) -> tuple[dict, dict, str]:\n    \"\"\"\n    Validate enrichment request and return (template, llm_enrichment, brand_name).\n\n    Raises HTTPException on validation failure.\n    \"\"\"\n    templates: Final = _load_policy_templates_from_local_backup()\n    template: Final = next((t for t in templates if t.get(\"id\") == data.template_id), None)\n    if template is None:\n        raise HTTPException(status_code=404, detail=f\"Template '{data.template_id}' not found\")\n\n    llm_enrichment: Final = template.get(\"llm_enrichment\")\n    if llm_enrichment is None:\n        raise HTTPException(status_code=400, detail=\"Template does not support LLM enrichment\")\n\n    # Validate competitors list size if provided\n    if data.competitors and len(data.competitors) > MAX_COMPETITOR_NAMES:\n        raise HTTPException(\n            status_code=400,\n            detail=f\"competitors list exceeds maximum of {MAX_COMPETITOR_NAMES}\",\n        )\n\n    brand_name: Final = data.parameters.get(llm_enrichment[\"parameter\"], \"\")\n    if not brand_name:\n        raise HTTPException(\n            status_code=400,\n            detail=f\"Parameter '{llm_enrichment['parameter']}' is required\",\n        )\n\n    return template, llm_enrichment, brand_name\n\n","sourceCodeStart":672,"sourceCodeEnd":708,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/policy_endpoints/endpoints.py#L672-L708","documentation":"Validation helper (_validate_enrichment_request) for the policy-template enrichment endpoint. The template_id supplied in the EnrichTemplateRequest resolved to a template whose definition does not permit LLM-based enrichment (it lacks the enrichment configuration/schema), so the endpoint refuses to run LLM enrichment against it. This is a configuration-level restriction of the chosen template, not a malformed request; pick an enrichment-capable template or enrich without LLM assistance.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/policy_endpoints/endpoints.py:690 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a template that declares LLM enrichment support."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}