]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
chat : add new template for DeepSeek V4 Flash 0731 (#26398)
authorThiago Padilha <redacted>
Mon, 3 Aug 2026 22:59:11 +0000 (19:59 -0300)
committerGitHub <redacted>
Mon, 3 Aug 2026 22:59:11 +0000 (17:59 -0500)
commit0ef6e55edb306fcbcf73e6f1f41923cccb9cf7f8
treea313310f0dfc911b19c9511cb01380e012466c00
parent94bc47f2807805ffdc1c5fbe5dce5cd2afdf3a97
chat : add new template for DeepSeek V4 Flash 0731 (#26398)

* common/chat: update DeepSeek V4 templates

Align the DeepSeek V4 templates with the official encoders while keeping parser behavior out of this change.

- Default drop_thinking for DeepSeek V4 history so prior thinking is omitted unless preserve_reasoning is requested or tools are present.
- Add structured output response-format instructions to the V4 templates and pass the schema into template rendering.
- Add a separate Flash 0731 template for the updated high and max reasoning effort mapping.
- Cover reasoning effort, drop_thinking, structured output prompts, preserved reasoning, continuations, and empty tool arguments in template rendering tests.

Official references:
https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash/blob/main/encoding/encoding_dsv4.py
https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash-0731/blob/main/encoding/encoding_dsv4.py

Assisted-by: Codex
* Fix deepseek v4 0731 template selection

* remove unneeded lower normalization

* Fix DSML parser to consume the tool call separator

* address aldehir requests

* address aldehir comment
common/chat.cpp
common/jinja/caps.cpp
conversion/deepseek.py
models/templates/deepseek-ai-DeepSeek-V4-Flash-0731.jinja [new file with mode: 0644]
models/templates/deepseek-ai-DeepSeek-V4.jinja
tests/test-chat.cpp