From 333e3bfde5d7589e9ea23a13ef4a790830cc316a Mon Sep 17 00:00:00 2001 From: Shi Shuai <126407087+shuaills@users.noreply.github.com> Date: Sat, 28 Dec 2024 15:00:38 +0000 Subject: [PATCH] [docs]Refactor constrained decoding tutorial (#2633) --- docs/backend/constrained_decoding.ipynb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/backend/constrained_decoding.ipynb b/docs/backend/constrained_decoding.ipynb index a0ea915f3..88cf4a717 100644 --- a/docs/backend/constrained_decoding.ipynb +++ b/docs/backend/constrained_decoding.ipynb @@ -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",