Pydantic AI CodeMode speculatively runs tools mid-generation, cutting 3 lookups from 8.7s to 4.7s
samuelcolvin · x · 2026-10-18
Pydantic AI's CodeMode now supports speculative tool execution: declare tools via CodeMode(speculate=['getweather']) and a call with literal keyword arguments launches as soon as its line streams in — no need to wait for the model to finish writing code. The author measured 3 slow lookups dropping from 8.7s to 4.7s. The pattern parallelizes model output streaming with tool execution, useful for agents with multiple independent slow I/O calls.
More from coding & agent
- Dev builds ChatGPT plugin that has his Dot monitor news hourly and alert him — koltregaskes · 2026-10-18
- Optimus launches: an autonomous RL agent harness that runs experiments itself — _AustinCalvert_ · 2026-10-18
- Work IQ MCP in GitHub Copilot cuts hours of manual issue tracking to under 30 minutes — DanWahlin · 2026-10-18
- Working with AI: sort your work by AI-verifiability, then design verifiers or be the judge — danshipper · 2026-10-18
- Personal agents vs. websites that block them: real-phone computer use may win — lucasmeijer · 2026-10-18
- LSCBench: top AI coding agent passes 91.3% of tests but only 25.1% ship securely — krishnan · 2026-10-18