What problem does it solve?
Constraint-heavy generation to produce valid, structured outputs (JSON/XML/code) while minimizing post-processing and retries.
Core Features & Use Cases
- Regex constraints: enforce formats for dates, emails, IDs, and other fields.
- Grammar-based generation: generate structured outputs like JSON, XML, or code with correctness guarantees.
- Token healing: automatically fix token boundaries to prevent spacing issues and improve output quality.
- Multi-step workflows: Pythonic control flow to orchestrate complex prompting sequences and validations.
- Structured formats enforcement: ensure outputs adhere to predefined schemas and formats across backends (local or API).
- Use cases: JSON data extraction, form validation, code and data structure generation, and end-to-end constrained pipelines.
Quick Start
Install Guidance, then define a constrained generation workflow using regex or grammars to produce a guaranteed structured output.