Plank Research · Technical

Does a coding-agent LoRA hurt normal API calls?

We put Thinking Machines Lab’s Inkling-2-Mini on an NVIDIA B300 and tested it with Hugging Face’s Inkling-2-Mini-pi-adapted, a 53 MB LoRA trained with reinforcement learning inside the pi coding agent. Inside pi, the LoRA cut output tokens by 60% and fixed multi-file bugs 42% faster. Outside pi, on raw API calls for JSON extraction, SQL, math, tool calls, and one-shot code, it still went 10 for 10 and used 29% fewer tokens.

By Anusheel Bhushan · November 30, 2026

Pi agent tokens

-60.0%

81,725 to 32,682 tok (thinking -72.8%)

Pi solve time

-42.3%

201.0s to 115.9s (64 to 44 tool calls)

Direct API pass rate

10 / 10

Same 10/10 score as the base model

Direct API tokens

-29.1%

9,518 to 6,745 tok across 10 tasks

Benchmark results comparing Inkling 2 Mini base weights and the Pi-adapted LoRA across three multi-file Pi coding tasks and ten direct Chat Completions tasks on an NVIDIA B300.
Paired runs on one NVIDIA B300 SXM6 running vLLM, FlashAttention 4, and DSpark speculative decoding (temperature 1.0, top-p 1.0).

Small models choke on big agent prompts

Inkling 2 Mini is compact: 26.4B total parameters in a 20 GB checkpoint, with 5.4B active per token. Frontier models ten times that size can swallow a 20,000-token system prompt and a dozen helper tools without losing track of the task. Small models cannot. Give them a heavy prompt and they loop, re-read the same file four times, or botch the edit format.

Before running the benchmark, we tested four terminal coding agents against Inkling 2 Mini on vLLM:

AgentEndpointPrompt & toolsWhat happens
Pi (@earendil-works/pi-coding-agent)/v1/chat/completions~2.1K tokens, 4 tools (read, write, edit, bash)Best fit. Thinking Machines Lab used Pi for its own Terminal-Bench v2.1 (71.6%) benchmark, and Hugging Face released a 53 MB RL LoRA trained inside Pi.
OpenCode/v1/chat/completionsMedium prompt, built-in LSP and diff promptsGood fit. Works out of the box if you set interleaved.field to reasoning_content so Inkling's thinking blocks stay in history across tool calls.
Claude Code/v1/messages~15K to 25K tokens, many helper toolsRuns, too heavy. vLLM speaks Anthropic's Messages API, so tool calls work. The giant Claude-tuned system prompt makes a small model loop more often.
Codex CLI/v1/responsesCustom apply_patch format + developer roleSkip. Inkling's chat template rejects the developer message role unless rewritten, and the model was not trained on Codex's patch format.

pi wins because it stays out of the model’s way. Its prompt and four tools take roughly 2,100 tokens. It also speaks standard /v1/chat/completions and passes reasoning_content back on every turn, which keeps Inkling’s thinking blocks intact and hits vLLM’s prefix cache.

One GPU usually does two jobs

Hugging Face’s harness-hub team trained a 53 MB rank-32 LoRA (Inkling-2-Mini-pi-adapted) by running reinforcement learning directly inside pi across 1,431 coding and security tasks. When the model solved a task in fewer tool calls and fewer tokens, it got a higher reward.

That raised a practical worry for us. When you rent an NVIDIA B300, you rarely spend the whole card on interactive terminal sessions. The same vLLM server also answers normal product traffic: strict JSON extraction, SQL generation, tool calls, and short classification jobs. If a LoRA is trained inside pi to be terse and decisive, does it cut corners on raw API calls that do not use pi at all?

We ran both models side by side on the same B300 to find out.

Inside Pi: same fixes, 60% fewer tokens

First, we gave pi three multi-file codebases in Python and Node.js. Each repo had three or four interacting bugs, and we graded the result after pi exited using a separate hidden test suite:

  • Multi-currency ledger (Python): rounding before FX conversion on 100 small JPY entries, double-counted subtotal rows in an account tree, and flipped variance signs on cost accounts.
  • Async rate limiter & worker pool (Node.js): race condition letting concurrent callers pull extra burst tokens, an off-by-one retry cap, and leaked timers when AbortSignal fired mid-wait.
  • Streaming CSV & sliding p95 (Python): 3-byte chunks splitting UTF-8 characters, CRLF line endings, and escaped quotes, paired with a sliding-window p95 tracker that dropped out-of-order timestamps.
Repo taskTurnsToolsOutput tokThinking tokTime
Multi-currency ledger & hierarchy rollup (Python, 4 files)19 → 1321 → 1523,058 → 9,556 (-59%)12,084 → 2,44448.2s → 26.9s (-44%)
Async TokenBucket, retries & AbortSignal pool (Node.js, 3 files)13 → 1012 → 925,687 → 11,424 (-56%)19,156 → 6,61060.3s → 49.9s (-17%)
Chunked UTF-8 CSV stream & sliding-window p95 (Python, 3 files)31 → 2131 → 2032,980 → 11,702 (-65%)23,134 → 5,75192.4s → 39.1s (-58%)
Total across all 3 repos63 → 44 (-30.2%)64 → 44 (-31.3%)81,725 → 32,682 (-60.0%)54,374 → 14,805 (-72.8%)201.0s → 115.9s (-42.3%)

Both models fixed the same bugs. The difference was how much time they spent second-guessing themselves. Base Inkling 2 Mini burned 54,374 thinking tokens re-checking edge cases it had already fixed in code. With the LoRA, thinking dropped to 14,805 tokens (-72.8%). It read each file once, patched the bug, ran the test command, and quit as soon as tests passed.

Outside Pi: 10 for 10 on raw API calls

