---
id: harness-adapters/Inkling-2-Mini
title: Inkling 2 Mini harness adapters
type: recipe
project: harness-adapters
model_id: thinkingmachines/Inkling-2-Mini
trainers:
- AsyncGRPOTrainer
platforms:
- hf_jobs
gpus:
- H200
- B200
verified:
  hf_jobs: true
trl_source:
- TRL fork
tags:
- lora
- agentic-rl
- harbor
- safeagents
- multi-harness
- live
date_added: '2026-11-25'
url: https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/index.html
markdown_url: https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/index.md
json_url: https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/recipe.json
yaml_url: https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/recipe.yaml
hub_tree: https://huggingface.co/spaces/trl-lib/trl-recipes/tree/main/recipes/harness-adapters/Inkling-2-Mini
---

# thinkingmachines/Inkling-2-Mini — Harness adapters

LoRA adapters for agent harnesses on Inkling 2 Mini, trained with async GRPO. Released: Inkling-2-Mini-pi-adapted, for pi at reasoning effort high (coding + cyber tasks, a tool-efficiency bonus and a length penalty; PRESET=pi-adapted), and the effort-none adapters (pi, hermes, opencode, DeepSeek Harness on scale800 + TermGrade, one job per harness). The Qwen3.8-27B recipe's settings, with what Inkling needs.

## Summary & Links

