Single-header C++ prompt templating: variable substitution, loops, conditionals, token-aware truncation.
Everything in include/llm_template.hpp. Guard: #ifdef LLM_TEMPLATE_IMPLEMENTATION. No external deps.
cmake -B build && cmake --build build
- {{var}} — variable substitution
- {{#list}}...{{/list}} — loop over list of maps
- {{#flag}}...{{/flag}} — conditional block
- {{!comment}} — ignored
Single header, no external deps, C++17, namespace llm.