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.Taskchildren; - 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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dsh_rlm-0.1.1.tar.gz | 93.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dsh_rlm-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 152.9 kB
Release files / dsh_rlm-0.1.1.tar.gz
| Download URL | dsh_rlm-0.1.1.tar.gz |
|---|---|
| Size | 93.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc215b47829a6f15843347d23edcd37f02ebdfb1a43cf5c46d117358aaa0f480
|
|
BLAKE2b-256 checksum How to use checksums |
72904df8bd2822f05ad8f940115e8e15c9ed7af1a3df81579d70e1c5224304d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.4
|
Release files / dsh_rlm-0.1.1-py3-none-any.whl
| Download URL | dsh_rlm-0.1.1-py3-none-any.whl |
|---|---|
| Size | 59.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
937a30fef2f700a33d155c1c144ad8d5b98c593d31f93eac5e22fc0ae1abda77
|
|
BLAKE2b-256 checksum How to use checksums |
9f2705ff93ebbb3a1309f13b99c0ca30b8b639145a041142cb9cdce1448c63d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.4
|
Security for dsh-rlm 0.1.1
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.