Discover and explore top open-source AI tools and projects—updated daily.
alexzhang13Minimal Recursive Language Models (RLMs) with REPL environments
Top 94.6% on SourcePulse
Recursive Language Models (RLMs) with REPL Environments This repository provides a minimal, gist-like implementation of Recursive Language Models (RLMs) designed for users to experiment with and build upon. It offers a simplified framework for creating recursive LLM interactions within REPL environments, targeting developers and researchers seeking a foundational RLM codebase. The primary benefit is ease of modification and a clear starting point for custom RLM applications.
How It Works
The core approach utilizes a REPL environment to manage language model interactions, enabling recursive calls. The RLM_REPL class in rlm_repl.py handles the RLM logic, with its completion() method designed to replace standard LLM completion calls. A basic exec-based REPL in repl.py facilitates sub-calls. While depth=1 recursion is directly supported, achieving deeper recursion requires replacing Sub_RLM with RLM_REPL, potentially necessitating adjustments to the exec environment. Utility functions for LLM clients and prompts reside in rlm/utils/.
Quick Start & Requirements
pip install rich is recommended for enhanced logging.openai (for LM API calls), dotenv (for environment variable loading). rich is optional but useful.main.py script demonstrates a "needle-in-the-haystack" task.Highlighted Details
RLM.completion() replacing standard LM.completion() calls.Maintenance & Community
This project is presented as a simplified, "gist-like" implementation. No specific details regarding active maintenance, community channels (like Discord/Slack), or a roadmap are provided in the README.
Licensing & Compatibility
The README does not specify a software license. This lack of explicit licensing information may pose compatibility concerns for commercial use or integration into proprietary projects.
Limitations & Caveats
This is a stripped-down version, omitting features like detailed logging, cost tracking, and advanced REPL execution logic found in more complex implementations. Achieving recursion beyond depth=1 may require significant modifications to the exec-based REPL environments. The project is positioned as a foundational example rather than a production-ready library.
1 month ago
Inactive
0russwest0
facebookresearch