Local LLM Prompt & ChatML Builder
Format system prompts, user turns, and assistant outputs into valid ChatML, Llama-3, and DeepSeek templates 100% client-side.
When deploying edge AI or running local GGUF models in-browser (via WebGPU / WASM ONNX) or locally via Ollama / LM Studio, prompt formatting must match the exact token delimiters of your model weights:
- SmolLM-135M-Instruct: ~90 MB download ·
Q4_K_M4-bit quantized · Ideal for ultra-fast in-browser micro-chat (50+ tok/s) - Qwen2.5-0.5B-Instruct: ~290 MB download ·
Q4_K_M4-bit quantized · Exceptional multi-turn logic & code generation - Llama-3.2-1B / 3B: ~1.1 GB download ·
Q4_K_M4-bit quantized · Standard Llama-3 special header tokens
Specifications & Specifications: Powered by open-source ChatML (<|im_start|>), Llama-3 (<|start_header_id|>), DeepSeek-V3, and Mistral GGUF Jinja2 chat template standards.
⚖️ Legal Notice: This prompt template builder utility is provided "as is", without warranty of any kind, express or implied, including but not limited to warranties of merchantability or fitness for a particular purpose. All prompt formatting occurs 100% locally inside your browser memory; zero prompt strings are saved or uploaded to remote servers.
What this tool does
It formats a system prompt and a user message into the exact delimiter syntax a local model expects, for four widely used chat template families: ChatML (<|im_start|> / <|im_end|>), Llama-3 (<|start_header_id|> / <|eot_id|>), DeepSeek-style (<|User|> / <|Assistant|>), and Mistral / Llama-2 ([INST] <<SYS>>). Wrong delimiters are the classic local-LLM failure mode: the model ignores your system prompt not because it is disobedient, but because it never saw one — your text arrived outside the slots its tokenizer was trained to expect. This builder emits the delimiters for you, and the copy button puts the result on your clipboard.
How to use it
- Pick the format matching your model's template family.
- Write your system directive and user message.
- Generate — it also re-runs when you switch formats — then paste the result into your Ollama Modelfile, a completion request, or a test fixture.
Where your data goes
Nowhere. This is string formatting in plain JavaScript — no libraries, no network calls, no storage. Your prompts stay in the tab; the copy button uses your browser's clipboard and nothing else.
Who it's for
Anyone running local GGUF models through Ollama, LM Studio, llama.cpp, or a serving stack who needs the chat template right; anyone debugging why a model "forgets" its instructions; and anyone authoring a Modelfile or checking whether a model's chat template is being applied at all. The model cards above — SmolLM-135M, Qwen2.5-0.5B, Llama-3.2 — are examples of weights shipped with specific template expectations, with rough Q4_K_M download sizes.
Honest limits
- Single turn. One system message and one user message. Multi-turn conversations need the pattern repeated per turn — your runtime usually applies that for you; this builder shows the shape.
- Templates drift by release. These are the common public variants; exact templates change between model releases and serving stacks (DeepSeek's own formatting has changed more than once). Verify against your model's chat template before relying on the output in production.
- Special tokens are emitted as text. Your runtime must treat them as special tokens, not literal strings — most do, some need it enabled, and a few escape them. If the model starts its reply by saying <|im_start|> out loud, that is what happened.
Questions people ask
Why does my model ignore the system prompt?
Usually delimiters. If you call a raw completion endpoint, no chat template is applied for you — the system text arrives as plain text, and the model treats it accordingly. Formatting the turns explicitly, the way this page does, is the fix.
Does Ollama need this?
For /chat, no — Ollama applies the model's own GGUF chat template. The formatted output here is for Modelfile SYSTEM blocks, raw /generate calls, test fixtures, and for debugging what a template actually produces.
Back to the tools directory.