Skip to content

OpenEnv v0.2.2 Release

Choose a tag to compare

@burtenshaw burtenshaw released this 20 Mar 17:52
· 1994 commits to main since this release
7fdccfa

Core Features

  • Async-first environment clients with persistent WebSocket sessions, plus a sync wrapper for non-async code. The core loop is standardized around reset(), step(), and state().
  • Rubric/evaluation support for RL and agentic evaluation, including delayed rewards, EvalHarness, Inspect/LightEval-style harnesses, and LLM-as-a-judge scoring via LLMJudge.
  • Auto-discovery API via AutoEnv and AutoAction, so callers can load envs by short name, package-name variant, or Hub repo ID instead of hardcoding imports.
  • MCP-native environments via MCPEnvironment, including tool discovery, tool calls through the env API, FastMCP 2.x/3.x compatibility, reserved-name validation, persistent MCP sessions, production vs simulation modes, and code mode support.
  • Built-in web UI at /web for interactive env inspection, with dynamic forms, action history, and live state updates.
  • Creator CLI bundled in openenv-core: openenv init, build, validate, push, fork, serve, and skills.
  • One-command Hugging Face publishing flow for env authors, plus fork/duplicate support for existing Spaces and custom registry pushes.

More Features

  • Generic client support via GenericEnvClient / GenericAction for raw-dict access when you do not want to install env-specific code or trust remote code locally.
  • Typed environment contracts built on Pydantic models for Action, Observation, State, and StepResult, including parameterized reset/step support.
  • Multiple connection modes for the same env client: connect to a live URL, launch from a Docker image, or run a Hugging Face Space locally with uv.
  • Runtime/provider abstraction for local execution: LocalDockerProvider, UVProvider, DockerSwarmProvider, Daytona support, and a Kubernetes-shaped extension point.
  • Multi-mode deployment validation in the CLI, including local structure checks and live endpoint/runtime checks for deployed envs.
  • One-command Hugging Face publishing flow for env authors, plus fork/duplicate support for existing Spaces and custom registry pushes.
  • Release/deploy infrastructure for env fleets, including versioned Hub tags, collection management, per-env deployment scripts, and endpoint verification tooling.
  • The package is now a real distributable core runtime, openenv-core, with the CLI included rather than a loose repo-only developer tool.
  • The framework is explicitly agent-facing, with Hub-hosted envs, MCP tools, sync/async client ergonomics, evaluation hooks, and RL-platform integration docs for TRL, Torchforge, Oumi, ART, and others.

Example Snippets

Async env usage plus sync wrapper

import asyncio
from echo_env import EchoAction, EchoEnv

async def main():
    async with EchoEnv(base_url="https://openenv-echo-env.hf.space") as env:
        await env.reset()
        result = await env.step(EchoAction(message="Hello, OpenEnv!"))
        print(result.observation.echoed_message)

asyncio.run(main())

with EchoEnv(base_url="https://openenv-echo-env.hf.space").sync() as env:
    env.reset()
    print(env.step(EchoAction(message="sync call")).observation.echoed_message)

Auto-discovery instead of manual imports

from openenv import AutoEnv, AutoAction

env = AutoEnv.from_env("coding-env")
CodeAction = AutoAction.from_env("coding-env")

with env.sync() as client:
    client.reset()
    result = client.step(CodeAction(code="print('Hello from AutoEnv')"))
    print(result.observation)

Run from Hub Docker or locally with uv

from echo_env import EchoEnv

env = await EchoEnv.from_env("openenv/echo_env")  # pull HF Docker image
local = await EchoEnv.from_env(
    "openenv/echo_env",
    use_docker=False,
    project_path="/path/to/local/echo_env",
)

CLI for creation, validation, publishing, and forking

openenv init my_env
cd my_env
openenv validate --verbose
openenv push --repo-id my-org/my-env --private
openenv fork openenv/echo_env --repo-id myuser/echo-env

MCP-style tool environments

from openenv.core.env_server import ListToolsAction, CallToolAction

obs = env.step(ListToolsAction())
print([tool.name for tool in obs.tools])

obs = env.step(CallToolAction(tool_name="echo", arguments={"message": "hi"}))
print(obs.result)

LLM-based rubric scoring

from openenv.core.rubrics import LLMJudge

judge = LLMJudge(
    prompt_template="Rate this action:\n{action}\n\nGiven observation:\n{observation}\nScore 0-1:",
    client=client,
)
score = await judge(action, observation)

Built-in web UI for local envs

from openenv.core.env_server import create_web_interface_app

app = create_web_interface_app(env, YourAction, YourObservation)
# browse http://localhost:8000/web

What's Changed

New Contributors

Full Changelog: https://github.com/meta-pytorch/OpenEnv/commits/v0.2.2