You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/vllm.md
+1-12Lines changed: 1 addition & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,8 @@ You can then query the model in shell by passing a prompt and either
24
24
25
25
1. a [JSON Schema][jsonschema]{:target="_blank"} specification or
26
26
2. a [Regex][regex]{:target="_blank"} pattern
27
-
2. an EBNF grammar
28
27
29
-
with the `schema`, `regex` of `cfg` parameters, respectively, to the `/generate` endpoint. If both are specified, the schema will be used. If neither is specified, the generated text will be unconstrained.
28
+
with the `schema` or `regex` parameters, respectively, to the `/generate` endpoint. If both are specified, the schema will be used. If neither is specified, the generated text will be unconstrained.
30
29
31
30
For example, to generate a string that matches the schema `{"type": "string"}` (any string):
To generate a string that matches the grammar `<grammar>`:
52
-
53
-
```bash
54
-
curl http://127.0.0.1:8000/generate \
55
-
-d '{
56
-
"prompt": "What is Pi? Give me the first 15 digits: ",
57
-
"cfg": <grammar>
58
-
}'
59
-
```
60
-
61
50
Instead of `curl`, you can also use the [requests][requests]{:target="_blank"} library from another python program.
62
51
63
52
Please consult the [vLLM documentation][vllm]{:target="_blank"} for details on additional request parameters. You can also [read the code](https://github.com/outlines-dev/outlines/blob/main/outlines/serve/serve.py) in case you need to customize the solution to your needs.
0 commit comments