WebLLM Structured Generation Playground
Generate structured output from LLMs using
WebLLM
and
XGrammar
.
Model
Grammar
JSON Schema (Default)
Custom Grammar
Custom Grammar
The custom grammar is described in the
extended Backus-Naur form (EBNF)
. Below is an example of JSON grammar in EBNF. Please follow this example when writing new grammars.
Schema
Check
TypeBox
for JSON schema type syntax and documentation.
Prompt
Generate
Output