The Open-Source AI Stack

The Stack · Runtime · Open source

Guidance

A programming model for constrained generation that interleaves control flow with model calls and enforces regex, grammars, and JSON Schema.

Guidance, maintained under the guidance-ai organization (the project originated at Microsoft), is a programming model for controlling generation. Instead of sending one prompt and parsing a blob back, you write a template that interleaves fixed text, control flow, and constrained model calls, where each generated span can be forced to match a regex, a grammar, or a JSON Schema. The result is output that is structured by construction. Where Outlines, XGrammar, and llguidance are the enforcement engines, Guidance is the developer-facing layer: it gives the authoring model and delegates the token masking to an engine (including llguidance). Instructor occupies a nearby niche but is organized around returning typed objects from a normal call; Guidance is organized around scripting the generation itself. It matters because it changed how people think about prompting open models: from coaxing free text into shape to programming the output structure directly, which is more reliable and is the pattern much of the structured-output tooling now follows.

Sources

Want a follow-up? Ask the chat about Guidance in context. It will compare to siblings at the same layer and ground every claim in the wiki.

Other projects at the Runtime layer

12 siblings · ordered open first