| What it is | A guidance language for controlling large language models | Structured outputs from LLMs, validated with Pydantic | A Python library that guarantees LLM output matches a JSON schema, Pydantic model, regex or grammar |
| Features | - gen() with regex and grammar constraints
- select() from a fixed set of options
- JSON generation from a JSON schema or Pydantic model
- context-free grammars for output
- interleaved control flow, loops and tool use
- @guidance decorator for reusable components
- token fast-forwarding where the structure is fixed
- backends: Transformers, llama.cpp, OpenAI and others
- All 9 features
| - extract structured data from LLM replies into Pydantic models
- validation with automatic retries
- streaming of partial objects and lists
- one interface for 15+ providers, including local models via Ollama
- async support and hooks
- CLI that opens and searches the docs
| - Constrains generation to a JSON schema or Pydantic model
- Regular expression constrained output
- Context-free grammar constrained output
- Multiple choice outputs
- Infers structure from function signatures
- Works with transformers, llama.cpp, vLLM, Ollama, OpenAI and Gemini
- Prompt templates
|