Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ An end-to-end framework for creating, deploying and using isolated execution env
<p align="center">
<a href="https://pypi.org/project/openenv/"><img alt="PyPI" src="https://img.shields.io/pypi/v/openenv?color=blue"/></a>
<a href="https://github.com/openenv/OpenEnv/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/badge/License-BSD%203--Clause-blue.svg"/></a>
<a href="https://huggingface.co/docs/openenv"><img alt="Docs" src="https://img.shields.io/badge/Docs-Explore-blue?logo=readthedocs&logoColor=white"/></a>
<a href="https://openenv.github.io/OpenEnv/"><img alt="Docs" src="https://img.shields.io/badge/Docs-Explore-blue?logo=readthedocs&logoColor=white"/></a>
<a href="https://huggingface.co/openenv"><img alt="Hugging Face" src="https://img.shields.io/badge/🤗%20Hugging%20Face-OpenEnv-yellow"/></a>
<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>
<a href="https://colab.research.google.com/github/openenv/OpenEnv/blob/main/examples/OpenEnv_Tutorial.ipynb"><img alt="Open In Colab" src="https://colab.research.google.com/assets/colab-badge.svg"/></a>
Expand All @@ -16,12 +16,12 @@ An end-to-end framework for creating, deploying and using isolated execution env
## What you get

