vanishingradient commited on
Commit
a0141b0
Β·
verified Β·
1 Parent(s): 0feee97

Add README.md

Browse files
Files changed (1) hide show
  1. README.md +54 -18
README.md CHANGED
@@ -1,32 +1,68 @@
1
  # deepagents-rl
2
 
3
- Post-train a small coding LM with **GRPO** + verifiable unit-test rewards, using:
4
 
5
- - Local **deepagents-style** harness smoke (`scripts/smoke_e2e.py`)
6
- - **Langfuse** traces (every tool + checkpoint eval)
7
- - **Weights & Biases** metrics
8
- - **Hugging Face** adapters (`vanishingradient/deepagents-rl-coding`)
9
- - **Kaggle T4Γ—2** training (`notebooks/kaggle_grpo.ipynb`)
10
 
11
- ## Checkpoint rule
12
-
13
- Before every HF checkpoint push: run held-out eval β†’ write **Langfuse** `kaggle-ckpt-eval` β†’ log W&B β†’ then push revision `grpo-step-{n}`.
 
 
 
 
 
 
14
 
15
  ## Quick start
16
 
17
  ```bash
18
- # local smoke (model on :8792)
19
- python scripts/smoke_e2e.py
 
 
 
 
 
 
 
 
 
 
20
 
21
- # build + push MBPP dataset
22
- python scripts/prepare_mbpp_and_push.py
23
 
24
- # upload trainer to HF for Kaggle download
25
- python scripts/push_trainer_to_hf.py
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  ```
27
 
28
- Then open the Kaggle notebook with **GPU T4 x2** and attach secrets β€” see [`kaggle/KAGGLE_SETUP.md`](kaggle/KAGGLE_SETUP.md).
29
 
30
- ## Dataset
31
 
32
- `vanishingradient/deepagents-rl-mbpp` β€” filtered MBPP sanitized (reference must pass sandbox).
 
1
  # deepagents-rl
2
 
3
+ Train / evaluate a coding **agent** in the **deepagents harness** on long-horizon SWE-bench tasks, with **official Docker evaluation** (not proxy rewards).
4
 
5
+ ## Protocol
 
 
 
 
6
 
7
+ 1. Load [SWE-bench/SWE-bench_Lite](https://huggingface.co/datasets/SWE-bench/SWE-bench_Lite) (`image`, `eval_script`, `FAIL_TO_PASS`, `PASS_TO_PASS`)
8
+ 2. Full `git checkout` of `repo` @ `base_commit` as the agent sandbox
9
+ 3. Agent edits via deepagents tools (`ls` / `read_file` / `edit_file` / `execute` / …)
10
+ 4. Export `git diff` as `model_patch`
11
+ 5. Grade inside the instance Docker image:
12
+ - apply patch β†’ run official `eval_script` (applies `test_patch`, runs pytest)
13
+ - parse `>>>>> Start/End Test Output`
14
+ - **resolved = FULL** iff all FAIL_TO_PASS pass and all PASS_TO_PASS maintained
15
+ 6. Record trajectory (messages, tools, patch, Langfuse, W&B, JSONL)
16
 
17
  ## Quick start
18
 
19
  ```bash
20
+ # Requires Docker Desktop running
21
+ python scripts/verify_swe_docker_grader.py # gold patch must FULL-resolve
22
+
23
+ python scripts/prepare_swe_lite_and_push.py # push metadata to HF
24
+
25
+ python scripts/run_deepagent_rollouts.py \
26
+ --split dev --limit 1 --mode tool_loop --log-level DEBUG
27
+ ```
28
+
29
+ Env: `MODEL_BASE_URL`, `MODEL_NAME`, Langfuse + W&B keys, Docker engine up.
30
+
31
+ ## Logging (every step)
32
 
33
+ Every stage is logged: repo clone/fetch, each LLM turn, every tool call (args + result), every `docker …` command, patch apply, eval_script, F2P/P2P grade.
 
34
 
35
+ Under `--artifacts` (default `artifacts/swe_lite/`):
36
+
37
+ | File | Contents |
38
+ |------|----------|
39
+ | `run.log` | Human-readable step log |
40
+ | `events.jsonl` | One JSON event per line (full replay) |
41
+ | `trajectories.jsonl` | Full episode trajectories |
42
+ | `evals/<episode_id>/` | model.patch, eval.sh, test_output.txt, report.json |
43
+
44
+ Env: `DARL_LOG_LEVEL`, `DARL_LOG_FILE`, `DARL_EVENTS_JSONL`.
45
+
46
+ ## Langfuse trace shape
47
+
48
+ Each episode is one agent trace with nested children:
49
+
50
+ ```
51
+ deepagent-swe-episode (agent)
52
+ β”œβ”€β”€ agent-loop (span)
53
+ β”‚ β”œβ”€β”€ turn-0 (span)
54
+ β”‚ β”‚ β”œβ”€β”€ llm-turn-0 (generation via CallbackHandler)
55
+ β”‚ β”‚ β”œβ”€β”€ ls / read_file … (tool)
56
+ β”‚ β”‚ └── …
57
+ β”‚ β”œβ”€β”€ turn-1 …
58
+ β”‚ └── …
59
+ └── reward_grader (evaluator)
60
+ β”œβ”€β”€ git_diff_model_patch (span)
61
+ └── docker_swe_eval (span)
62
  ```
63
 
64
+ Scores on the trace: `pass_frac`, `reward_total`, `resolved`, `n_tool_calls`.
65
 
66
+ ## Grader
67
 
68
+ `src/deepagents_rl/harness/swe_docker_eval.py` β€” same protocol as the SWE-bench harness (instance image + eval script + F2P/P2P). No file-overlap shortcuts.