Recursive Language Models (GitHub Summary)

Recursive Language Models — GitHub Repository Summary

Repository: https://github.com/alexzhang13/rlm

  • Stars: 3,569 | Forks: 650 | Issues: 77
  • License: MIT
  • Language: Python
  • Maintainer: MIT OASYS lab

Overview

The official implementation of Recursive Language Models (RLMs) provides an extensible inference engine that wraps standard API-based and local LLMs with recursive REPL-based context handling. Installable via pip install rlms [Source: sources/rlm-github.md].


Key Features

Drop-in API

from rlm import RLM
 
rlm = RLM(
    backend="openai",
    backend_kwargs={"model_name": "gpt-5-nano"},
    verbose=True,
)
print(rlm.completion("Print me the first 100 powers of two, each on a newline.").response)

Multiple REPL Environments

EnvironmentTypeIsolationNotes
local (default)Non-isolatedHost processUses Python exec; shares venv; safe for benchmarking
dockerSemi-isolatedContainerDefault python:3.11-slim image
modalIsolatedCloudModal Sandboxes
primeIsolatedCloudPrime Intellect Sandboxes (beta)
daytonaIsolatedCloudDaytona Sandboxes
e2bIsolatedCloudE2B Sandboxes [Source: sources/rlm-github.md]

Model Provider Support

  • OpenAI, Anthropic
  • Router platforms: OpenRouter, Portkey
  • Local models via vLLM (OpenAI-compatible client) [Source: sources/rlm-github.md]

Logging & Visualization

  • In-memory metadata: completion.metadata holds full trajectory (config + iterations + sub-calls)
  • Disk logging: RLMLogger(log_dir="./logs") writes JSONL for the visualizer
  • Visualizer: Node.js/shadcn/ui app to inspect code, sub-LM, and root-LM call trajectories [Source: sources/rlm-github.md]


Citation

@misc{zhang2026recursivelanguagemodels,
      title={Recursive Language Models},
      author={Alex L. Zhang and Tim Kraska and Omar Khattab},
      year={2026},
      eprint={2512.24601},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2512.24601},
}

  • [[recursive-language-models]] — Main concept page
  • [[rlm-paper]] — arXiv paper summary
  • [[alex-l-zhang]] — Lead author / maintainer