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 @@ ...@@ -4,17 +4,13 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# Constrained Decoding Tutorial\n", "# Constrained Decoding"
"\n",
"This tutorial shows how to format model outputs using constrained decoding in SGLang."
] ]
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"### Constrained Decoding\n",
"\n",
"With SGLang, You can define a JSON schema, EBNF or regular expression to constrain the model's output.\n", "With SGLang, You can define a JSON schema, EBNF or regular expression to constrain the model's output.\n",
"\n", "\n",
"[JSON Schema](https://json-schema.org/): Formats output into structured JSON objects with validation rules.\n", "[JSON Schema](https://json-schema.org/): Formats output into structured JSON objects with validation rules.\n",
...@@ -23,7 +19,7 @@ ...@@ -23,7 +19,7 @@
"\n", "\n",
"[Regular Expressions](https://en.wikipedia.org/wiki/Regular_expression): Matches text patterns for simple validation and formatting.\n", "[Regular Expressions](https://en.wikipedia.org/wiki/Regular_expression): Matches text patterns for simple validation and formatting.\n",
"\n", "\n",
"### Constrained Decoding Backends\n", "## Grammar Backend\n",
"\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", "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", "\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