PEFT
Safetensors
trl
grpo
async-grpo
lora
agents
harbor
openenv
pi

TwIL-8B · Harbor · pi (LoRA)

A LoRA adapter for webAI-Official/TwIL-8B, trained with reinforcement learning to work as the model behind the pi coding agent on data-analysis tasks.

Each training rollout is a full pi session in a remote sandbox: the agent reads the task, runs shell and Python tools against the task's data files, and answers. A verifier then grades the answer. The adapter was trained on those grades with TRL's asynchronous GRPO trainer.

In short: this checkpoint solves tasks about as often as the base model, with 37% fewer tool calls on the tasks both solve. On harder repository tasks rebuilt from real agent sessions (traj2envs), it is within noise of the base model (+5.7 ± 16.0 points).

Results

Evaluated with the pi harness, one attempt per task at temperature 0.8, paired against the base model on the same tasks. The interval is 95%; tool calls are compared on the tasks both solved.

Tasks n Base model This adapter (step 90) Difference (points) Tool calls
150 held-out tasks of FineEnvs/SmolDataEnvs-harbor-train 146 81.5% 84.9% +3.4 ± 5.8 -37% (112 tasks)
40 held-out tasks of harness-hub/traj2envs-rl 35 31.4% 37.1% +5.7 ± 16.0 -24% (8 tasks)

The main evaluation is the first row: 150 held-out tasks of FineEnvs/SmolDataEnvs-harbor-train (tasks 1,000 and up, easy and medium, none of them seen in training). Step 90 of 100 was picked by looking at the checkpoints' scores on this same evaluation, so the difference above is optimistic.

Use with pi

1. Serve the adapter with vLLM

vllm serve webAI-Official/TwIL-8B \
    --enable-lora --max-lora-rank 32 \
    --lora-modules twil-harbor-pi=harness-hub/TwIL-8B-pi \
    --enable-auto-tool-choice --tool-call-parser qwen3_coder --reasoning-parser qwen3 --chat-template chat_template.jinja \
    --max-model-len 131072

This is the configuration used in training and evaluation.

chat_template.jinja is in this repo (hf download harness-hub/TwIL-8B-pi chat_template.jinja --local-dir .): it is the template training and evaluation served TwIL with.

2. Point pi at it

Install pi (Node.js 22.19 or newer):

npm install -g --ignore-scripts @earendil-works/pi-coding-agent

Add the server to ~/.pi/agent/models.json:

{
  "providers": {
    "local": {
      "baseUrl": "http://localhost:8000/v1",
      "api": "openai-completions",
      "apiKey": "dummy",
      "models": [{ "id": "twil-harbor-pi" }]
    }
  }
}

"api": "openai-completions" matters: without it pi uses the Responses API, which this adapter was not trained or evaluated with.

pi --provider local --model twil-harbor-pi --print "Which region had the highest revenue growth in sales.csv?"

Use with llama.cpp

A GGUF version of this adapter is in harness-hub/TwIL-8B-pi-GGUF. It runs on top of a GGUF of the base model:

hf download mradermacher/TwIL-8B-GGUF TwIL-8B.Q8_0.gguf --local-dir .
hf download harness-hub/TwIL-8B-pi-GGUF TwIL-8B-harbor-pi-lora-F16.gguf --local-dir .
hf download harness-hub/TwIL-8B-pi chat_template.jinja --local-dir .

llama serve -m TwIL-8B.Q8_0.gguf --lora TwIL-8B-harbor-pi-lora-F16.gguf \
    --chat-template-file chat_template.jinja -c 65536 --port 8080 --alias twil-harbor-pi
pi install git:github.com/huggingface/pi-llama
pi --model llama-cpp/twil-harbor-pi

The GGUF version has not been re-evaluated.

Training

Method AsyncGRPO (TRL, experimental), LoRA
Environment Harbor tasks served by OpenEnv, rollouts in HF sandboxes, tool calls screened by safeagents
Harness pi
Tasks trained on, up to this checkpoint 142 SmolDataEnvs tasks
Reward the task verifier's correctness (falls back to reward), plus a tool-efficiency bonus of weight 0.1
Steps 90 (this checkpoint), of a 100-step run
Learning rate 1e-5
LoRA r = 32, alpha = 64, all linear layers
Rollouts 8 per task, temperature 0.8, up to 30 model calls and 1,200 s per rollout
Batch 4 micro-batches of up to 65,536 tokens per step, rollouts up to 4 policy versions stale
Hardware 4× NVIDIA H200 on HF Jobs: vLLM on one, one trainer per harness on each of the other three

The training script is examples/async_grpo_harbor in TRL.

Limitations

  • Small evaluation. 146 tasks put the 95% interval on the paired pass@1 difference at ±5.8 points.
  • One task family. Training and the main evaluation are on data-analysis tasks. On the traj2envs repository tasks (second row), it does not improve on the base model.
  • traj2envs. This checkpoint never reached the traj2envs tasks in training, so its traj2envs result measures transfer from SmolDataEnvs.
  • One harness. The adapter was trained inside pi's prompts and tools. With another agent, expect it to behave like the base model, or worse.
  • Non-commercial license. TwIL-8B is released under the webAI non-commercial license, and so is this adapter.
Downloads last month
8
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for harness-hub/TwIL-8B-pi

Adapter
(3)
this model
Adapters
1 model

Dataset used to train harness-hub/TwIL-8B-pi

Collection including harness-hub/TwIL-8B-pi