BerriAI/litellm · error · KeyError

Prompt '{prompt_id}'{version_str} not found. Available promp

Error message

Prompt '{prompt_id}'{version_str} not found. Available prompts: {available_prompts}

What it means

Error "Prompt '{prompt_id}'{version_str} not found. Available prompts: {available_prompts}" thrown in BerriAI/litellm.

Source

Thrown at litellm/integrations/dotprompt/prompt_manager.py:210

        Args:
            prompt_id: The ID of the prompt template to render
            prompt_variables: Variables to substitute in the template
            version: Optional version number. If provided, looks for {prompt_id}.v{version}

        Returns:
            The rendered prompt string

        Raises:
            KeyError: If prompt_id is not found
            ValueError: If template rendering fails
        """
        # Get the template (versioned or base)
        template: Final = self.get_prompt(prompt_id=prompt_id, version=version)

        if template is None:
            available_prompts: Final = list(self.prompts.keys())
            version_str: Final = f" (version {version})" if version else ""
            raise KeyError(f"Prompt '{prompt_id}'{version_str} not found. Available prompts: {available_prompts}")

        variables: Final = prompt_variables or {}

        # Validate input variables against schema if defined
        if template.input_schema:
            self._validate_input(variables, template.input_schema)

        try:
            # Create Jinja2 template and render
            jinja_template: Final = self.jinja_env.from_string(template.content)
            rendered: Final = jinja_template.render(**variables)
            return rendered
        except Exception as e:
            raise ValueError(f"Error rendering template '{prompt_id}': {e}")

    def _validate_input(self, variables: dict[str, Any], schema: dict[str, Any]) -> None:
        """Basic validation of input variables against schema."""
        for field_name, field_type in schema.items():

View on GitHub (pinned to 6c2dcb801b)

Solutions

  1. Use one of the available prompts listed, or add the missing prompt file.

When it happens

Trigger: Thrown at litellm/integrations/dotprompt/prompt_manager.py:210 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@6c2dcb801b (2026-08-15). Data as JSON: /api/errors/b771b1e3cc981325. Report an issue: GitHub.