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