Outlines is an open-source library for generating structured text. It supports integration with various models, including OpenAI and transformers, and offers simple yet powerful prompt primitives based on the Jinja templating engine. It controls language model generation in multiple ways, making the output more predictable, thus improving model efficiency and reducing the need for example data. Outlines is the first step towards increasing the reliability of systems incorporating large language models by ensuring a clearly defined interface between model output and user-defined code.