https://github.com/jrcalgo/relayrl
A MultiAgent Reinforcement Learning Framework primarily for Rust workflows
https://github.com/jrcalgo/relayrl
cli deep-learning distributed-system framework monorepo offline-training online-training python-bindings reinforcement-learning tensor-types
Last synced: about 2 months ago
JSON representation
A MultiAgent Reinforcement Learning Framework primarily for Rust workflows
- Host: GitHub
- URL: https://github.com/jrcalgo/relayrl
- Owner: jrcalgo
- License: apache-2.0
- Created: 2025-09-25T06:03:46.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2026-04-02T17:41:49.000Z (about 2 months ago)
- Last Synced: 2026-04-02T19:10:35.040Z (about 2 months ago)
- Topics: cli, deep-learning, distributed-system, framework, monorepo, offline-training, online-training, python-bindings, reinforcement-learning, tensor-types
- Language: Rust
- Homepage: https://crates.io/crates/relayrl_framework
- Size: 1.64 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# RelayRL
**Multi-Agent Reinforcement Learning Framework**
[](https://www.rust-lang.org/)
[](LICENSE)
[]()
*A Rust-native framework for scalable deep reinforcement learning experiments*
---
## Overview
RelayRL is a **monorepo** containing a suite of Rust crates designed for distributed multi-agent reinforcement learning. Built with a Rust-first philosophy, the framework prioritizes performance, type safety, and scalability while maintaining an ergonomic API for single- and multi-agent learning environments.
### Key Highlights
- **Pure Rust Core** — No Python dependencies in the framework layer
- **Multi-Actor Native** — Concurrent actor execution with router-based message dispatching
- **Backend Agnostic** — Generic tensor interface via Burn (supports `NdArray`, `Tch` for CPU/CUDA/MPS)
- **Modular Architecture** — Decoupled layers for client, server, transport, and data handling
- **Robust Error Handling** — Proper error propagation instead of panics
## Crates
| Crate | Version | Description |
|-------|---------|-------------|
| [`relayrl_framework`](crates/relayrl_framework/) | `0.5.0-beta` | Core library with the local/default client runtime plus experimental server/transport scaffolding |
| [`relayrl_types`](crates/relayrl_types/) | `0.5.4` | Data types, tensor containers, inference models, and codec pipeline (compression, encryption, integrity) |
| [`relayrl_algorithms`](crates/relayrl_algorithms/) | `0.1.0` | Deep RL algorithms (PPO, REINFORCE, etc.) |
| [`relayrl_env_trait`](crates/relayrl_env_trait/) | `1.0.0` | Stable trait impl. for integrating environment logic |
| [`relayrl_python`](crates/relayrl_python/) | `0.1.0` | Python bindings via PyO3 — *scaffolding only* |
| [`relayrl_cli`](crates/relayrl_cli/) | `0.1.0` | Command-line interface with gRPC — *scaffolding only* |
## Platform Support
| Platform | Status |
|----------|--------|
| macOS (Apple Silicon) | Tested |
| Linux (Ubuntu) | Tested |
| Windows 10 (x86_64) | Tested |
| Windows 11 (x86_64) | Not tested (yet) |
## Quick Start
### Prerequisites
- Rust 2024 edition (`rustup update`)
- For GPU support: CUDA toolkit or MPS-compatible macOS
### Installation
In your Cargo.toml:
```toml
relayrl_framework = "0.5.0-beta"
```
### Basic Usage
```rust
use relayrl_framework::prelude::network::{AgentBuilder, RelayRLAgentActors};
use relayrl_framework::prelude::types::model::ModelModule;
use relayrl_framework::prelude::types::tensor::relayrl::DeviceType;
use burn_ndarray::NdArray;
use burn_tensor::{Tensor, Float};
#[tokio::main]
async fn main() -> Result<(), Box> {
// Build agent with 4 concurrent actors
let default_model = ModelModule::::load_from_path("model_dir")?;
let (mut agent, params) = AgentBuilder::::builder()
.actor_count(4)
.default_model(default_model)
.build().await?;
// Start the agent runtime
agent.start(params).await?;
// Request actions from actors
let obs = Tensor::::zeros([1, 4], &Default::default());
let ids = agent.get_actor_ids()?;
let actions = agent.request_action(ids, obs, None, 1.0).await?;
// Graceful shutdown
agent.shutdown().await?;
Ok(())
}
```
### 0.5.0-beta Scope
The supported beta path is the local/default client runtime:
- local inference
- actor lifecycle management
- router scaling
- local trajectory writing
The following surfaces remain experimental in `0.5.0-beta`, even when the feature flags are available:
- `zmq-transport`
- `nats-transport`
- server-backed inference or training workflows
- server crates and scaffolding
For more usage details, see the [Framework README](crates/relayrl_framework/README.md) and the [Client Guide](CLIENT_GUIDE.md).
## Framework Roadmap
### Near Term
- **v0.5.x** — Local/default client runtime beta polish, comprehensive testing, transport-backed flows remain experimental
- **v0.6.0** — Training Server for Online client workflows, algorithm integration
### Medium Term
- **v0.7.0** — Inference Server for remote inference capabilities for clients
- **v0.8.0** — Full system integration, performance optimizations, API stabilization
### Long Term
- **v0.9.0 / v1.0.0** — Production stability guarantees
- `relayrl_algorithms` — Complete RL algorithm implementations
- `relayrl_cli` — Language-agnostic deployable gRPC interface
## Contributing
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) before submitting PRs.
## License
Licensed under [Apache License 2.0](LICENSE).