Skip to main content

Recursive Language Models with DSPy + Modal and an integrated Web UI for secure long-context code execution

Project description

fleet-rlm

PyPI version Python versions License: MIT CI PyPI Downloads

Secure, cloud-sandboxed Recursive Language Models (RLM) with DSPy and Modal.

fleet-rlm gives AI agents a secure cloud sandbox for long-context code and document work, with a Web UI-first experience, recursive delegation, and DSPy-aligned tooling.

Paper | Docs | Contributing


Quick Start

Install and launch the Web UI in under a minute:

# Option 1: install as a runnable tool
uv tool install fleet-rlm
fleet web

Or in your active environment:

# Option 2: regular environment install
uv pip install fleet-rlm
fleet web

Open http://localhost:8000 in your browser.

fleet web is the primary interactive interface. The published package already includes the built frontend assets, so end users do not need bun or a separate frontend toolchain.

What You Get

  • Browser-first RLM chat (fleet web)
  • Secure Modal-backed long-context execution for code/doc workflows
  • WS-first runtime streaming for chat and execution events
  • Runtime configuration and diagnostics from the Web UI settings
  • Optional MCP server surface (fleet-rlm serve-mcp)

Common Commands

# Standalone terminal chat
fleet-rlm chat --trace-mode compact

# Explicit API server
fleet-rlm serve-api --port 8000

# MCP server
fleet-rlm serve-mcp --transport stdio

# Scaffold assets for Claude Code
fleet-rlm init --list

Runtime Notes

  • Product chat transport is WS-first (/api/v1/ws/chat).
  • Runtime model updates from Settings are hot-applied in-process (/api/v1/runtime/settings) and reflected on /api/v1/runtime/status.
  • Secret inputs in Runtime Settings are write-only.

Running From Source (Contributors)

# from repo root
uv sync --extra dev --extra server
uv run fleet web
uv run fastapi dev

For release/packaging workflows, uv build now runs frontend build sync automatically (requires bun in repo checkouts that include src/frontend).

Use full contributor setup and quality gates in AGENTS.md and CONTRIBUTING.md.

Architecture Overview

Read this after the quick start if you want the full system picture (entry points, ReAct orchestration, tools, Modal execution, persistent storage).

graph TB
    subgraph entry ["🚪 Entry Points"]
        CLI["CLI (Typer)"]
        WebUI["Web UI<br/>(React SPA)"]
        API["FastAPI<br/>(WS/REST)"]
        TUI["Ink TUI<br/>(standalone runtime)"]
        MCP["MCP Server"]
    end

    subgraph orchestration ["🧠 Orchestration Layer"]
        Agent["RLMReActChatAgent<br/>(dspy.Module)"]
        History["Chat History"]
        Memory["Core Memory<br/>(Persona/Human/Scratchpad)"]
        DocCache["Document Cache"]
    end

    subgraph tools ["🔧 ReAct Tools"]
        DocTools["📄 load_document<br/>read_file_slice<br/>chunk_by_*"]
        RecursiveTools["🔄 rlm_query<br/>llm_query<br/>(recursive delegation)"]
        ExecTools["⚡ execute_code<br/>edit_file<br/>search_code"]
    end

    subgraph execution ["⚙️ Execution Layer"]
        Interpreter["ModalInterpreter<br/>(JSON protocol)"]
        Profiles["Execution Profiles:<br/>ROOT | DELEGATE | MAINTENANCE"]
    end

    subgraph cloud ["☁️ Modal Cloud"]
        Sandbox["Sandbox Driver<br/>(Python REPL)"]
        Volume[("💾 Persistent Volume<br/>/data/<br/>• workspaces<br/>• artifacts<br/>• memory<br/>• session state")]
    end

    WebUI -->|"WS-first"| API
    CLI --> Agent
    API --> Agent
    TUI --> Agent
    MCP --> Agent

    Agent --> History
    Agent --> Memory
    Agent --> DocCache

    Agent --> DocTools
    Agent --> RecursiveTools
    Agent --> ExecTools

    DocTools --> Interpreter
    RecursiveTools --> Interpreter
    ExecTools --> Interpreter

    Interpreter --> Profiles
    Interpreter -->|"stdin/stdout<br/>JSON commands"| Sandbox
    Sandbox -->|"read/write"| Volume

    style entry fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
    style orchestration fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
    style tools fill:#fff3e0,stroke:#f57c00,stroke-width:2px
    style execution fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
    style cloud fill:#fce4ec,stroke:#c2185b,stroke-width:2px

Docs and Guides

Advanced Features (Docs-First)

fleet-rlm also supports runtime diagnostics endpoints, WebSocket execution streams (/api/v1/ws/execution), multi-tenant Neon-backed persistence, and opt-in PostHog LLM analytics. Those workflows are documented in the guides/reference docs rather than front-loaded here.

Contributing

Contributions are welcome. Start with CONTRIBUTING.md, then use AGENTS.md for repo-specific commands and quality gates.

License

MIT License — see LICENSE.

Based on Recursive Language Modeling research by Alex L. Zhang (MIT CSAIL), Omar Khattab (Stanford), and Tim Kraska (MIT).

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.94.tar.gz (974.4 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.94-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fleet_rlm-0.4.94.tar.gz
  • Upload date:
  • Size: 974.4 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.94.tar.gz
Algorithm Hash digest
SHA256 682a3e459ad6e95f97b9f6abf00032e5cb9e9b0c4fe7f31c7d4b20649466b3b2
MD5 e900fbfb58f782442098e2ab0b78b92d
BLAKE2b-256 8cbe6ead82f2dd4ecf166c25e984223b0e072caf5fdb5ab4c379c303b1b85d12

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: fleet_rlm-0.4.94-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • 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.94-py3-none-any.whl
Algorithm Hash digest
SHA256 f23cda159e69e755e7326b40445c61cd49382b98d299294bf1cf8553b1358f45
MD5 c1d0bc0d9929667345ae0dddfede5b19
BLAKE2b-256 9d2ba169074c48e7b42bcc71dd37c08c7fc336147bf62c2c96da3d0fc4a36a46

See more details on using hashes here.

Provenance

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