Fleet RLM
Recursive language-model backend with live streaming, durable sessions, and sandboxed execution.
Fleet RLM runs DSPy dspy.RLM behind a compact FastAPI + SSE API. Each turn executes in an isolated Daytona sandbox with workspace-scoped volumes, host-mediated tools, and a terminal client that streams reasoning, code, and output as it happens.
Why Fleet RLM
- RLM-native — One fresh
dspy.RLMper turn with Python REPL execution, native sub-LM queries, and optional recursive child RLMs. - Operator-visible streaming — Reasoning, tool calls, interpreter code, and stdout flow over SSE to the maintained pi-tui terminal.
- Durable by default — Sessions, turns, attachments, artifacts, and workspace memory survive across runs.
- Sandboxed execution — Daytona interpreters run in isolated sandboxes with bounded workspace volumes and host-mediated memory tools.
- Policy-driven runtime — Non-secret behavior lives in
config/fleet.toml; secret values stay in environment variables.
Current state
- Certified dependency baseline — The runtime is pinned to published releases only:
dspy==3.3.1(plusgepa==0.1.4under theoptimizeextra). The lockfile is registry-only with no VCS pins, and an exact-version guard (CERTIFIED_DSPY_VERSION) fails startup on any drift.uv run python scripts/certification_gate.pyre-verifies the certified baseline and the sealed P53.2 live Session evidence. - Turn orchestration —
TurnCoordinatoris the sole owner of the claim → cleanup path with atomic turn commit; the stream vocabulary is the closed v1 Runtime Event set (freeze suites intests/freeze/). - Recursive RLM — Native DSPy 3.3.1 child RLMs run under one contracted runtime owner (
src/fleet_rlm/daytona/recursive_child_runtime.py) with a child deadline fence and zero-leak certification lanes intests/live/backend/. - Tools — Explicit Session Workspace (7 tools) and Project (6 tools) hosts; cross-sandbox Workspace Memory append coordination is unsupported by design.
- Optimization —
src/fleet_rlm/optimization/gepa_runner.pydrives the officialgepa.optimizeAPI under amax_metric_callsbudget; nofleet optimizeCLI exists yet. - Live evidence —
FLEET_LIVE=1serial lanes write receipts under.fleet-evidence/receipts/(archived sets under.fleet-evidence/receipts-archive/); see the testing strategy.
Quick start
1. Install
git clone https://github.com/Qredence/fleet-rlm.git
cd fleet-rlm
uv sync --all-extras --dev
pnpm --dir tools/fleet-tui install --frozen-lockfile
You need Node 22.19+ and pnpm for the terminal client (fleet cli). uv sync does not install TUI dependencies; run the pnpm step above before fleet cli.
2. Configure credentials
Pick a runtime profile in config/fleet.toml (default_profile; shipped default is daytona-recursive), then export the provider and Daytona variables for that profile. See the profile matrix for the exact environment names.
Fleet connects through an OpenAI-compatible Chat Completions base URL, so
Databricks is only the shipped example. To use OpenAI or another compatible
provider, update the selected profile's model, api_key_env, and
base_url_env entries in config/fleet.toml; the base URL is typically the
provider's /v1 root, such as https://api.openai.com/v1.
export FLEET_DATABASE_URL='postgresql+asyncpg://...'
export FLEET_DAYTONA_API_KEY='...'
export DATABRICKS_TOKEN='...'
export FLEET_LLM_BASE_URL='https://<workspace-host>/ai-gateway/mlflow/v1'
uv run python scripts/db_init.py
FLEET_LLM_BASE_URL is the committed Fleet chat-inference base; the client
appends /chat/completions. Keep DATABRICKS_HOST for Databricks MLflow or
evaluation tooling. FLEET_DATABRICKS_AI_GATEWAY_BASE_URL is reserved for
explicit custom or benchmark paths and is not read by the shipped profile.
Startup never applies migrations automatically — initialize the database explicitly before serving.
3. Run
Supervised backend + terminal (recommended for local development):
uv run fleet cli
Backend only:
uv run fleet web
# or
uv run fleet-rlm serve-api --port 8000
Resume a durable session:
uv run fleet cli -- --session <session-uuid>
Before your first turn, verify Daytona connectivity:
uv run fleet doctor daytona
Profile mismatch fails fast.
fleet clirequires a Daytona profile that matches your credentials. Select profiles with/profilesin the TUI or editdefault_profile, then restart Fleet.
How a turn works
Client → POST /api/sessions/{id}/turns → SSE stream
│
├─ validate scope, attachments, skills
├─ TurnCoordinator opens run + prepares context
├─ RLMRunner executes one native dspy.RLM in Daytona
├─ stream reasoning, tools, code, output events
└─ RunLifecycle commits result, artifacts, and turn history
The root agent can answer directly, delegate to sub-LMs, or fan out bounded recursive child RLMs. Session history stays host-side; workspace memory (memory/MEMORIES.md) persists across sandbox replacement.
Commands
| Command | What it does |
|---|---|
uv run fleet cli |
Start backend + pi-tui terminal (Daytona profile required) |
uv run fleet web |
Start backend only on port 8000 |
uv run fleet doctor daytona |
Opt-in disposable probe of provider, DB, mounts, interpreter |
uv run python scripts/db_init.py |
Initialize or upgrade database to Alembic head |
make check |
Default validation lane (backend + TUI) |
Backend logs for supervised runs: .fleet_rlm/logs/.
API surface
| Endpoint | Purpose |
|---|---|
POST /api/sessions/{session_id}/turns |
Idempotent turn execution over SSE |
/api/sessions |
Session CRUD and committed turn history |
/api/attachments |
Durable attachment upload and lookup |
/api/artifacts/{artifact_id} |
Committed artifact metadata and content |
GET /api/volume/tree |
Bounded read-only workspace volume tree (Daytona) |
/api/workspace/files |
Session workspace file management |
/api/settings |
Loopback-only non-secret runtime policy inspection and editing |
/api/skills |
Bundled skill card discovery |
PUT /api/runs/{run_id}/cancellation |
Durable run cancellation |
Full contract: HTTP API reference and OpenAPI.
Project layout
| Path | Role |
|---|---|
src/fleet_rlm/ |
Canonical Python backend |
tools/fleet-tui/ |
Maintained pi-tui terminal client |
config/fleet.toml |
Runtime policy (profiles, limits, tracing) |
migrations/ |
Alembic schema |
docs/ |
Architecture, guides, and reference |
Development
make check # lint, typecheck, tests (default lane)
make api-sync # regenerate OpenAPI + TUI types
make check-security # security scans
Contributing workflow and architecture rules: CONTRIBUTING.md.
Key docs:
- Architecture
- P41 behavior freeze
- Configuration
- Terminal UI guide
- DSPy + Daytona integration
- Testing strategy
License
MIT — see LICENSE.
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.7.6.tar.gz.
File metadata
- Download URL: fleet_rlm-0.7.6.tar.gz
- Upload date:
- Size: 522.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46e6fcf6c69b5bf3b5f66df7313d0d08a9a416840a8104176507b68500264624
|
|
| MD5 |
b53bd0739a4011f6cbaba1f76b77d581
|
|
| BLAKE2b-256 |
6d63b5b8430c3082c3dfd9698a2fcd070055596f99609d14a9f6e81c685feae6
|
Provenance
The following attestation bundles were made for fleet_rlm-0.7.6.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.7.6.tar.gz -
Subject digest:
46e6fcf6c69b5bf3b5f66df7313d0d08a9a416840a8104176507b68500264624 - Sigstore transparency entry: 2710076841
- Sigstore integration time:
-
Permalink:
Qredence/fleet-rlm@b673587d05d6ec5901a5fcfd4747b82dcf683288 -
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@b673587d05d6ec5901a5fcfd4747b82dcf683288 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file fleet_rlm-0.7.6-py3-none-any.whl.
File metadata
- Download URL: fleet_rlm-0.7.6-py3-none-any.whl
- Upload date:
- Size: 602.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d084d46cd49b75cb14b2ec326987146f500eb2576ee9e061095c93b1ffb270a9
|
|
| MD5 |
0eb8783393b250712be37ddf51fa0b0b
|
|
| BLAKE2b-256 |
8e786d805884bd7394b5df641e9c4e0243c5a4d410aac32328adfc453f4891ab
|
Provenance
The following attestation bundles were made for fleet_rlm-0.7.6-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.7.6-py3-none-any.whl -
Subject digest:
d084d46cd49b75cb14b2ec326987146f500eb2576ee9e061095c93b1ffb270a9 - Sigstore transparency entry: 2710076922
- Sigstore integration time:
-
Permalink:
Qredence/fleet-rlm@b673587d05d6ec5901a5fcfd4747b82dcf683288 -
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@b673587d05d6ec5901a5fcfd4747b82dcf683288 -
Trigger Event:
workflow_dispatch
-
Statement type: