Skip to content

Installation

Dependency Management

We recommend using modern Python packaging tools such as uv for managing python dependencies.

# Install uv
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create a virtual environment and install Outlines
uv venv
source .venv/bin/activate
uv pip install outlines

or with pip:

pip install outlines

Optional Dependencies

To use Outlines models, you need to install the Python libraries for the associated inference engines/clients. Such libraries are not part of the general installation as you should only install the libraries needed for the specific models you want to use.

Outlines models with the installation of their associated additional depencies:

If you encounter any problems using Outlines with these libraries, take a look at their installation instructions. The installation of openai and transformers should be straightforward, but other libraries have specific hardware requirements.

Hardware Requirements

If you are using a local model, your model may require specific hardware. Please check the documentation for these libraries.

Some libraries like vllm and llama-cpp-python require specific hardware, such as a compatible GPU. mlx-lm on its side is designed for Apple Silicon, so it may not be appropriate for your use case if you are on a different platform.

Bleeding Edge

You can install the latest version of Outlines from the repository's main branch:

pip install git+https://github.com/dottxt-ai/outlines.git@main

This can be useful, for instance, when a fix has been merged but not yet released.

Installing for Development

See the contributing documentation for instructions on how to install Outlines for development, including an example using the dot-install method for one of the backends.