Pydantic AI author boosts PiDrei, a Python port of Pi using Rust-based Monty

samuelcolvin · x · 2026-10-15

Samuel Colvin (author of Pydantic AI) reshared a new project, PiDrei: a Python port of the Pi coding agent built on the TonIO runtime, developed with substantial LLM assistance under human supervision.

PiDrei's codemode also uses Monty, a Python interpreter written in Rust and designed to run AI-written code: it starts in under 1ms (vs 1500ms for a sandbox service), has no filesystem, env, or network access, and only exposes the functions you pass in. In Pydantic AI, CodeMode() runs your agent's tools through it.

The project is described as "Alpha, and the honest kind" — validated by porting Pi's own test suites module by module and keeping them green. Motivations include understanding Pi internals, stress-testing TonIO, and exercising free-threaded CPython.

Original post →

More from coding & agent

coding & agent channel →