Repository navigation
[Kimi K3] Add reasoning, tool-call, and OpenAI serving support - #33025
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
/tag-and-rerun-ci |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
/rerun-failed-ci |
# Conflicts: # python/sglang/srt/entrypoints/openai/serving_chat.py # python/sglang/srt/managers/scheduler.py
|
Heads-up: #32960 (literal template_kwargs["image_prompts"] = ["<|media_pad|>"] * image_countWith |
|
@tancheng33 This is fixed through #33003, and the fix is landed in this PR. |
|
@hnyls2002 Thanks — confirmed #33003's neutralization covers both message-content paths (structured text parts in There's a residual path it doesn't reach, though: the upstream renderer also runs its placeholder scan ( So a text-only agentic conversation still 400s when an assistant turn's tool arguments quote the literal — e.g. a coding agent whose tool args include the Two independent one-liners would close it:
Happy to send either as a small PR with a regression test if that helps. |
…pty image_prompts" This reverts commit 5f4f76c.
Co-authored-by: A-transformer <cl5743590921@gmail.com>
|
Verified on the current branch head — #33183 covers both residual paths: reasoning/nested tool-call arguments now go through the neutralizer before templating, and |
|
/rerun-failed-ci |
…roject#33025) Co-authored-by: hnyls2002 <lsyincs@gmail.com> Co-authored-by: Liangsheng Yin <hnyls2002@gmail.com> Co-authored-by: A-transformer <cl5743590921@gmail.com>
…roject#33025) Co-authored-by: hnyls2002 <lsyincs@gmail.com> Co-authored-by: Liangsheng Yin <hnyls2002@gmail.com> Co-authored-by: A-transformer <cl5743590921@gmail.com>
Summary
Motivation
This extracts the parser and directly related OpenAI serving work from #32541 so the model-support PR has a smaller review surface. The parser, constraint, auto-detection, Chat Completions, and Responses pieces are presented as one pull request because they share the same Kimi K3 wire format and need end-to-end validation together.
The serving changes also include #33003: literal
<|kimi_image_placeholder|>text is neutralized in both string and list-form content so user text cannot be interpreted as an image slot.Details
require_reasoningthrough Chat and Responses generation, builtin-tool continuations, streaming, and background requeststool_choice, and reasoning effort through the Kimi K3 Chat encodertool_choicetoautoresponse_formatparallel_tool_calls, strict per-tool schemas, andSGLANG_TOOL_STRICT_LEVELValidation
200 passedacross protocol, Chat Completions, Responses, reasoner grammar, grammar backend, and reasoning-token accounting tests with the repository-pinnedopenai==2.6.1; one environment-gated grammar-manager module skipped35 passedin focused Kimi K3 structural-tag tests436 passed, 14 subtests passedacross registered unit function-call tests73 passed, 7 subtests passedacross registered function-call testsSGLANG_TOOL_STRICT_LEVELvaluegit diff --checkpassedCommit structure
Supersedes #32768 and the temporary stacked drafts #33017, #33018, #33019, and #33020.
CI States
Latest PR Test (Base): ✅ Run #30693526825
Latest PR Test (Extra): ✅ Run #30693526820