Recursive Language Models with DSPy + Modal for secure long-context code execution
Project description
fleet-rlm
Secure, cloud-sandboxed Recursive Language Models (RLM) with DSPy and Modal.
Allow your LLMs to write code that explores massive datasets or long documents in the cloud, without downloading them locally.
Documentation | Paper | Contributing
graph TD
User[User/Agent] -->|Question| CLI[fleet-rlm CLI]
CLI -->|Plan| DSPy[DSPy Planner]
DSPy -->|Generate Code| Modal[Modal Sandbox]
Modal -->|Execute safely| Cloud[Cloud Environment]
Cloud -->|Result| Modal
Modal -->|Answer| User
style Modal fill:#f9f,stroke:#333,stroke-width:2px
style DSPy fill:#bbf,stroke:#333,stroke-width:2px
What is this?
fleet-rlm gives your AI agent a secure "computer" in the cloud. Instead of trying to shove 10,000 pages of text into a prompt, the agent writes Python code to:
- Search and filter data in a remote sandbox (Modal).
- Read only what matters.
- Synthesize the answer.
This approach, called Recursive Language Modeling, mimics how humans solve research tasks: we don't memorize the library; we look things up.
Quick Start: Claude Code Integration
1. Install & Initialize
Install the package and register the RLM skills with your local Claude Code agent (~/.claude/).
# Install fleet-rlm
uv pip install fleet-rlm
# Install skills, agents, and prompts to ~/.claude
uv run fleet-rlm init
2. Configure Cloud Runtime
Authenticate with Modal to enable the sandboxed execution environment.
uv run modal setup
uv run modal secret create LITELLM DSPY_LM_MODEL=openai/gpt-4o DSPY_LLM_API_KEY=sk-...
3. Use with Claude
Now your Claude Code agent has "superpowers". You can ask it to perform deep research tasks that require running code.
Example Prompts:
"Use the
rlmskill to analyze the latest papers on linear attention mechanisms." "Run therlm-batchagent to parallelize data extraction for these 50 files."
Available Skills:
rlm- Core recursive research capability.rlm-batch- Parallel processing.rlm-memory- Persistent storage.
Standalone Usage
You can also run fleet-rlm directly without Claude Code:
Interactive Chat (TUI) Chat with the RLM agent in your terminal using the OpenTUI interface.
uv run fleet-rlm code-chat --opentui
API Server Start a FastAPI server to expose RLM capabilities over HTTP.
# Dev server with hot reload
uv run fastapi dev src/fleet_rlm/server/main.py
# Production server via CLI
uv run fleet-rlm serve-api
API docs are available at /docs (Swagger) and /scalar (Scalar).
Features
- 🔒 Sandboxed Execution: Code runs in isolated Modal containers, not on your laptop.
- 🧠 DSPy Powered: Uses advanced prompt engineering pipelines for reliable code generation.
- 💬 Interactive TUI: Chat with the agent in your terminal (
fleet-rlm code-chat). - ⚡ Production Ready: Includes a fastapi server and MCP integration for Claude Desktop.
Documentation
- Tutorials: Step-by-step lessons.
- Installation Guide: Detailed setup instructions.
- Skills & Agents: Enhance Claude with RLM capabilities.
Contributing
We welcome contributions! Whether it's reporting a bug, suggesting a feature, or writing code, your input is verified.
- Check out our Contribution Guide.
- Fork the repo and create a branch.
- Run tests with
uv run pytest. - Submit a Pull Request.
Acknowledgments
This project is built upon the innovative research by Alex L. Zhang (MIT CSAIL), Omar Khattab (Stanford), and Tim Kraska (MIT).
Reference: Recursive Language Models (Zhang, Kraska, Khattab, 2025)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fleet_rlm-0.4.1.tar.gz.
File metadata
- Download URL: fleet_rlm-0.4.1.tar.gz
- Upload date:
- Size: 148.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e87ab0d61ecd3bf73340ead579034ea4e9657121452e4bdd603ad0809cde3e3b
|
|
| MD5 |
cf461909d82b8fedb2d20f0b615fb463
|
|
| BLAKE2b-256 |
e96de1450be3e96d8e7c9959dfc3ffc632f58db8259f1c5b8c4cba657bea2758
|
Provenance
The following attestation bundles were made for fleet_rlm-0.4.1.tar.gz:
Publisher:
release.yml on Qredence/fleet-rlm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fleet_rlm-0.4.1.tar.gz -
Subject digest:
e87ab0d61ecd3bf73340ead579034ea4e9657121452e4bdd603ad0809cde3e3b - Sigstore transparency entry: 945935684
- Sigstore integration time:
-
Permalink:
Qredence/fleet-rlm@98a2aa0ff36d69f9a417c2c9a9569bfe6043451f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Qredence
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@98a2aa0ff36d69f9a417c2c9a9569bfe6043451f -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fleet_rlm-0.4.1-py3-none-any.whl.
File metadata
- Download URL: fleet_rlm-0.4.1-py3-none-any.whl
- Upload date:
- Size: 184.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cec4b7af946899bd2e69b3abc2eabc8347b73293bc22e0c2e79aaac7e82dcdba
|
|
| MD5 |
561134240863f69e686bcccb6380e860
|
|
| BLAKE2b-256 |
8412d12ac4e2e38a875f929c6b661c5d62d7315e1f8d74ed5d446e62177c2a4c
|
Provenance
The following attestation bundles were made for fleet_rlm-0.4.1-py3-none-any.whl:
Publisher:
release.yml on Qredence/fleet-rlm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fleet_rlm-0.4.1-py3-none-any.whl -
Subject digest:
cec4b7af946899bd2e69b3abc2eabc8347b73293bc22e0c2e79aaac7e82dcdba - Sigstore transparency entry: 945935699
- Sigstore integration time:
-
Permalink:
Qredence/fleet-rlm@98a2aa0ff36d69f9a417c2c9a9569bfe6043451f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Qredence
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@98a2aa0ff36d69f9a417c2c9a9569bfe6043451f -
Trigger Event:
workflow_dispatch
-
Statement type: