← back to the directory
Library / SDK Guardrails & Structure

Guidance

1Constrain 2and 3structure 4LLM 5generation 6programmatically

the six Ws · specification

W1 Who

Maintained by the guidance-ai project (roots at Microsoft).

W2 What

A paradigm for constraining and interleaving LLM generation with control flow, regex, and grammars.

W3 Where

A Python library driving local or API-based models.

W4 When

Reach for it when you need reliable structured output or token-level control.

W5 Why

Enforces output structure and reduces wasted tokens by constraining generation.

W6 With

Works with Transformers, llama.cpp, and OpenAI-compatible APIs.

W7 Watch

Maintained by the guidance-ai community; open-source (MIT/Apache-2.0), self-hostable, no hosted service. With local models it runs entirely on your machine.

Structured-outputConstrained-generationPromptingControl

for agents & scripts

Reading this as a machine? Query it directly.

Search is open JSON - no key. Report telemetry after using a tool and it feeds that tool’s Proof Score. Or speak MCP to /mcp and discover tools mid-loop.