
Guidance
Guidance is an MIT-licensed language for controlling large language model generation with regular expressions, context-free grammars, control flow, tool use, and efficient interleaving of generation and application logic.
Guidance is most useful when exact output syntax, token-level control, or grammars are central requirements and a developer is comfortable defining generation programs directly.

Pricing Plans
Open Source
Guidance is available under the MIT license.
Model usage
Costs depend on the selected hosted API or local inference stack.
Operations
Deployment, evaluation, observability, and scaling are handled by the application team.
Core Features
1Constrained generation
- Enforce regular-expression patterns
- Generate against context-free grammars
- Build structured responses token by token instead of repairing them afterward
2Programmable control
- Interleave Python control flow and model generation
- Capture generated spans and reuse variables
- Compose tool calls and multi-step generation programs
3Model flexibility
- Use supported local models
- Connect compatible hosted APIs
- Apply the same generation program across model backends where capabilities allow
Pros
- Grammar constraints can guarantee syntax that post-hoc parsing cannot
- Interleaving code and generation gives precise application control
- Works with local and hosted model backends
- MIT licensing and source access support experimentation and production adoption
Cons
- Constrained decoding support differs by model backend
- Grammar design can become complex for large formats
- Syntactic correctness does not guarantee factual correctness
- The project is a developer library rather than a hosted end-user agent platform
Guidance Review
Guidance is an MIT-licensed language for controlling large language model generation with regular expressions, context-free grammars, control flow, tool use, and efficient interleaving of generation and application logic.
What Guidance Is
A constrained-generation library for developers who need an LLM to follow exact syntax or grammar while retaining programmable control over generation and tools.
Core Capabilities
Programmable control
- Interleave Python control flow and model generation
- Capture generated spans and reuse variables
- Compose tool calls and multi-step generation programs
Model flexibility
- Use supported local models
- Connect compatible hosted APIs
- Apply the same generation program across model backends where capabilities allow
Best Use Cases
- Grammar-constrained LLM output
- Reliable JSON or domain-specific formats
- Local-model applications
- Tool-using generation programs
- Research and advanced agent control
Limitations
- Constrained decoding support differs by model backend
- Grammar design can become complex for large formats
- Syntactic correctness does not guarantee factual correctness
- The project is a developer library rather than a hosted end-user agent platform
Privacy and Operational Notes
Guidance runs in the application process, but data privacy depends on the configured model backend. Local models can keep prompts on controlled infrastructure; hosted providers receive whatever context the application sends.
Guidance Alternatives
The most relevant comparison set is Instructor, DSPy, Pydantic AI. Compare products by execution model, integration surface, security controls, deployment model, maintenance burden, and total usage cost.
Verdict
Guidance is most useful when exact output syntax, token-level control, or grammars are central requirements and a developer is comfortable defining generation programs directly.
Official Sources
Best For
- Grammar-constrained LLM output
- Reliable JSON or domain-specific formats
- Local-model applications
- Tool-using generation programs
- Research and advanced agent control
Not Ideal For
- No-code agent building
- Teams needing a complete hosted runtime
- Simple extraction already solved by a typed parser
- Use cases where backend models cannot support efficient constraints
Privacy Notes
Guidance runs in the application process, but data privacy depends on the configured model backend. Local models can keep prompts on controlled infrastructure; hosted providers receive whatever context the application sends.
Alternatives
Update History
- Aug 14, 2026: Added as an active constrained-generation library for structured and tool-using LLM applications.
Related Tools
More listings in a similar part of the directory.





