OpenEnv documentation

Tutorials

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v0.4.1).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Tutorials

New to OpenEnv? Start Here

The Getting Started Series walks you from zero to deploying your own environment in five short parts. No GPU required.

PartWhat it coversNotebook
1 — Introduction & Quick StartWhat OpenEnv is, why it exists, and your first environment in under 10 minutesOpen In Colab
2 — Using EnvironmentsConnect to environments, create policies, run evaluationsOpen In Colab
3 — Building EnvironmentsCreate a custom environment from scratchOpen In Colab
4 — Packaging & DeployingPackage with Docker and deploy to Hugging Face
5 — Contributing to Hugging FacePublish, fork, and share environments on the Hub

Topic Tutorials

Already familiar with the basics? These tutorials cover specific workflows in depth.

TutorialWhat it coversGPUNotebook
OpenEnv TutorialFull introduction to OpenEnv: install, connect to a hosted environment, step through an episode, define a reward function, and run a basic training loop.NoOpen In Colab
End-to-end walkthroughThe full pipeline: connect to reasoning_gym, wire it into TRL via environment_factory, fine-tune with GRPO, and push the checkpoint to the Hub.YesOpen In Colab
Building and using MCP environmentsConsume and build MCP-backed environments: list and call tools through step(), register Python functions as tools with FastMCP.NoOpen In Colab
RubricsCompose reward functions from reusable pieces using Gate, WeightedSum, LLMJudge, and TrajectoryRubric.NoOpen In Colab
Wordle GRPOTrain an agent to play Wordle using GRPO via TRL’s environment_factory.YesOpen In Colab
RL Training with 2048Train a language model to play 2048 using GRPO. Covers game-state representation and reward shaping.Yes
Evaluating agents with Inspect AIWrap an OpenEnv environment in an Inspect AI Task, run it via InspectAIHarness, and get a structured EvalResult.NoOpen In Colab
BrowserGym Harness RolloutsDrive BrowserGym through the OpenEnv harness runtime when a trainer needs token sampling, logprobs, and reward assignment inside the training loop.Yes
Collecting rollouts for supervised trainingRun a teacher model to collect reward-labeled rollouts, filter them, and fine-tune a student with TRL’s SFTTrainer as a warm-start for GRPO.YesOpen In Colab
Update on GitHub