What problem does it solve?
Guidance eliminates unpredictable or malformed LLM outputs by constraining generation so that results conform to required syntaxes and structured formats, removing the need for retry loops and ad-hoc post-validation.
Core Features & Use Cases
- Constrained generation using regex and grammar rules to guarantee valid JSON, XML, CSV, or programming language snippets.
- Token healing to avoid tokenization boundary errors and ensure natural continuations.
- Selection constraints and multi-step, stateful workflows for ReAct-style agents, data extraction, classification, and planning.
- Backend-agnostic support for Anthropic, OpenAI, Transformers, and llama.cpp enabling both cloud and local deployments.
- Use Case: Produce production-ready JSON payloads for downstream services, extract structured entities from documents, or build agents that call validated tools without generating invalid arguments.
Quick Start
Generate a validated JSON user object from a natural-language prompt using Guidance with regex/grammar constraints and your chosen LLM backend.