# 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.

Canonical URL: https://aiidelist.com/ide/guidance

Language: en

Updated: 2026-08-14

## Overview

- Category: Developer Workflow Tools
- A constrained-generation library for developers who need an LLM to follow exact syntax or grammar while retaining programmable control over generation and tools.
- Editor base: Python library
- Platforms: Python, Local models, Hosted model APIs
- Open source: Yes
- Local model support: Yes
- Bring your own API key: Yes

## Quick 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.

## Best for

- Grammar-constrained LLM output
- Reliable JSON or domain-specific formats
- Local-model applications
- Tool-using generation programs
- Research and advanced agent control

## Strengths

- 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

## Limitations

- 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
- 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

### Constrained generation

- Enforce regular-expression patterns
- Generate against context-free grammars
- Build structured responses token by token instead of repairing them afterward

### 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

## Pricing

- **Open Source:** $0 — Guidance is available under the MIT license.
- **Model usage:** Provider or infrastructure cost — Costs depend on the selected hosted API or local inference stack.
- **Operations:** Self-managed — Deployment, evaluation, observability, and scaling are handled by the application team.

Pricing and availability can change. These details were checked against official sources on 2026-08-14.

## Advantages

- 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

## 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

- [Official repository](https://github.com/guidance-ai/guidance)
- [Documentation](https://guidance.readthedocs.io/)
- [License](https://github.com/guidance-ai/guidance/blob/main/LICENSE)

## Features

### Constrained generation

- Enforce regular-expression patterns
- Generate against context-free grammars
- Build structured responses token by token instead of repairing them afterward

### 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

## Pricing

open-source

- Open Source: $0 — Guidance is available under the MIT license.
- Model usage: Provider or infrastructure cost — Costs depend on the selected hosted API or local inference stack.
- Operations: Self-managed — Deployment, evaluation, observability, and scaling are handled by the application team.

Pricing checked: 2026-08-14

## Privacy and data handling

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

- Instructor
- DSPy
- Pydantic AI

## Sources

- [Official website](https://github.com/guidance-ai/guidance)
- [Official repository](https://github.com/guidance-ai/guidance)
- [Documentation](https://guidance.readthedocs.io/)
- [License](https://github.com/guidance-ai/guidance/blob/main/LICENSE)

Last checked: 2026-08-14

## Update history

- 2026-08-14: Added as an active constrained-generation library for structured and tool-using LLM applications.
