Skip to content

chat : implement minicpm5 parser#24889

Merged
pwilkin merged 16 commits into
ggml-org:masterfrom
aldehir:minicpm5
Jun 28, 2026
Merged

chat : implement minicpm5 parser#24889
pwilkin merged 16 commits into
ggml-org:masterfrom
aldehir:minicpm5

Conversation

@aldehir

@aldehir aldehir commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Overview

Supersedes #23802.

Implemented minicpm5 as a dedicated parser, due to the use of <![CDATA[/]]> tags when string arguments contains < & or \n.

Requirements

@aldehir
aldehir requested review from a team, CISC, ggerganov and pwilkin as code owners June 22, 2026 01:44
@github-actions github-actions Bot added testing Everything test related jinja parser Issues related to the jinja parser labels Jun 22, 2026
@aldehir aldehir mentioned this pull request Jun 22, 2026
3 tasks
@zhangtao2-1

Copy link
Copy Markdown
Contributor

LGTM, no issues from my side. Thanks!

@pwilkin pwilkin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add data.message_spans as well.

@aldehir

aldehir commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Yep, forgot about that one. Let's wait for #24176 to land so I don't have to change it twice.

@zhangtao2-1

Copy link
Copy Markdown
Contributor

Now that #24176 is merged into master, the blocker for adding data.message_spans should be resolved. @aldehir is this ready to move forward?

@aldehir
aldehir requested a review from pwilkin June 25, 2026 09:59
@aldehir

aldehir commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

@pwilkin let's get this to the finish line.

@pwilkin
pwilkin merged commit c818263 into ggml-org:master Jun 28, 2026
21 of 25 checks passed
turbo-tan pushed a commit to turbo-tan/llama.cpp-tq3 that referenced this pull request Jul 1, 2026
* Add minicpm5 tool call parser

* Refactor MiniCPM5 PEG parser per review feedback

* Fix jinja min/max API to match Jinja2

* modify by review

* MiniCPM5: use autoparser for XML tool calls and fix grammar preserved-token triggers

* MiniCPM5: fix streaming tool-arg placeholder and remove alt XML markers

* skip min/max attribute tests in -py mode

* test-jinja: use real expected output for min/max attribute tests

* MiniCPM5: revert shared mapper and history fallbacks per review

Drop streaming tool-arg placeholder workarounds from the generic PEG
mapper and restore strict tool-call argument JSON parsing so MiniCPM5
support stays limited to autoparser/diff-analyzer changes.

* chat : refactor minicpm5 back to dedicated parser

* cont : simplify grammar

* cont : refactor

* cont : fixes

* cont : rename template to openbmb-MiniCPM5-1B.jinja

* cont : add message delimiters

* cont : fix tests

---------

Co-authored-by: zhangtao <zhangtao2@modelbest.cn>
Co-authored-by: 张涛 <>
adrianhoehne pushed a commit to adrianhoehne/llama.cpp that referenced this pull request Jul 5, 2026
* Add minicpm5 tool call parser

* Refactor MiniCPM5 PEG parser per review feedback

* Fix jinja min/max API to match Jinja2

* modify by review

* MiniCPM5: use autoparser for XML tool calls and fix grammar preserved-token triggers

* MiniCPM5: fix streaming tool-arg placeholder and remove alt XML markers

* skip min/max attribute tests in -py mode

* test-jinja: use real expected output for min/max attribute tests

* MiniCPM5: revert shared mapper and history fallbacks per review

Drop streaming tool-arg placeholder workarounds from the generic PEG
mapper and restore strict tool-call argument JSON parsing so MiniCPM5
support stays limited to autoparser/diff-analyzer changes.

* chat : refactor minicpm5 back to dedicated parser

* cont : simplify grammar

* cont : refactor

* cont : fixes

* cont : rename template to openbmb-MiniCPM5-1B.jinja

* cont : add message delimiters

* cont : fix tests

---------

Co-authored-by: zhangtao <zhangtao2@modelbest.cn>
Co-authored-by: 张涛 <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jinja parser Issues related to the jinja parser testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants