Prompt template renderer
Fill a prompt template's {{variables}} from JSON or a form, see missing and unused variables, and count the rendered prompt's tokens.
What it does
Write a prompt with {{variables}} in it, give the variables their values, and see the prompt exactly as it will be sent:
- Variables as JSON — one object,
{"audience": "managers", "sentences": 3}— or as a form with one field for each variable the template uses. - Missing variables — used in the template, with no value — are listed and marked where they would have gone.
- Unused variables — given, but never used by the template — are listed too.
- The rendered prompt's tokens, for the model you pick, with the way they were counted.
Try it: an article summary with JSON variables, a support reply filled in with the form, or JSON values, an escape and an unused variable.
Everything runs in your browser. Nothing you type is sent anywhere.
How it computes
The template is filled by the same template engine the Batch JSONL Builder uses. The site has one, and a test fails if a second one is added. Its rules:
{{name}}is a variable. A name is letters, digits, spaces,_,-and., with the spaces around it trimmed.- A string value is written as it is. A number, a boolean,
null, a list or an object is written as JSON. {{name | json}}writes the value as JSON text, always — a string in quotes, with its quotes, backslashes and newlines escaped — so it can sit inside a JSON example in the prompt.\{{writes a literal{{. A value is written in as it is and never read again as a template, so a value that contains{{stays text.- A
{{that never closes, a name with other characters, or any filter butjsonis an error at its line, and the text is written through unchanged. - In the form, a field left blank is a missing variable, not an empty value.
Tokens are counted by the site's token counter: exact for the OpenAI models whose tokenizer runs in the browser, and an estimate (characters ÷ 4), labelled estimate, for every other model.
What it does not know
- Only
{{name}}. There are no conditions, loops or other filters: this is not Jinja, Handlebars or Mustache in full. - Not the Behaviors syntax. Salyro Behaviors write
{{input.x}}with their own compiler's meaning. This tool does not implement it: here a dot is part of a name, so{{input.topic}}is the variable namedinput.topic, nottopicinsideinput. The tool says so when a template uses that form. - The answer. It renders the prompt; it does not send it to a model.
- Tokens outside the prompt. A chat request adds per-message framing, and some providers add tokens for tools. The count is the rendered text alone.
FAQ
Why is my variable "not used"?
The JSON has a name the template never mentions — often a typo on one side. Names match exactly, including case and spaces inside the name.
How do I write a literal {{ in a prompt?
Write \{{. It renders as {{ and is not read as a variable.
Why is the token count an estimate?
The model you picked has no tokenizer that runs offline in a browser. Pick an OpenAI model to count exactly.
Sources
Token counting uses OpenAI's published encodings for exact counts, and the four-characters-a-token rule Salyro's engine estimates with for every other model.
Where the numbers come from
- Facts about models and providers that are not in that catalogue carry their own source and the date they were checked, and are shown as unknown where no reliable source exists.