- **Recipe ID:** `harness-adapters/Inkling-2-Mini`
- **Model:** [thinkingmachines/Inkling-2-Mini](https://huggingface.co/thinkingmachines/Inkling-2-Mini)
- **Project:** [Harness adapters](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/index.md)
- **Trainers:** `AsyncGRPOTrainer`
- **Harnesses:** `pi`, `hermes`, `opencode`, `deepseek-harness`
- **GPUs:** H200, B200
- **Platforms:** HF Jobs
- **Interactive command builder:** https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/index.html
- **Structured JSON:** https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/recipe.json
- **Recipe YAML:** https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/recipe.yaml
- **Space files:** https://huggingface.co/spaces/trl-lib/trl-recipes/tree/main/recipes/harness-adapters/Inkling-2-Mini

## Quickstart Commands

### Train on HF Jobs (verified · h200x2 per harness, 32768-token window; b200x4 for PRESET=pi-adapted (65536-token window))

```bash
hf download trl-lib/trl-recipes --repo-type space --include "recipes/harness-adapters/*" --local-dir trl-recipes
cd trl-recipes/recipes/harness-adapters/Inkling-2-Mini
HARNESS=pi \
PRESET=effort-none \
BUCKET="<your user>/<bucket>" \
bash train_hf_jobs.sh
```

- Note: Requires a TRL fork (see TRL version section), not a PyPI release.
- Note: `BUCKET` defaults to `ybelkada/harbor-evals` (the authors' bucket); set `BUCKET=<your user>/<bucket>`.
- Note: `TRACKIO_SPACE_ID` defaults to `ybelkada/async-grpo-harbor` (the authors' resource); override with `TRACKIO_SPACE_ID=<you>/<name>`.

### Evaluate on HF Jobs (verified · h200x2 per harness, 32768-token window; b200x4 for PRESET=pi-adapted (65536-token window))

```bash
hf download trl-lib/trl-recipes --repo-type space --include "recipes/harness-adapters/*" --local-dir trl-recipes
cd trl-recipes/recipes/harness-adapters/Inkling-2-Mini
BENCH=tbfull \
EFFORT=none \
EVALS=pi@pi:base \
BUCKET="<your user>/<bucket>" \
bash eval_hf_jobs.sh
```

- Note: Requires a TRL fork (see TRL version section), not a PyPI release.
- Note: `BUCKET` defaults to `ybelkada/harbor-evals` (the authors' bucket); set `BUCKET=<your user>/<bucket>`.

## Guide

LoRA adapters for agent harnesses on
[`thinkingmachines/Inkling-2-Mini`](https://huggingface.co/thinkingmachines/Inkling-2-Mini). Released:
[Inkling-2-Mini-pi-adapted](https://huggingface.co/harness-hub/Inkling-2-Mini-pi-adapted), for pi at reasoning effort
high ([below](#released-inkling-2-mini-pi-adapted-pi-effort-high)). The effort-none runs, for pi, hermes, opencode and
DeepSeek Harness, train for up to 1,000 steps on the 750 scale800 tasks interleaved with 300 TermGrade tasks, thinking
off. Live dashboard:
[harness-hub/inkling-livestream](https://huggingface.co/spaces/harness-hub/inkling-livestream). Setup and shared
settings: [../README.md](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/README.md). Full hyperparameters: [recipe.yaml](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/recipe.yaml).

| | HF Jobs |
|---|---|
| Train | `HARNESS=pi bash train_hf_jobs.sh`, one h200x2 job per harness; `PRESET=pi-adapted bash train_hf_jobs.sh`, the released adapter |
| Eval | `BENCH=tbfull\|sbp EVALS="pi@pi:base" bash eval_hf_jobs.sh`, one h200 job per policy |

How this differs from the Qwen3.8-27B recipe (same data, reward, LoRA rank, learning rate and agent limits):
- **TRL.** The `async-grpo-shared-vllm` branch plus what Inkling needs: tree packing for Inkling 2 Loop's attention
  and short convolutions, and the adapter's module names renamed to vLLM's when the trainer syncs it. All of it is in
  [trl.patch](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/trl.patch), relative to upstream `d115286b`. `train_hf_jobs.sh` applies it to that commit and builds a
  wheel.
- **Libraries.** transformers 5.24.0, the first with Inkling 2 Loop, and a vLLM nightly (`b976fff8`) that serves it
  with runtime LoRA and has its `inkling` tool and reasoning parsers.
- **Model split.** vLLM serves the quantized checkpoint; the trainer trains on the BF16-dequantized model.
- **LoRA on attention only** (`q/k/v/o_proj` of the language model): the experts stay frozen, and those are the four
  projections vLLM serves LoRA on for this model.
- **Thinking off as effort.** Inkling's chat template has no `enable_thinking`: rollouts run at
  `reasoning_effort: "none"`.
- **Context window.** 32,768 tokens on H200 (40,960 and 49,152 ran out of memory on the trainer); 65,536 on B300,
  where hermes from step 60 and DeepSeek Harness train.
- **32 gradient-accumulation steps**: at 16, a step trained on 3-5 groups.
- **DeepSeek Harness** runs through [../scripts/deepseek_harness.py](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/deepseek_harness.py), the
  harness-leaderboard's setup pointed at the capture proxy, with web fetch off in training (safeagents blocks most
  fetches, which zeroes the reward).

## Released: Inkling-2-Mini-pi-adapted (pi, effort high)

[harness-hub/Inkling-2-Mini-pi-adapted](https://huggingface.co/harness-hub/Inkling-2-Mini-pi-adapted) is step 100 of a
pi run at reasoning effort high (the chat template's default), on coding and cyber tasks:

```sh
PRESET=pi-adapted bash train_hf_jobs.sh
```

What the preset changes from the effort-none runs below:
- **Data.** 1,431 tasks of [UltraTerminals](https://huggingface.co/datasets/harness-hub/UltraTerminals)
  (`@24e4ce50`), listed in [pi_adapted_tasks.txt](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/pi_adapted_tasks.txt): 531 coding tasks (SWE-smith Python and Go,
  Tasksmith) interleaved with 900 Cedar and OpenFGA authorization tasks. Of four mixes (coding, coding + cyber, coding +
  knowledge work, hard tasks only), coding + cyber gave the best Terminal-Bench 2.1 results. The adapter trained on
  these tasks' earlier builds: the cyber tasks are unchanged, while UltraTerminals now runs the coding tasks in pinned,
  prebuilt images (each instruction gains a short note on the environment) with the same problems and tests.
- **Thinking.** Effort high, temperature 1.0 (Inkling's generation config), a 65,536-token window with up to 32,768
  output tokens a call.
- **Reward.** The verifier's 0/1, plus, on correct rollouts only, a tool-efficiency bonus `0.1 × clip(1 − tool calls /
  30, 0, 1)` and a length penalty `0.2 × min(1, generated tokens / 65,536)`. An ablation at effort low found the length
  penalty with a 0.1 bonus the most token-efficient at the same accuracy.
- **Batch.** 16 gradient-accumulation steps, 96 rollouts in flight.

The released run trained on 4 B300 GPUs (vLLM on 2 with tensor parallelism, the trainer on 2). On HF Jobs, the preset
runs on a b200x4 job (vLLM on one GPU, the trainer on three): the 65,536-token window does not
fit an H200 trainer. It has not been run as written on HF Jobs.

Results (pi, effort high, temperature 1.0, paired against the base model): Terminal-Bench 2.1 with 1 h per task, 44.2%
→ 56.9% avg@3 and 56.2% → 70.8% pass@3; SWE-bench Pro (hard 51), 66.7% → 70.6%; on the tasks both solve, 22–33% fewer
tool calls and about 40% fewer output tokens. With a generous budget (4 h per task, or 256k context), both models
solve about as many tasks. See the model card for the full results.

## Results so far (effort none)

Terminal-Bench 2.1, all 89 tasks, thinking off, one attempt per task, on HF Jobs (h200, `eval_hf_jobs.sh`):

| harness | base | best checkpoint so far |
|---|---|---|
| hermes | 57.5% | 63.2% (step 70), 7% fewer tool calls per solved task |
| pi | 54.0% | 58.6% (step 70), 25-30% fewer tool calls per solved task |
| DeepSeek Harness | 47.1% | training |

On SWE-bench Pro (hard 51), hermes at step 70 solves 62.7%. These adapters are not released: see the dashboard for
their numbers.

## Evaluating checkpoints

Checkpoints reach the dashboard and the HF Jobs evals through the bucket. `eval_listener_hf.sh` schedules an hourly HF
Jobs eval of the newest checkpoint; `eval_hf_jobs.sh` evaluates chosen ones side by side.

## Hyperparameters

| Parameter | Value |
|---|---|
| `lora_r` | `32` |
| `lora_target_modules` | `.*language_model.*self_attn\.(q_proj|k_proj|v_proj|o_proj)\.linear` |
| `learning_rate` | `2e-5` |
| `num_generations` | `8` |
| `gradient_accumulation_steps` | `32` |
| `max_staleness` | `16` |
| `temperature` | `0.8` |
| `max_completion_length` | `8,192` |
| `max_model_len` | `32,768` |
| `token_budget` | `32,768` |
| `agent_step_limit` | `50` |
| `agent_timeout_s` | `1,800` |
| `max_inflight` | `64` |
| `tool_efficiency_weight` | `0.1` |
| `max_steps` | `1,000` |
| `save_steps` | `10` |
| `thinking` | `false` |
| `pi_adapted` | `PRESET=pi-adapted: reasoning effort high, temperature 1.0, 16 gradient-accumulation steps, 96 rollouts in flight, 65536-token window, 32768 output tokens a call, tool-efficiency bonus 0.1 x clip(1 - tool calls / 30, 0, 1), length penalty 0.2 x min(1, tokens / 65536) on correct rollouts, released at step 100` |

### Serving (vLLM)

| Setting | Value |
|---|---|
| `commit` | `b976fff86af82c559b19aa676f52ea193eb0c188` |
| `tool_call_parser` | `inkling` |
| `reasoning_parser` | `inkling` |
| `extra_args` | `--enable-prefix-caching, --default-chat-template-kwargs '{"reasoning_effort": "none"}'` |

### Hardware

- **HF Jobs:** h200x2 per harness, 32768-token window; b200x4 for PRESET=pi-adapted (65536-token window) (ran as written)

## Datasets

### Training

- [`harness-hub/scale800-harbor@56c7f75d01f70859ec1354e97866e32a175c1a40`](https://huggingface.co/datasets/harness-hub/scale800-harbor)
- [`harness-hub/termgrade-train-harbor`](https://huggingface.co/datasets/harness-hub/termgrade-train-harbor)
- [`harness-hub/UltraTerminals@24e4ce50aeb68d33563f219613028c06c38591d2`](https://huggingface.co/datasets/harness-hub/UltraTerminals)

### Evaluation

| Benchmark | Details |
|---|---|
| `tbfull` | harborframework/terminal-bench-2.1@3e235dff6880252a587fa479c09bcb1e16edf2eb, all 89 tasks, 3600 s and 100 steps |
| `sbp` | harness-hub/swebench-pro-v2-hard51-harbor, 7200 s and 100 steps |

## TRL Version

- **Fork:** [`younesbelkada/trl@e498acc6`](https://github.com/younesbelkada/trl/commit/e498acc637084cffff14deb09ccdc423a766adb2) (async-grpo-shared-vllm)
- **Upstream base:** [`huggingface/trl@d115286b`](https://github.com/huggingface/trl/commit/d115286bc5aef8d346e8510bfe312803c7881c4a)
- **Patch file:** [trl.patch](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/trl.patch)

```bash
git clone https://github.com/huggingface/trl && cd trl
git checkout d115286bc5aef8d346e8510bfe312803c7881c4a
curl -sL https://huggingface.co/spaces/trl-lib/trl-recipes/resolve/main/recipes/harness-adapters/Inkling-2-Mini/trl.patch | git apply
```

## Files

- [`train_hf_jobs.sh`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/train_hf_jobs.sh) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Inkling-2-Mini/train_hf_jobs.sh))
- [`eval_hf_jobs.sh`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/eval_hf_jobs.sh) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Inkling-2-Mini/eval_hf_jobs.sh))
- [`recipe.yaml`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/recipe.yaml) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Inkling-2-Mini/recipe.yaml))
- [`trl.patch`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/trl.patch) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Inkling-2-Mini/trl.patch))
- [`async_grpo_harbor.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/async_grpo_harbor.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Inkling-2-Mini/async_grpo_harbor.py))
- [`eval_listener_hf.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/eval_listener_hf.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Inkling-2-Mini/eval_listener_hf.py))
- [`eval_listener_hf.sh`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/eval_listener_hf.sh) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Inkling-2-Mini/eval_listener_hf.sh))
- [`pi_adapted_tasks.txt`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/pi_adapted_tasks.txt) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/Inkling-2-Mini/pi_adapted_tasks.txt))

### Shared by project

- [`scripts/async_grpo_harbor.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/async_grpo_harbor.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/async_grpo_harbor.py))
- [`scripts/atif_harbor.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/atif_harbor.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/atif_harbor.py))
- [`scripts/atif_smoldataenvs.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/atif_smoldataenvs.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/atif_smoldataenvs.py))
- [`scripts/atif_traj2envs.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/atif_traj2envs.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/atif_traj2envs.py))
- [`scripts/deepseek_harness.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/deepseek_harness.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/deepseek_harness.py))
- [`scripts/eval_sweep.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/eval_sweep.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/eval_sweep.py))
- [`scripts/evaluate_harbor.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/evaluate_harbor.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/evaluate_harbor.py))
- [`scripts/launcher_eval.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/launcher_eval.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/launcher_eval.py))
- [`scripts/launcher_train.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/launcher_train.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/launcher_train.py))
- [`scripts/release_adapters.py`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/release_adapters.py) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/release_adapters.py))
- [`scripts/slurm_setup.sh`](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/scripts/slurm_setup.sh) ([Hub raw](https://huggingface.co/spaces/trl-lib/trl-recipes/raw/main/recipes/harness-adapters/scripts/slurm_setup.sh))
