Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,14 @@ parsing. Tagged parameters, as in GLM, retain malformed JSON values as strings.
DeepSeek retains the original text of a `string="false"` parameter that cannot
be decoded inside the argument object. Invalid JSON in a whole argument document
or a typed XTML value fails parsing. Required mode needs at least one declared
tool, adds an instruction to call a tool to the prompt, and validates that
generation produced at least one
completed call to a declared tool. Sampling is unchanged; no calls are fabricated
tool. Jinja-template and TMLv0 prompt encoders add a system instruction to call
a tool to the prompt. The native DeepSeek V4 and V4.1 prompt encoders add none:
in thinking mode they render required mode identically to `"auto"` so reasoning
starts in `<think>`, and in non-thinking mode their template opens the DSML
tool-call block at the end of the prompt so generation starts inside the
tool-call envelope. In all modes, including DeepSeek thinking mode, completion
validates that generation produced at least one completed call to a declared
tool. Sampling is unchanged; no calls are fabricated
and no retries are attempted. Missing calls, including output truncated before a
complete call, produce HTTP 500 for buffered requests or a terminal error event
for streams. A required-mode stream may deliver partial text before that error, but does not
Expand Down
7 changes: 5 additions & 2 deletions docs/core-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -1724,8 +1724,11 @@ While device grammar masking is active (outside open reasoning, including prose
and tool calls), the request uses MTP width one and the
[native replay loop](#native-replay-loop) keeps one step in flight for any
decode batch containing it.
`tool_choice=required` adds a prompt instruction and requires a completed call
to a declared tool. Without a grammar it uses ordinary sampling. Named tool
`tool_choice=required` requires a completed call to a declared tool;
Jinja-template and TMLv0 prompt encoders also add a system prompt instruction,
while native DeepSeek V4 and V4.1 encoders do not (see the
[API contracts](api.md#conversation-and-tool-semantics)). Without a grammar it
uses ordinary sampling. Named tool
selection filters the definitions to that tool; it does not by itself enable a
grammar. The encoder requires a completed call to the selected tool and rejects
other tool names. It omits ordinary answer text but preserves reasoning and arguments.
Expand Down