Pydantic's code mode cuts agent tokens 30% and speeds long tasks 51% across 8 models

samuelcolvin · x · 2026-10-29

Pydantic released a report on its code mode: instead of issuing 200 tool calls to update 200 records, the model writes a single Python loop. Across 8 models and 5,276 runs, long tasks ran 51% faster and succeeded 16 points more often.

User @dlewis reports a 30% token reduction after implementing code mode with Monty, plus the ability to scale to tools with very long outputs by letting the agent write filtering code.

Related event: Pydantic's Code Mode Cuts Agent Tokens 30%, Speeds Tasks 51%(2 posts)→

Original post →

More from coding & agent

coding & agent channel →