SmolLM2 WebGPU Structured Generation 🔥
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
Provide a JSON schema to generate output in the specified format.
Prompt
Generate
Output