Speculative Programmatic Tool Calling Speeds Up Code Agents by 1.2x

a1zhang · x · 2026-08-26

Alex Zhang introduces "Speculative Programmatic Tool Calling" (sPTC), a harness-level trick to reduce latency in code agents. By speculatively executing tool calls parsed from partial code generations while the model is still streaming, sPTC overlaps high-latency sub-LLM/sub-agent calls with token generation. A "shadow REPL" tracks dependencies safely. Experiments show this achieves 1.2x wall-clock time speed-ups without modifying the model or agent logic.

Related event: sPTC: Speculative Programmatic Tool Calling Speeds Up Code Agents by 1-1.2x(13 posts)→

Original post →

More from coding & agent

coding & agent channel →