Next, we removed pi and sent 10 plain POST /v1/chat/completions calls to both models across all four thinking levels (high, medium, low, and none). Every answer was checked by running the generated Python or SQL code, or checking exact numbers and tool arguments:

Direct API taskEffortBaseLoRABase tokLoRA tokLatency
1-shot VersionedKV Python class (12 unit assertions)
JSON schema + Python test
highPASSPASS4,9061,831 (-63%)8.27s -> 4.53s
Combinatorics count (6-letter {A,B,C} strings = 406)
JSON schema integer
highPASSPASS1,6731,483 (-11%)4.38s -> 4.61s
SQLite running-total & lag window query
JSON schema + live SQLite
highPASSPASS591471 (-20%)1.62s -> 1.64s
SemVer dependency solver with security advisory
JSON schema object
highPASSPASS583700 (+20%)1.49s -> 1.89s
Parallel tool calls (weather + GitHub release)
OpenAI tools[]
highPASSPASS144143 (-1%)0.57s -> 0.76s
GitHub issue triage (5 issues)
JSON schema enum list
mediumPASSPASS422263 (-38%)1.24s -> 1.28s
5-slot schedule solver
JSON schema object
mediumPASSPASS440631 (+43%)2.35s -> 2.26s
Invoice discount, credit memo & tax audit
JSON schema numbers
lowPASSPASS484878 (+81%)2.17s -> 2.68s
Server log severity tagging (6 lines)
JSON schema enum list
lowPASSPASS139204 (+47%)0.83s -> 0.96s
Fast arithmetic with thinking turned off
JSON schema integer
nonePASSPASS136141 (+4%)1.06s -> 0.81s
Total across all 10 direct tasks10 / 1010 / 109,5186,745 (-29.1%)23.98s -> 21.42s

Both scored 10 out of 10. On high-effort code generation (writing a Python key-value store with snapshot reads and tombstones in one shot), the LoRA cut tokens from 4,906 to 1,831 (-63%) and nearly halved latency from 8.27s to 4.53s.

One tradeoff did show up at low thinking effort. Because the LoRA was trained only at high effort, asking for low effort on the invoice audit made it think longer than the base model (878 tokens vs. 484, about half a second slower). It still got every number right, just with more thinking than asked for.

Serve both from one GPU without merging weights

You do not have to choose between the two models, and you should not merge the LoRA into the base checkpoint on disk.

On our B300 (268 GiB VRAM), vLLM loads the 20 GB base model once alongside DSpark speculative decoding, leaving 243.8 GiB free for KV cache. Passing --enable-lora registers inkling-pi as a named runtime adapter:

vllm serve thinkingmachines/Inkling-2-Mini \
  --tensor-parallel-size 1 \
  --max-num-seqs 32 \
  --enable-prefix-caching \
  --enable-lora \
  --max-lora-rank 32 \
  --lora-modules inkling-pi=/root/.cache/huggingface/inkling-pi/vllm \
  --reasoning-parser inkling \
  --tool-call-parser inkling \
  --enable-auto-tool-choice \
  --speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"probabilistic"}'

Point coding agents at model: "inkling-pi" for the 60% token cut. Point latency-sensitive low-effort pipelines at model: "thinkingmachines/Inkling-2-Mini". Both run off the same weights in memory.

If you connect pi (v1.7.0+) to that server, set "api": "openai-completions" in ~/.pi/agent/models.json (otherwise pi defaults to /v1/responses), map off to none, and leave temperature at 1.0:

{
  "$schema": "https://pi.dev/schemas/models.schema.json",
  "providers": {
    "b300": {
      "name": "Nebius B300 (vLLM)",
      "baseUrl": "http://127.0.0.1:8000/v1",
      "api": "openai-completions",
      "apiKey": "dummy",
      "compat": {
        "supportsReasoningEffort": true,
        "thinkingFormat": "openai",
        "maxTokensField": "max_tokens",
        "supportsDeveloperRole": false
      },
      "models": [
        {
          "id": "inkling-pi",
          "name": "Inkling 2 Mini Pi-Adapted LoRA",
          "reasoning": true,
          "thinkingLevelMap": {
            "off": "none",
            "minimal": "minimal",
            "low": "low",
            "medium": "medium",
            "high": "high",
            "xhigh": "xhigh",
            "max": "max"
          },
          "samplingParams": { "temperature": 1.0, "top_p": 1.0 },
          "input": ["text", "image"],
          "contextWindow": 262144,
          "maxTokens": 32768
        }
      ]
    }
  }
}

Frequently asked questions

Which coding agent works best with Inkling 2 Mini?

Pi (@earendil-works/pi-coding-agent). Its prompt and four tools take about 2.1K tokens, Thinking Machines Lab used it for Inkling 2 Mini's Terminal-Bench v2.1 benchmark, and Hugging Face's harness-hub ships a 53 MB LoRA trained specifically for Pi.

Does the Pi LoRA hurt normal API calls outside the Pi agent?

No. Across 10 direct /v1/chat/completions tasks covering strict JSON schemas, parallel tool calls, SQL, math, and one-shot Python code across high, medium, low, and none thinking effort, both the base model and the LoRA scored 10/10, and the LoRA used 29.1% fewer tokens.

Can one vLLM server run both the base model and the LoRA at once?

Yes. Start vLLM with --enable-lora --max-lora-rank 32 --lora-modules inkling-pi=/path/to/lora. vLLM keeps one 20 GB copy of the base weights in GPU memory and applies the 53 MB LoRA only when a request asks for model: inkling-pi.

References

Put an embedded AI team on your roadmap

Forward-deployed engineers to deploy, AI-native engineers to build, and on-demand QA pods to validate, embedded with your team, starting the same day.