BerriAI/litellm · error · ValueError
Template '{template_id}' not found
Error message
Template '{template_id}' not found What it means
Error "Template '{template_id}' not found" thrown in BerriAI/litellm.
Source
Thrown at litellm/integrations/arize/arize_phoenix_prompt_manager.py:152
"model_provider": data.get("model_provider"),
"description": data.get("description", ""),
"template_type": data.get("template_type"),
"template_format": data.get("template_format", "MUSTACHE"),
"invocation_parameters": invocation_params,
"temperature": provider_params.get("temperature"),
"max_tokens": provider_params.get("max_tokens"),
}
return ArizePhoenixPromptTemplate(
template_id=prompt_version_id,
messages=messages,
metadata=metadata,
)
def render_template(self, template_id: str, variables: dict[str, Any] | None = None) -> list[AllMessageValues]:
"""Render a template with the given variables and return formatted messages."""
if template_id not in self.prompts:
raise ValueError(f"Template '{template_id}' not found")
template: Final = self.prompts[template_id]
rendered_messages: Final[list[AllMessageValues]] = []
for message in template.messages:
role = message.get("role", "user")
content_parts = message.get("content", [])
# Render each content part
rendered_content_parts = []
for part in content_parts:
if part.get("type") == "text":
text = part.get("text", "")
# Render the text with Jinja2 (Mustache-style)
jinja_template = self.jinja_env.from_string(text)
rendered_text = jinja_template.render(**(variables or {}))
rendered_content_parts.append(rendered_text)
else:View on GitHub (pinned to 6c2dcb801b)
Solutions
- Check that the template_id exists in the loaded prompt version.
When it happens
Trigger: Thrown at litellm/integrations/arize/arize_phoenix_prompt_manager.py:152 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/82bab493c7ee0502.
Report an issue: GitHub.