# Build and Compilation Steps for RLM: A Pure-Python Installation Guide

> Discover RLM's effortless pure-Python installation. No build or compilation steps needed for this library. Get started quickly with pip or uv.

- Repository: [az/rlm](https://github.com/alexzhang13/rlm)
- Tags: how-to-guide
- Published: 2026-06-18

---

**RLM requires no compilation; it is a pure-Python library installed via `uv` or `pip` in editable mode within a virtual environment.**

The Recursive Language Model (RLM) repository (`alexzhang13/rlm`) contains no C extensions, Rust components, or binary build steps. Because the entire codebase consists of Python source files, installation focuses on virtual environment creation and dependency resolution rather than traditional compilation.

## Prerequisites for Building RLM

Before installing RLM, ensure you have **Python 3.11 or newer** installed. The project uses `uv` as its preferred package manager for faster dependency resolution.

Install `uv` if you haven't already:

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh

```

## Core Build Steps for RLM

Since RLM is a pure-Python project, the "build" process consists of creating a virtual environment and installing the package in editable mode. This approach allows you to modify source files in `rlm/` and see changes immediately without reinstallation.

### 1. Initialize the Virtual Environment

Create an isolated environment using `uv`:

```bash
uv init && uv venv --python 3.12

```

### 2. Install RLM in Editable Mode

Navigate to the repository root and install the package using the editable flag:

```bash
uv pip install -e .

```

This command reads [`pyproject.toml`](https://github.com/alexzhang13/rlm/blob/main/pyproject.toml) to resolve core dependencies and makes the `rlm` package importable from your environment. The `-e` flag creates a link to your source directory, so changes to [`rlm/__init__.py`](https://github.com/alexzhang13/rlm/blob/main/rlm/__init__.py) or other modules reflect immediately.

### 3. Verify the Installation

Confirm the installation by importing the library and running a minimal completion:

```python
from rlm import RLM

rlm = RLM(
    backend="openai",
    backend_kwargs={"model_name": "gpt-5-nano"},
    verbose=True,
)

print(
    rlm.completion(
        "Print the first 10 Fibonacci numbers, one per line."
    ).response
)

```

## Optional Dependencies and Extras

RLM provides sandbox environments through optional extras defined in [`pyproject.toml`](https://github.com/alexzhang13/rlm/blob/main/pyproject.toml). These extras install additional third-party libraries for specific backends like Modal, Prime, or Docker.

Install with the Modal extra:

```bash
uv pip install -e ".[modal]"

```

The repository includes a `Makefile` that wraps these commands. Key targets include:

- **`make install`** – Runs `uv sync` to create a reproducible virtual environment with core dependencies.
- **`make install-dev`** – Installs development and test groups using `uv sync --group dev --group test`.
- **`make install-modal`** – Installs the Modal extra specifically via `uv pip install -e ".[modal]"`.

## Development and Verification Workflow

After installation, verify the build by running the test suite or quick-start examples. The `Makefile` provides convenient targets for these tasks.

Run the quick-start example (requires an OpenAI API key):

```bash
make quickstart

# Or directly: uv run python -m examples.quickstart

```

Execute linting and tests:

```bash
make check

```

This target invokes `ruff` for linting and `pytest` to run the test suite located in `tests/`, confirming that the editable installation functions correctly.

## Key Build Files in the RLM Repository

Understanding these files helps diagnose installation issues:

- **[`pyproject.toml`](https://github.com/alexzhang13/rlm/blob/main/pyproject.toml)** – Declares package metadata, core dependencies, and optional extras like `modal` and `prime`. This file drives the entire installation process and dependency resolution.
- **`Makefile`** – Encapsulates common commands including `install`, `install-dev`, `install-modal`, and `check`. It provides a consistent interface for the build workflow.
- **[`README.md`](https://github.com/alexzhang13/rlm/blob/main/README.md)** – Contains the official installation instructions in the *Quick Setup* and *Manual Setup* sections.
- **[`rlm/__init__.py`](https://github.com/alexzhang13/rlm/blob/main/rlm/__init__.py)** – The package entry point; importing `rlm` loads from this file after successful installation.
- **[`examples/quickstart.py`](https://github.com/alexzhang13/rlm/blob/main/examples/quickstart.py)** – A minimal runnable script that validates the installation by executing a basic RLM completion call.
- **`tests/`** – Directory containing the test suite executed by `make test` or `uv run pytest`.

## Summary

- RLM is a **pure-Python library** requiring no compilation, C++ compilers, or binary builds.
- The core build step is **editable installation** (`uv pip install -e .`) which links the source directory to your environment.
- **Optional extras** in [`pyproject.toml`](https://github.com/alexzhang13/rlm/blob/main/pyproject.toml) provide sandbox support (Modal, Docker) via `uv pip install -e ".[extra]"`.
- The **`Makefile`** automates environment setup, dependency installation, and verification targets.
- Python **3.11+** is required, with `uv` as the recommended package manager for fastest resolution.

## Frequently Asked Questions

### Does RLM require a C++ compiler or build tools?

No. RLM contains no C extensions, Rust components, or compiled binaries according to the source code analysis. The installation process only requires Python and a package manager (`uv` or `pip`) to resolve dependencies listed in [`pyproject.toml`](https://github.com/alexzhang13/rlm/blob/main/pyproject.toml).

### What is the difference between `uv sync` and `uv pip install -e .`?

`uv sync` creates a reproducible virtual environment based strictly on the lockfile and dependency groups in [`pyproject.toml`](https://github.com/alexzhang13/rlm/blob/main/pyproject.toml), while `uv pip install -e .` installs the package in editable mode, creating a link to your source directory. The editable mode is preferred for development because changes to `rlm/` source files reflect immediately without reinstallation.

### How do I install RLM with Docker support?

Docker support is available as an optional extra. Run `uv pip install -e ".[docker]"` or use the Makefile target `make install-dev` if Docker dependencies are grouped there. Verify the installation by running `make docker-repl`, which launches the Docker-based REPL example from the repository.

### Why does the Makefile use `uv` instead of standard `pip`?

The `Makefile` defaults to `uv` because it provides faster dependency resolution and environment management compared to `pip`. However, the commands are functionally equivalent; you can substitute `pip install -e .` for `uv pip install -e .` if you prefer standard tooling, though `uv` is strongly recommended for consistency with the project's development workflow.