Unverified Commit 333e3bfd authored by Shi Shuai's avatar Shi Shuai Committed by GitHub
Browse files

[docs]Refactor constrained decoding tutorial (#2633)

parent 239c9d4d
......@@ -4,17 +4,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Constrained Decoding Tutorial\n",
"\n",
"This tutorial shows how to format model outputs using constrained decoding in SGLang."
"# Constrained Decoding"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Constrained Decoding\n",
"\n",
"With SGLang, You can define a JSON schema, EBNF or regular expression to constrain the model's output.\n",
"\n",
"[JSON Schema](https://json-schema.org/): Formats output into structured JSON objects with validation rules.\n",
......@@ -23,7 +19,7 @@
"\n",
"[Regular Expressions](https://en.wikipedia.org/wiki/Regular_expression): Matches text patterns for simple validation and formatting.\n",
"\n",
"### Constrained Decoding Backends\n",
"## Grammar Backend\n",
"\n",
"SGLang has two backends: [Outlines](https://github.com/dottxt-ai/outlines) (default) and [XGrammar](https://blog.mlc.ai/2024/11/22/achieving-efficient-flexible-portable-structured-generation-with-xgrammar). We suggest using XGrammar whenever possible for its better performance. For more details, see [XGrammar technical overview](https://blog.mlc.ai/2024/11/22/achieving-efficient-flexible-portable-structured-generation-with-xgrammar).\n",
"\n",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment