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
A LoRA adapter for thinkingmachines/Inkling-2-Mini, trained
with reinforcement learning in TRL to work as the model behind Codex CLI, at the
default reasoning effort (high).
A third to nearly half fewer output tokens, and more SWE-bench Pro tasks solved. Under Codex, on the tasks both models always solve, this adapter writes 33% fewer output tokens on SWE-bench Pro (hard 51) and 44% fewer on Terminal-Bench 2.1, with 42% and 50% less reasoning. Over three attempts per task it solves 74.0% of the SWE-bench Pro tasks, against 66.0% for the base model, and keeps the same accuracy on Terminal-Bench 2.1 (65.8% against 64.6%).
- Higher accuracy: SWE-bench Pro (hard 51), 2 h per task, pass@3 66.0% β 74.0% (+8.0 Β± 12.3 points; 7 tasks gained, 3 lost), avg@3 46.7% β 60.7% (+14.0 Β± 9.9 points).
- Less reasoning per solved task: 42% fewer reasoning tokens, 33% fewer output tokens in all.
- Fewer actions: 16% fewer tool calls and 16% fewer model turns per solved task.
- About a fifth faster: 22.7 β 17.7 minutes per solved task (β22%, 95% interval [β30%, β15%]).
- Terminal-Bench 2.1: same accuracy, half the reasoning. pass@3 64.6% β 65.8%, with 50% fewer reasoning tokens, 44% fewer output tokens and 27% fewer tool calls per solved task.
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, three attempts per task for each model. Base model and adapter run under the same settings and are paired per task. Compare base and adapter only within this card.
Pick your setup
Results
| SWE-bench Pro (hard 51), 2 h per task | Inkling-2-Mini | Inkling-2-Mini-codex-adapted | Change |
|---|---|---|---|
| pass@3 (50 tasks) | 66.0% | 74.0% | +8.0 Β± 12.3 points |
| avg@3 (50 tasks) | 46.7% | 60.7% | +14.0 Β± 9.9 points |
| Output tokens per solved task (13 tasks) | 34.7k | 23.4k | β33% [β39, β26] |
| Reasoning tokens per solved task (13 tasks) | 23.5k | 13.7k | β42% [β49, β35] |
| Visible output tokens per solved task (13 tasks) | 11.2k | 9.7k | β14% [β25, β1] |
| Tool calls per solved task (13 tasks) | 55.5 | 46.4 | β16% [β23, β9] |
| Model turns per solved task (13 tasks) | 53.5 | 44.7 | β16% [β23, β9] |
| Minutes per solved task (10 tasks) | 22.7 | 17.7 | β22% [β30, β15] |
pass@3 counts a task as solved if any of the three attempts solves it; avg@3 is the share of solved attempts. The efficiency rows compare the tasks both models solve in every attempt: same tasks, same outcome, so they measure only how much work each needed, averaged over the three attempts. Tokens come from Codex's own session log, counted with the model's tokenizer: reasoning is the model's thinking, visible output is its messages and tool-call arguments. Β± is the 95% interval of the paired difference over tasks; brackets are 95% bootstrap intervals.
About a fifth faster
Minutes are each attempt's wall clock, sandbox setup and grading included, on the same tasks without the 3 where the base model lost its connection to the model server in one run (see Evaluation setup): 22.7 β 17.7 minutes per solved task, β22% [β30, β15].
Terminal-Bench 2.1: same accuracy, half the reasoning
| Terminal-Bench 2.1, 1 h per task | Inkling-2-Mini | Inkling-2-Mini-codex-adapted | Change |
|---|---|---|---|
| pass@3 (79 tasks) | 64.6% | 65.8% | +1.3 Β± 8.3 points |
| avg@3 (79 tasks) | 54.0% | 55.3% | +1.3 Β± 5.2 points |
| Output tokens per solved task (31 tasks) | 14.9k | 8.3k | β44% [β53, β36] |
| Reasoning tokens per solved task (31 tasks) | 10.4k | 5.2k | β50% [β60, β40] |
| Visible output tokens per solved task (31 tasks) | 4.5k | 3.1k | β31% [β37, β24] |
| Tool calls per solved task (31 tasks) | 20.8 | 15.2 | β27% [β36, β16] |
Same definitions as above. 79 of the 89 tasks have all six attempts graded; the other 10 each have a base-model attempt that was not graded (the connection to the model server dropped, or the agent's output could not be read) and are left out for both models. Minutes are not compared on Terminal-Bench: the measured β26% comes mostly from the base model's stream retries (see Evaluation setup), and without them the difference is within noise.
Evaluation setup
- Harness. Codex CLI 0.172.0 (
codex exec), through a custom provider on the Responses API without WebSockets. Its tools areexec_command,write_stdinandrequest_user_input; file edits go throughapply_patchinsideexec_command. Web search, image tools, subagents, goals, plugins and update checks are off. Reasoning efforthigh(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.
- Benchmarks. SWE-bench Pro (hard 51): the 51 hardest tasks of SWE-bench Pro, 2 h per task. Terminal-Bench 2.1, all 89 tasks, 1 h per task. Three attempts per task for each model on both.
- Failed runs. SWE-bench Pro: one adapter attempt was not graded (an error reading the agent's output), so its task is left out of pass@3 and avg@3 (50 of 51 tasks). Every other attempt was graded. One attempt per model ended on a harness error and counts as a failure. Terminal-Bench 2.1: see its section above.
- Time. On SWE-bench Pro, in one base run, the tunnel between the sandboxes and the model server dropped on some attempts (HTTP 530, retried by Codex), which slows those attempts down: the 3 tasks this touched are left out of the minutes, which use the other 10. Codex also retries a reply after 5 minutes without data (the serving proxy sends a reply only once it is complete), which happens more often to the base model; taking 5 minutes off per retry still gives β20% [β28, β13].
- 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.
Contamination check
No training task shares a name or a repository with SWE-bench Pro hard 51. The training set was not built with an explicit step that excludes evaluation tasks: we checked it was clean after the fact.
Use with Codex
Serve the adapter with vLLM and point Codex at it
1. Serve the adapter with vLLM
Inkling 2 Mini needs a vLLM nightly; we used commit b976fff86af82c559b19aa676f52ea193eb0c188. The adapter under
vLLM's module names is in vllm/:
hf 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, so
no template argument is needed.
2. Point Codex at it
Install Codex CLI 0.172.0, the version of the evaluations:
npm install -g @openai/codex@0.172.0
Add the server as a provider in ~/.codex/config.toml:
model = "inkling-codex"
model_provider = "local"
model_context_window = 131072
web_search = "disabled"
[model_providers.local]
name = "local"
base_url = "http://localhost:8000/v1"
env_key = "INKLING_API_KEY"
wire_api = "responses"
supports_websockets = false
export INKLING_API_KEY=dummy
codex exec "Find out why the tests in tests/test_parser.py fail and fix the bug."
Use with Codex (llama.cpp)
Serve the GGUF with llama.cpp and point Codex at it
The GGUF version is in
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.
llama 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:
hf 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 the
trained behavior. Q8_0 is a good default; lower-bit quants drift further. The GGUF version has not been re-evaluated.
Merge the adapter into the base model
Get a standalone model, with no LoRA at serving time
import torch
from peft import PeftModel
from 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 merged
model like the base model, without the LoRA flags:
vllm 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
Training
Method, data, hyperparameters and hardware
| Method | AsyncGRPO (TRL), LoRA |
| Environment | 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: 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 calls drop from 11.7 to 9.2 (β21%) and output tokens from 14.3k to 8.6k (β40%), while the share of solved rollouts rises from 0.56 to 0.64:
The training scripts are in the TRL recipe (files).
Links
- Base model: thinkingmachines/Inkling-2-Mini (Thinking Machines Lab, Apache 2.0)
- The same recipe under other harnesses: pi, Hermes, omp
- Trainer: TRL AsyncGRPO
- Harness: Codex CLI
- Downloads last month
- -
Model tree for harness-hub/Inkling-2-Mini-codex-adapted
Base model
thinkingmachines/Inkling-2-Mini



