{"record":{"id":"4d5c6b490dd9f728","repo":"BerriAI/litellm","slug":"invalid-yaml-frontmatter-e","errorCode":null,"errorMessage":"Invalid YAML frontmatter: {e}","messagePattern":"Invalid YAML frontmatter: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/dotprompt/prompt_manager.py","lineNumber":175,"sourceCode":"            content=template_content.strip(),\n            metadata=frontmatter,\n            template_id=prompt_id,\n        )\n\n    def _parse_frontmatter(self, content: str) -> tuple[dict[str, Any], str]:\n        \"\"\"Parse YAML frontmatter from prompt content.\"\"\"\n        # Match YAML frontmatter between --- delimiters\n        frontmatter_pattern: Final = r\"^---\\s*\\n(.*?)\\n---\\s*\\n(.*)$\"\n        match: Final = re.match(frontmatter_pattern, content, re.DOTALL)\n\n        if match:\n            frontmatter_yaml: Final = match.group(1)\n            template_content = match.group(2)\n\n            try:\n                frontmatter = yaml.safe_load(frontmatter_yaml) or {}\n            except yaml.YAMLError as e:\n                raise ValueError(f\"Invalid YAML frontmatter: {e}\")\n        else:\n            # No frontmatter found, treat entire content as template\n            frontmatter = {}\n            template_content = content\n\n        return frontmatter, template_content\n\n    def render(\n        self,\n        prompt_id: str,\n        prompt_variables: dict[str, Any] | None = None,\n        version: int | None = None,\n    ) -> str:\n        \"\"\"\n        Render a prompt template with the given variables.\n\n        Args:\n            prompt_id: The ID of the prompt template to render","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/dotprompt/prompt_manager.py#L157-L193","documentation":"Error \"Invalid YAML frontmatter: {e}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/integrations/dotprompt/prompt_manager.py:175 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the YAML frontmatter in the .prompt file."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}