rlmesh.jax.RemoteEnv
Experimental JAX-backed remote client for one environment.
RemoteEnv(
address: str | None = None,
*,
host: str | None = None,
port: int | None = None,
path: str | None = None,
transport: Transport | None = None,
connect_timeout_seconds: float | None = None,
request_timeout_seconds: float | None = None,
workflow_edition: str | None = None,
) -> NoneTensor leaves decode to JAX arrays while Python primitives and nested
containers are preserved. Decoded arrays are immutable (see
asarray()), so there is no wire-buffer mutation hazard.
Parameters
| Name | Type | Description |
|---|---|---|
address | str | None | Endpoint address such as "tcp://127.0.0.1:5555", "127.0.0.1:5555", or "unix:///tmp/env.sock". |
host | str | None | TCP host helper used when address is omitted. |
port | int | None | TCP port helper used when address is omitted. |
path | str | None | Unix socket path helper used when address is omitted. |
transport | Transport | None | Explicit transport selector. |
connect_timeout_seconds | float | None | Optional dial timeout in seconds; None uses the native default. |
request_timeout_seconds | float | None | Optional per-request (reset/step/render) timeout in seconds; None waits indefinitely. |
Examples
>>> from rlmesh.jax import RemoteEnv
>>> env = RemoteEnv("127.0.0.1:5555")
>>> observation, info = env.reset(seed=42)
>>> observation, reward, terminated, truncated, info = env.step(
... 0
... )
>>> env.close()Attributes
- observation_spaceObservation space loaded from the remote environment contract.
- action_spaceAction space loaded from the remote environment contract.
- addressEndpoint address this client is connected to.
- env_idThis connection's container id (UUIDv7).
- selected_workflow_editionThe workflow edition this connection negotiated with the env.
- env_contractEnvironment contract returned by the endpoint handshake.
- render_modeConfigured render mode reported by the endpoint.
- metadataEndpoint metadata reported by the environment contract.
- observation_space_specNative observation space spec reported by the endpoint.
- action_space_specNative action space spec reported by the endpoint.
Methods
observation_space
property[source]property observation_space: Space[ValueT]Observation space loaded from the remote environment contract.
action_space
property[source]property action_space: Space[ActionT]Action space loaded from the remote environment contract.
reset
function[source]reset(
*,
seed: int | None = None,
options: dict[str, object] | None = None,
) -> tuple[ValueT, ResetInfo]Reset the remote environment and decode the observation.
Parameters
| Name | Type | Description |
|---|---|---|
seed | int | None | Optional environment reset seed. |
options | dict[str, object] | None | Optional reset options forwarded to the environment. |
Returns
| Type | Description |
|---|---|
tuple[ValueT, ResetInfo] | A decoded observation and reset info dictionary. |
step
function[source]step(action: ActionT) -> tuple[ValueT, float, bool, bool, StepInfo]Step the remote environment with one encoded action.
Parameters
| Name | Type | Description |
|---|---|---|
action | ActionT | Action accepted by the remote environment action space. |
Returns
| Type | Description |
|---|---|
tuple[ValueT, float, bool, bool, StepInfo] | Observation, reward, terminated flag, truncated flag, and step info. |
address
property[source]property address: strEndpoint address this client is connected to.
env_id
property[source]property env_id: strThis connection’s container id (UUIDv7).
A stable correlation identity, distinct from the human env name
(env_contract.id).
selected_workflow_edition
property[source]property selected_workflow_edition: strThe workflow edition this connection negotiated with the env.
The highest edition both sides can drive, at or below whatever either
declared, in the exact spelling they agreed on – so a prerelease build
reports its cohort, not the bare sealed base. Named apart from the
workflow_edition declaration surfaces on purpose: this is what was
agreed, not what this side asked for.
env_contract
property[source]property env_contract: EnvContractEnvironment contract returned by the endpoint handshake.
render_mode
property[source]property render_mode: str | NoneConfigured render mode reported by the endpoint.
metadata
property[source]property metadata: MetadataEndpoint metadata reported by the environment contract.
observation_space_spec
property[source]property observation_space_spec: SpaceSpecNative observation space spec reported by the endpoint.
action_space_spec
property[source]property action_space_spec: SpaceSpecNative action space spec reported by the endpoint.
render
function[source]render(*, env_index: int = 0) -> ValueT | NoneRender a frame from the remote environment.
Parameters
| Name | Type | Description |
|---|---|---|
env_index | int | Environment index to render. Single environments use 0. |
Returns
| Type | Description |
|---|---|
ValueT | None | A decoded render frame, or None when the environment has no frame. |
close
function[source]close() -> NoneDetach this client from the remote endpoint.
shutdown
function[source]shutdown(reason: str = 'owner shutdown') -> boolRequest owner-level shutdown of the remote environment endpoint.