File size: 3,143 Bytes
124801a
9be8c40
81663e8
 
 
124801a
ac2657f
124801a
 
9be8c40
81663e8
f7aae3e
88d0cf9
81663e8
 
43fadb0
88d0cf9
 
81663e8
2dab131
81663e8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2dab131
81663e8
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
title: SmolDataEnvs Multi-harness | Native OpenCode
emoji: 馃И
colorFrom: blue
colorTo: green
sdk: docker
app_port: 7860
---

# SmolDataEnvs: Native OpenCode

**[Read the multi-harness RL article](https://huggingface.co/spaces/FineEnvs/multi-harness-rl)** 路 [Collection](https://huggingface.co/collections/FineEnvs/smoldataenvs-multi-harness-rl-6abdfaaa8d74dacd481d5212) 路 [Training tutorial](https://github.com/adithya-s-k/FineEnvs/tree/main/05-multi-harness-rl)

Native OpenCode runs inside the sandbox. The server grades its answer and returns a typed token trace for AsyncGRPO.

`opencode_env` is deprecated since OpenEnv 0.7.0. This environment remains available for the historical comparison; new runs should use the [Harbor Space](https://huggingface.co/spaces/FineEnvs/smoldataenv-multi-harness-harbor) with `harness="opencode"`. Rebuilding this standalone Space from main will stop working once upstream removes `opencode_env`.

This folder contains the complete Space source. You can run it locally or deploy it on its own.

[Open the deployed UI](https://fineenvs-smoldataenv-multi-harness-opencode.hf.space/web/) 路 [Space](https://huggingface.co/spaces/FineEnvs/smoldataenv-multi-harness-opencode)

## Read the code

- [`smoldataenv_opencode/environment.py`](smoldataenv_opencode/environment.py): task execution and grading.
- [`smoldataenv_opencode/server.py`](smoldataenv_opencode/server.py): OpenEnv server and UI.
- [`prepare.py`](prepare.py) and [`data/`](data/): the pinned 1,000 train / 250 test tasks, with grader and split checks.
- [`Dockerfile`](Dockerfile): exactly what the Space builds.

## Run locally

Use Python 3.12. From this directory:

```bash
uv venv --python 3.12 --seed .venv
source .venv/bin/activate
bash install.sh
hf auth login
export HF_TOKEN="$(hf auth token)"
export DAYTONA_API_KEY="your-key"
bash start.sh
```

Open **http://localhost:7860/**. It opens the UI at `/web/`; the API is at `/docs` and health at `/health`. `install.sh` installs OpenEnv from main and its environment examples from the same checkout. This server needs no GPU or TRL installation.

For agent rollouts, set `SANDBOX_VLLM_URL` and the secret `SANDBOX_VLLM_KEY` to an inference endpoint reachable by the sandbox. Training requires engine token IDs and logprobs.

## Deploy this folder

```bash
python deploy.py --repo YOUR_ORG/smoldataenv-multi-harness-opencode --public
```

Add `HF_TOKEN` and `DAYTONA_API_KEY` as Space secrets. The uploader sends the files in this directory, without generating or swapping application code. It enables the UI and preserves an existing concurrency limit. For a new Space the limit defaults to 40; use `--concurrency` to change it. CPU Basic serves the API; actual tasks run in Daytona.

You can test the same image locally:

```bash
docker build -t smoldataenv-opencode .
docker run --rm -p 7860:7860 -e HF_TOKEN -e DAYTONA_API_KEY smoldataenv-opencode
```

Runtime downloads, local credentials and old deployment archives are excluded from uploads and Docker builds. Task questions and held-out answers are never bundled into the image; the pinned tasks are prepared at startup.