[feat] Add SGLANG_TOOL_STRICT_LEVEL for tool-call behavior control (#12423)

Signed-off-by: Xinyuan Tong <xinyuantong.cs@gmail.com>
This commit is contained in:
Xinyuan Tong
2025-11-01 13:15:02 -07:00
committed by GitHub
parent 2b7bf11bd2
commit d2a8f71c2f
4 changed files with 38 additions and 3 deletions
+6
View File
@@ -108,3 +108,9 @@ SGLang supports various environment variables that can be used to configure its
| --- | --- | --- |
| `SGLANG_WAIT_WEIGHTS_READY_TIMEOUT` | Timeout period for waiting on weights | `120` |
| `SGLANG_DISABLE_OUTLINES_DISK_CACHE` | Disable Outlines disk cache | `true` |
## Function Calling / Tool Use
| Environment Variable | Description | Default Value |
| --- | --- | --- |
| `SGLANG_TOOL_STRICT_LEVEL` | Controls the strictness level of tool call parsing and validation. <br>**Level 0**: Off - No strict validation <br>**Level 1**: Function strict - Enables structural tag constraints for all tools (even if none have `strict=True` set) <br>**Level 2**: Parameter strict - Enforces strict parameter validation for all tools, treating them as if they all have `strict=True` set | `0` |