cmake -B build && cmake --build build ./build/basic_template
include/llm_template.hpp is the entire library.
- Template(str) — construct from string
- render(vars) → string — simple var substitution
- render(ctx) → string — full: vars + lists + flags
- render_truncated(ctx, max_tokens) → string — trims longest var until fits
- variables() → vector — all {{var}} names
- missing_vars(ctx) → vector — vars not in context
- TemplateRegistry: add, load_file, get, has
chars/4 — same heuristic as llm-cost