RLM is a general, plug-and-play inference library for Recursive Language Models, an approach in which a language model recursively calls itself, and other models, inside a sandboxed environment to work through very long inputs and complex tasks. Based on the 2025 research paper of the same name, the library supports multiple sandbox backends and has earned more than 5,700 stars on GitHub.
Instead of stuffing everything into a single context window, a Recursive Language Model treats its input as data to explore programmatically: the model writes code to inspect, chunk and search the material, then delegates sub-problems to further model calls and combines the results. The RLM library wraps that pattern into a reusable inference engine, so you can point it at a very long document or codebase, choose a sandbox for safe code execution, and let the recursion run with the LLM clients you already use. The approach is particularly relevant for deep-research and document-analysis workloads, where the answer depends on details scattered across hundreds of pages and a single pass of attention tends to miss them. Because the recursion is driven by ordinary code, its behaviour is inspectable: you can see what the model chose to read, search or delegate at every step.
Free. RLM is open source under the MIT license; your only costs are the model calls your workloads make.
Engineers and researchers tackling very long documents, large codebases and deep-research-style tasks where a single prompt, however large the context window, is not enough.