Skip to main content

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:

  1. Search and filter data in a remote sandbox (Modal).
  2. Read only what matters.
  3. 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 rlm skill to analyze the latest papers on linear attention mechanisms." "Run the rlm-batch agent 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

Contributing

We welcome contributions! Whether it's reporting a bug, suggesting a feature, or writing code, your input is verified.

  1. Check out our Contribution Guide.
  2. Fork the repo and create a branch.
  3. Run tests with uv run pytest.
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fleet_rlm-0.4.1.tar.gz (148.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fleet_rlm-0.4.1-py3-none-any.whl (184.7 kB view details)

Uploaded Python 3

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

Hashes for fleet_rlm-0.4.1.tar.gz
Algorithm Hash digest
SHA256 e87ab0d61ecd3bf73340ead579034ea4e9657121452e4bdd603ad0809cde3e3b
MD5 cf461909d82b8fedb2d20f0b615fb463
BLAKE2b-256 e96de1450be3e96d8e7c9959dfc3ffc632f58db8259f1c5b8c4cba657bea2758

See more details on using hashes here.

Provenance

The following attestation bundles were made for fleet_rlm-0.4.1.tar.gz:

Publisher: release.yml on Qredence/fleet-rlm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for fleet_rlm-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cec4b7af946899bd2e69b3abc2eabc8347b73293bc22e0c2e79aaac7e82dcdba
MD5 561134240863f69e686bcccb6380e860
BLAKE2b-256 8412d12ac4e2e38a875f929c6b661c5d62d7315e1f8d74ed5d446e62177c2a4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fleet_rlm-0.4.1-py3-none-any.whl:

Publisher: release.yml on Qredence/fleet-rlm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page