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.0.tar.gz (146.0 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.0-py3-none-any.whl (182.1 kB view details)

Uploaded Python 3

File details

Details for the file fleet_rlm-0.4.0.tar.gz.

File metadata

  • Download URL: fleet_rlm-0.4.0.tar.gz
  • Upload date:
  • Size: 146.0 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.0.tar.gz
Algorithm Hash digest
SHA256 2949f6d5fa2c8fff2f7f6bdf8eee29b7ac7cce6b2547eb99bf91fe02e87c2fe5
MD5 aa29f1f45803d02ccca5c0ad2129d006
BLAKE2b-256 6539153ff28559cb0e1a42afc2ef1d7f46e31f87d5ec6a5144ab9f54d15cded4

See more details on using hashes here.

Provenance

The following attestation bundles were made for fleet_rlm-0.4.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: fleet_rlm-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 182.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c85265f8418ee24da22e706f59126876132cf69e2398de13d23bba3d1b0e9bc
MD5 4535f4a3b4e60091fbf8586c4cfbdbd8
BLAKE2b-256 8f23ea4e61286d437d125b380dd2f090e6eae5e0f8850a18e0fd063a9339edba

See more details on using hashes here.

Provenance

The following attestation bundles were made for fleet_rlm-0.4.0-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