# guidance-ai/guidance

A guidance language for controlling large language models.

Repository: https://github.com/guidance-ai/guidance
Canonical: https://ross.abutalabs.com/products/guidance
Language: Jupyter Notebook
License: MIT
License Family: permissive
Last push: 2026-05-21T17:08:04+00:00

## Health v2 (maintenance only)
Score: 79/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 83, release rhythm 63, longevity 99
- inputs: {"age_days": 1392, "days_push": 104, "days_rel": 168, "gap_med": 40, "n_releases_24m": 8}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 21714, forks 1201 (observed 2026-08-28T04:11:31.983632+00:00)

## What it is
Guidance is a Python library providing an efficient programming paradigm for steering large language models, letting you interleave control flow (conditionals, loops, tool use) with generation. It supports constrained generation via regex and context-free grammars to guarantee output syntax, working with backends like Transformers, llama.cpp, and OpenAI.

## Use cases
- force an LLM to output valid JSON or structured data
- constrain model generation with a regex or grammar
- build prompt programs with control flow interleaved with generation
- capture and reuse specific parts of model output
- reduce latency and cost versus conventional prompting
- prototype LLM apps in Jupyter notebooks

## When to choose
- you need guaranteed output syntax like JSON, regex, or CFG-constrained formats
- you want deterministic structure from LLMs without fine-tuning
- you want a Pythonic interface across multiple model backends
- you're prototyping LLM workflows interactively in notebooks

## When to avoid
- you need a full agent framework with built-in memory and tool orchestration
- your backend model isn't supported by one of Guidance's adapters
- you only need simple one-off prompting without structured output

## Facets
- artifact type: library
- maturity: active
- function: llm-inference, prompt-engineering, nlp, sdk
- domain: large-language-models, artificial-intelligence, developer-tools
- platform: python, cross-platform
- tags: constrained-generation, structured-output, llm-programming, grammar-constrained-decoding, jupyter, natural-language-processing

## Member repositories
- guidance-ai/guidance (main) score 79

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:31.983632+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T16:57:49.678395+00:00, confidence not recorded.
  - readme: https://github.com/guidance-ai/guidance (fetched 2026-08-28T04:11:31.983632+00:00, sha ac165bc863a4)
  - registry_pypi: https://pypi.org/pypi/guidance/json (fetched 2026-08-29T07:56:18.845954+00:00, sha 3d29f4aeff8b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
