#2727th of 33 in Agent frameworks and SDKs
guidance
Python library for constrained generation and control flow with LLMs
- Stars
- 21.8k
- License
- MIT
- Last commit
- May 2026
- Last release
- Mar 2026
- Language
- Jupyter Notebook
Missed the latest GitHub check; these facts may be older.
Overview
Guidance is a Python library that constrains language model output with regex, select lists, JSON schemas (including Pydantic models) and context-free grammars. It interleaves Python control flow with generation and works with backends such as Transformers, llama.cpp and OpenAI. When a grammar fixes upcoming tokens, it inserts them without a model forward pass.
Who it is for: Python developers who need structured, grammar-constrained LLM output
Strengths
- Regex, select, JSON schema and CFG constraints guarantee output syntax
- Token fast-forwarding skips forward passes when the grammar fixes the next tokens
- Mock model and grammar.match() allow offline grammar debugging without API calls
- @guidance functions compose into larger grammars; model objects are immutable
Weaknesses
- Full CFG support depends on the backend; README does not list which qualify
- Not a full agent framework: no orchestration, memory or deployment tooling
- README gives no hardware requirements or benchmarks
- Jupyter widget gives the richer view; command line output is plain text
What it needs
- GPU optional
- Needs Python, pip, Transformers, llama.cpp or OpenAI backend
- Models: Transformers, llama.cpp, OpenAI
Also in Agent frameworks and SDKs
See all 33| Rank | Project | Score |
|---|---|---|
| 1 | ppt-masterAgent skill that turns documents into natively editable PowerPoint decks | 92 out of 100 |
| 2 | langchainPython framework for building LLM agents and apps from interoperable components | 88 out of 100 |
| 3 | browser-usePython library that lets an LLM agent control a web browser | 88 out of 100 |
| #4 | tradingagentsLangGraph multi-agent framework simulating a trading firm to analyze tickers | 87 out of 100 |
| #5 | copilotkitSDK for adding agent chat, generative UI and shared state to apps | 84 out of 100 |