Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
45a31a82
Unverified
Commit
45a31a82
authored
May 27, 2025
by
Vincent Zhong
Committed by
GitHub
May 27, 2025
Browse files
docs: Update documentation to reflect xgrammar as default grammar backend (#6601)
Co-authored-by:
b8zhong
<
b8zhong@uwaterloo.ca
>
parent
1aa0fbf4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
docs/backend/sampling_params.md
docs/backend/sampling_params.md
+4
-4
No files found.
docs/backend/sampling_params.md
View file @
45a31a82
...
@@ -177,15 +177,15 @@ You can specify a JSON schema, regular expression or [EBNF](https://en.wikipedia
...
@@ -177,15 +177,15 @@ You can specify a JSON schema, regular expression or [EBNF](https://en.wikipedia
SGLang supports two grammar backends:
SGLang supports two grammar backends:
-
[
Outlines
](
https://github.com/dottxt-ai/outlines
)
(
default
)
: Supports JSON schema and regular expression constraints.
-
[
Outlines
](
https://github.com/dottxt-ai/outlines
)
: Supports JSON schema and regular expression constraints.
-
[
XGrammar
](
https://github.com/mlc-ai/xgrammar
)
: Supports JSON schema, regular expression, and EBNF constraints.
-
[
XGrammar
](
https://github.com/mlc-ai/xgrammar
)
(
default
)
: Supports JSON schema, regular expression, and EBNF constraints.
-
XGrammar currently uses the
[
GGML BNF format
](
https://github.com/ggerganov/llama.cpp/blob/master/grammars/README.md
)
.
-
XGrammar currently uses the
[
GGML BNF format
](
https://github.com/ggerganov/llama.cpp/blob/master/grammars/README.md
)
.
I
nitialize the XGrammar backend using
`--grammar-backend
xgrammar
`
flag:
I
f instead you want to initialize the Outlines backend, you can use
`--grammar-backend
outlines
`
flag:
```
bash
```
bash
python
-m
sglang.launch_server
--model-path
meta-llama/Meta-Llama-3.1-8B-Instruct
\
python
-m
sglang.launch_server
--model-path
meta-llama/Meta-Llama-3.1-8B-Instruct
\
--port
30000
--host
0.0.0.0
--grammar-backend
[
xgrammar|outlines]
# xgrammar or outlines (default:
outlines
)
--port
30000
--host
0.0.0.0
--grammar-backend
[
xgrammar|outlines]
# xgrammar or outlines (default:
xgrammar
)
```
```
```
python
```
python
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment