OpenEnv
A unified open-source framework for building, deploying, and interacting with isolated execution environments for agentic reinforcement learning, using Gymnasium-style APIs.
At a Glance
About OpenEnv
OpenEnv is an open-source framework from Hugging Face for creating, deploying, and using isolated execution environments designed for agentic RL training. It provides a standard Gymnasium-style interface—step(), reset(), and state()—that makes it straightforward to integrate with existing RL frameworks. The project is currently in an experimental stage, with active development coordinated through a public technical committee.
What It Is
OpenEnv sits at the intersection of reinforcement learning infrastructure and agentic AI tooling. Its core job is to standardize how RL agents interact with execution environments—whether those environments involve code generation, web browsing, game playing, or financial simulation. Rather than each RL framework inventing its own environment protocol, OpenEnv provides a shared contract: environments expose HTTP/WebSocket endpoints, agents call familiar step() and reset() methods, and everything runs inside isolated Docker containers for reproducibility and security.
The framework is governed by a technical committee that the project page lists as including representatives from Meta-PyTorch, Reflection, Unsloth, Modal, Prime Intellect, Nvidia, Mercor, Fleet AI, Microsoft, Hugging Face, and RadixArk.
Architecture and Core Components
OpenEnv is built around four main layers:
- Environment (server-side): A base class implementing
reset(),step(action), andstate(), served via FastAPI over WebSocket inside a Docker container. - EnvClient (client-side): A base class that handles WebSocket connections to the environment server, with both async (recommended) and sync (
.sync()wrapper) usage patterns. - Container Providers: Pluggable backends for running containers—
LocalDockerProvider,DockerSwarmProvider,UVProvider,DaytonaProvider,ACASandboxProvider, and a plannedKubernetesProvider. - CLI (
openenv): Commands for scaffolding (init), deploying (push), serving locally (serve), building images (build), forking Spaces (fork), and validating configurations (validate).
The web interface, conditionally enabled via ENABLE_WEB_INTERFACE=true, provides a two-pane layout with real-time WebSocket updates, dynamically generated action forms, and a full action history log.
Pre-Built Environment Library
OpenEnv ships with several ready-to-use environments:
- Echo Environment — Echoes messages with metadata; useful for testing infrastructure and learning the framework.
- Coding Environment — Sandboxed Python code execution via smolagents, capturing stdout/stderr/exit codes with persistent episode context.
- Chess Environment — Full chess rules with configurable opponents for RL training.
- Atari Environment — Classic Arcade Learning Environment tasks for RL benchmarking.
- FinRL Environment — Financial market simulations for algorithmic trading experiments.
Community environments are browsable at the Hugging Face OpenEnv docs page.
RL Framework Integrations
OpenEnv is designed to plug into a growing ecosystem of RL training frameworks:
- TRL — GRPO training integration documented in the TRL docs.
- torchforge (Meta-PyTorch) — Featured BlackJack GRPO training example.
- Unsloth — 2048 game training example via Colab notebook.
- SkyRL (UC Berkeley) — Documented integration for training on OpenEnv environments.
- ART (OpenPipe) — Integration for model training with ART.
- Oumi — GRPO with TRL notebook.
- Lightning AI — Featured templates.
Update: v0.3.1
The latest release is v0.3.1, published on June 2, 2026. The repository shows active development with 2,376 stars and 403 forks as of late June 2026. Active RFCs include support for MCP (Model Context Protocol) environments, delayed rewards for trajectory-based scoring, agentic harness integration, and an env-token world modeling proposal (ECHO). The project explicitly notes it is in an experimental stage and that APIs may change in future versions.
Community Discussions
Be the first to start a conversation about OpenEnv
Share your experience with OpenEnv, ask questions, or help others learn from your insights.
Pricing
Open Source
Fully free and open-source under BSD 3-Clause license. Install via pip and deploy environments anywhere.
- Full framework access under BSD 3-Clause license
- CLI for environment management
- Pre-built environment library
- Docker-based deployment
- Hugging Face Spaces integration
Capabilities
Key Features
- Gymnasium-style step(), reset(), state() APIs
- Container-first design with Docker packaging
- HTTP/WebSocket-native environment serving
- Secure sandboxed execution for untrusted agent code
- Pre-built environments: Echo, Coding, Chess, Atari, FinRL
- CLI for environment scaffolding, deployment, and management
- Async and sync client APIs
- Built-in web interface for interactive debugging
- MCP (Model Context Protocol) environment support
- Delayed rewards for trajectory-based scoring
- Auto-discovery of environment tools by agents
- Deploy environments to Hugging Face Spaces
- Multiple container providers: Local Docker, Docker Swarm, UV, Daytona, ACA Sandbox
- Type-safe action/observation models via Pydantic
- RL framework integrations: TRL, torchforge, Unsloth, SkyRL, ART, Oumi, Lightning AI
