Core Exports¶
Note
This is the autodoc API reference. For authoring guides see Environments and Models.
The top-level rlmesh package re-exports the common entry points: environment serving and clients, model running, sandboxing, and the spaces, types, and adapters subpackages.
The top-level client and model classes are dependency-free wrappers around RLMesh-native values. Reach for them when you want native values and no framework dependency; reach for a backend module (Framework Backends) when you want tensor leaves decoded to NumPy arrays or Torch tensors.
Import |
Description |
|---|---|
|
Serve a Gymnasium-compatible environment endpoint (scalar or vector). |
|
Connect to one environment and preserve RLMesh-native values. |
|
Connect to a vector endpoint and preserve RLMesh-native values. |
|
Build an env image and own the container behind a single client. |
|
Build an env image and own the container behind a vector client. |
|
Wrap a Python prediction function as a native-value model worker. |
|
Connect to an already-served model and drive it against an env. |
|
Run a model policy in its own container (experimental). |
|
Native serve lifecycle options. |
|
Native tensor value used by dependency-free clients. |
|
Observation/action adapters and contract-based resolution. |
|
Space wrappers and Gymnasium conversion helpers. |
|
Structural protocols and value aliases. |
The detailed pages below describe the shared behavior:
Types¶
The rlmesh.types module defines the structural protocols that EnvServer accepts and the shared value aliases used by dependency-free clients. The protocols are structural, so any object with the right methods satisfies them; you do not subclass anything. Reach for them to type-annotate an environment or a value, or to check what EnvServer expects. For authoring an environment against these protocols see Environments.
Public structural protocols and shared value aliases.
- class rlmesh.types.EnvLike[source]¶
Bases:
Protocol[EnvObsT,EnvActT]Structural protocol for a single environment.
- property observation_space: SpaceLike[EnvObsT][source]¶
Space describing reset and step observations.
- reset(*, seed=None, options=None)[source]¶
Reset the environment and return the initial observation.
- Parameters:
seed (int | None)
options (dict[str, object] | None)
- Return type:
tuple[EnvObsT, dict[str, object]]
- step(action)[source]¶
Apply one action and return the Gymnasium-style step tuple.
- Parameters:
action (EnvActT)
- Return type:
tuple[EnvObsT, SupportsFloat, bool, bool, dict[str, object]]
- __init__(*args, **kwargs)¶
- class rlmesh.types.SpaceLike[source]¶
Bases:
Protocol[SpaceT]Structural protocol for RLMesh-compatible spaces.
- contains(value, /)[source]¶
Return whether
valuebelongs to the space.- Parameters:
value (Any)
- Return type:
bool
- seed(seed=None)[source]¶
Seed the space sampler.
- Parameters:
seed (int | None)
- Return type:
int | list[int] | dict[str, int] | None
- __init__(*args, **kwargs)¶
- class rlmesh.types.VectorEnvLike[source]¶
Bases:
Protocol[BatchActionT,VectorObsT,VectorActT]Structural protocol for vectorized environments.
- property single_observation_space: SpaceLike[VectorObsT][source]¶
Observation space for one environment in the vector.
- property single_action_space: SpaceLike[VectorActT][source]¶
Action space for one environment in the vector.
- reset(*, seed=None, options=None)[source]¶
Reset all environments and return batched observations.
- Parameters:
seed (int | None)
options (dict[str, object] | None)
- Return type:
tuple[object, dict[str, object]]
- step(actions)[source]¶
Apply a batch of actions and return batched step values.
- Parameters:
actions (BatchActionT)
- Return type:
tuple[object, object, object, object, dict[str, object]]
- __init__(*args, **kwargs)¶