mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-10-02 19:07:25 -05:00
* chat: add dedicated Ling 3.0 (Bailing V3) parser Ling 3.0 Flash templates pre-open the think block in the generation prompt, so the model never emits an opening <think>, and a tool call can arrive before any </think>. The generated autoparser terminated reasoning only at the close tag, which classified such tool calls entirely as reasoning_content: clients received content="" with no tool_calls and agent loops died as reasoning-only turns. Adds a specialized parser that terminates reasoning at the think close tag or at a <tool_call> start, mirroring the hand-written Qwen3-Coder and Kimi K3 parsers and the reference vLLM/SGLang Ling3 parser (which treats <tool_call> as an implicit reasoning terminator). Detection is gated on the <role>...</role> section markers, unique to this family among the tagged-argument templates. Adds the Ling 3.0 Flash chat template and tests covering the unclosed-think tool call (full parse and streaming), healthy closed-think paths, trailing prose, parallel calls, marker-like strings in argument values, string-union and non-string argument types, and reasoning_format=none. Assisted-by: Kimi Code * tests : move Ling 3.0 test --------- Co-authored-by: aetherbird <aetherbird@users.noreply.github.com> Co-authored-by: Alde Rojas <hello@alde.dev>
22 lines
920 B
CMake
22 lines
920 B
CMake
# Specialized chat template parsers, listed explicitly so that adding or removing one re-runs CMake instead of leaving an incremental build stale.
|
|
|
|
set(LLAMA_CHAT_PARSERS_SOURCES
|
|
${CMAKE_CURRENT_LIST_DIR}/parsers.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/parsers.h
|
|
${CMAKE_CURRENT_LIST_DIR}/cohere2moe.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/deepseek.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/functionary-v3-2.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/gemma4.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/gigachat-v3.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/gpt-oss.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/kimi-k2.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/kimi-k3.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/ling3.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/lfm2.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/minicpm5.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/minimax-m3.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/ministral3.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/muse-glimmer.cpp
|
|
${CMAKE_CURRENT_LIST_DIR}/qwen3-coder.cpp
|
|
)
|