Skip to main content

DSH RLM

A Python-native agent environment built on DeepSeek Harness.

Launch

After the package and matching native assets are released:

uvx dsh-rlm
uvx dsh-rlm setup
uvx dsh-rlm doctor

Or install a persistent command:

uv tool install dsh-rlm
dsh-rlm

Upgrade with uvx --upgrade dsh-rlm or uv tool upgrade dsh-rlm. The first launch downloads a version-matched prebuilt Node/DSH application with checksum verification. Python comes from uv's tool environment. No npm account, Git clone, or existing DSH installation is needed. Credentials, sessions, and checkpoints remain outside uv's cache. macOS and glibc Linux are the first targets.

Publication and full native-app acceptance are still pending. See the project for release status.

Python runtime

The Python half of the DSH RLM mode provides:

  • a persistent CPython namespace with top-level await;
  • native asyncio.Task children;
  • bounded, typed local mailboxes;
  • bounded best-effort checkpoints and explicit recovery notices; and
  • a multiplexed JSONL bridge for host-backed DSH tool and model calls.

Develop

uv sync
uv run pytest
uvx ruff check .
uvx ruff format --check .

Local kernel

from pathlib import Path
from dsh_rlm import LocalKernel

kernel = await LocalKernel.open(Path(".dsh-rlm/example"))
try:
    recovery = kernel.take_recovery_notice()
    if recovery is not None:
        print(recovery)  # include it before the next model request

    result = await kernel.execute("value = 40 + 2\nvalue")
    assert result.ok
    print(result.value)
finally:
    await kernel.close()

A successful cell is checkpointed. A failed cell does not replace the last good checkpoint. After restart, a new kernel restores each recoverable value independently. runtime.recovery exposes bounded restored/skipped/failed inventories for explicit inspection, while the routine notice remains concise. The bridge gates the first submitted cell with execution.status = "not_executed" and reason = "recovery_gate"; that source did not run. Old tasks, mailboxes, handles, host callback leases, and external effects never revive.

Checkpoint files use dill. Load only session directories controlled by the local user because a malicious checkpoint can execute code while loading.

Subprocess bridge

uv run python -m dsh_rlm.bridge --session-dir .dsh-rlm/example

Standard output is reserved for protocol frames. Ordinary Python stdout and raw fd 1 writes are isolated from that channel. Legacy requests remain supported:

{"id":"1","method":"execute","source":"40 + 2"}
{"id":"2","method":"close"}

The DSH plugin opts a cell into bidirectional callbacks with:

{"id":"1","method":"execute","source":"await runtime.tools.list()","capabilities":["host-callback-v1"]}

While that cell is active, Python can use:

schemas = await runtime.tools.list()
value = await runtime.tools.call("read", {"file_path": "README.md"})
completion = await runtime.models.complete("Summarize the evidence")

Callback requests and replies are correlated, so asyncio.gather model calls can finish out of order. Framing, queued requests, source, callback payload, callback count, and in-flight work are bounded. Protocol output uses strict JSON values and JavaScript-safe integers. EOF drains complete accepted execute requests. EOF during an active or attempted host callback records an interrupted run before exit. A standalone Runtime, a non-opted-in execute, or a task that calls the host after its creating cell ends fails clearly with UnsupportedOperationError.

connect(), spawn_rlm(), and runtime.processes remain future API. The DSH plugin owns provider/tool callbacks and managed subprocess lifecycle.

Metadata

Release files for dsh-rlm 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dsh-rlm 0.1.2
File Size Uploaded Provenance
dsh_rlm-0.1.2.tar.gz 93.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for dsh-rlm 0.1.2
File Interpreter ABI Platform
dsh_rlm-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 152.9 kB

Release files / dsh_rlm-0.1.2.tar.gz

Download URL dsh_rlm-0.1.2.tar.gz
Size 93.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3d5a84e3425929968d9727a2bddcf54c9422984a2817acadc4943bee952201f4
BLAKE2b-256 checksum
How to use checksums
0ee61cbbf4dc64ac403a57f9b47ee6dd7e32e40fb3d9657f6479585bd72f7460
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.4

Release files / dsh_rlm-0.1.2-py3-none-any.whl

Download URL dsh_rlm-0.1.2-py3-none-any.whl
Size 59.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4175c9327d9e33ca757c554a3f1a9cfeaf6bb70db289179778b85206ce1f4af
BLAKE2b-256 checksum
How to use checksums
eaf6ac1159d28d65148ef0399f87bb32f7ceb146e3436d39a598c7b56c63a38b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.4

Security for dsh-rlm 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page