Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b73f3eb
feat: openai policy
zaneni6 Sep 23, 2026
7834941
Merge branch 'main' into openai-refactor
zaneni6 Oct 5, 2026
4126ce6
Merge branch 'main' into openai-refactor
zaneni6 Oct 5, 2026
1865383
Add xgrammar as a dependency for constrained decoding
zaneni6 Oct 7, 2026
8a842f3
Add a shared chat library: format detection, parsing, constraints
zaneni6 Oct 7, 2026
ed7473b
Let the sampler take an allowed-token bitmask
zaneni6 Oct 7, 2026
ef7009f
Parse chat output with the shared library and enforce tool_choice
zaneni6 Oct 7, 2026
48ad359
Report streaming usage only when stream_options.include_usage asks fo…
zaneni6 Oct 12, 2026
e74b13d
Build xgrammar with /utf-8 under MSVC
zaneni6 Oct 13, 2026
403fc03
Keep reasoning out of the grammar when the model's thinking is off
zaneni6 Oct 13, 2026
89cd9ab
Merge remote-tracking branch 'origin/main' into openai-refactor
zaneni6 Oct 14, 2026
4856ec8
Move MiniCPM-V onto the shared chat library
zaneni6 Oct 14, 2026
5f44227
Build the chat library into the test harnesses
zaneni6 Oct 14, 2026
92a64f4
Merge remote-tracking branch 'origin/main' into openai-refactor
zaneni6 Oct 16, 2026
594c8d4
docs(server): document reasoning, tool calling, and structured output
zaneni6 Oct 19, 2026
bddd0a6
test(server): add OpenAI API conformance tests
zaneni6 Oct 19, 2026
3fad463
docs: update sidebar
zaneni6 Oct 19, 2026
444a1e4
fix(chat): keep the grammar when the prompt opens a reasoning block
zaneni6 Oct 19, 2026
f1d2a11
fix(qwen3.5-omni): report thinking as off
zaneni6 Oct 19, 2026
3b52b39
fix(server): reject forced tool calls on models not shown tools
zaneni6 Oct 19, 2026
84dffcf
fix(server): treat null request fields as unset
zaneni6 Oct 19, 2026
5072086
docs(license): add xgrammar, picojson and dlpack notices
zaneni6 Oct 19, 2026
b413aef
Merge remote-tracking branch 'origin/main' into openai-refactor
zaneni6 Oct 19, 2026
3b7f04d
Merge remote-tracking branch 'origin/main' into openai-refactor
zaneni6 Oct 19, 2026
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
8 changes: 4 additions & 4 deletions .github/script/sweep_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,10 +709,8 @@ def collect_stream(self, response) -> tuple[str, str]:
f"stream exceeded the {self.args.request_timeout:.0f}s "
f"request timeout after {len(output_content)} characters"
)
# FLM attaches usage to the final chunk, which also carries a
# choices entry with a null delta. Read it before the choices
# guard below, so a server that instead sends usage on its own
# terminal chunk (the stock OpenAI shape) still gets picked up.
# With include_usage the usage arrives on its own terminal chunk
# with no choices, so read it before the choices guard below.
if getattr(chunk, "usage", None):
usage = chunk.usage
if not chunk.choices:
Expand All @@ -736,6 +734,8 @@ def chat(self, model: str, messages: list, stream: bool = True) -> tuple[str, st
model=model,
messages=messages,
stream=stream,
# a stream reports usage only when asked, as OpenAI's does
**({"stream_options": {"include_usage": True}} if stream else {}),
**self.completion_kwargs(),
)
if stream:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "third_party/tokenizers-cpp"]
path = third_party/tokenizers-cpp
url = https://github.com/mlc-ai/tokenizers-cpp
[submodule "third_party/xgrammar"]
path = third_party/xgrammar
url = https://github.com/mlc-ai/xgrammar
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ No model rewrites, no tuning — it just works.
- Inspired by the widely adopted [llama.cpp](https://github.com/ggml-org/llama.cpp) and [Ollama](https://github.com/ollama/ollama)
- Tokenization accelerated with [MLC-ai/tokenizers-cpp](https://github.com/mlc-ai/tokenizers-cpp)
- Chat formatting via [Google/minja](https://github.com/google/minja)
- Constrained decoding (tool calls, structured output) powered by [MLC-ai/xgrammar](https://github.com/mlc-ai/xgrammar)
- Low-level kernels optimized using the powerful [IRON](https://github.com/amd/iron)+[AIE-MLIR](https://github.com/Xilinx/mlir-aie)

---
Expand Down
69 changes: 69 additions & 0 deletions THIRD_PARTY_NOTICES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ Components
29. HRX
30. flatcc
31. pkgconf
32. XGrammar
33. PicoJSON
34. DLPack

==============================================================================
1. libcurl
Expand Down Expand Up @@ -1146,6 +1149,72 @@ This software is provided 'as is' and without any warranty, express or
implied. In no event shall the authors be liable for any damages arising
from the use of this software.

==============================================================================
32. XGrammar
==============================================================================

License: Apache License 2.0
Homepage: https://github.com/mlc-ai/xgrammar
Used in: Statically linked into flm (v0.2.8).

Copyright (c) 2024 by XGrammar Contributors

Licensed under the Apache License, Version 2.0. The license text is
reproduced at the end of this file.

XGrammar's NOTICE file reads:

XGrammar

Copyright (c) 2024 by XGrammar Contributors

==============================================================================
33. PicoJSON
==============================================================================

License: BSD 2-Clause License
Homepage: https://github.com/kazuho/picojson
Used in: Compiled into flm (via XGrammar).

Copyright 2009-2010 Cybozu Labs, Inc.
Copyright 2011-2014 Kazuho Oku
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

==============================================================================
34. DLPack
==============================================================================

License: Apache License 2.0
Homepage: https://github.com/dmlc/dlpack
Used in: Compiled into flm (via XGrammar, header only).

Copyright 2017 by Contributors

Licensed under the Apache License, Version 2.0. The license text is
reproduced at the end of this file.

==============================================================================
Full license texts
==============================================================================
Expand Down
6 changes: 6 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ docs_nav:
url: "/docs/instructions/server/webui/"
- label: Tool Calling
url: "/docs/instructions/server/tool_calling/"
- label: Reasoning & Tool Calls
url: "/docs/instructions/server/reasoning_and_tools/"
- label: Structured Output
url: "/docs/instructions/server/structured_output/"
- label: Output Parsing Internals
url: "/docs/instructions/server/chat_output_internals/"
- label: LangChain RAG
url: "/docs/instructions/server/rag_LangChain/"
- label: LangChain Web Search
Expand Down
Loading
Loading