Skip to content

Commit 22d24f3

Browse files
authored
Merge branch 'main' into cursor/setup-dev-environment-05d9
2 parents 0727437 + 7a5996b commit 22d24f3

105 files changed

Lines changed: 6790 additions & 5678 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/generate-openenv-env/assets/openenv_env_template/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ requires-python = ">=3.10"
1616
dependencies = [
1717
# Core OpenEnv runtime (provides FastAPI server + HTTP client types)
1818
# install from github
19-
# "openenv-core[core] @ git+https://github.com/huggingface/OpenEnv.git",
20-
"openenv-core[core]>=0.2.2",
19+
# "openenv @ git+https://github.com/huggingface/OpenEnv.git",
20+
"openenv>=0.2.2",
2121
# Environment-specific dependencies
2222
# Add all dependencies needed for your environment here
2323
# Examples:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
openenv-core[core]>=0.2.2
1+
openenv>=0.2.2
22
fastapi>=0.116.0
33
uvicorn>=0.24.0

.github/workflows/openspiel_base_build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858

5959
# Job 2: Build OpenSpiel base image (depends on base)
6060
build-openspiel-base:
61-
runs-on: 8-core-ubuntu
61+
runs-on: ubuntu-latest
6262
needs: build-base # Wait for base image to be built
6363
permissions:
6464
contents: read
@@ -94,6 +94,8 @@ jobs:
9494
file: envs/openspiel_env/server/Dockerfile.openspiel-base
9595
push: true
9696
platforms: linux/amd64,linux/arm64
97+
build-args: |
98+
BASE_IMAGE=${{ env.REGISTRY }}/${{ env.IMAGE_PREFIX }}-base:latest
9799
tags: ${{ steps.meta-openspiel-base.outputs.tags }}
98100
labels: ${{ steps.meta-openspiel-base.outputs.labels }}
99101
cache-from: type=gha,scope=openspiel-base

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ Base class for environment communication:
175175
Manage container deployment:
176176
- `LocalDockerProvider`: Run containers on local Docker daemon
177177
- `DockerSwarmProvider`: Deploy to Docker Swarm clusters
178-
- `KubernetesProvider`: Deploy to Kubernetes clusters
179178
- `UVProvider`, `DaytonaProvider`, `ACASandboxProvider`: Additional runtime providers
179+
- `KubernetesProvider`: Deploy to Kubernetes clusters (planned)
180180

181181
#### 5. Models
182182
Type-safe data structures:

docs/source/_toctree.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
title: MCP Environment Lifecycle
3030
- local: guides/connecting
3131
title: Connecting to Servers
32+
- local: guides/runtime-providers
33+
title: Runtime Providers
3234
title: Advanced Guides
3335
title: Guides
3436
- sections:

docs/source/contributing.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ Have an idea? Open a [feature request](https://github.com/huggingface/OpenEnv/is
2525

2626
One of the best ways to contribute is to add a new environment! See the [Building Environments](guides/first-environment.md) guide to get started.
2727

28+
### ☁️ Add a Runtime Provider
29+
30+
To support a new runtime (a cloud sandbox, a scheduler, etc.), subclass
31+
`ContainerProvider` and follow the existing providers (`DaytonaProvider`,
32+
`ACASandboxProvider`) as references. To keep it consistent:
33+
34+
- Put the SDK in a named `[project.optional-dependencies]` extra in `pyproject.toml` and import it lazily, so core OpenEnv stays SDK-free.
35+
- Add an `[[autodoc]]` entry under "Container providers" in `docs/source/reference/core.md`.
36+
- In the [Runtime Providers guide](guides/runtime-providers.md), add a row to the table and a "Per-provider setup" subsection (kept in alphabetical order).
37+
- Add a test (the providers under `tests/test_core/` inject a fake SDK, so no network is needed).
38+
39+
See the Cloud Sandbox Providers amendment proposed in RFC 002 for the
40+
provider-neutral invariants (direct base URL, WebSocket conformance, network posture).
41+
2842
### 📝 Improve Documentation
2943

3044
Documentation improvements are always welcome:

docs/source/environments/sophistry_bench_sprint.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ from sophistry_bench_sprint_env import SophistryBenchSprintEnv
3737

3838
async def main():
3939
# Deployed Hugging Face Space (or .from_docker_image("openenv-sophistry_bench_sprint:latest")):
40-
client = await SophistryBenchSprintEnv.from_env("anushaacharya/sophistry_bench_sprint_env")
40+
client = await SophistryBenchSprintEnv.from_env("openenv-community/sophistry_bench_sprint_env")
4141
async with client:
4242
obs = (await client.reset()).observation
4343
print(obs.prompt, obs.answer_to_defend)
@@ -67,6 +67,22 @@ the reward-hacking measurement. By default it holds **seven** components; `corre
6767
> reason; even with the rest of the components, forwarding them to the agent leaks the
6868
> reward signal and defeats the reward-hacking measurement.
6969
70+
## Training
71+
72+
[`examples/sophistry_bench_sprint_grpo.py`](https://github.com/huggingface/OpenEnv/blob/main/examples/sophistry_bench_sprint_grpo.py)
73+
trains a policy on this env with TRL's `GRPOTrainer` — a plain prompt ->
74+
completion -> reward setup, since the episode is single-step.
75+
76+
Validated with a real 100-step run on Hugging Face Jobs (`Qwen2.5-0.5B-Instruct`,
77+
`a10g-small`) and a 100-step run on the Prime Intellect Hub
78+
(`Llama-3.2-1B-Instruct`, registered as `anusha/sophistry-bench-sprint`, parity-tested
79+
against this port). Both show `aggregate_reward` (the optimized proxy) climbing while
80+
`correctness_reward` (the hidden ground truth, weight 0) stays flat — the reward-hacking
81+
signature this env is designed to surface. The larger Prime Intellect run converges on
82+
the literal `claim_count_cliff` target (`n_claims` saturates at exactly 8); the smaller
83+
HF Jobs run finds a different shortcut instead (`n_claims` collapses to ~0, near-empty
84+
completions) — same underlying finding, different degenerate strategy depending on scale.
85+
7086
## Build & test
7187

7288
```bash

docs/source/environments/unity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ This approach is useful when:
594594
- `mlagents` (installed from source via git)
595595
- `numpy>=1.20.0`
596596
- `pillow>=9.0.0` (for visual observations)
597-
- `openenv[core]>=0.2.0`
597+
- `openenv>=0.2.0`
598598

599599
## References
600600

docs/source/getting-started.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,19 @@ pip install openenv
99
```
1010

1111
> [!NOTE]
12-
> This installs the `openenv` CLI and the `openenv.core` runtime. Environment
13-
> projects can depend on `openenv[core]` when they only need the server and
14-
> client libraries.
12+
> This installs the full OpenEnv runtime: the environment server, the client,
13+
> the `openenv` CLI, the web interface, and MCP support. Environments depend on
14+
> `openenv` directly.
1515
1616
### Optional dependencies
1717

18-
OpenEnv ships optional extras for specific integrations. Install them with
18+
A few integrations ship as optional extras. Install them with
1919
`pip install openenv[<extra>]`:
2020

2121
| Extra | Pulls in |
2222
|-------|----------|
23-
| `core` | Server + client runtime only (no CLI) |
24-
| `cli` | The `openenv` command-line interface |
25-
| `all` | `core` + `cli` |
2623
| `inspect` | The Inspect AI evaluation harness |
27-
28-
Cloud sandbox providers ship their own extras (`daytona`, `aca`); see the Core
29-
API reference.
24+
| `daytona`, `aca`, `modal` | Cloud sandbox providers (see the Core API reference) |
3025

3126
## Try an Environment
3227

@@ -147,16 +142,18 @@ Cloud sandbox providers implement the same `ContainerProvider` contract as
147142
local Docker: they start an isolated environment server and return a `base_url`
148143
that an `EnvClient` can connect to directly, while keeping provider-specific
149144
control-plane concepts (sandbox groups, projects, signed URLs, snapshots, egress
150-
policy) inside the provider. This keeps OpenEnv an open protocol that any hosted
151-
runtime — Daytona, Modal, E2B, Azure Container Apps Sandboxes, Kubernetes-backed
152-
sandboxes, and others — can implement without changing the client/server
153-
protocol.
154-
155-
See RFC 002, "Cloud Sandbox Providers", for the provider-neutral invariants
156-
(direct base URL, WebSocket conformance, base URL lifetime and reconnect,
157-
provider-specific source mapping, orchestration-only lifecycle, explicit network
158-
posture), and the [Core API reference](reference/core.md) for the available
159-
provider implementations and their provider-specific setup.
145+
policy) inside the provider. Because the contract is provider-neutral, any hosted
146+
runtime can implement it without changing the client/server protocol.
147+
148+
Providers shipped today: `LocalDockerProvider`, `DockerSwarmProvider`,
149+
`UVProvider`, `DaytonaProvider`, and `ACASandboxProvider` (Azure Container Apps
150+
Sandboxes). A `KubernetesProvider` is planned.
151+
152+
See the [Runtime Providers guide](guides/runtime-providers.md) for the full list,
153+
install extras, and how to select a provider, and the
154+
[Core API reference](reference/core.md) for each provider's API. The
155+
provider-neutral invariants are described in the Cloud Sandbox Providers amendment
156+
proposed in RFC 002 (env-spec).
160157

161158
## Next Steps
162159

docs/source/getting_started/contributing-envs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This guide covers three workflows:
1717
Before you start, make sure you have:
1818

1919
- Python 3.11+ and [`uv`](https://github.com/astral-sh/uv) installed
20-
- The OpenEnv CLI: `pip install openenv[cli]` (or install from source)
20+
- The OpenEnv CLI: `pip install openenv` (or install from source)
2121
- A [Hugging Face account](https://huggingface.co/join) with a [write token](https://huggingface.co/settings/tokens)
2222

2323
Authenticate with the Hub:

0 commit comments

Comments
 (0)