Skip to content

Delegating Coding Legwork to a Local Small Model

Delegate bounded coding investigations and test runs to a local small model when frontier cost matters more than response time.

Keep the frontier model responsible for the patch and give a local small language model focused investigation and verification work. Delegent demonstrates this split in a Claude Code harness without training either model. Its evidence supports a conditional choice: measure savings against correctness and latency on your workload (Gu and Lin, sections 2–4).

How the handoff works

Delegent routes the main loop to the frontier model and subagent calls to the small model through an API relay. Each worker has a fresh context and its own tool loop. Only its final report enters the frontier context; intermediate tool outputs stay with the worker (section 2).

For a coding implementation, use the paper's instruction as the starting contract:

  • Delegate locating relevant code, reproducing a bug, and running verification commands.
  • Keep the main code changes with the frontier model.
  • Request reports of at most 150 words, including paths, line numbers, and exact errors.
  • Check a reported fact yourself before making a fix depend on it.

These are instructions from Delegent's coding prompt, rather than guarantees about worker behavior. The authors observed source edits by the smaller worker in some episodes (section 5 and appendix A).

Why it works

Replacing expensive subagent calls accounts for most of the savings in the authors' DeepSWE analysis. The instruction also reduces the frontier model's own testing and coordination calls. Compact reports limit how much worker output the frontier model reads. Both effects matter: Delegent measures against a baseline that already uses prompt caching (sections 4–5).

This is a role-based orchestrator-worker design. Its adoption decision concerns whether an untrained local worker can handle bounded legwork. The adjacent specialized SLM tool pattern describes fine-tuned models behind tool interfaces; context-step model splitting concerns compression calls.

Evidence and cost boundaries

With GPT-6.1-Sol at high effort and Qwen3.8-27B-FP8 workers, Delegent resolves 29 of 50 sampled DeepSWE tasks, matching the frontier-only baseline. Mean frontier cost per task falls from $2.110 to $0.704. Pricing the worker at the paper's API rates raises the total to $0.806. These are sampled benchmark results under the authors' settings, not a prediction for another repository (table 1, section 3, appendix C).

Treat frontier billing and deployment cost separately. The paper excludes local hardware costs from its headline metric. Its median DeepSWE latency with the Qwen worker rises from 25 to 38 minutes on shared GPUs (section 4 and limitations).

When this backfires

Unrestricted delegation weakens the result. Without the instruction, MiniCPM5-2B workers accompany 22 solved DeepSWE tasks; with it, the system solves 30. The frontier-only baseline solves 29. Preserve the task boundary when testing a smaller worker (table 3).

Short tasks and latency-sensitive work deserve separate evaluation. Delegation sometimes raises frontier cost on short tasks, and the authors report roughly doubled median latency on SWE-bench Verified. Savings also vary with the frontier model's working style (sections 4–5).

Example

For an ABS interpreter task involving module-loading flags, the paper records a read-only investigation brief. It asks the worker to inspect the module loader, cache, environments, and tests. The requested report identifies files and functions to change, plus relevant test commands, within 150 words. This illustrates a bounded handoff that leaves patch authorship with the lead model (appendix A, example briefs).

Key Takeaways

  • Use the published instruction as a baseline for a local trial; evaluate task-boundary compliance alongside solved tasks (appendix A and table 3).
  • Record frontier billing and worker-serving costs separately, then compare latency before adopting the split (section 3 and limitations).