Run this model with HF Jobs
Run harness-hub/Inkling-2-Mini-codex-adapted on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/harness-hub/Inkling-2-Mini-codex-adapted. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/harness-hub/Inkling-2-Mini-codex-adapted on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/harness-hub/Inkling-2-Mini-codex-adapted. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/harness-hub/Inkling-2-Mini-codex-adapted. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use harness-hub/Inkling-2-Mini-codex-adapted with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use harness-hub/Inkling-2-Mini-codex-adapted with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("thinkingmachines/Inkling-2-Mini") model = PeftModel.from_pretrained(base_model, "harness-hub/Inkling-2-Mini-codex-adapted") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse filesFiles changed (5)
- .gitattributes+3
- README.mdAdded+275
- banner.pngAdded
- time_sbp.pngAdded
- train_efficiency.gifAdded
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines33343536373832 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textbanner.png filter=lfs diff=lfs merge=lfs -texttime_sbp.png filter=lfs diff=lfs merge=lfs -texttrain_efficiency.gif filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275---base_model: thinkingmachines/Inkling-2-Minilibrary_name: peftlicense: apache-2.0tags:- trl- grpo- async-grpo- lora- agents- harbor- codex- harness-adapterpipeline_tag: image-text-to-text---

A LoRA adapter for [thinkingmachines/Inkling-2-Mini](https://huggingface.co/thinkingmachines/Inkling-2-Mini), trainedwith reinforcement learning in TRL to work as the model behind [Codex CLI](https://github.com/openai/codex), at thedefault reasoning effort (`high`).
> [!Tip]> **Solves SWE-bench Pro tasks 40% faster.** Under Codex, on the SWE-bench Pro (hard 51) tasks both models solve, this> adapter takes 21 minutes per task instead of 35, with 30% fewer tool calls and 39% fewer output tokens. It solves as> many tasks as the base model: 71.4% for both.
- **Time to solve:** 35.5 β 21.2 minutes per solved task (β40%, 95% interval [β47%, β33%]), every repository faster.- **Less work per solved task:** 30% fewer tool calls and model turns, 39% fewer output tokens.- **Same accuracy:** SWE-bench Pro (hard 51), 2 h per task, pass@1 71.4% β 71.4% (4 tasks gained, 4 lost).
> [!Note]> These are first results: one attempt per task for each model. Results over 3 attempts (pass@3, avg@3) are running> and will replace them here. All results are under Codex CLI 0.172.0, reasoning effort `high`, temperature 1.0, a> 131k-token context and up to 32k output tokens per turn, in HF Sandboxes. Base model and adapter run under the same> settings and are paired per task. Compare base and adapter only within this card.<!-- TODO (584313/584314): pass@3 + avg@3 from the x3 runs; Terminal-Bench 2.1 only once final. -->
**Pick your setup**
[](#results)[](#use-with-codex)[](#use-with-llama-cpp)[](https://huggingface.co/harness-hub/Inkling-2-Mini-codex-adapted-GGUF)[](#merge)[](#training)
<a id="results"></a>
## Results

| SWE-bench Pro (hard 51), 2 h per task | Inkling-2-Mini | **Inkling-2-Mini-codex-adapted** | Change ||---|---|---|---|| pass@1 (42 tasks graded for both) | 71.4% | 71.4% | +0.0 Β± 13.4 points || Minutes per solved task (26 tasks) | 35.5 | **21.2** | **β40%** [β47, β33] || Tool calls per solved task (17 tasks) | 66.8 | 46.6 | β30% [β38, β23] || Output tokens per solved task (17 tasks) | 35.8k | 21.9k | β39% [β48, β29] || Model turns per solved task (17 tasks) | 67.1 | 47.3 | β30% [β36, β22] |
The efficiency rows compare the tasks both models solve: same tasks, same outcome, so they measure only how much workeach needed. Minutes are each attempt's wall clock, sandbox setup and grading included. Β± is the 95% interval of thepaired difference over tasks; brackets are 95% bootstrap intervals. Tool calls, tokens and turns cover fewer tasks thanminutes because some attempts did not keep those counts (their grade stands).
<details open><summary><b>Faster on every repository</b></summary>
Minutes per solved task, base model β adapter, on the tasks both solve:
| Repository | Tasks | Minutes ||---|---|---|| teleport | 6 | 37.5 β 24.3 || element-web | 4 | 41.8 β 25.0 || ansible | 3 | 26.8 β 17.6 || vuls | 3 | 33.6 β 20.0 || navidrome | 3 | 34.7 β 14.4 || flipt | 2 | 28.1 β 19.2 || webclients | 2 | 36.3 β 18.3 || NodeBB, openlibrary, qutebrowser | 1 each | 33.5 β 22.0, 32.9 β 21.6, 48.8 β 30.4 |
</details>
<details><summary><b>Evaluation setup</b></summary>
- **Harness.** Codex CLI 0.172.0 (`codex exec`), through a custom provider on the Responses API without WebSockets. Its tools are `exec_command`, `write_stdin` and `request_user_input`; file edits go through `apply_patch` inside `exec_command`. Web search, image tools, subagents, goals, plugins and update checks are off. Reasoning effort `high` (the chat template's default), temperature 1.0, 131k-token context, up to 32k output tokens per turn.- **Serving.** vLLM nightly `b976fff86af82c559b19aa676f52ea193eb0c188`, the adapter loaded as a runtime LoRA.- **Sandboxes.** HF Sandboxes, for the base model and the adapter alike.- **Benchmark.** [SWE-bench Pro (hard 51)](https://huggingface.co/datasets/harness-hub/swebench-pro-v2-hard51-harbor): the 51 hardest tasks of SWE-bench Pro, 2 h per task, one attempt per task for each model.- **Ungraded attempts.** Attempts that ended on an infrastructure failure (no model call) are left out for both models: 8 of the base model's 51 attempts, none of the adapter's. pass@1 is computed on the 42 tasks graded for both.- **Grading.** Every verifier run first resets the repository's tests to their original state and applies the benchmark's reference tests, so changes the agent makes to tests cannot affect its grade.
</details>
<details><summary><b>Contamination check</b></summary>
No training task shares a name or a repository with SWE-bench Pro hard 51. The training set was not built with anexplicit step that excludes evaluation tasks: we checked it was clean after the fact.
</details>
<a id="use-with-codex"></a>
## Use with Codex
<details open><summary><b>Serve the adapter with vLLM and point Codex at it</b></summary>
### 1. Serve the adapter with vLLM
Inkling 2 Mini needs a vLLM nightly; we used commit `b976fff86af82c559b19aa676f52ea193eb0c188`. The adapter undervLLM's module names is in `vllm/`:
```shhf download harness-hub/Inkling-2-Mini-codex-adapted --include "vllm/*" --local-dir inkling-codex
vllm serve thinkingmachines/Inkling-2-Mini \ --enable-lora --max-lora-rank 32 --lora-modules inkling-codex=./inkling-codex/vllm \ --enable-auto-tool-choice --tool-call-parser inkling --reasoning-parser inkling \ --max-model-len 131072```
The chat template's default reasoning effort is `high`, which is what this adapter was trained and evaluated with, sono template argument is needed.
### 2. Point Codex at it
<!-- TODO: check on a clean machine with codex 0.172.0 against vLLM's own /v1/responses (the evals went throughOpenEnv's capture proxy, which serves /v1/responses on top of vLLM's chat completions). -->
Install Codex CLI 0.172.0, the version of the evaluations:
```shnpm install -g @openai/codex@0.172.0```
Add the server as a provider in `~/.codex/config.toml`:
```tomlmodel = "inkling-codex"model_provider = "local"model_context_window = 131072web_search = "disabled"
[model_providers.local]name = "local"base_url = "http://localhost:8000/v1"env_key = "INKLING_API_KEY"wire_api = "responses"supports_websockets = false```
```shexport INKLING_API_KEY=dummycodex exec "Find out why the tests in tests/test_parser.py fail and fix the bug."```
</details>
<a id="use-with-llama-cpp"></a>
## Use with Codex (llama.cpp)
<details open><summary><b>Serve the GGUF with llama.cpp and point Codex at it</b></summary>
The GGUF version is in[harness-hub/Inkling-2-Mini-codex-adapted-GGUF](https://huggingface.co/harness-hub/Inkling-2-Mini-codex-adapted-GGUF):the adapter merged into the base model as one `Q8_0` file, and the adapter alone as an F16 LoRA.
```shllama serve -hf harness-hub/Inkling-2-Mini-codex-adapted-GGUF:Q8_0 -c 131072 --alias inkling-codex```
Or the adapter on top of a GGUF of the base model:
```shhf download ggml-org/Inkling-2-Mini-GGUF Inkling-2-Mini-Q8_0.gguf --local-dir .hf download harness-hub/Inkling-2-Mini-codex-adapted-GGUF Inkling-2-Mini-codex-adapted-lora-F16.gguf --local-dir .
llama serve -m Inkling-2-Mini-Q8_0.gguf --lora Inkling-2-Mini-codex-adapted-lora-F16.gguf \ -c 131072 --alias inkling-codex```
Then set `base_url = "http://localhost:8080/v1"` in `config.toml` above. Codex talks to the Responses API(`/v1/responses`): use a llama.cpp build that serves it.
The adapter was trained on the base model's own weights: the closer the base GGUF is to them, the closer you get to thetrained behavior. `Q8_0` is a good default; lower-bit quants drift further. The GGUF version has not been re-evaluated.
</details>
<a id="merge"></a>
## Merge the adapter into the base model
<details open><summary><b>Get a standalone model, with no LoRA at serving time</b></summary>
```pythonimport torchfrom peft import PeftModelfrom transformers import AutoModelForImageTextToText, AutoTokenizer
base = AutoModelForImageTextToText.from_pretrained("thinkingmachines/Inkling-2-Mini", dtype=torch.bfloat16, device_map="cpu")model = PeftModel.from_pretrained(base, "harness-hub/Inkling-2-Mini-codex-adapted").merge_and_unload()model.save_pretrained("Inkling-2-Mini-codex-merged")AutoTokenizer.from_pretrained("thinkingmachines/Inkling-2-Mini").save_pretrained("Inkling-2-Mini-codex-merged")```
The adapter at the repository root uses PEFT's module names; the copy in `vllm/` is for vLLM. Then serve the mergedmodel like the base model, without the LoRA flags:
```shvllm serve Inkling-2-Mini-codex-merged --served-model-name inkling-codex \ --enable-auto-tool-choice --tool-call-parser inkling --reasoning-parser inkling \ --max-model-len 131072```
</details>
<a id="training"></a>
## Training
<details open><summary><b>Method, data, hyperparameters and hardware</b></summary>
<!-- TODO: confirm run 561653's TRAIN_EXTRA (assumed the omp arm's: --tool-budget 30 --length-penalty-weight 0.2--length-budget 65536 --verifier-timeout-sec 300; both arms launched together, "same setup" in UPDATES.md). -->
| | ||---|---|| Method | [AsyncGRPO](https://huggingface.co/docs/trl/main/en/async_grpo_trainer) (TRL), LoRA || Environment | [Harbor](https://github.com/laude-institute/harbor) tasks, rollouts in HF Sandboxes || Harness | Codex CLI 0.172.0 with the settings above, reasoning effort `high` (the template default) || Tasks | 989 tasks from [UltraTerminals](https://huggingface.co/datasets/harness-hub/UltraTerminals): agentic coding tasks (SWE-smith Python and Go, Tasksmith) and cybersecurity tasks (Cedar and OpenFGA authorization), without the tasks an earlier Inkling 2 Mini run always solved || Reward | The task's verifier result (0 or 1). Solved rollouts also get a tool-efficiency bonus, 0.1 Γ clip(1 β tool calls / 30, 0, 1), and a length penalty, β0.2 Γ min(1, output tokens / 65,536) || Guardrails | safeagents checks on every tool call during training: web fetches to hosts that appear nowhere in the task are blocked || Steps | 200 (this checkpoint). Steps 121β200 resumed from the step-120 checkpoint, with Codex's context compaction handled in the rollouts from then on || Learning rate | 2e-5 || LoRA | r = 32, alpha = 64, dropout 0, on the language model's attention projections (q, k, v, o) || Rollouts | 8 per task, temperature 1.0 || Batch | gradient accumulation 16 || Hardware | 4Γ NVIDIA B300: vLLM on 2, the trainer on 2; about 7 minutes per step |
The model learns to do less during training. On solved rollouts, from the first 10 steps to the last 10, tool callsdrop from 11.7 to 9.2 (β21%) and output tokens from 14.3k to 8.6k (β40%), while the share of solved rollouts risesfrom 0.56 to 0.64:

The training scripts are in the [TRL recipe](https://trl-lib-trl-recipes.static.hf.space/recipes/harness-adapters/Inkling-2-Mini/index.html) ([files](https://huggingface.co/spaces/trl-lib/trl-recipes/tree/main/recipes/harness-adapters/Inkling-2-Mini)).<!-- TODO: add the codex harness settings and preset to the recipe and name it here. -->
</details>
## Links
- Base model: [thinkingmachines/Inkling-2-Mini](https://huggingface.co/thinkingmachines/Inkling-2-Mini) (Thinking Machines Lab, Apache 2.0)- The same recipe under other harnesses: [pi](https://huggingface.co/harness-hub/Inkling-2-Mini-pi-adapted), [Hermes](https://huggingface.co/harness-hub/Inkling-2-Mini-hermes-adapted), [omp](https://huggingface.co/harness-hub/Inkling-2-Mini-omp-adapted)- Trainer: [TRL AsyncGRPO](https://huggingface.co/docs/trl/main/en/async_grpo_trainer)- Harness: [Codex CLI](https://github.com/openai/codex).gitattributes+3
README.mdAdded+275
banner.pngAdded

Large File Pointer Details
- SHA256: b88addd2f1aa36255f0290334dfbd00126bba63024df0295151cd2f1ccdb15ed
- Pointer size: 132 Bytes
- Size of remote file: 1.32 MB
time_sbp.pngAdded

Large File Pointer Details
- SHA256: 9e09f61c1c33fcecc9484448ce3bc47eb48092768c7969aa33653aae06b2a890
- Pointer size: 131 Bytes
- Size of remote file: 105 kB
train_efficiency.gifAdded

Large File Pointer Details
- SHA256: f13a5999f40861eda3da22f6ba5cb05cf04b9bb590c177cfdf022a22d73f72f4
- Pointer size: 131 Bytes
- Size of remote file: 735 kB