[{"name":"Apertus-8B-Instruct.jinja","kind":"file","size":14190,"lastCommitHash":"566059a26b0ce8faec4ea053605719d399c64cc5","lastCommitWhen":"2026-03-06T21:01:00+01:00","lastCommitMessage":"Autoparser - complete refactoring of parser architecture (#18675)\n\n* Autoparser - full single commit squish\n\n* Final pre-merge changes: minor fixes, Kimi 2.5 model parser"},{"name":"Apriel-1.6-15b-Thinker-fixed.jinja","kind":"file","size":8091,"lastCommitHash":"5e54d51b199ad2d70cf6eba4bff756bbf63366a6","lastCommitWhen":"2026-03-19T16:58:21+01:00","lastCommitMessage":"common/parser: add proper reasoning tag prefill reading (#20424)\n\n* Implement proper prefill extraction\n\n* Refactor cli parameters, update docs, move reasoning budget sampler part to common/reasoning-budget.cpp\n\n* Update tools/server/server-task.cpp\n\n* refactor: move grammars to variant, remove grammar_external, handle exception internally\n\n* Make code less C++y\n\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>"},{"name":"Bielik-11B-v3.0-Instruct.jinja","kind":"file","size":4077,"lastCommitHash":"566059a26b0ce8faec4ea053605719d399c64cc5","lastCommitWhen":"2026-03-06T21:01:00+01:00","lastCommitMessage":"Autoparser - complete refactoring of parser architecture (#18675)\n\n* Autoparser - full single commit squish\n\n* Final pre-merge changes: minor fixes, Kimi 2.5 model parser"},{"name":"ByteDance-Seed-OSS.jinja","kind":"file","size":7705,"lastCommitHash":"60e5eee31f1af9bb579ac45380e3857d610020b9","lastCommitWhen":"2025-08-29T14:53:41+02:00","lastCommitMessage":"chat : Seed OSS thinking + tool call support (#15552)\n\n* Reasoning and tool-calling support for Seed OSS\n\n* Fix grammar and partial parsing\n\n* Whitespace\n\n* New chat template\n\n* Update common/chat.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Update common/chat.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Remove unused 'purge_healing_marker' helper\n\n---------\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>"},{"name":"Cohere2MoE.jinja","kind":"file","size":12397,"lastCommitHash":"aedb2a5e9ca3d4064148bbb919e0ddc0c1b70ab3","lastCommitWhen":"2026-06-14T20:17:40+02:00","lastCommitMessage":"chat: add dedicated Cohere2MoE (North Code) parser (#24615)\n\n* chat: add dedicated Cohere2MoE (North Code) parser\n\n* Some renames to make @CISC happy :>"},{"name":"CohereForAI-c4ai-command-r-plus-tool_use.jinja","kind":"file","size":8038,"lastCommitHash":"8b576b6c55bc4e6be898b47522f0ef402b93ef62","lastCommitWhen":"2025-01-30T19:13:58Z","lastCommitMessage":"Tool call support (generic + native for Llama, Functionary, Hermes, Mistral, Firefunction, DeepSeek) w/ lazy grammars (#9639)\n\n\r\n---------\r\n\r\nCo-authored-by: Xuan Son Nguyen <thichthat@gmail.com>\r\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>\r\nCo-authored-by: Xuan Son Nguyen <son@huggingface.co>"},{"name":"CohereForAI-c4ai-command-r7b-12-2024-tool_use.jinja","kind":"file","size":11504,"lastCommitHash":"566059a26b0ce8faec4ea053605719d399c64cc5","lastCommitWhen":"2026-03-06T21:01:00+01:00","lastCommitMessage":"Autoparser - complete refactoring of parser architecture (#18675)\n\n* Autoparser - full single commit squish\n\n* Final pre-merge changes: minor fixes, Kimi 2.5 model parser"},{"name":"deepseek-ai-DeepSeek-R1-Distill-Llama-8B.jinja","kind":"file","size":2478,"lastCommitHash":"566059a26b0ce8faec4ea053605719d399c64cc5","lastCommitWhen":"2026-03-06T21:01:00+01:00","lastCommitMessage":"Autoparser - complete refactoring of parser architecture (#18675)\n\n* Autoparser - full single commit squish\n\n* Final pre-merge changes: minor fixes, Kimi 2.5 model parser"},{"name":"deepseek-ai-DeepSeek-R1-Distill-Qwen-32B.jinja","kind":"file","size":2567,"lastCommitHash":"5e54d51b199ad2d70cf6eba4bff756bbf63366a6","lastCommitWhen":"2026-03-19T16:58:21+01:00","lastCommitMessage":"common/parser: add proper reasoning tag prefill reading (#20424)\n\n* Implement proper prefill extraction\n\n* Refactor cli parameters, update docs, move reasoning budget sampler part to common/reasoning-budget.cpp\n\n* Update tools/server/server-task.cpp\n\n* refactor: move grammars to variant, remove grammar_external, handle exception internally\n\n* Make code less C++y\n\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>"},{"name":"deepseek-ai-DeepSeek-V3.1.jinja","kind":"file","size":3357,"lastCommitHash":"5e54d51b199ad2d70cf6eba4bff756bbf63366a6","lastCommitWhen":"2026-03-19T16:58:21+01:00","lastCommitMessage":"common/parser: add proper reasoning tag prefill reading (#20424)\n\n* Implement proper prefill extraction\n\n* Refactor cli parameters, update docs, move reasoning budget sampler part to common/reasoning-budget.cpp\n\n* Update tools/server/server-task.cpp\n\n* refactor: move grammars to variant, remove grammar_external, handle exception internally\n\n* Make code less C++y\n\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>"},{"name":"deepseek-ai-DeepSeek-V3.2.jinja","kind":"file","size":7007,"lastCommitHash":"1c0d9081fd2c83bd221c157728a8cf0124cd4e27","lastCommitWhen":"2026-04-13T22:23:53+02:00","lastCommitMessage":"chat: dedicated DeepSeek v3.2 parser + \"official\" template (#21785)"},{"name":"deepseek-ai-DeepSeek-V4-Flash-0731.jinja","kind":"file","size":7646,"lastCommitHash":"0ef6e55edb306fcbcf73e6f1f41923cccb9cf7f8","lastCommitWhen":"2026-08-03T17:59:11-05:00","lastCommitMessage":"chat : add new template for DeepSeek V4 Flash 0731 (#26398)\n\n* common/chat: update DeepSeek V4 templates\n\nAlign the DeepSeek V4 templates with the official encoders while keeping parser behavior out of this change.\n\n- Default drop_thinking for DeepSeek V4 history so prior thinking is omitted unless preserve_reasoning is requested or tools are present.\n- Add structured output response-format instructions to the V4 templates and pass the schema into template rendering.\n- Add a separate Flash 0731 template for the updated high and max reasoning effort mapping.\n- Cover reasoning effort, drop_thinking, structured output prompts, preserved reasoning, continuations, and empty tool arguments in template rendering tests.\n\nOfficial references:\nhttps://huggingface.co/deepseek-ai/DeepSeek-V4-Flash/blob/main/encoding/encoding_dsv4.py\nhttps://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731/blob/main/encoding/encoding_dsv4.py\n\nAssisted-by: Codex\n\n* Fix deepseek v4 0731 template selection\n\n* remove unneeded lower normalization\n\n* Fix DSML parser to consume the tool call separator\n\n* address aldehir requests\n\n* address aldehir comment"},{"name":"deepseek-ai-DeepSeek-V4.jinja","kind":"file","size":6945,"lastCommitHash":"0ef6e55edb306fcbcf73e6f1f41923cccb9cf7f8","lastCommitWhen":"2026-08-03T17:59:11-05:00","lastCommitMessage":"chat : add new template for DeepSeek V4 Flash 0731 (#26398)\n\n* common/chat: update DeepSeek V4 templates\n\nAlign the DeepSeek V4 templates with the official encoders while keeping parser behavior out of this change.\n\n- Default drop_thinking for DeepSeek V4 history so prior thinking is omitted unless preserve_reasoning is requested or tools are present.\n- Add structured output response-format instructions to the V4 templates and pass the schema into template rendering.\n- Add a separate Flash 0731 template for the updated high and max reasoning effort mapping.\n- Cover reasoning effort, drop_thinking, structured output prompts, preserved reasoning, continuations, and empty tool arguments in template rendering tests.\n\nOfficial references:\nhttps://huggingface.co/deepseek-ai/DeepSeek-V4-Flash/blob/main/encoding/encoding_dsv4.py\nhttps://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731/blob/main/encoding/encoding_dsv4.py\n\nAssisted-by: Codex\n\n* Fix deepseek v4 0731 template selection\n\n* remove unneeded lower normalization\n\n* Fix DSML parser to consume the tool call separator\n\n* address aldehir requests\n\n* address aldehir comment"},{"name":"fireworks-ai-llama-3-firefunction-v2.jinja","kind":"file","size":3298,"lastCommitHash":"566059a26b0ce8faec4ea053605719d399c64cc5","lastCommitWhen":"2026-03-06T21:01:00+01:00","lastCommitMessage":"Autoparser - complete refactoring of parser architecture (#18675)\n\n* Autoparser - full single commit squish\n\n* Final pre-merge changes: minor fixes, Kimi 2.5 model parser"},{"name":"GigaChat3-10B-A1.8B.jinja","kind":"file","size":13977,"lastCommitHash":"a8304b4d279cadc240802388d1532bea650de4c8","lastCommitWhen":"2026-03-12T01:22:25+01:00","lastCommitMessage":"common/parser: add GigaChatV3/3.1 models support (#19931)\n\nCo-authored-by: Mishusha <pmv26021975@gmail.com>"},{"name":"GigaChat3.1-10B-A1.8B.jinja","kind":"file","size":13375,"lastCommitHash":"a8304b4d279cadc240802388d1532bea650de4c8","lastCommitWhen":"2026-03-12T01:22:25+01:00","lastCommitMessage":"common/parser: add GigaChatV3/3.1 models support (#19931)\n\nCo-authored-by: Mishusha <pmv26021975@gmail.com>"},{"name":"GLM-4.6.jinja","kind":"file","size":3374,"lastCommitHash":"1920345c3bcec451421bb6abc4981678cc721154","lastCommitWhen":"2025-11-18T18:54:15+01:00","lastCommitMessage":"common : Generalized XML-style tool-call parsing with streaming support (GLM 4.5/4.6 + MiniMax M2 + SeedOSS + Kimi-K2 + Qwen3-Coder + Apriel-1.5 + Xiaomi-MiMo) (#16932)\n\n* Add files via upload\n\n* fix unit test\n\n* fix crashes for --reasoning-format=none\n\n* Patch buggy official MiniMax-M2 chat template\n\n* add upstream minja fix: https://github.com/ochafik/minja/pull/7\n\n* Fix <think> token not generated\n\n* add test copied from https://github.com/ggml-org/llama.cpp/pull/16946\n\n* cleanup\n\n* Hopes to fix the compilation error on CI\n\n* Delete chat template patching since it’s fixed by upstream Minja\n\n* Remove undeeded Minimax-M2 template patch\n\nhttps://github.com/ochafik/minja/pull/7#issuecomment-3480356100\n\n* Add proper handling of optional parameters with test\nmerged tests from: https://github.com/ggml-org/llama.cpp/pull/16946/commits/23d4bb75c485c12ac89f81c424dc03c87a640e8c\n\n* Fix making all tool parameters optional\n\n* Move xml tool parser to separate file\n\n* cleanup & add tests for GLM4.5\n\n* add streaming tests & enhancement & cleanups\n\nAdd streaming test for both GLM 4.5 and minimax-m2.\nCleanup for preserved_tokens.\nCleanup for grammar rule name.\nEnhance the parser's stability.\n\n* cleanup & add support for Kimi-K2 Qwen3-Coder Apriel-1.5 Xiaomi-MiMo\n\n* apply suggestions from reviewers\n\n* fix a misuse for data.grammar_lazy\n\n* fix grammar when tool have no argument\n\n* Fix `no triggers set for lazy grammar!` for GLM4.5/4.6. Insert additional stops for Kimi-K2\n\n* update chat.cpp\n\n* fix grammar for GLM 4.5/4.6\n\n* Try fix Jinja template for GLM\n\n* Try fix GLM-4.6.jinja\n\n* Update common/chat-parser-xml-toolcall.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Update tests/test-chat.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* improve chat template for GLM, rename Kimi-K2 template to Kimi-K2-Thinking\n\n* Improve Kimi-K2 chat template\n\n* Fix unit test\n\n* Fix \"Invalid tool call arguments passed\" in a rare case.\n\nIn a rare case, the model may emit a raw string that begins with a valid JSON string. This commit adds unit tests to cover that scenario and fixes the regression introduced during the Kimi-K2 adaptation.\n\n---------\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>"},{"name":"GLM-4.7-Flash.jinja","kind":"file","size":3120,"lastCommitHash":"566059a26b0ce8faec4ea053605719d399c64cc5","lastCommitWhen":"2026-03-06T21:01:00+01:00","lastCommitMessage":"Autoparser - complete refactoring of parser architecture (#18675)\n\n* Autoparser - full single commit squish\n\n* Final pre-merge changes: minor fixes, Kimi 2.5 model parser"},{"name":"google-gemma-2-2b-it.jinja","kind":"file","size":591,"lastCommitHash":"8b576b6c55bc4e6be898b47522f0ef402b93ef62","lastCommitWhen":"2025-01-30T19:13:58Z","lastCommitMessage":"Tool call support (generic + native for Llama, Functionary, Hermes, Mistral, Firefunction, DeepSeek) w/ lazy grammars (#9639)\n\n\r\n---------\r\n\r\nCo-authored-by: Xuan Son Nguyen <thichthat@gmail.com>\r\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>\r\nCo-authored-by: Xuan Son Nguyen <son@huggingface.co>"},{"name":"google-gemma-4-31B-it-interleaved.jinja","kind":"file","size":12752,"lastCommitHash":"3fc65063d9c356510b86fc2f15ca8aea711bfc47","lastCommitWhen":"2026-04-10T16:12:53-05:00","lastCommitMessage":"common : better align to the updated official gemma4 template (#21704)"},{"name":"google-gemma-4-31B-it.jinja","kind":"file","size":16448,"lastCommitHash":"3fc65063d9c356510b86fc2f15ca8aea711bfc47","lastCommitWhen":"2026-04-10T16:12:53-05:00","lastCommitMessage":"common : better align to the updated official gemma4 template (#21704)"},{"name":"HuggingFaceTB-SmolLM3-3B.jinja","kind":"file","size":3795,"lastCommitHash":"7a0b6a635ef33a9fd7f9441231c6c705f10abb59","lastCommitWhen":"2026-03-23T08:35:27+01:00","lastCommitMessage":"common/autoparser : detect reasoning markers when enable_thinking changes system prompt (#20859)"},{"name":"ibm-granite-granite-3.3-2B-Instruct.jinja","kind":"file","size":4567,"lastCommitHash":"3db4da56a5a00c4b47bbb3b18f85fb4473662adb","lastCommitWhen":"2025-08-06T20:27:30+02:00","lastCommitMessage":"chat : support Granite model reasoning and tool call (#14864)\n\n"},{"name":"ibm-granite-granite-4.0.jinja","kind":"file","size":6418,"lastCommitHash":"6137c325a16073c8bf68a52396a815006ccaa9a9","lastCommitWhen":"2026-04-02T11:28:56+02:00","lastCommitMessage":"chat : add Granite 4.0 chat template with correct tool_call role mapping (#20804)\n\n* chat : add Granite 4.0 chat template with correct tool_call role mapping\n\nIntroduce `LLM_CHAT_TEMPLATE_GRANITE_4_0` alongside the existing Granite\n3.x template (renamed `LLM_CHAT_TEMPLATE_GRANITE_3_X`).\n\nThe Granite 4.0 Jinja template uses `<tool_call>` XML tags and maps the\n`assistant_tool_call` role to `<|start_of_role|>assistant<|end_of_role|><|tool_call|>`.\nWithout a matching C++ handler, the fallback path emits the literal role\n`assistant_tool_call` which the model does not recognize, breaking tool\ncalling when `--jinja` is not used.\n\nChanges:\n- Rename `LLM_CHAT_TEMPLATE_GRANITE` to `LLM_CHAT_TEMPLATE_GRANITE_3_X`\n  (preserves existing 3.x behavior unchanged)\n- Add `LLM_CHAT_TEMPLATE_GRANITE_4_0` enum, map entry, and handler\n- Detection: `<|start_of_role|>` + (`<tool_call>` or `<tools>`) → 4.0,\n  otherwise → 3.x\n- Add production Granite 4.0 Jinja template\n- Add tests for both 3.x and 4.0 template paths (C++ and Jinja)\n\nCo-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>\n\n* Code review: follow standard format and use common logic in test-chat-template.cpp\n\n* Rename custom_conversation variable for extra_conversation to give it a more meaningful name\n\n---------\n\nCo-authored-by: Claude Opus 4.6 <noreply@anthropic.com>"},{"name":"ibm-granite-granite-4.1.jinja","kind":"file","size":6099,"lastCommitHash":"bb771cbd2bfd92cfc99263e75053f5eb9b936d84","lastCommitWhen":"2026-05-28T13:13:33+02:00","lastCommitMessage":"chat : add Granite 4.1 chat template (#23518)"},{"name":"Kimi-K2-Instruct.jinja","kind":"file","size":2519,"lastCommitHash":"636fc17a376dacc01da20d508e6986a299b1f819","lastCommitWhen":"2025-12-08T14:32:04+01:00","lastCommitMessage":"Fix Kimi-K2 tool-call parsing issues (#17376)\n\n* Fix kimi-k2 parsing\n\n* fix template & add more tests for kimi-k2\n\n* Another fix for Kimi-K2 chat template.\n\n* enable allow_toolcall_in_think for Kimi-K2\n\n* Refine key-value separator and value end format\n\n* Enable tool call in think for kimi-k2\n\n* allow_toolcall_in_think is now tested with Kimi-K2\n\n* Remove outdated TODO comment in XML tool call parser\n\nRemoved TODO comment about untested tool call feature.\n\n* Rename function from \"utf8_truncate_safe\" to \"utf8_truncate_safe_len\""},{"name":"Kimi-K2-Thinking.jinja","kind":"file","size":4130,"lastCommitHash":"636fc17a376dacc01da20d508e6986a299b1f819","lastCommitWhen":"2025-12-08T14:32:04+01:00","lastCommitMessage":"Fix Kimi-K2 tool-call parsing issues (#17376)\n\n* Fix kimi-k2 parsing\n\n* fix template & add more tests for kimi-k2\n\n* Another fix for Kimi-K2 chat template.\n\n* enable allow_toolcall_in_think for Kimi-K2\n\n* Refine key-value separator and value end format\n\n* Enable tool call in think for kimi-k2\n\n* allow_toolcall_in_think is now tested with Kimi-K2\n\n* Remove outdated TODO comment in XML tool call parser\n\nRemoved TODO comment about untested tool call feature.\n\n* Rename function from \"utf8_truncate_safe\" to \"utf8_truncate_safe_len\""},{"name":"Kimi-K3.jinja","kind":"file","size":14909,"lastCommitHash":"ad1de39e0708e3ced9c71bb3c82d93a2c046a73f","lastCommitWhen":"2026-08-15T17:11:05+02:00","lastCommitMessage":"model: add Kimi-K3 text model (#26185)\n\n* model: add Kimi-K3 text model\n\nHybrid KDA (linear) + MLA (full) attention as in Kimi-Linear-48B, plus five\nthings that architecture does not have:\n\n  1. cross-layer residual attention  (attn_res_block_size)\n  2. latent MoE                      (routed experts run at n_expert_latent)\n  3. situ activation                 (replaces SwiGLU everywhere)\n  4. MLA output gate                 (sigmoid gate before o_proj)\n  5. full-rank KDA gate              (single ssm_g instead of ssm_g_a/ssm_g_b)\n\nK3's text_config reports KimiLinearForCausalLM - the older 48B architecture -\nso get_model_architecture routes on the top-level name instead.\n\nThe KDA decay gate has two forms, selected by linear_attn_config's\ngate_lower_bound. It is not a clamp: when set it swaps the activation entirely\n(fla/ops/kda/gate.py), from -exp(A_log)*softplus(x) to\nlower_bound*sigmoid(exp(A_log)*x). K3 sets it to -5.0; kimi-linear leaves it\nunset, so that path is unchanged.\n\nCross-layer residuals reuse ggml_dsv4_hc_pre for the weighted sum. That op is\nCPU + CUDA only, so Metal/Vulkan will fall back per-node until those kernels\nexist.\n\nThe routed experts ship as compressed-tensors \"mxfp4-pack-quantized\". That is\nbit-compatible with ggml's MXFP4 - same E2M1 code assignment, same E8M0 scale\nbyte, only the nibble positions within a block differ - so they are repacked\nrather than dequantized, losslessly and without a ~5.5 TB bf16 round-trip.\nThe repack is built lazily because gguf_writer holds every added tensor until\nthe final write. DeepSeek-V4 was already doing the identical bit-shuffling, so\nit now shares the helper.\n\nVerified against Moonshot's own code path (transformers + fla's Triton KDA\nkernels) on a tiny model exercising every K3-specific feature. Final-position\nlogits vs the fp32 reference: 6.7e-05 rel / corr 1.00000000 for both the\nchunked and the recurrent delta-net path. MXFP4 blocks dequantize to the source\nweights with 0.0e+00 error.\n\nAssisted-By: Claude Opus 5 (1M context) <noreply@anthropic.com>\n\n* model: fix ty errors in the Kimi-K3 converter\n\n- `_res_parts` buffers (kind, tensor) pairs, not bare tensors\n- `get_tensors` must return an Iterator, matching ModelBase\n- LazyBase's `func` takes one argument, so pass the expert loaders through\n  `args` instead of the closure\n- borrowing KimiLinearModel.set_vocab from an unrelated TextModel is\n  deliberate and safe, but not expressible in the signature\n\nNo behaviour change: the MXFP4 repack still dequantizes to the source weights\nwith 0.0e+00 error and end-to-end logits are unchanged (8.386e-03 rel,\ncorr 0.99996630).\n\nAssisted-By: Claude Opus 5 (1M context) <noreply@anthropic.com>\n\n* Update conversion/kimi_k3.py\n\nCo-authored-by: Boris Dvorkin  <b_dvorkin@niuitmo.ru>\n\n* Increase LLAMA_MAX_EXPERTS from 512 to 1024\n\n* tests : support for Kimi K3 in archs test\n\n* chat : add Kimi K3 chat format (reasoning, content, typed tool calls)\n\nK3's assistant output is an XTML-ish tagged format built by the template's\nopen_tag/close_tag macros. Two properties break generic parsing:\n\n1. The generation prompt ends with open_tag('think'), so the completion\n   starts inside the think section with no opening marker in the output\n   (thinking_forced_open).\n2. Only <|open|>/<|close|>/<|sep|>/<|end_of_msg|> are special tokens; tag\n   names (\"think\", \"response\", \"message\") are ordinary text tokens.\n\nAdds common_chat_params_init_kimi_k3 (PEG_NATIVE) with detection on the\nmarker trio, reasoning extraction, response unwrapping, and tool-call\nparsing of the tools/call/argument tag structure with argument types\ntaken from the tool schema. Includes the K3 chat template fixture and 9\ntest-chat cases derived from real generations of the full 2.8T model.\n\nVerified end-to-end against Kimi-K3-Q2_K (GrEarl/Kimi-K3-GGUF) on 8x B200:\ncontent, reasoning_content, streaming deltas, and tool_calls all correct;\nfinish_reason stop/tool_calls as appropriate.\n\nCo-Authored-By: Claude Fable 5 <noreply@anthropic.com>\n\n* chat : add message_delimiters for Kimi K3\n\nPer-role message-start markers for token-level span splitting. User and\nassistant messages carry only the role attribute, so their full opener\n(through <|sep|>) is used; system and tool messages continue with more\nattributes (type=/tool=/index=), so those delimiters stop after the\nrole's closing quote. Verified against the K3 tiktoken vocabulary that\nthe closing quote is always a standalone token across all attribute\nvariants, so the token-level prefix match stays exact.\n\nCo-Authored-By: Claude Fable 5 <noreply@anthropic.com>\n\n* fix: apply nits from @ngxson and text fixes from @danielhanchen\n\n* tests : added missing hyperparameters and tensors for Kimi K3 in test-llama-archs\n\n* chore : move overly verbose header file comments to Kimi K3 source file\n\n* tests : re-enabled KIMI_K3 in test-llama-archs for WebGPU backend\n\n* model-saver : emit kda_gate_lower_bound for Kimi K3\n\nQuick fix. The Kimi K3 loader reads kda_gate_lower_bound and gates a graph branch on it (it scales the KDA gate when the bound is above -INFINITY), but the model\nsaver never wrote the key, so a save->load roundtrip silently dropped it back to the -INFINITY default and changed the model's output. The real K3 config sets gate_lower_bound = -5.0.\n\nI propose to emit it from the saver, and set it to -5.0 in the test-llama-archs K3 case so the roundtrip check exercises it (the roundtrip fails without the saver line).\n\n* Refactor conditional for model architecture check\n\n* tests : re-enabled (again) KIMI_K3 and MINIMAX_M3 in test-llama-archs for WebGPU backend\n\n* fix code comments\n\n* add template on conversion\n\n* move repack_mxfp4_blocks to model base\n\n* nits\n\n* add_value_length\n\n* optimize res_stack construction\n\n* nits\n\n---------\n\nCo-authored-by: Boris Dvorkin <b_dvorkin@niuitmo.ru>\nCo-authored-by: Stanisław Szymczyk <sszymczy@gmail.com>\nCo-authored-by: Deepankar Singh <singh.deepankar39@gmail.com>\nCo-authored-by: Claude Fable 5 <noreply@anthropic.com>\nCo-authored-by: Caleb DeLeeuw <caleb.deleeuw@gmail.com>\nCo-authored-by: Xuan Son Nguyen <son@huggingface.co>"},{"name":"LFM2-8B-A1B.jinja","kind":"file","size":1349,"lastCommitHash":"97c64fbdbdf6662a0f31c97918fec7d480e1ecf5","lastCommitWhen":"2026-03-09T01:11:22+01:00","lastCommitMessage":"PEG parser for LFM2 (#20251)\n\n* PEG parser for LFM2\n\n* Simplify using python_value()"},{"name":"LFM2.5-8B-A1B.jinja","kind":"file","size":4621,"lastCommitHash":"98d5e8ba8a2642710c9871d05ac1033a3328b884","lastCommitWhen":"2026-06-06T22:39:21+02:00","lastCommitMessage":"common/chat : fix LFM2/LFM2.5 reasoning round-trip and <think> leak (#24234)\n\n* common/chat : fix LFM2 reasoning round-trip and stray <think> leak\n* Gate by reasoning format and whether the template supports <think>"},{"name":"LFM2.5-Instruct.jinja","kind":"file","size":1783,"lastCommitHash":"1d6d4cf7a5361046f778414c5b1f5ecbc07eeb77","lastCommitWhen":"2026-04-01T16:22:44+02:00","lastCommitMessage":"fix: tool call parsing for LFM2 and LFM2.5 models (#21242)\n\n* fix: tool call parsing for LFM2 and LFM2.5 models'\n\n* refactor: add test / break out lfm2 and lfm2.5 parsing logic"},{"name":"llama-cpp-deepseek-r1.jinja","kind":"file","size":3067,"lastCommitHash":"5e54d51b199ad2d70cf6eba4bff756bbf63366a6","lastCommitWhen":"2026-03-19T16:58:21+01:00","lastCommitMessage":"common/parser: add proper reasoning tag prefill reading (#20424)\n\n* Implement proper prefill extraction\n\n* Refactor cli parameters, update docs, move reasoning budget sampler part to common/reasoning-budget.cpp\n\n* Update tools/server/server-task.cpp\n\n* refactor: move grammars to variant, remove grammar_external, handle exception internally\n\n* Make code less C++y\n\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>"},{"name":"llama-cpp-rwkv-world.jinja","kind":"file","size":1229,"lastCommitHash":"0d9226763c82562186122f3b827fa3862864a19c","lastCommitWhen":"2025-07-14T07:43:43+08:00","lastCommitMessage":"llama : add jinja template for rwkv-world (#14665)\n\n* llama : add jinja template for rwkv-world\n\nSigned-off-by: Molly Sophia <mollysophia379@gmail.com>\n\n* Update convert_hf_to_gguf.py\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n---------\n\nSigned-off-by: Molly Sophia <mollysophia379@gmail.com>\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>"},{"name":"meetkai-functionary-medium-v3.1.jinja","kind":"file","size":3252,"lastCommitHash":"5e54d51b199ad2d70cf6eba4bff756bbf63366a6","lastCommitWhen":"2026-03-19T16:58:21+01:00","lastCommitMessage":"common/parser: add proper reasoning tag prefill reading (#20424)\n\n* Implement proper prefill extraction\n\n* Refactor cli parameters, update docs, move reasoning budget sampler part to common/reasoning-budget.cpp\n\n* Update tools/server/server-task.cpp\n\n* refactor: move grammars to variant, remove grammar_external, handle exception internally\n\n* Make code less C++y\n\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>"},{"name":"meetkai-functionary-medium-v3.2.jinja","kind":"file","size":12792,"lastCommitHash":"8b576b6c55bc4e6be898b47522f0ef402b93ef62","lastCommitWhen":"2025-01-30T19:13:58Z","lastCommitMessage":"Tool call support (generic + native for Llama, Functionary, Hermes, Mistral, Firefunction, DeepSeek) w/ lazy grammars (#9639)\n\n\r\n---------\r\n\r\nCo-authored-by: Xuan Son Nguyen <thichthat@gmail.com>\r\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>\r\nCo-authored-by: Xuan Son Nguyen <son@huggingface.co>"},{"name":"meta-llama-Llama-3.1-8B-Instruct.jinja","kind":"file","size":4614,"lastCommitHash":"8b576b6c55bc4e6be898b47522f0ef402b93ef62","lastCommitWhen":"2025-01-30T19:13:58Z","lastCommitMessage":"Tool call support (generic + native for Llama, Functionary, Hermes, Mistral, Firefunction, DeepSeek) w/ lazy grammars (#9639)\n\n\r\n---------\r\n\r\nCo-authored-by: Xuan Son Nguyen <thichthat@gmail.com>\r\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>\r\nCo-authored-by: Xuan Son Nguyen <son@huggingface.co>"},{"name":"meta-llama-Llama-3.2-3B-Instruct.jinja","kind":"file","size":3827,"lastCommitHash":"8b576b6c55bc4e6be898b47522f0ef402b93ef62","lastCommitWhen":"2025-01-30T19:13:58Z","lastCommitMessage":"Tool call support (generic + native for Llama, Functionary, Hermes, Mistral, Firefunction, DeepSeek) w/ lazy grammars (#9639)\n\n\r\n---------\r\n\r\nCo-authored-by: Xuan Son Nguyen <thichthat@gmail.com>\r\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>\r\nCo-authored-by: Xuan Son Nguyen <son@huggingface.co>"},{"name":"meta-llama-Llama-3.3-70B-Instruct.jinja","kind":"file","size":4614,"lastCommitHash":"8b576b6c55bc4e6be898b47522f0ef402b93ef62","lastCommitWhen":"2025-01-30T19:13:58Z","lastCommitMessage":"Tool call support (generic + native for Llama, Functionary, Hermes, Mistral, Firefunction, DeepSeek) w/ lazy grammars (#9639)\n\n\r\n---------\r\n\r\nCo-authored-by: Xuan Son Nguyen <thichthat@gmail.com>\r\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>\r\nCo-authored-by: Xuan Son Nguyen <son@huggingface.co>"},{"name":"microsoft-Phi-3.5-mini-instruct.jinja","kind":"file","size":430,"lastCommitHash":"8b576b6c55bc4e6be898b47522f0ef402b93ef62","lastCommitWhen":"2025-01-30T19:13:58Z","lastCommitMessage":"Tool call support (generic + native for Llama, Functionary, Hermes, Mistral, Firefunction, DeepSeek) w/ lazy grammars (#9639)\n\n\r\n---------\r\n\r\nCo-authored-by: Xuan Son Nguyen <thichthat@gmail.com>\r\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>\r\nCo-authored-by: Xuan Son Nguyen <son@huggingface.co>"},{"name":"MiMo-VL.jinja","kind":"file","size":2471,"lastCommitHash":"1920345c3bcec451421bb6abc4981678cc721154","lastCommitWhen":"2025-11-18T18:54:15+01:00","lastCommitMessage":"common : Generalized XML-style tool-call parsing with streaming support (GLM 4.5/4.6 + MiniMax M2 + SeedOSS + Kimi-K2 + Qwen3-Coder + Apriel-1.5 + Xiaomi-MiMo) (#16932)\n\n* Add files via upload\n\n* fix unit test\n\n* fix crashes for --reasoning-format=none\n\n* Patch buggy official MiniMax-M2 chat template\n\n* add upstream minja fix: https://github.com/ochafik/minja/pull/7\n\n* Fix <think> token not generated\n\n* add test copied from https://github.com/ggml-org/llama.cpp/pull/16946\n\n* cleanup\n\n* Hopes to fix the compilation error on CI\n\n* Delete chat template patching since it’s fixed by upstream Minja\n\n* Remove undeeded Minimax-M2 template patch\n\nhttps://github.com/ochafik/minja/pull/7#issuecomment-3480356100\n\n* Add proper handling of optional parameters with test\nmerged tests from: https://github.com/ggml-org/llama.cpp/pull/16946/commits/23d4bb75c485c12ac89f81c424dc03c87a640e8c\n\n* Fix making all tool parameters optional\n\n* Move xml tool parser to separate file\n\n* cleanup & add tests for GLM4.5\n\n* add streaming tests & enhancement & cleanups\n\nAdd streaming test for both GLM 4.5 and minimax-m2.\nCleanup for preserved_tokens.\nCleanup for grammar rule name.\nEnhance the parser's stability.\n\n* cleanup & add support for Kimi-K2 Qwen3-Coder Apriel-1.5 Xiaomi-MiMo\n\n* apply suggestions from reviewers\n\n* fix a misuse for data.grammar_lazy\n\n* fix grammar when tool have no argument\n\n* Fix `no triggers set for lazy grammar!` for GLM4.5/4.6. Insert additional stops for Kimi-K2\n\n* update chat.cpp\n\n* fix grammar for GLM 4.5/4.6\n\n* Try fix Jinja template for GLM\n\n* Try fix GLM-4.6.jinja\n\n* Update common/chat-parser-xml-toolcall.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Update tests/test-chat.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* improve chat template for GLM, rename Kimi-K2 template to Kimi-K2-Thinking\n\n* Improve Kimi-K2 chat template\n\n* Fix unit test\n\n* Fix \"Invalid tool call arguments passed\" in a rare case.\n\nIn a rare case, the model may emit a raw string that begins with a valid JSON string. This commit adds unit tests to cover that scenario and fixes the regression introduced during the Kimi-K2 adaptation.\n\n---------\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>"},{"name":"MiniMax-M1.jinja","kind":"file","size":3442,"lastCommitHash":"16d222fc5ead59d20039501a37251c9ed457a454","lastCommitWhen":"2026-08-15T00:02:38+02:00","lastCommitMessage":"model : add support for MiniMaxText01ForCausalLM and MiniMaxM1ForCausalLM (#27018)\n\n* llama : support for MiniMax-Text-01 model\n\n* chore : renames to match the other MiniMax models\n\n* model : add logits mask as MiniMax-Text-01 embeddings tensor has zero-valued embeddings for tokens >= 200032 that produce zero logits disrupting the token sampling process\n\n* llama : replace hardcoded conditions with hparams.is_recr()\n\n* model : used build_rs() for recurrent state management\n\n* chore : code cleanup\n\n* model : optimized MiniMax-Text-01 by removing the state tranpose operations\n\n* chore : removed unnecessary ggml_cont() in MiniMax-Text-01 implementation\n\n* llama : add generic logits mask graph input\n\n* model : permuted diag_decay dimensions to avoid doing it inside MiniMax-Text-01 graph\n\n* chore : code cleanup\n\n* chore : code cleanup\n\n* model : use token positions when calculating MiniMax-Text-01 decay tensors\n\n* convert : add support for MiniMaxM1ForCausalLM as it seems to be the same as MiniMaxText01ForCausalLM\n\n* chat : add jinja template for MiniMax-M1\n\nCo-authored-by: QscQ <qscqesze@gmail.com>\n\n* chore : code cleanup\n\n* tests : MINIMAX_01-related fixes\n\n* chore : silence Python lint errors\n\n* vocab : remove unnecessary vocab type\n\n* convert : update MiniMaxText01Model conversion to use yield when modifying tensors\n\n* convert : suppress tokens with zero-valued embeddings during MiniMax-Text-01 conversion\n\n* llama : removed logits mask - no longer necessary as token suppression is used instead\n\n* model : use common functions to make MiniMax-Text-01 implementation more concise\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>\n\n* model : use common functions to make MiniMax-Text-01 implementation more concise\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>\n\n* convert : override non-working built-in chat template during conversion\n\n* tests : skip arch MINIMAX_01 tests for WebGPU backend (it breaks again)\n\n---------\n\nCo-authored-by: Stanisław Szymczyk <sszymczy@gmail.com>\nCo-authored-by: QscQ <qscqesze@gmail.com>\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@huggingface.co>"},{"name":"MiniMax-M2.jinja","kind":"file","size":6482,"lastCommitHash":"1920345c3bcec451421bb6abc4981678cc721154","lastCommitWhen":"2025-11-18T18:54:15+01:00","lastCommitMessage":"common : Generalized XML-style tool-call parsing with streaming support (GLM 4.5/4.6 + MiniMax M2 + SeedOSS + Kimi-K2 + Qwen3-Coder + Apriel-1.5 + Xiaomi-MiMo) (#16932)\n\n* Add files via upload\n\n* fix unit test\n\n* fix crashes for --reasoning-format=none\n\n* Patch buggy official MiniMax-M2 chat template\n\n* add upstream minja fix: https://github.com/ochafik/minja/pull/7\n\n* Fix <think> token not generated\n\n* add test copied from https://github.com/ggml-org/llama.cpp/pull/16946\n\n* cleanup\n\n* Hopes to fix the compilation error on CI\n\n* Delete chat template patching since it’s fixed by upstream Minja\n\n* Remove undeeded Minimax-M2 template patch\n\nhttps://github.com/ochafik/minja/pull/7#issuecomment-3480356100\n\n* Add proper handling of optional parameters with test\nmerged tests from: https://github.com/ggml-org/llama.cpp/pull/16946/commits/23d4bb75c485c12ac89f81c424dc03c87a640e8c\n\n* Fix making all tool parameters optional\n\n* Move xml tool parser to separate file\n\n* cleanup & add tests for GLM4.5\n\n* add streaming tests & enhancement & cleanups\n\nAdd streaming test for both GLM 4.5 and minimax-m2.\nCleanup for preserved_tokens.\nCleanup for grammar rule name.\nEnhance the parser's stability.\n\n* cleanup & add support for Kimi-K2 Qwen3-Coder Apriel-1.5 Xiaomi-MiMo\n\n* apply suggestions from reviewers\n\n* fix a misuse for data.grammar_lazy\n\n* fix grammar when tool have no argument\n\n* Fix `no triggers set for lazy grammar!` for GLM4.5/4.6. Insert additional stops for Kimi-K2\n\n* update chat.cpp\n\n* fix grammar for GLM 4.5/4.6\n\n* Try fix Jinja template for GLM\n\n* Try fix GLM-4.6.jinja\n\n* Update common/chat-parser-xml-toolcall.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Update tests/test-chat.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* improve chat template for GLM, rename Kimi-K2 template to Kimi-K2-Thinking\n\n* Improve Kimi-K2 chat template\n\n* Fix unit test\n\n* Fix \"Invalid tool call arguments passed\" in a rare case.\n\nIn a rare case, the model may emit a raw string that begins with a valid JSON string. This commit adds unit tests to cover that scenario and fixes the regression introduced during the Kimi-K2 adaptation.\n\n---------\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>"},{"name":"MiniMax-M3.jinja","kind":"file","size":11756,"lastCommitHash":"6ba5ef247034cd57201360aed246d98f5a404d92","lastCommitWhen":"2026-07-28T04:27:20-05:00","lastCommitMessage":"common/chat: add specialized minimax m3 parser (#26210)"},{"name":"Mistral-Small-3.2-24B-Instruct-2506.jinja","kind":"file","size":6704,"lastCommitHash":"901e20bbe571fbde48d13eb188f4e7cdc7562fb6","lastCommitWhen":"2025-06-24T09:17:58+03:00","lastCommitMessage":"jinja : Add Mistral-Small-3.2-24B-Instruct-2506.jinja (#14349)\n\nThis will allow the use of tools on the llama-server"},{"name":"mistralai-Ministral-3-14B-Reasoning-2512.jinja","kind":"file","size":6206,"lastCommitHash":"2fbe3b7bb7814621477d658a81f0d0cca08761cf","lastCommitWhen":"2025-12-09T17:31:04-06:00","lastCommitMessage":"common : add parser for ministral/mistral large 3/devstral 2 (#17713)\n\n"},{"name":"mistralai-Mistral-Nemo-Instruct-2407.jinja","kind":"file","size":3945,"lastCommitHash":"8b576b6c55bc4e6be898b47522f0ef402b93ef62","lastCommitWhen":"2025-01-30T19:13:58Z","lastCommitMessage":"Tool call support (generic + native for Llama, Functionary, Hermes, Mistral, Firefunction, DeepSeek) w/ lazy grammars (#9639)\n\n\r\n---------\r\n\r\nCo-authored-by: Xuan Son Nguyen <thichthat@gmail.com>\r\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>\r\nCo-authored-by: Xuan Son Nguyen <son@huggingface.co>"},{"name":"moonshotai-Kimi-K2.jinja","kind":"file","size":1835,"lastCommitHash":"566059a26b0ce8faec4ea053605719d399c64cc5","lastCommitWhen":"2026-03-06T21:01:00+01:00","lastCommitMessage":"Autoparser - complete refactoring of parser architecture (#18675)\n\n* Autoparser - full single commit squish\n\n* Final pre-merge changes: minor fixes, Kimi 2.5 model parser"},{"name":"muse-glimmer.jinja","kind":"file","size":9992,"lastCommitHash":"0b1bad14ff204627636aeb1de22ddcd5acb859d4","lastCommitWhen":"2026-08-11T15:15:20-05:00","lastCommitMessage":"chat : fix muse-glimmer detection of tool calls after EOM (#26879)\n\n* chat : fix muse-glimmer swallowing a trailing tool call into content\n\nMuse Glimmer routinely answers the user and calls a tool in a single\ngeneration. The template terminates a message with <|eom|> when more\nmessages follow in the same turn and <|eot|> only at the end of the turn,\nso the answer is closed by <|eom|> and the call opens a fresh header:\n\n    <prose><|eom|><|start|>assistant to=<tool><|message|><atem:function_calls>...\n\nThe final-message rule read content with until(\"<|eot|>\"), which assumed the\nuser-facing message is always last. There is no <|eot|> before the call, so\ncontent ran to the end of the turn, absorbed the markup, and no tool_calls\nwere emitted - the tool never ran. On a tau2-bench telecom run this hit 43\nturns across 19 of 114 tasks.\n\nStop the answer at <|eom|> and parse what follows as tool calls.\n\nAdds models/templates/muse-glimmer.jinja and four parser tests: a plain\nanswer, the <|eom|> junction, markup quoted in an answer staying content,\nand tool markup inside the to=self channel staying reasoning.\n\n* address comment"},{"name":"NousResearch-Hermes-2-Pro-Llama-3-8B-tool_use.jinja","kind":"file","size":5004,"lastCommitHash":"8b576b6c55bc4e6be898b47522f0ef402b93ef62","lastCommitWhen":"2025-01-30T19:13:58Z","lastCommitMessage":"Tool call support (generic + native for Llama, Functionary, Hermes, Mistral, Firefunction, DeepSeek) w/ lazy grammars (#9639)\n\n\r\n---------\r\n\r\nCo-authored-by: Xuan Son Nguyen <thichthat@gmail.com>\r\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>\r\nCo-authored-by: Xuan Son Nguyen <son@huggingface.co>"},{"name":"NousResearch-Hermes-3-Llama-3.1-8B-tool_use.jinja","kind":"file","size":5004,"lastCommitHash":"8b576b6c55bc4e6be898b47522f0ef402b93ef62","lastCommitWhen":"2025-01-30T19:13:58Z","lastCommitMessage":"Tool call support (generic + native for Llama, Functionary, Hermes, Mistral, Firefunction, DeepSeek) w/ lazy grammars (#9639)\n\n\r\n---------\r\n\r\nCo-authored-by: Xuan Son Nguyen <thichthat@gmail.com>\r\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>\r\nCo-authored-by: Xuan Son Nguyen <son@huggingface.co>"},{"name":"NVIDIA-Nemotron-3-Nano-30B-A3B-BF16.jinja","kind":"file","size":10504,"lastCommitHash":"c15395f73c42805d9609a55749a1d4b5b2251379","lastCommitWhen":"2026-01-16T11:22:06+01:00","lastCommitMessage":"common : implement new jinja template engine (#18462)\n\n* jinja vm\n\n* lexer\n\n* add vm types\n\n* demo\n\n* clean up\n\n* parser ok\n\n* binary_expression::execute\n\n* shadow naming\n\n* bin ops works!\n\n* fix map object\n\n* add string builtins\n\n* add more builtins\n\n* wip\n\n* use mk_val\n\n* eval with is_user_input\n\n* render gemma tmpl ok\n\n* track input string even after transformations\n\n* support binded functions\n\n* keyword arguments and slicing array\n\n* use shared_ptr for values\n\n* add mk_stmt\n\n* allow print source on exception\n\n* fix negate test\n\n* testing more templates\n\n* mostly works\n\n* add filter_statement\n\n* allow func to access ctx\n\n* add jinja-value.cpp\n\n* impl global_from_json\n\n* a lot of fixes\n\n* more tests\n\n* more fix, more tests\n\n* more fixes\n\n* rm workarounds\n\n* demo: type inferrence\n\n* add placeholder for tojson\n\n* improve function args handling\n\n* rm type inference\n\n* no more std::regex\n\n* trailing spaces\n\n* make testing more flexible\n\n* make output a bit cleaner\n\n* (wip) redirect minja calls\n\n* test: add --output\n\n* fix crash on macro kwargs\n\n* add minimal caps system\n\n* add some workarounds\n\n* rm caps_apply_workarounds\n\n* get rid of preprocessing\n\n* more fixes\n\n* fix test-chat-template\n\n* move test-chat-jinja into test-chat-template\n\n* rm test-chat-jinja from cmake\n\n* test-chat-template: use common\n\n* fix build\n\n* fix build (2)\n\n* rename vm --> interpreter\n\n* improve error reporting\n\n* correct lstrip behavior\n\n* add tojson\n\n* more fixes\n\n* disable tests for COMMON_CHAT_FORMAT_GENERIC\n\n* make sure tojson output correct order\n\n* add object.length\n\n* fully functional selectattr / rejectattr\n\n* improve error reporting\n\n* more builtins added, more fixes\n\n* create jinja rendering tests\n\n* fix testing.h path\n\n* adjust whitespace rules\n\n* more fixes\n\n* temporary disable test for ibm-granite\n\n* r/lstrip behavior matched with hf.js\n\n* minimax, glm4.5 ok\n\n* add append and pop\n\n* kimi-k2 ok\n\n* test-chat passed\n\n* fix lstrip_block\n\n* add more jinja tests\n\n* cast to unsigned char\n\n* allow dict key to be numeric\n\n* nemotron: rm windows newline\n\n* tests ok\n\n* fix test\n\n* rename interpreter --> runtime\n\n* fix build\n\n* add more checks\n\n* bring back generic format support\n\n* fix Apertus\n\n* [json.exception.out_of_range.403] key 'content' not found\n\n* rm generic test\n\n* refactor input marking\n\n* add docs\n\n* fix windows build\n\n* clarify error message\n\n* improved tests\n\n* split/rsplit with maxsplit\n\n* non-inverse maxsplit\n\nforgot to change after simplifying\n\n* implement separators for tojson and fix indent\n\n* i like to move it move it\n\n* rename null -- > none\n\n* token::eof\n\n* some nits + comments\n\n* add exception classes for lexer and parser\n\n* null -> none\n\n* rename global -> env\n\n* rm minja\n\n* update docs\n\n* docs: add input marking caveats\n\n* imlement missing jinja-tests functions\n\n* oops\n\n* support trim filter with args, remove bogus to_json reference\n\n* numerous argument fixes\n\n* updated tests\n\n* implement optional strip chars parameter\n\n* use new chars parameter\n\n* float filter also has default\n\n* always leave at least one decimal in float string\n\n* jinja : static analysis + header cleanup + minor fixes\n\n* add fuzz test\n\n* add string.cpp\n\n* fix chat_template_kwargs\n\n* nits\n\n* fix build\n\n* revert\n\n* unrevert\n\nsorry :)\n\n* add fuzz func_args, refactor to be safer\n\n* fix array.map()\n\n* loosen ensure_vals max count condition, add not impl for map(int)\n\n* hopefully fix windows\n\n* check if empty first\n\n* normalize newlines\n\n---------\n\nCo-authored-by: Alde Rojas <hello@alde.dev>\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>"},{"name":"NVIDIA-Nemotron-Nano-v2.jinja","kind":"file","size":5496,"lastCommitHash":"b2426e469e2fdb6c44216d56baa4cfff4f39ae00","lastCommitWhen":"2025-09-05T01:22:22+02:00","lastCommitMessage":"chat : nemotron thinking & toolcalling support (#15676)\n\n* feat: nemotron thinking & toolcalling support\n\n* Trailing whitespaces\n\n* Corrected template for Nemotron\n\n* Template and parser fixes\n\n* Final template and grammar changes\n\n* Whitespace\n\n* Always do lazy grammar processing since </think> tag will always be there.\n\n* Allow extra content after toolcall\n\n* Whitespace\n\n* New tests: thinking + tools, tools + content, thinking + tools + content (new!)\n\n* Whitespace\n\n* Remove cURL test script"},{"name":"openai-gpt-oss-120b.jinja","kind":"file","size":16738,"lastCommitHash":"b204a5a234f4cf0b3f449476da639a5510c6d157","lastCommitWhen":"2025-08-14T17:23:11+03:00","lastCommitMessage":"gpt-oss: implement harmony parsing (#15181)\n\n* model : add harmony parser for gpt-oss\n\n* gpt-oss : fix grammar trigger from causing empty stack\n\n* gpt-oss: tweak the grammar trigger again\n\n* gpt-oss : add support for recipient in role header\n\n* gpt-oss : fix ungrouped tool calls in grammar\n\n* gpt-oss : loosen function name matching during parse\n\n* gpt-oss : clean up workarounds\n\n* gpt-oss : add template tests\n\n* gpt-oss : simulate thinking and tool call tags\n\n* gpt-oss : undo think tags when reasoning_format is none\n\n* gpt-oss : set special tokens back to user defined\n\n* gpt-oss : update openai-gpt-oss template\n\n* server : filter out harmony thought messages\n\n* gpt-oss : simplify parsing"},{"name":"openbmb-MiniCPM5-1B.jinja","kind":"file","size":9062,"lastCommitHash":"c818263f2a5ddab028dea5f169ea2b2266421125","lastCommitWhen":"2026-06-28T16:53:32+02:00","lastCommitMessage":"chat : implement minicpm5 parser (#24889)\n\n* Add minicpm5 tool call parser\n\n* Refactor MiniCPM5 PEG parser per review feedback\n\n* Fix jinja min/max API to match Jinja2\n\n* modify by review\n\n* MiniCPM5: use autoparser for XML tool calls and fix grammar preserved-token triggers\n\n* MiniCPM5: fix streaming tool-arg placeholder and remove alt XML markers\n\n* skip min/max attribute tests in -py mode\n\n* test-jinja: use real expected output for min/max attribute tests\n\n* MiniCPM5: revert shared mapper and history fallbacks per review\n\nDrop streaming tool-arg placeholder workarounds from the generic PEG\nmapper and restore strict tool-call argument JSON parsing so MiniCPM5\nsupport stays limited to autoparser/diff-analyzer changes.\n\n* chat : refactor minicpm5 back to dedicated parser\n\n* cont : simplify grammar\n\n* cont : refactor\n\n* cont : fixes\n\n* cont : rename template to openbmb-MiniCPM5-1B.jinja\n\n* cont : add message delimiters\n\n* cont : fix tests\n\n---------\n\nCo-authored-by: zhangtao <zhangtao2@modelbest.cn>\nCo-authored-by: 张涛 <>"},{"name":"poolside-Laguna-S-2.1.jinja","kind":"file","size":3961,"lastCommitHash":"a52077c4cabb4f3c0298329c9d2dd1324d5604cb","lastCommitWhen":"2026-08-10T05:20:59-05:00","lastCommitMessage":"chat : Align Laguna-S-2.1 chat template to huggingface (#26232)"},{"name":"poolside-Laguna-XS-2.1.jinja","kind":"file","size":6116,"lastCommitHash":"1f66c3ce1c26c95db3fadb734086c7d9fba23bb9","lastCommitWhen":"2026-07-22T09:54:08+08:00","lastCommitMessage":"Add support for Laguna XS.2 & M.1 (#25165)"},{"name":"poolside-Laguna-XS.2.jinja","kind":"file","size":6232,"lastCommitHash":"1f66c3ce1c26c95db3fadb734086c7d9fba23bb9","lastCommitWhen":"2026-07-22T09:54:08+08:00","lastCommitMessage":"Add support for Laguna XS.2 & M.1 (#25165)"},{"name":"Qwen-Qwen2.5-7B-Instruct.jinja","kind":"file","size":2507,"lastCommitHash":"8b576b6c55bc4e6be898b47522f0ef402b93ef62","lastCommitWhen":"2025-01-30T19:13:58Z","lastCommitMessage":"Tool call support (generic + native for Llama, Functionary, Hermes, Mistral, Firefunction, DeepSeek) w/ lazy grammars (#9639)\n\n\r\n---------\r\n\r\nCo-authored-by: Xuan Son Nguyen <thichthat@gmail.com>\r\nCo-authored-by: Georgi Gerganov <ggerganov@gmail.com>\r\nCo-authored-by: Xuan Son Nguyen <son@huggingface.co>"},{"name":"Qwen-Qwen3-0.6B.jinja","kind":"file","size":4116,"lastCommitHash":"e121edc4324a640be11b7e567edd39b721b0f8e4","lastCommitWhen":"2025-05-26T00:30:51+01:00","lastCommitMessage":"`server`: add `--reasoning-budget 0` to disable thinking (incl. qwen3 w/ enable_thinking:false) (#13771)\n\n---------\n\nCo-authored-by: ochafik <ochafik@google.com>\nCo-authored-by: Xuan-Son Nguyen <thichthat@gmail.com>"},{"name":"Qwen-QwQ-32B.jinja","kind":"file","size":2829,"lastCommitHash":"566059a26b0ce8faec4ea053605719d399c64cc5","lastCommitWhen":"2026-03-06T21:01:00+01:00","lastCommitMessage":"Autoparser - complete refactoring of parser architecture (#18675)\n\n* Autoparser - full single commit squish\n\n* Final pre-merge changes: minor fixes, Kimi 2.5 model parser"},{"name":"Qwen3-Coder.jinja","kind":"file","size":6148,"lastCommitHash":"566059a26b0ce8faec4ea053605719d399c64cc5","lastCommitWhen":"2026-03-06T21:01:00+01:00","lastCommitMessage":"Autoparser - complete refactoring of parser architecture (#18675)\n\n* Autoparser - full single commit squish\n\n* Final pre-merge changes: minor fixes, Kimi 2.5 model parser"},{"name":"Qwen3.5-4B.jinja","kind":"file","size":7756,"lastCommitHash":"98ae0a0d3600f08fbd8d938bc8de0436755e50c3","lastCommitWhen":"2026-03-28T20:41:32+01:00","lastCommitMessage":"common/parser: fix handling of tool definition with missing properties key (#21128)"},{"name":"README.md","kind":"file","size":3049,"lastCommitHash":"88021565f08e0b7c4e07ac089a15ec16fae9166c","lastCommitWhen":"2025-09-08T16:59:48+02:00","lastCommitMessage":"chat : Deepseek V3.1 reasoning and tool calling support (OpenAI Style) (#15533)\n\n* Add DeepSeek V3.1 thinking mode support\n\n- Added COMMON_CHAT_FORMAT_DEEPSEEK_V3_1 enum value\n- Created common_chat_params_init_deepseek_v3_1() function (currently uses R1 implementation)\n- Created common_chat_parse_deepseek_v3_1() function that handles V3.1 thinking format:\n  - Extracts reasoning content before '</think>' tag into reasoning_content\n  - Extracts regular content after '</think>' tag into content\n  - No opening '<think>' tag in V3.1 format\n- Added detection logic for V3.1 templates based on pattern: 'message['prefix'] is defined and message['prefix'] and thinking'\n- Added V3.1 case to parsing switch statement\n\nThis addresses the issue where V3.1 outputs reasoning content followed by '</think>' and then regular content without the opening '<think>' tag.\n\n* Another attempt by V3.1 non-thinking\n\n* Fix test, but it's not asserting anything.\n\n* Ignore vim swap files in tests dir\n\n* Update the test\n\n* Try using try_find_literal instead of regex\n\n* passing test\n\n* Revert \"Try using try_find_literal instead of regex\"\n\nThis reverts commit c50d887ec2780dd9e6b8b397e92347d3db8d5575.\n\n* Remove unnecessary change\n\n* Remove comment\n\n* Add code to handle non-thinking mode.\n\n* Try to set message['prefix'] when thinking is enabled.\n\n* This fixes reasoning, but breaks normal content. We need state in the\nchat parser.\n\n* DeepSeek V3.1 thinking is now the default. Disable with `--reasoning-budget 0`.\n\n* Simplify (DeepSeek V3.1 reasoning)\n\n* Fix sign inversion bug\n\n* Add some tool calling code (not working).\n\n* Tool calls working in non-reasoning mode.\n\n* Attempt a unit test for tool call parsing.\n\n* Passing test\n\n* Add tests for both happy path and broken fenced DeepSeek V3.1 tool call variants.\n\n* Passing DeepSeek V3.1 tool call tests, but model is not working.\n\n* Revert assistance response prefill change. Not my monkeys.\n\n* Add fenced_thinking unit test variant. Passes, but thinking tool calling\nstill isn't working for some reason.\n\n* Tests pass in reasoning mode. Also e2e tool test passes.\n\n* Make a copy of the parse_json_tool_calls function for deepseek-v3.1 so\nas to not accidentally introduce regressions.\n\n* Fix thinking_forced_open logic. tool calling broken. Need to add another\ntest case.\n\n* That's what I get for cargo culting a newline.\n\n* Add multi tool call test for deepseek v3.1 non-reasoning\n\n* Move test, remove .gitignore change\n\n* Place deepseek-v3.1 reasoning test directly into existing reasoning\nfunction per CISC's request.\n\n* Address whitespace CI failure.\n\n* Merge two assert_equals per CISC's request.\n\n* Add DeepSeek-V3.1 tests to tests/test-chat.cpp per CISC's request.\n\n* Merge deepseek V3.1 and regular parse_json_tool_calls() function\nbehaviors by adding optional update_cursor argument.\n\n* Update tests/test-chat-parser.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Update tests/test-chat-parser.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Update tests/test-chat-parser.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Update tests/test-chat-parser.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Update tests/test-chat-parser.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Update tests/test-chat-parser.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Update tests/test-chat-parser.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Update tests/test-chat-parser.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Update tests/test-chat-parser.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* DeepSeek V3.1 fix reasoning_format none\n\n* Strip grammar down to strictly what we expect based on model card. Throw\nout parts we cargo culted from R1 that don't make sense.\n\n* Update tests/test-chat-parser.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* DeepSeek V3.1 - Add edge case where thinking is forced open, there is\ntool calling in the reasoning content, but then the model just stops the\noutput without closing the </think> tag, so it's not a partial. In this\ncase, use the tool call in the reasoning content.\n\n* DeepSeek V3.1 - simplify update_cursor\n\n* Update common/chat.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Update common/chat.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Update common/chat.cpp\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n* Fix indent\n\n---------\n\nCo-authored-by: openhands <openhands@all-hands.dev>\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>"},{"name":"Reka-Edge.jinja","kind":"file","size":8141,"lastCommitHash":"e1a9a6dcbefccb4b864d9385ce8494f2a7f2ffcd","lastCommitWhen":"2026-04-15T10:51:50+02:00","lastCommitMessage":"autoparser: support case of JSON_NATIVE with per-call markers (test case: Reka-Edge) (#21892)"},{"name":"StepFun3.5-Flash.jinja","kind":"file","size":5004,"lastCommitHash":"566059a26b0ce8faec4ea053605719d399c64cc5","lastCommitWhen":"2026-03-06T21:01:00+01:00","lastCommitMessage":"Autoparser - complete refactoring of parser architecture (#18675)\n\n* Autoparser - full single commit squish\n\n* Final pre-merge changes: minor fixes, Kimi 2.5 model parser"},{"name":"tencent-Hy3.jinja","kind":"file","size":10199,"lastCommitHash":"2969d6d15d67a08e7b83f26164b15350c79c5248","lastCommitWhen":"2026-07-14T00:31:04+02:00","lastCommitMessage":"model: add Hy3 (hy_v3) support with MTP speculative decoding (#25395)\n\n* model: add Hy3 (hy_v3) architecture support\n\nAdds Tencent Hunyuan 3 (HF architecture HYV3ForCausalLM, GGUF arch\nhy_v3): a MoE decoder stack with per-head Q/K RMSNorm, a sigmoid\nrouter with expert selection bias, an always-active ungated shared\nexpert, and leading dense block(s) (first_k_dense_replace).\n\nThe base implementation is ported from charlie12345's fork\n(https://github.com/charlie12345/ROCmFPX, src/models/hyv3.cpp),\nadapted to current mainline APIs (hparams.n_layer(), build_qkv,\nbuild_moe_ffn with fused gate_up + scale tensors, output_s).\n\nNote: blk.N.exp_probs_b is stored without a .bias suffix for\ncompatibility with existing hy_v3 GGUFs produced by that fork.\n\nCo-Authored-By: charlie12345 <charlie12345@users.noreply.github.com>\nCo-authored-by: Piotr Wilkin <ilintar@gmail.com>\nAssisted-by: Claude Fable 5"},{"name":"unsloth-Apriel-1.5.jinja","kind":"file","size":6518,"lastCommitHash":"566059a26b0ce8faec4ea053605719d399c64cc5","lastCommitWhen":"2026-03-06T21:01:00+01:00","lastCommitMessage":"Autoparser - complete refactoring of parser architecture (#18675)\n\n* Autoparser - full single commit squish\n\n* Final pre-merge changes: minor fixes, Kimi 2.5 model parser"},{"name":"unsloth-mistral-Devstral-Small-2507.jinja","kind":"file","size":9838,"lastCommitHash":"00fa15fedc79263fa0285e6a3bbb0cfb3e3878a2","lastCommitWhen":"2025-07-28T15:01:48+02:00","lastCommitMessage":"mtmd : add support for Voxtral (#14862)\n\n* mtmd : add support for Voxtral\n\n* clean up\n\n* fix python requirements\n\n* add [BEGIN_AUDIO] token\n\n* also support Devstral conversion\n\n* add docs and tests\n\n* fix regression for ultravox\n\n* minor coding style improvement\n\n* correct project activation fn\n\n* Apply suggestions from code review\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>\n\n---------\n\nCo-authored-by: Sigbjørn Skjæret <sigbjorn.skjaeret@scala.com>"},{"name":"upstage-Solar-Open-100B.jinja","kind":"file","size":7300,"lastCommitHash":"7b7ae857f686a4191dbd48252ab4dda426846a29","lastCommitWhen":"2026-01-29T16:06:15+01:00","lastCommitMessage":"chat : add parsing for solar-open-100b (#18540)\n\n* chat : add parsing for solar-open-100b\n\n* add comments to rules\n\n* cont : make assistant start optional\n\n* cont : remove assistant start prefix altogether\n\n---------\n\nCo-authored-by: Piotr Wilkin (ilintar) <piotr.wilkin@syndatis.com>"}]