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: grammars/README.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -110,20 +110,20 @@ While semantically correct, the syntax `x? x? x?.... x?` (with N repetitions) ma
110
110
111
111
You can use GBNF grammars:
112
112
113
-
- In the [server](../examples/server)'s completion endpoints, passed as the `grammar` body field
114
-
- In the [main](../examples/main) CLI, passed as the `--grammar` & `--grammar-file` flags
115
-
- With the [gbnf-validator](../examples/gbnf-validator) tool, to test them against strings.
113
+
- In [llama-server](../examples/server)'s completion endpoints, passed as the `grammar` body field
114
+
- In [llama-cli](../examples/main), passed as the `--grammar` & `--grammar-file` flags
115
+
- With [llama-gbnf-validator](../examples/gbnf-validator) tool, to test them against strings.
116
116
117
117
## JSON Schemas → GBNF
118
118
119
119
`llama.cpp` supports converting a subset of https://json-schema.org/ to GBNF grammars:
120
120
121
-
- In the [server](../examples/server):
121
+
- In [llama-server](../examples/server):
122
122
- For any completion endpoints, passed as the `json_schema` body field
123
123
- For the `/chat/completions` endpoint, passed inside the `result_format` body field (e.g. `{"type", "json_object", "schema": {"items": {}}}`)
124
-
- In the [main](../examples/main) CLI, passed as the `--json` / `-j` flag
124
+
- In [llama-cli](../examples/main), passed as the `--json` / `-j` flag
125
125
- To convert to a grammar ahead of time:
126
-
- in CLI, with [json_schema_to_grammar.py](../examples/json_schema_to_grammar.py)
126
+
- in CLI, with [examples/json_schema_to_grammar.py](../examples/json_schema_to_grammar.py)
127
127
- in JavaScript with [json-schema-to-grammar.mjs](../examples/server/public/json-schema-to-grammar.mjs) (this is used by the [server](../examples/server)'s Web UI)
128
128
129
129
Take a look at [tests](../../tests/test-json-schema-to-grammar.cpp) to see which features are likely supported (you'll also find usage examples in https://github.com/ggerganov/llama.cpp/pull/5978, https://github.com/ggerganov/llama.cpp/pull/6659 & https://github.com/ggerganov/llama.cpp/pull/6555).
0 commit comments