Skip to content

Welcome to Outlines

Outlines〰 is a Python library that allows you to use Large Language Model in a simple and robust way (with structured generation). It is built by .txt, and is already used in production by many companies.

What models do you support?

We support Openai, but the true power of Outlines〰 is unleashed with Open Source models available via the transformers, llama.cpp, exllama2 and mamba_ssm libraries. If you want to build and maintain an integration with another library, get in touch.

What are the main features?

  • Make LLMs generate valid JSON

    No more invalid JSON outputs, 100% guaranteed

    Generate JSON

  • JSON mode for vLLM

    Deploy a LLM service using Outlines' JSON structured generation and vLLM

    Deploy outlines

  • Make LLMs follow a Regex

    Generate text that parses correctly 100% of the time

    Guide LLMs

  • Powerful Prompt Templating

    Better manage your prompts' complexity with prompt templating

    Learn more

Why use Outlines?

Outlines〰 is built at .txt by engineers with decades of experience in software engineering, machine learning (Bayesian Statistics and NLP), and compilers. .txt is a VC-backed company fully focused on the topic of structured generation and is committed to make the community benefit from its experience.

We are also open source veterans and have authored/maintained many libraries over the years: the Aesara and Pythological ecosystems, Blackjax and Hy among many others. .

Outlines does not use unnecessary abstractions that tend to get in your way. We have a laser focus on reliable text generation with LLMs, a clear roadmap to push the state of the art in this area and a commitment to clean and robust code.

And last but not least, unlike alternatives, Outlines' structured generation introduces no overhead during inference.

Who is using Outlines?

Hundreds of organisations and the main LLM serving frameworks (vLLM, TGI, LoRAX, xinference, SGLang) are using Outlines. Some of the prominent companies and organizations that are using Outlines include:

Organizations are included either because they use Outlines as a dependency in a public repository, or because of direct communication between members of the Outlines team and employees at these organizations.

Make sure to take a look at what the community is building!


Outlines 〰 is a library for neural text generation. You can think of it as a more flexible replacement for the generate method in the transformers library.

Outlines 〰 helps developers structure text generation to build robust interfaces with external systems. It provides generation methods that guarantee that the output will match a regular expressions, or follow a JSON schema.

Outlines 〰 provides robust prompting primitives that separate the prompting from the execution logic and lead to simple implementations of few-shot generations, ReAct, meta-prompting, agents, etc.

Outlines 〰 is designed as a library that is meant to be compatible the broader ecosystem, not to replace it. We use as few abstractions as possible, and generation can be interleaved with control flow, conditionals, custom Python functions and calls to other libraries.

Outlines 〰 is compatible with every auto-regressive model. It only interfaces with models via the next-token logits distribution.


Outlines was originally developed at @NormalComputing by @remilouf and @BrandonTWillard. It is now maintained by .txt.