llguidance-wasm demo

This website will load a choosen language model, store it in browser cache, and then generate text based on the provided grammar. It uses Low-level Guidance (llguidance) library compiled to WebAssembly and a bunch of glue code. The llguidance grammars are generated from TypeScript/JavaScript code via guidance-ts library.

To simulate proposed APIs that are not yet available in the browser, the site uses WebLLM (see implementation). WebLLM requires a GPU exposed via WebGPU. It seems to work in Edge on Mac and Windows.

Instructions in plain text.
It will be eval()ed. You can use gen() and select() functions. More info
Examples:
Output:
Stats: