Back to directory

Recursive Language Models

An inference library for Recursive Language Models, a task-agnostic paradigm that lets a language model programmatically examine, decompose and recursively call itself over near-infinite-length contexts.

Recursive Language Models

Recursive Language Models replace a plain llm.completion(prompt, model) call with rlm.completion(prompt, model), offloading the input context as a variable inside a REPL environment that the model can inspect and call itself over. The repository provides both an inference engine and a training environment for standard API-based and local LLMs.

The approach argues for a CodeAct-style harness in which sub-language-model calls are functions in code and prompts are objects in code, moving away from JSON tool-calling for sub-agents and generic tool calls. The default client runs its REPL through Python exec calls on the host process, sharing the host's virtual environment and dependencies with some limits on available global modules; a verifiers training environment based on Prime Intellect's prime-rl is also included.

It installs with pip install rlms, requires Python 3.11 or later, is written in Python, and is licensed under MIT.

More in Models

See all 405
  • mini-AGI

    github.com

    A continual learning language model that trains from scratch on a single 8 GB VRAM GPU, assembling its own architecture and adapting its size to the hardware and data available rather than shipping as a fixed pretrained model.

  • An open-source contrastive-embedding pipeline that maps technical CVE vulnerability descriptions to formal cybersecurity compliance controls in NIST SP 800-53 and CMMC, published with its model generation, fine-tuning and evaluation code.

  • peekaboolean

    github.com

    A small vision-language model, fine-tuned with LoRA on a 500-million-parameter backbone, that answers typed multiple-choice, ordinal-score and yes/no questions about an image with calibrated probabilities, in about 400 milliseconds on a laptop.