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.

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 vLLM llama.cpp GGUF Merge Training

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 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.
  • 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

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for harness-hub/Inkling-2-Mini-codex-adapted

Adapter
(88)
this model
Adapters
2 models
Quantizations
5 models