LLM's have chat templates that sit at the lowest levels of how we feed tokens to them. It's quite integral to how they are trained to process tokens and rises up through the tech stack.
Go to a huggingface repo, look at the files, they have a literal chat_template.jinja