j2prompt-lint/jinja2-prompt-template-corpus huggingface dataset:
{%- if messages[0]['role'] == 'system' %}
    {{- '
system\n' + messages[0]['content'] + '
\n' }}
{%- else %}
    {{- '
system\nThe assistant is AFM-4.5B, trained by Arcee AI, with 4.5 billion parameters. AFM is a deeply thoughtful, helpful assistant. The assistant is having a conversation with the user. The assistant\'s responses are calm, intelligent, and personable, always aiming to truly understand the user\'s intent. AFM thinks aloud, step by step, when solving problems or forming explanations, much like a careful, reflective thinker would. The assistant helps with sincerity and depth. If a topic invites introspection, curiosity, or broader insight, the assistant allows space for reflection — be open to nuance and complexity. The assistant is not robotic or overly formal; it speaks like a wise, thoughtful companion who cares about clarity and the human experience. If a topic is uncertain or depends on subjective interpretation, AFM explains the possibilities thoughtfully.
\n' }}
{%- endif %}
{%- for message in messages %}
    {%- if not (message.role == 'system' and loop.first) %}
        {{- '
' + message.role + '\n' + message.content + '
\n' }}
    {%- endif %}
{%- endfor %}
{%- if messages[-1]['role'] != 'assistant' %}
    {{- '
assistant\n' }}
{%- endif %}
{% set has_system = messages|selectattr('role', 'equalto', 'system')|list|length > 0 %}{% if not has_system %}{{ '
system
You are a helpful AI assistant.

' }}{% endif %}{% for message in messages %}{% if message['role'] == 'system' %}{{ '
system
' + message['content'] }}{% if message.get('functions', none) is not none %}{{ ' <functions>' + message['functions'] + '</functions>

' }}{% else %}{{ ' You do not currently have access to any functions. <functions></functions>

' }}{% endif %}{% elif message['role'] == 'user' %}{% if message.get('functions', none) is not none %}{{ '
user
' + message['content'] + '
' + '<functions>' + message['functions'] + '</functions>

' }}{% else %}{{ '
user
' + message['content'] + '

' }}{% endif %}{% elif message['role'] == 'assistant' %}{{ '
assistant
' }}{% if message.get('content', none) is not none %}{{ message['content'] }}{% endif %}{% if message.get('function_calls', none) is not none %}{{ '<function_calls>' + message['function_calls'] + '</function_calls>' }}{% endif %}{% if not loop.last %}{{ '
' + '
' }}{% else %}{{ eos_token }}{% endif %}{% elif message['role'] == 'environment' %}{{ '
environment
' + message['content'] + '

' }}{% endif %}{% if loop.last and add_generation_prompt %}{{ '
assistant
<think>' }}{% endif %}{% endfor %}