burtenshaw HF Staff commited on
Commit
63b7ad1
·
verified ·
1 Parent(s): 522b79d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +127 -32
README.md CHANGED
@@ -3,35 +3,40 @@ license: apache-2.0
3
  sdk: static
4
  ---
5
 
6
- # OpenEnv: Agentic Execution Environments
7
 
8
- [![PyPI](https://img.shields.io/pypi/v/openenv?color=blue)](https://pypi.org/project/openenv/)
9
- [![Discord](https://img.shields.io/badge/Discord-OpenEnv-7289da?style=flat&logo=discord&logoColor=white)](https://discord.gg/YsTYBh6PD9)
10
- [![Docs](https://img.shields.io/badge/Docs-Explore-blue?logo=readthedocs&logoColor=white)](https://meta-pytorch.org/OpenEnv/)
11
 
12
- An e2e framework for creating, deploying and using isolated execution environments for agentic RL training, built using Gymnasium style simple APIs. A community driven collection of OpenEnv-spec Environments composed of a **Hub** and a **Standardized spec** to ensure environment compatibility.
 
 
 
 
 
 
 
13
 
14
- <a href="https://rdi.berkeley.edu/agentx-agentbeats.html" style="text-decoration: none; color: inherit; width: 100%; height: 120px; margin-bottom: 10px; margin-top: 10px;">
15
- <div style="padding: 5px; padding-left: 20px; border-radius: 8px; background-color: whitesmoke; color: black; box-shadow: 1px 1px 3px rgba(0,0,0,0.1); border: 2px solid #3498db; height: 100%; transition: all 0.3s ease;" onmouseover="this.style.transform='scale(1.02)'; this.style.boxShadow='2px 2px 8px rgba(0,0,0,0.2)'; this.style.backgroundImage='linear-gradient(to bottom, #d6f0ff, #b8daff)';" onmouseout="this.style.transform='scale(1)'; this.style.boxShadow='1px 1px 3px rgba(0,0,0,0.1)'; this.style.backgroundImage='linear-gradient(to bottom, #e6f7ff, #cce5ff)';">
16
- <p> Join the Hackathon! </p>
17
- <p>Additionally, we’re thrilled to announce a new AgentBeats custom track: the <strong><a href="https://drive.google.com/file/d/1NASall4R84xAhoDdcaMwwJ78Ao3B-EK4/view?usp=sharing" rel="">OpenEnv Challenge: SOTA Environments to Drive General Intelligence</a></strong>, sponsored by the <a href="https://pytorch.org/" rel="">PyTorch</a> team at <a href="https://www.meta.com/" rel="">Meta</a>, <a href="https://huggingface.co/" rel="">Hugging Face</a>, and <a href="https://unsloth.ai/" rel="">Unsloth</a>. Participants will compete to develop innovative, open-source RL environments that push the frontiers of agent learning, with a prize pool of <strong>$10K in Hugging Face credits</strong>, and the chance to be published on the <a href="https://pytorch.org/blog/" rel="">PyTorch blog</a></p>
18
- <a href="https://rdi.berkeley.edu/agentx-agentbeats.html">Sign up here</a>
19
- </div>
20
- </a>
21
 
22
  ## Quick Start
23
 
24
- You can install Hugging Face spaces for client code:
 
 
 
 
 
 
25
 
26
  ```bash
27
  pip install git+https://huggingface.co/spaces/openenv/echo_env
28
  ```
29
 
30
- Then use the environment hosted on spaces:
31
 
32
  ```python
33
  import asyncio
34
- from echo_env import EchoAction, EchoEnv
35
 
36
  async def main():
37
  # Connect to a running Space (async context manager)
@@ -41,31 +46,121 @@ async def main():
41
  print(result.observation.echoed_message) # "Echo environment ready!"
42
 
43
  # Send messages
44
- result = await client.step(EchoAction(message="Hello, World!"))
45
- print(result.observation.echoed_message) # "Hello, World!"
46
- print(result.reward) # 1.3 (based on message length)
 
 
 
 
 
47
 
48
  asyncio.run(main())
49
  ```
50
 
51
- To pull the environments locally from Spaces as docker containers, you can do this:
52
 
53
  ```python
54
- import asyncio
55
- from echo_env import EchoEnv
 
 
 
 
 
 
 
 
 
 
 
56
 
57
- async def main():
58
- # Pulls from Hugging Face and starts a container
59
- client = await EchoEnv.from_env("openenv/echo_env")
60
- async with client:
61
- result = await client.reset()
62
- print(result.observation)
63
 
64
- asyncio.run(main())
65
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
 
67
- ## Hugging Face x Meta-PyTorch
68
 
69
- Hugging Face, Meta-PyTorch and many other [supporters](https://github.com/meta-pytorch/OpenEnv?tab=readme-ov-file#community-support--acknowledgments) are committed to democratizing RL post training with environmnets.
70
 
71
- ![Sponsor Logos](https://huggingface.co/spaces/openenv/README/resolve/main/openenv-sponsors.png)
 
3
  sdk: static
4
  ---
5
 
6
+ # <img width="35" height="35" alt="image" src="https://github.com/user-attachments/assets/2700a971-e5d6-4036-b03f-2f89c9791609" /> OpenEnv: Agentic Execution Environments
7
 
8
+ An e2e framework for creating, deploying and using isolated execution environments for agentic RL training, built using Gymnasium style simple APIs.
 
 
9
 
10
+ <p align="center">
11
+ <a href="https://pypi.org/project/openenv/"><img alt="PyPI" src="https://img.shields.io/pypi/v/openenv?color=blue"/></a>
12
+ <a href="https://github.com/huggingface/OpenEnv/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/badge/License-BSD%203--Clause-blue.svg"/></a>
13
+ <a href="https://huggingface.co/docs/openenv"><img alt="Docs" src="https://img.shields.io/badge/Docs-Explore-blue?logo=readthedocs&logoColor=white"/></a>
14
+ <a href="https://huggingface.co/openenv"><img alt="Hugging Face" src="https://img.shields.io/badge/🤗%20Hugging%20Face-OpenEnv-yellow"/></a>
15
+ <a href="https://discord.gg/YsTYBh6PD9"><img alt="Discord" src="https://img.shields.io/badge/Discord-OpenEnv-7289da?style=flat&logo=discord&logoColor=white"/></a>
16
+ <a href="https://colab.research.google.com/github/huggingface/OpenEnv/blob/main/examples/OpenEnv_Tutorial.ipynb"><img alt="Open In Colab" src="https://colab.research.google.com/assets/colab-badge.svg"/></a>
17
+ </p>
18
 
19
+ ---
 
 
 
 
 
 
20
 
21
  ## Quick Start
22
 
23
+ Install the OpenEnv package:
24
+
25
+ ```bash
26
+ pip install openenv
27
+ ```
28
+
29
+ Install an environment client (e.g., Echo):
30
 
31
  ```bash
32
  pip install git+https://huggingface.co/spaces/openenv/echo_env
33
  ```
34
 
35
+ Then use the environment:
36
 
37
  ```python
38
  import asyncio
39
+ from echo_env import CallToolAction, EchoEnv
40
 
41
  async def main():
42
  # Connect to a running Space (async context manager)
 
46
  print(result.observation.echoed_message) # "Echo environment ready!"
47
 
48
  # Send messages
49
+ result = await client.step(
50
+ CallToolAction(
51
+ tool_name="echo_message",
52
+ arguments={"message": "Hello, World!"},
53
+ )
54
+ )
55
+ print(result.observation.result) # "Hello, World!"
56
+ print(result.reward)
57
 
58
  asyncio.run(main())
59
  ```
60
 
61
+ **Synchronous usage** is also supported via the `.sync()` wrapper:
62
 
63
  ```python
64
+ from echo_env import CallToolAction, EchoEnv
65
+
66
+ # Use .sync() for synchronous context manager
67
+ with EchoEnv(base_url="https://openenv-echo-env.hf.space").sync() as client:
68
+ result = client.reset()
69
+ result = client.step(
70
+ CallToolAction(
71
+ tool_name="echo_message",
72
+ arguments={"message": "Hello, World!"},
73
+ )
74
+ )
75
+ print(result.observation.result)
76
+ ```
77
 
78
+ For a detailed quick start, check out the [docs page](https://huggingface.co/docs/openenv/getting-started).
 
 
 
 
 
79
 
80
+ ## Overview
81
+
82
+ OpenEnv provides a standard for interacting with agentic execution environments via simple Gymnasium style APIs - `step()`, `reset()`, `state()`. Users of agentic execution environments can interact with the environment during RL training loops using these simple APIs.
83
+
84
+ In addition to making it easier for researchers and RL framework writers, we also provide tools for environment creators making it easier for them to create richer environments and make them available over familiar protocols like HTTP and packaged using canonical technologies like docker. Environment creators can use the OpenEnv framework to create environments that are isolated, secure, and easy to deploy and use.
85
+
86
+ The OpenEnv CLI (`openenv`) provides commands to initialize new environments and deploy them to Hugging Face Spaces.
87
+
88
+ > ⚠️ **Early Development Warning** OpenEnv is currently in an experimental
89
+ > stage. You should expect bugs, incomplete features, and APIs that may change
90
+ > in future versions. The project welcomes bugfixes, but significant changes
91
+ > should be discussed before implementation so the technical committee and
92
+ > community can coordinate scope, compatibility, and release timing. It's
93
+ > recommended that you signal your intention to contribute in the issue tracker,
94
+ > either by filing a new issue or by claiming an existing one.
95
+
96
+ ### RFCs
97
+
98
+ Below is a list of active and historical RFCs for OpenEnv. RFCs are proposals for major changes or features. Please review and contribute!
99
+
100
+ - [RFC 001: Baseline API and Interface Specifications](https://github.com/huggingface/OpenEnv/pull/26)
101
+ - [RFC 002: Discoverability of environment tools by agents](https://github.com/huggingface/OpenEnv/pull/32)
102
+ - [RFC 003: Add MCP (Model Context Protocol) support](https://github.com/huggingface/OpenEnv/pull/224)
103
+ - [RFC 004: Add delayed rewards support for trajectory-based scoring](https://github.com/huggingface/OpenEnv/pull/337)
104
+ - [RFC 005: Agentic Harness Integration](https://github.com/huggingface/OpenEnv/pull/387)
105
+
106
+ ## CLI Commands
107
+
108
+ The OpenEnv CLI provides commands to manage environments:
109
+
110
+ - **`openenv init <env_name>`** - Initialize a new environment from template
111
+ - **`openenv push [--repo-id <repo>] [--private]`** - Deploy environment to Hugging Face Spaces
112
+ - **`openenv serve`** - Serve an environment locally with optional auto-reload
113
+ - **`openenv build`** - Build the Docker image for an environment
114
+ - **`openenv fork <space-id>`** - Fork a Space from HF Hub to your account
115
+ - **`openenv validate`** - Validate an environment configuration
116
+
117
+ ### Quick Start
118
+
119
+ ```bash
120
+ # Create a new environment
121
+ openenv init my_game_env
122
+
123
+ # Deploy to Hugging Face (will prompt for login if needed)
124
+ cd my_game_env
125
+ openenv push
126
+ ```
127
+
128
+ For detailed options run any command with `--help`.
129
+
130
+ ## Integrations
131
+
132
+ OpenEnv works with a growing ecosystem of RL frameworks and platforms. If your project supports OpenEnv, open a PR to add it here.
133
+
134
+ ### TRL
135
+ See the [TRL example](https://huggingface.co/docs/trl/openenv) on how to integrate OpenEnv environments with GRPO training.
136
+
137
+ ### torchforge
138
+ See GRPO BlackJack training example: [`examples/grpo_blackjack/`](examples/grpo_blackjack/)
139
+
140
+ ### Unsloth
141
+ See the 2048 game example based on gpt-oss: [Colab notebook](https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/OpenEnv_gpt_oss_(20B)_Reinforcement_Learning_2048_Game.ipynb)
142
+
143
+ ### SkyRL
144
+ See the [SkyRL example](https://skyrl.readthedocs.io/en/latest/examples/openenv.html) on how to train on OpenEnv environments with SkyRL.
145
+
146
+ ### ART
147
+ See the [ART example](https://art.openpipe.ai/integrations/openenv-integration) on how OpenEnv environments can be used to train models with ART.
148
+
149
+ ### Oumi
150
+ See the [Oumi example](https://github.com/oumi-ai/oumi/blob/main/notebooks/Oumi%20-%20OpenEnv%20GRPO%20with%20trl.ipynb) on how OpenEnv environments can be used to train models with Oumi.
151
+
152
+ ### Lightning AI
153
+ [Lightning AI templates](https://lightning.ai/templates?section=featured&query=openenv)
154
+
155
+ > Browse the full catalog of community environments at [huggingface.co/docs/openenv/environments](https://huggingface.co/docs/openenv/environments).
156
+
157
+ ## Community Support & Acknowledgments
158
+
159
+ OpenEnv is governed by a technical committee that coordinates project direction, major technical decisions, RFCs, and release planning through the public issue tracker, pull requests, and RFC process. Current committee members: Meta-PyTorch, Reflection, Unsloth, Modal, Prime Intellect, Nvidia, Mercor, Fleet AI, and Hugging Face.
160
+
161
+ The project is also supported by a broader community of organizations. If you would like to add your project or organization here, please open a pull request for maintainer review.
162
 
163
+ Supporters include: [Meta-PyTorch](https://github.com/meta-pytorch), [Hugging Face](https://huggingface.co), [Scaler AI Labs](https://scalerailabs.com), [Patronus AI](https://patronus.ai), [Surge AI](https://surgehq.ai), [LastMile AI](https://www.lastmileai.dev), [Unsloth](https://unsloth.ai), [Reflection](https://reflection.ai), [vLLM](https://vllm.ai), [SkyRL](https://skyrl.readthedocs.io) (UC-Berkeley), [Lightning AI](https://lightning.ai), [Axolotl AI](https://github.com/axolotl-ai-cloud/axolotl), [Stanford Scaling Intelligence Lab](https://scalingintelligence.stanford.edu/), [Mithril](https://mithril.ai), [OpenMined](https://openmined.org/), [Fleet AI](https://fleetai.com), [Halluminate](https://halluminate.ai/), [Turing](https://www.turing.com/), [Scale AI](https://scale.com/), [Scorecard](https://www.scorecard.io/)
164
 
165
+ And we'd also like to acknowledge the team at Farama Foundation as the OpenEnv API was heavily inspired by the work you all have done on Gymnasium. Cheers!
166