guidance - Constrain LLM generation with Guidance
Controls LLM generation with regex, selections, and grammars to produce structured outputs and multi-step workflows.
Tags
Updated: 2026-09-29Capabilities
Typical Inputs
Typical Outputs
What this skill does
- Constrain output with regex
- Generate valid JSON
- Generate valid XML
- Generate valid code
- Enforce structured formats
- Build multi-step workflows
- Select constrained choices
- Heal token boundaries
- Define reusable generation functions
- Execute tool-assisted workflows
Inputs
- User prompts
- Regex patterns
- Grammar definitions
- Selection options
- Model configuration
- API keys
- Local model paths
- Tool definitions
Outputs
- Constrained text
- Structured JSON
- Structured XML
- Generated code
- Selected values
- Workflow results
Requirements
- Python environment
- guidance package
- transformers package
- Compatible LLM backend
- API credentials for hosted models
- Local model files for local backends
