Outlines
Structured LLM output library from .txt (dottxt): JSON/schema/grammar constraints with broad model integrations.
Tags
Description
Established Apache-2.0 structured-generation library (dottxt-ai/outlines; not archived). PyPI outlines 1.3.3 verified 2026-11-09. Docs at https://dottxt-ai.github.io/outlines/. Optional commercial/enterprise offerings from .txt are separate from the open-source package. Model inference costs are not included. Official docs disagree on LlamaCpp context-free grammar support, so this entry does not claim it either way: the models feature matrix marks LlamaCpp Grammar as unsupported (https://dottxt-ai.github.io/outlines/latest/features/models/); the LlamaCpp page says the model “supports all output types available in Outlines” and includes a Context-free grammar section (https://dottxt-ai.github.io/outlines/latest/features/models/llamacpp/); backends.md lists LlamaCpp as a steerable model that can use outlines_core or llguidance (not xgrammar) and shows Grammar supported by llguidance/xgrammar but not outlines_core (https://dottxt-ai.github.io/outlines/latest/features/advanced/backends/). Check those pages for the revision you are using.
Agent access
Related
- Guidance: Microsoft Research library for constrained LLM generation with a Python guidance language, token healing and multi-backend support.
- XGrammar: Fast portable structured-generation engine for LLM grammars and constrained decoding (MLC AI).
- llguidance: High-performance structured-output / constrained-decoding engine from the Guidance project (Rust core, Python bindings).
Guides & comparisons
- Ollama vs llama.cpp for agents — tools, OpenAI APIs, grammars and local serving (Comparison): Compare Ollama and llama.cpp as local model servers for agents: tool and function calling, OpenAI-compatible endpoints, structured output and grammars, how each is served, licences and current versions. Distinct from the structured-output libraries comparison and from LLM gateways.
- Structured-output libraries compared — Outlines, XGrammar, Guidance and llguidance (Comparison): Compare Outlines, XGrammar, Guidance and llguidance by constraint form (regex, JSON Schema, CFG), documented engine integrations, licences, current PyPI versions and official JSON Schema coverage limits. The libraries compose: Outlines and Guidance can sit on these backends.
Sources
- https://github.com/dottxt-ai/outlines
- https://github.com/dottxt-ai/outlines/blob/main/LICENSE
- https://pypi.org/project/outlines/
- https://dottxt-ai.github.io/outlines/
- https://dottxt-ai.github.io/outlines/latest/features/models/
- https://dottxt-ai.github.io/outlines/latest/features/models/llamacpp/
- https://dottxt-ai.github.io/outlines/latest/features/advanced/backends/
Machine-readable
- JSON
- Markdown
- Source file on GitHub (edit via pull request)