fast-rlm  by avbiswas

RLMs for arbitrarily long prompts

Created 3 months ago
366 stars

Top 76.8% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

fast-rlm provides a minimal Python implementation of Recursive Language Models (RLMs), enabling Large Language Models (LLMs) to process and interact with arbitrarily long prompts. It targets engineers and researchers needing to overcome context window limitations, offering programmatic exploration of extensive data through an external REPL.

How It Works

The core approach leverages an external REPL where an LLM can write and execute code to decompose tasks and explore prompts. It supports recursive invocation of sub-agents, with their responses returned as symbols or variables within the parent agent's REPL, rather than being automatically injected into the context. This design allows for efficient, programmatic handling of data far exceeding standard LLM context windows.

Quick Start & Requirements

Installation is straightforward via pip: pip install fast-rlm. Prerequisites include Python 3.10+, Deno 2+, and optionally Bun for the TUI log viewer. An LLM API key must be set via the RLM_MODEL_API_KEY environment variable. The project provides links to GitHub, documentation, PyPI, and a YouTube tutorial for further guidance.

Highlighted Details

  • Arbitrarily Long Context: Handles millions of tokens by enabling agents to write code for searching, filtering, and chunking data programmatically.
  • Extensive Configuration: Offers fine-grained control over agent models, recursion depth, budget caps, and token limits via RLMConfig.
  • Log Viewer: Generates .jsonl logs for each run, with an optional interactive TUI viewer accessible via the fast-rlm-log command.
  • Model Agnostic: Supports any OpenAI-compatible LLM API by configuring RLM_MODEL_BASE_URL.

Maintenance & Community

The project is supported via Patreon. Specific details regarding core contributors, sponsorships, or dedicated community channels (like Discord/Slack) are not detailed in the README. Contributions are welcomed but restricted to small, focused Pull Requests.

Licensing & Compatibility

The project's license is not explicitly stated in the provided README. This omission requires clarification for users considering commercial use or integration into closed-source projects.

Limitations & Caveats

The system requires careful prompt engineering, particularly regarding task placement and marking structured data. Performance is dependent on the chosen LLM's coding capabilities. Development from source necessitates setup for both Deno and Bun. The contribution guidelines emphasize small PRs and discourage large feature requests without prior discussion.

Health Check
Last Commit

6 days ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
88 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera), and
6 more.

prompt-engine by microsoft

0.1%
3k
NPM library for LLM prompt engineering
Created 4 years ago
Updated 3 years ago
Feedback? Help us improve.