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.0

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.0
File Size Uploaded Provenance
dsh_rlm-0.1.0.tar.gz 93.6 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 152.8 kB

Release files / dsh_rlm-0.1.0.tar.gz

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

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

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

Security for dsh-rlm 0.1.0

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