- **One API for every environment.** `reset()`, `step()` and `state()`, sync or async, over a WebSocket.
- **Isolated, deployable environments.** Each environment is a Docker image that runs locally, on a cloud sandbox, or as a [Hugging Face Space](https://huggingface.co/docs/openenv/getting_started/contributing-envs).
- **40+ ready-to-use environments**, from games and coding sandboxes to browsers, finance and simulators, in the [environment catalog](https://huggingface.co/docs/openenv/environments).
- **Isolated, deployable environments.** Each environment is a Docker image that runs locally, on a cloud sandbox, or as a [Hugging Face Space](https://openenv.github.io/OpenEnv/main/getting_started/contributing-envs).
- **40+ ready-to-use environments**, from games and coding sandboxes to browsers, finance and simulators, in the [environment catalog](https://openenv.github.io/OpenEnv/main/environments).
- **Train with your framework.** TRL, Unsloth, SkyRL, ART, Oumi, torchforge, Miles and more (see [Integrations](#integrations)).
- **Train real coding agents.** The [Harbor integration](https://huggingface.co/docs/openenv/environments/harbor) runs Claude Code, Codex, OpenCode, mini-swe-agent and other harnesses on Harbor tasks, and captures the exact tokens for RL.
- **Serve tools to agents.** MCP environments expose their tools to agents over `/mcp` in [production mode](https://huggingface.co/docs/openenv/guides/simulation-vs-production), while training keeps using `step()` and rewards.
- **Rewards and evals built in.** Compose rewards with [rubrics](https://huggingface.co/docs/openenv/guides/rewards) and evaluate with [Inspect AI](https://huggingface.co/docs/openenv/tutorials/evaluation-inspect).
- **Train real coding agents.** The [Harbor integration](https://openenv.github.io/OpenEnv/main/environments/harbor) runs Claude Code, Codex, OpenCode, mini-swe-agent and other harnesses on Harbor tasks, and captures the exact tokens for RL.
- **Serve tools to agents.** MCP environments expose their tools to agents over `/mcp` in [production mode](https://openenv.github.io/OpenEnv/main/guides/simulation-vs-production), while training keeps using `step()` and rewards.
- **Rewards and evals built in.** Compose rewards with [rubrics](https://openenv.github.io/OpenEnv/main/guides/rewards) and evaluate with [Inspect AI](https://openenv.github.io/OpenEnv/main/tutorials/evaluation-inspect).

## Quick Start

Expand Down Expand Up @@ -80,14 +80,14 @@ with EchoEnv(base_url="https://openenv-echo-env.hf.space").sync() as client:
print(result.observation.result["data"])
```

For a detailed quick start, check out the [docs page](https://huggingface.co/docs/openenv/getting-started).
For a detailed quick start, check out the [docs page](https://openenv.github.io/OpenEnv/main/getting-started).

## Train an agent

Any training framework that can call an environment can train on it. [Training with OpenEnv](https://huggingface.co/docs/openenv/guides/training) maps the ways to train and the frameworks that support each one.
Any training framework that can call an environment can train on it. [Training with OpenEnv](https://openenv.github.io/OpenEnv/main/guides/training) maps the ways to train and the frameworks that support each one.

- **Environments as tools (white-box).** The trainer runs the multi-turn tool loop and the environment supplies the tools and the reward. Each framework under [Integrations](#integrations) has its own example. With TRL, `GRPOTrainer` takes an `environment_factory`: start with the [Wordle GRPO tutorial](https://huggingface.co/docs/openenv/tutorials/wordle-grpo) or [TRL's OpenEnv guide](https://huggingface.co/docs/trl/openenv).
- **Real agent harnesses (loop-owning).** The agent runs its own loop, and OpenEnv's [Harbor integration](https://huggingface.co/docs/openenv/environments/harbor) captures every model call as a framework-neutral `TrainingTrace`. TRL's `AsyncGRPOTrainer` trains on those captures today: see [`examples/async_grpo_harbor`](https://github.com/huggingface/trl/tree/main/examples/async_grpo_harbor) and [The ultimate guide to multi-harness RL](https://huggingface.co/spaces/FineEnvs/multi-harness-rl).
- **Environments as tools (white-box).** The trainer runs the multi-turn tool loop and the environment supplies the tools and the reward. Each framework under [Integrations](#integrations) has its own example. With TRL, `GRPOTrainer` takes an `environment_factory`: start with the [Wordle GRPO tutorial](https://openenv.github.io/OpenEnv/main/tutorials/wordle-grpo) or [TRL's OpenEnv guide](https://huggingface.co/docs/trl/openenv).
- **Real agent harnesses (loop-owning).** The agent runs its own loop, and OpenEnv's [Harbor integration](https://openenv.github.io/OpenEnv/main/environments/harbor) captures every model call as a framework-neutral `TrainingTrace`. TRL's `AsyncGRPOTrainer` trains on those captures today: see [`examples/async_grpo_harbor`](https://github.com/huggingface/trl/tree/main/examples/async_grpo_harbor) and [The ultimate guide to multi-harness RL](https://huggingface.co/spaces/FineEnvs/multi-harness-rl).

## Build your own environment

Expand All @@ -99,22 +99,22 @@ openenv push my_env # deploy it to Hugging Face Spaces

For local development, run `openenv serve my_env` after installing its dependencies. This runs on the host and binds to `127.0.0.1`; use Docker or Spaces for isolated training and deployment.

See [Your First Environment](https://huggingface.co/docs/openenv/guides/first-environment) and [Deploying an Environment](https://huggingface.co/docs/openenv/getting_started/environment-builder). `openenv import` wraps an existing environment from ORS/OpenReward or Verifiers, or an AgentEnv bundle.
See [Your First Environment](https://openenv.github.io/OpenEnv/main/guides/first-environment) and [Deploying an Environment](https://openenv.github.io/OpenEnv/main/getting_started/environment-builder). `openenv import` wraps an existing environment from ORS/OpenReward or Verifiers, or an AgentEnv bundle.

## Environments

A few to start with:

| Environment | What it is |
|---|---|
| [Echo](https://huggingface.co/docs/openenv/environments/echo) | Minimal MCP environment, for learning the API and testing a deployment |
| [Coding](https://huggingface.co/docs/openenv/environments/coding) | Sandboxed Python execution with stdout, stderr and exit codes |
| [TextArena (Wordle and more)](https://huggingface.co/docs/openenv/environments/textarena) | Text games for multi-turn RL |
| [OpenSpiel](https://huggingface.co/docs/openenv/environments/openspiel) | Board and card games from DeepMind's OpenSpiel |
| [BrowserGym](https://huggingface.co/docs/openenv/environments/browsergym) | Web navigation tasks (MiniWoB++, WebArena, ...) |
| [Harbor](https://huggingface.co/docs/openenv/environments/harbor) | Harbor task datasets through coding-agent harnesses, with token capture for training |
| [Echo](https://openenv.github.io/OpenEnv/main/environments/echo) | Minimal MCP environment, for learning the API and testing a deployment |
| [Coding](https://openenv.github.io/OpenEnv/main/environments/coding) | Sandboxed Python execution with stdout, stderr and exit codes |
| [TextArena (Wordle and more)](https://openenv.github.io/OpenEnv/main/environments/textarena) | Text games for multi-turn RL |
| [OpenSpiel](https://openenv.github.io/OpenEnv/main/environments/openspiel) | Board and card games from DeepMind's OpenSpiel |
| [BrowserGym](https://openenv.github.io/OpenEnv/main/environments/browsergym) | Web navigation tasks (MiniWoB++, WebArena, ...) |
| [Harbor](https://openenv.github.io/OpenEnv/main/environments/harbor) | Harbor task datasets through coding-agent harnesses, with token capture for training |

Browse all of them in the [environment catalog](https://huggingface.co/docs/openenv/environments), or on the [OpenEnv Hub organization](https://huggingface.co/openenv).
Browse all of them in the [environment catalog](https://openenv.github.io/OpenEnv/main/environments), or on the [OpenEnv Hub organization](https://huggingface.co/openenv).

## Integrations

Expand All @@ -134,9 +134,9 @@ OpenEnv works with a growing ecosystem of RL frameworks and platforms. If your p

## Learn more

- [Documentation](https://huggingface.co/docs/openenv): concepts, guides and tutorials
- [Core Concepts](https://huggingface.co/docs/openenv/guides/concepts) and the [CLI reference](https://huggingface.co/docs/openenv/reference/cli)
- [Tutorials](https://huggingface.co/docs/openenv/tutorials/index), and the [Zero to Hero tutorial](https://github.com/openenv/OpenEnv/tree/main/tutorial) from our GPU Mode lecture
- [Documentation](https://openenv.github.io/OpenEnv/): concepts, guides and tutorials
- [Core Concepts](https://openenv.github.io/OpenEnv/main/guides/concepts) and the [CLI reference](https://openenv.github.io/OpenEnv/main/reference/cli)
- [Tutorials](https://openenv.github.io/OpenEnv/main/tutorials/index), and the [Zero to Hero tutorial](https://github.com/openenv/OpenEnv/tree/main/tutorial) from our GPU Mode lecture
- [FineEnvs](https://github.com/adithya-s-k/FineEnvs): end-to-end projects that build, deploy and train against OpenEnv environments
- [RFCs](https://github.com/openenv/OpenEnv/tree/main/rfcs), the proposals behind major changes
- [Contributing](https://github.com/openenv/OpenEnv/blob/main/CONTRIBUTING.md): development setup, tests and the PR process
Expand Down
2 changes: 1 addition & 1 deletion docs/source/environments/browsergym.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ env.close()

## Training with TRL

To train a model on BrowserGym, pass a small environment class to TRL's `GRPOTrainer` through `environment_factory`. Its methods (`click`, `fill`, `send_keys`, `scroll`, `noop`) become the model's tools, and TRL runs the multi-turn loop. The [BrowserGym tutorial](https://huggingface.co/docs/openenv/tutorials/browsergym-harness) walks through it, and TRL's [`examples/grpo_browsergym`](https://github.com/huggingface/trl/tree/main/examples/grpo_browsergym) is the full script, with screenshots for vision-language models.
To train a model on BrowserGym, pass a small environment class to TRL's `GRPOTrainer` through `environment_factory`. Its methods (`click`, `fill`, `send_keys`, `scroll`, `noop`) become the model's tools, and TRL runs the multi-turn loop. The [BrowserGym tutorial](https://openenv.github.io/OpenEnv/main/tutorials/browsergym-harness) walks through it, and TRL's [`examples/grpo_browsergym`](https://github.com/huggingface/trl/tree/main/examples/grpo_browsergym) is the full script, with screenshots for vision-language models.

`browsergym_env.harness.BrowserGymSessionFactory` exposes the same tools to OpenEnv's session runtime, which [`examples/browsergym_harness_eval.py`](https://github.com/openenv/OpenEnv/blob/main/examples/browsergym_harness_eval.py) uses to evaluate a chat model on BrowserGym.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/environments/grid_world.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ There is no step limit: the episode only ends at the goal.
- `server/app.py`: the server, built with `create_app`
- `client.py`: `GridWorldEnv`, with a `step_move(MoveAction.UP)` helper

To build your own environment, see [Your First Environment](https://huggingface.co/docs/openenv/guides/first-environment).
To build your own environment, see [Your First Environment](https://openenv.github.io/OpenEnv/main/guides/first-environment).
2 changes: 1 addition & 1 deletion docs/source/environments/maze.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ docker build -t maze_env-env:latest -f server/Dockerfile .

## Deploying to Hugging Face Spaces

From `envs/maze_env/`, run `openenv push` (or `openenv push --repo-id my-org/maze-env`). See the [`openenv push` reference](https://huggingface.co/docs/openenv/reference/cli#openenv-push) for all options.
From `envs/maze_env/`, run `openenv push` (or `openenv push --repo-id my-org/maze-env`). See the [`openenv push` reference](https://openenv.github.io/OpenEnv/main/reference/cli#openenv.cli.commands.push) for all options.

## Running the Default Maze

Expand Down
2 changes: 1 addition & 1 deletion docs/source/environments/openspiel.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ From `envs/openspiel_env/`:
openenv push --repo-id my-org/openspiel-env -e OPENSPIEL_GAME=tic_tac_toe
```

`-e` sets the variables above on the Space. See the [`openenv push` reference](https://huggingface.co/docs/openenv/reference/cli#openenv-push) for all options. The Space serves the web UI at `/web`, the API docs at `/docs` and a health check at `/health`. The default Dockerfile uses the pre-built OpenSpiel base image, so it runs on standard CPU hardware.
`-e` sets the variables above on the Space. See the [`openenv push` reference](https://openenv.github.io/OpenEnv/main/reference/cli#openenv.cli.commands.push) for all options. The Space serves the web UI at `/web`, the API docs at `/docs` and a health check at `/health`. The default Dockerfile uses the pre-built OpenSpiel base image, so it runs on standard CPU hardware.

## Environment Details

Expand Down
2 changes: 1 addition & 1 deletion docs/source/environments/reasoning_gym.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ docker build -t reasoning_gym-env:latest -f server/Dockerfile .

## Deploying to Hugging Face Spaces

From `envs/reasoning_gym_env/`, run `openenv push` (or `openenv push --repo-id my-org/reasoning-gym-env`). See the [`openenv push` reference](https://huggingface.co/docs/openenv/reference/cli#openenv-push) for all options. The Space serves the web UI at `/web`, the API docs at `/docs`, a health check at `/health` and the WebSocket session endpoint at `/ws`.
From `envs/reasoning_gym_env/`, run `openenv push` (or `openenv push --repo-id my-org/reasoning-gym-env`). See the [`openenv push` reference](https://openenv.github.io/OpenEnv/main/reference/cli#openenv.cli.commands.push) for all options. The Space serves the web UI at `/web`, the API docs at `/docs`, a health check at `/health` and the WebSocket session endpoint at `/ws`.

## Environment Details

Expand Down
2 changes: 1 addition & 1 deletion docs/source/environments/repl.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ with LocalREPLEnv() as env:

Customize `LocalREPLEnv(rubric=...)` with the match, partial-credit, custom-metric,
or execution rubrics in [`rubrics.py`](https://github.com/openenv/OpenEnv/blob/main/envs/repl_env/rubrics.py). See the
[rubric guide](https://huggingface.co/docs/openenv/guides/rewards) for composition.
[rubric guide](https://openenv.github.io/OpenEnv/main/guides/rewards) for composition.

## Running an RLM Locally

Expand Down
2 changes: 1 addition & 1 deletion docs/source/environments/spatial_gym.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ with SpatialGymEnv(base_url="http://localhost:8000").sync() as env:

## Run it yourself

From `envs/spatial_gym_env/`, start the server with `uv run --project . server` (port 8000; set `ENABLE_WEB_INTERFACE=true` for the playground at `/web`). Build the image with `openenv build`, and deploy a Space with `openenv push` (or `openenv push --repo-id my-org/spatial-gym-env`). See the [`openenv push` reference](https://huggingface.co/docs/openenv/reference/cli#openenv-push) for all options.
From `envs/spatial_gym_env/`, start the server with `uv run --project . server` (port 8000; set `ENABLE_WEB_INTERFACE=true` for the playground at `/web`). Build the image with `openenv build`, and deploy a Space with `openenv push` (or `openenv push --repo-id my-org/spatial-gym-env`). See the [`openenv push` reference](https://openenv.github.io/OpenEnv/main/reference/cli#openenv.cli.commands.push) for all options.

The tests download the SPaRC dataset and skip themselves when Spatial-Gym is not installed. From the repository root:

Expand Down
2 changes: 1 addition & 1 deletion docs/source/environments/tau2.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@ The image starts from a Python 3.12 base rather than `openenv-base`, because τ
## Notes

- τ²-bench is installed from GitHub, pinned to a commit. The `tau2` package on PyPI is an unrelated project.
- To evaluate Claude Code on τ²-bench, see [Evaluate Claude Code in an Environment](https://huggingface.co/docs/openenv/tutorials/claude-code-harness).
- To evaluate Claude Code on τ²-bench, see [Evaluate Claude Code in an Environment](https://openenv.github.io/OpenEnv/main/tutorials/claude-code-harness).
- Train on the `train` split and evaluate on `test`, so training does not leak into the benchmark.
- litellm has no prices for Inference Providers models, so τ²-bench reports the cost of those runs as $0.
6 changes: 3 additions & 3 deletions docs/source/environments/textarena.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ An OpenEnv wrapper for [TextArena](https://github.com/textarena/textarena) game
> Generic wrapper for any [TextArena](https://www.textarena.ai/docs/overview) game inside OpenEnv. This module exposes the TextArena `Env` interface through the standard HTTP server/client APIs used by other OpenEnv environments, enabling quick experimentation with the full suite of word, reasoning, and multi-agent games.

Try Wordle on the [`openenv/wordle`](https://huggingface.co/spaces/openenv/wordle) Space, or connect a client to `https://openenv-wordle.hf.space`.
To train a model on it, follow the [Wordle tutorial](https://huggingface.co/docs/openenv/tutorials/wordle-grpo): an SFT warmup, then GRPO with TRL.
To train a model on it, follow the [Wordle tutorial](https://openenv.github.io/OpenEnv/main/tutorials/wordle-grpo): an SFT warmup, then GRPO with TRL.

## Quick Start

Expand Down Expand Up @@ -67,7 +67,7 @@ docker build -t textarena-env:latest -f server/Dockerfile .

## Testing the Gradio UI locally

With the web interface enabled, the server serves a **Gradio UI** at `/web`. If your `openenv` supports `gradio_builder`, you get two tabs (see [Customizing the Web UI](https://huggingface.co/docs/openenv/guides/customizing-web-ui)):
With the web interface enabled, the server serves a **Gradio UI** at `/web`. If your `openenv` supports `gradio_builder`, you get two tabs (see [Customizing the Web UI](https://openenv.github.io/OpenEnv/main/guides/customizing-web-ui)):

- **Playground** – default OpenEnv UI (Reset, Step, Episode, Quick Start, README).
- **Custom** – Wordle-style HTML block (see `server/gradio_ui.py`; uses [Gradio 6 `gr.HTML`](https://gradio.app/docs/gradio/html) to render the block).
Expand Down Expand Up @@ -104,7 +104,7 @@ From `envs/textarena_env/`:
openenv push --repo-id my-org/textarena-env -e TEXTARENA_ENV_ID=Wordle-v0
```

`-e` sets the [configuration variables](#environment-configuration) on the Space. See the [`openenv push` reference](https://huggingface.co/docs/openenv/reference/cli#openenv-push) for all options. The Space serves the web UI at `/web`, the API docs at `/docs` and a health check at `/health`.
`-e` sets the [configuration variables](#environment-configuration) on the Space. See the [`openenv push` reference](https://openenv.github.io/OpenEnv/main/reference/cli#openenv.cli.commands.push) for all options. The Space serves the web UI at `/web`, the API docs at `/docs` and a health check at `/health`.

## Environment Details

Expand Down
Loading