Richland Technology
Richland Technology
← Back to Blog
llmopen-sourceagentsresearchcost-optimization

Delegent cuts frontier-agent cost by delegating legwork to a local SLM — the savings are mostly a prompt-engineering result

A training-free harness keeps the frontier model in charge and hands easy subtasks to a local SLM — 67% cheaper coding, 59% cheaper search, no loss in solved tasks.

Richland AI Desk·26 November 2026·5 min read
Delegent cuts frontier-agent cost by delegating legwork to a local SLM — the savings are mostly a prompt-engineering result

University of Waterloo researchers built Delegent, a training-free harness on top of Claude Code. A frontier model stays in charge of every task but hands easy subtasks — investigating code, running tests, searching a corpus — to a small language model on the user's own GPU. With a 27B FP8 SLM, the frontier model's API cost falls 67% on long-horizon coding and 59% on agentic search, with no loss in solved tasks; a 2B laptop-class SLM still cuts coding cost 66% (arXiv:2611.33098, code).

What shipped

Delegent, by Lingwei Gu and Jimmy Lin (David R. Cheriton School of Computer Science, University of Waterloo), is harness engineering, not a new model. Nothing is trained or fine-tuned, so either model can be swapped freely. The harness starts from stock Claude Code and adds a relay that routes calls by role: the main loop's calls go to the frontier model; calls from Claude Code's subagents and its small auxiliary model go to the SLM (paper §2). The relay speaks the Anthropic Messages API, so Claude Code runs unmodified.

The Delegent harness: the user talks to the main loop where the frontier model leads the task and spawns stacked SLM subagents through the Agent and Delegate tools; both loops act on the environment, a repository or corpus.

The design has three load-bearing pieces:

  • Parallel SLM subagents with fresh context. Subtasks issued in one turn run concurrently, each in its own tool loop with a fresh context. Only their final reports reach the frontier model — never their tool output — so its context stays short, which matters because every step re-reads the whole conversation.
  • Caching on both sides. Every frontier call within a task carries the same prompt-cache key, so consecutive steps hit the provider's cache; each SLM subagent is pinned to one vLLM replica so its growing prefix stays cached.
  • A quote check on search. Before a search report comes back, the harness checks each evidence line against the cited document and notes whether it was found verbatim, so the frontier model can tell a located passage from a hallucinated one.

For search, the SLM subagent design comes from AREX-Turbo, a deep-research agent built around a 4B model — its prompts and tools were already written for a small model to follow (paper §2).

Headline numbers, all author-reported: GPT-6.1-Sol at high reasoning effort as the frontier model, cost measured as the frontier model's API price with prompt caching.

  • Coding. On DeepSWE v1.1 (50 tasks), frontier cost per task falls from $2.11 to $0.70 with Qwen3.8-27B-FP8 (−67%) and to $0.71 with MiniCPM5-2B (−66%), with solved counts holding at 29 and 30. On SWE-bench Verified and SWE-bench Pro the reductions are 56% and 63% with the 27B model, again with no loss in resolved tasks (README).
  • Search. Across 694 questions (BrowseComp-Plus, Total Recall QA, HotpotQA, DeepSearchQA), frontier cost falls 59% while correct answers hold at 663 of 694 (README).

Why it matters

Two things make this more than a benchmark artifact. First, it is directly adoptable: the repo installs into an existing Claude Code or Codex setup, the SLM runs on hardware you already own, and the frontier model can be OpenAI or Anthropic (README). Second, the paper's ablations reframe where the savings come from.

Delegent deliberately does not do what cascades and model routers do. Those pick one model to execute the entire task; a 2B SLM would rarely solve one on its own. Here the frontier model always produces the final answer, and no SLM output is accepted until the frontier model reads it (paper §1).

The most interesting result: savings scale with how much legwork the frontier model would otherwise do itself. On DeepSWE, GPT-6.1-Sol alone runs a long edit-test-fix loop (~84 turns) and with an SLM costs 34% of baseline; Claude Opus 5.5 plans first (~18 turns alone) and still costs 69% of baseline with an SLM (README, paper §5). The chart below pools 350 task pairs across three coding sets and both SLMs: median relative frontier cost falls from 0.62 for tasks the frontier model would finish in under 25 calls alone to 0.26 for tasks it would spend more than 200 calls on.

Median relative frontier cost per coding task falls from 0.62 for tasks with fewer than 25 frontier calls alone to 0.26 for tasks with more than 200.

The single biggest lever is a short instruction, not the SLM. Installed as a user-level CLAUDE.md, it tells the frontier model to delegate investigation and verification ("find the code involved in the issue and explain how it works; write a minimal script that reproduces the bug") while making code changes itself, and to keep subagent reports under 150 words (instruction file). In an ablation on 50 DeepSWE tasks, the 2B MiniCPM5-2B resolved 22 tasks at 51% of baseline cost without the instruction; with it, 30 tasks at 34%. The authors attribute roughly three-fifths of the savings to the instruction, two-fifths to the SLM (alphaXiv overview).

The practical lesson: savings from delegating to a cheap model depend less on the cheap model than on the frontier model's habits. A frontier model that burns dozens of turns on legwork is the one worth delegating from.

Caveats

These are the authors' own runs, not independently replicated, and the headline figures are narrower than they first look.

  • "Cost" is frontier API cost only. The headline percentages exclude the SLM — the local GPU is not free. The one exception: a DeepSWE scenario where Qwen3.8-27B-FP8 is priced at API rates, giving a total cost of $0.806 per task, 38% of baseline (paper).
  • Delegation adds latency. Median DeepSWE time rose to 38 minutes with the 27B SLM from 25 minutes alone, and a short SWE-bench Verified task took roughly twice as long (alphaXiv overview).
  • "No loss" is benchmark-specific. In the under-25-call bin, 11% of tasks actually cost more with delegation (alphaXiv overview).
  • Coverage is limited. The experiments used only GPT-6.1-Sol and Claude Opus 5.5 as frontier models; Opus was tested on DeepSWE only, MiniCPM5-2B on coding only, and Gemini is not covered. The repo's Codex integration was tested but not benchmarked. Agent runs are nondeterministic, and the 200 BrowseComp-Plus questions were sampled from those not used to draft the instruction — so the instruction was tuned on part of that benchmark (paper §3).

Sources

Start a Conversation

Ready to build something like this?

Tell us about your project and we'll respond with a clear plan within one business day.

Tell Us About Your Project

Takes 3 minutes. We read every submission personally.