#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
Also in Agent frameworks and SDKs
RankProjectScore
1ppt-masterAgent skill that turns documents into natively editable PowerPoint decks Live demo ↗ (opens in a new tab)62.1k starsMIT92 out of 100
2langchainPython framework for building LLM agents and apps from interoperable components147.8k starsMIT88 out of 100
3browser-usePython library that lets an LLM agent control a web browser Live demo ↗ (opens in a new tab)118k starsMIT88 out of 100
#4tradingagentsLangGraph multi-agent framework simulating a trading firm to analyze tickers Live demo ↗ (opens in a new tab)111.2k starsApache-2.087 out of 100
#5copilotkitSDK for adding agent chat, generative UI and shared state to apps38k starsMIT84 out of 100