TRL /Recipes

thinkingmachines/Inkling-2-Mini

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.

AsyncGRPOTrainerH200 · B200TRL forkLoRA r321,000 stepspi · hermes · opencode · deepseek-harnessloraagentic-rlharborsafeagentsmulti-harnesslive

Command builder

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

Ran as written
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

Guide

LoRA adapters for agent harnesses on thinkingmachines/Inkling-2-Mini. Released: Inkling-2-Mini-pi-adapted, for pi at reasoning effort high (below). 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. Setup and shared settings: ../README.md. Full hyperparameters: 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, 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, 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 is step 100 of a pi run at reasoning effort high (the chat template's default), on coding and cyber tasks:

PRESET=pi-adapted bash train_hf_jobs.sh

What the preset changes from the effort-none runs below: - Data. 1,431 tasks of UltraTerminals (@24e4ce50), listed in 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

lora_r32
lora_target_modules.*language_model.*self_attn\.(q_proj|k_proj|v_proj|o_proj)\.linear
learning_rate2e-5
num_generations8
gradient_accumulation_steps32
max_staleness16
temperature0.8
max_completion_length8,192
max_model_len32,768
token_budget32,768
agent_step_limit50
agent_timeout_s1,800
max_inflight64
tool_efficiency_weight0.1
max_steps1,000
save_steps10
thinkingfalse
pi_adaptedPRESET=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)

commitb976fff86af82c559b19aa676f52ea193eb0c188
tool_call_parserinkling
reasoning_parserinkling
extra_args--enable-prefix-caching, --default-chat-template-kwargs '{"reasoning_effort": "none"}'

Hardware

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

Datasets

Training

Evaluation

tbfullharborframework/terminal-bench-2.1@3e235dff6880252a587fa479c09bcb1e16edf2eb, all 89 tasks, 3600 s and 100 steps
sbpharness-hub/swebench-pro-v2-hard51-harbor, 7200 s and 100 steps

TRL version

This recipe runs on a TRL fork. trl.patch holds the changes to trl/ relative to the upstream base commit.

Forkyounesbelkada/trl@e498acc6 async-grpo-shared-vllm
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

Download trl.patch (10 files changed)

Files

Shared by the project

Added 2026-11-25 Report an issue