# dottxt-ai/outlines

Structured Outputs

Repository: https://github.com/dottxt-ai/outlines
Canonical: https://ross.abutalabs.com/products/outlines
Homepage: https://dottxt-ai.github.io/outlines/
Language: Python
License: Apache-2.0
License Family: permissive
Topics: generative-ai, llms, prompt-engineering, symbolic-ai, cfg, json, regex, structured-generation
Last push: 2026-08-26T12:22:19+00:00

## Health v2 (maintenance only)
Score: 96/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 96, longevity 90
- inputs: {"age_days": 1265, "days_push": 7, "days_rel": 27, "gap_med": 7, "n_releases_24m": 44}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 15695, forks 866 (observed 2026-08-28T04:11:13.790811+00:00)

## What it is
Outlines is a Python library for structured generation that guarantees LLM outputs conform to a desired structure (JSON schemas, regex, grammars, types) during generation rather than via post-hoc parsing. It works provider-independently across models like OpenAI, Ollama, and vLLM with a simple model(prompt, output_type) interface.

## Use cases
- make an LLM always return valid JSON matching a schema
- extract structured data like event details from unstructured text
- categorize documents or products into predefined types with guaranteed labels
- generate function-calling arguments that always parse
- force LLM output to match a regex or context-free grammar
- switch LLM providers without rewriting structured-output code

## When to choose
- you need guaranteed-valid structured outputs from any LLM
- you want provider-independent code that works across OpenAI, Ollama, vLLM, etc.
- post-generation parsing of LLM output is fragile or failing
- you need constrained generation via JSON schema, regex, or CFG

## When to avoid
- you only need free-form text generation with no structure constraints
- you need a hosted API service rather than a Python library
- your stack is not Python

## Facets
- artifact type: library
- maturity: active
- function: llm-inference, prompt-engineering, serialization, parser
- domain: large-language-models, artificial-intelligence, developer-tools
- platform: python
- tags: structured-generation, structured-outputs, -schema, regex-generation, cfg, llm-output-constraints, natural-language-processing

## Member repositories
- dottxt-ai/outlines (main) score 96

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:13.790811+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-29T17:05:34.554456+00:00, confidence not recorded.
  - readme: https://github.com/dottxt-ai/outlines (fetched 2026-08-28T04:11:13.790811+00:00, sha 22aa69457e47)
  - homepage: https://dottxt-ai.github.io/outlines/ (fetched 2026-08-29T08:03:28.863552+00:00, sha 36c6c3c2e4f9)
  - registry_pypi: https://pypi.org/pypi/outlines/json (fetched 2026-08-29T08:03:28.872378+00:00, sha 76a760b91e8f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
