alexzhang13/rlm

General plug-and-play inference library for Recursive Language Models (RLMs), supporting various sandboxes.

What it solves

RLMs address the challenge of handling near-infinite length contexts in language models. Instead of passing a massive prompt to a single model call, RLMs allow a model to programmatically decompose a task, examine its input, and recursively call itself to process information in manageable chunks.

How it works

RLMs replace the standard completion call with a system that offloads the context as a variable within a REPL (Read-Eval-Print Loop) environment. The language model interacts with this environment to launch sub-LM calls as functions in code. This approach moves away from JSON tool-calling in favor of a CodeAct-style harness where the model treats prompts and context as objects in a code environment.

Who it’s for

This project is designed for AI researchers and developers building advanced inference engines or agents that need to process extremely large datasets or complex tasks that require recursive decomposition.

Highlights

  • Flexible REPL Environments: Supports local execution (via exec or IPython), Docker containers, and cloud-based isolated sandboxes (Modal, Prime, Daytona, e2b).
  • Extensible Inference Engine: Compatible with major providers like OpenAI and Anthropic, as well as local models via vLLM.
  • Integrated Training: Includes a reinforcement learning training harness based on prime-rl and verifiers to train models specifically for the RLM paradigm.
  • Trajectory Visualization: Provides a logger and a Node.js-based visualizer to inspect the execution paths, code, and sub-calls of a completion.

関連

  • プロジェクト
  • プロジェクト
  • プロジェクト
  • Dispatch
  • プロジェクト